getType

<html> <head> <meta http-equiv="Content-Language" content="zh-cn"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>bool char</title> </head> <body> <p><font color="#0000FF">bool</font><font color="darkorange"> </font> <font color="#00FF00"> obj</font>.<font color="#FF8C00">getType</font>(<font color="blue">int</font> 对象索引)</p> <p><strong>函数功能:</strong></p> <p><font color="#006400">通过对象索引获取对象类型</font></p> <p><strong>参数说明:</strong></p> <table border="1" width="643" id="table1"> <tr> <td width="154">对象索引</td> <td width="152">[整型</td> <td width="315">一个对象索引</td> </tr> </table> <p><strong>返回值:</strong></p> <table cellpadding="0" cellspacing="0" width="292" height="69"> <!-- MSTableType="layout" --> <tr> <td width="46">0</td> <td width="100" valign="top">角色</td> <td valign="top" height="18">OBJTYPE_CHARA</td> </tr> <tr> <td width="46">1</td> <td width="100" valign="top">道具</td> <td valign="top" height="16">OBJTYPE_ITEM</td> </tr> <tr> <td valign="top" width="46">2</td> <td valign="top" width="100">宠物</td> <td valign="top" height="17">OBJTYPE_GOLD</td> </tr> <tr> <td valign="top" width="46">3</td> <td valign="top" width="100">跳点</td> <td valign="top" height="18" width="146">OBJTYPE_WARPPOINT</td> </tr> </table> <p><strong>使用例子:</strong></p> <p><font color="#008000">--判断一下组队开关是否打开</font><br> <font color="#0000FF">if</font> <font color="#00FF00"> obj</font>.<font color="#FF8C00">getType</font>(objindex) == 0 <font color="#0000FF">then</font><br> <font color="#0000FF">&nbsp;&nbsp;&nbsp; print</font>(&quot;该对象类型是角色&quot;)<font color="#0000FF"><br> else if</font> <font color="#00FF00"> obj</font>.getType(index) == 1 <font color="#0000FF">then<br> &nbsp;&nbsp;&nbsp; print</font>(&quot;该对象类型是道具&quot;)<font color="#0000FF"><br> else if</font> <font color="#00FF00"> obj</font>.getType(index) == 2 <font color="#0000FF">then<br> &nbsp;&nbsp;&nbsp; print</font>(&quot;该对象类型是宠物&quot;)<font color="#0000FF"><br> else if</font> <font color="#00FF00"> obj</font>.getType(index) == 3 <font color="#0000FF">then<br> &nbsp;&nbsp;&nbsp; print</font>(&quot;该对象类型是跳点&quot;)<font color="#0000FF"><br> end</font></p> <p><strong>参数说明:</strong></p> <p> </p> <p> </p> </body> </html>