setFunctionPointer
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>bool item</title>
</head>
<body>
<p><font color="#0000FF">bool</font><font color="darkorange"> </font>
<font color="#00FF00"> item</font>.<font color="#FF8C00">setFunctionPointer</font>(<font color="blue">int</font>
索引, <font color="blue">char</font>*(<font color="blue">int</font>) 事件,
<font color="blue">char</font>* 函数名, <font color="blue">char</font>* 脚本路径)</p>
<p><strong>函数功能:</strong></p>
<p><font color="darkgreen">为道具设置一个新的响应事件,有复盖性质的,也就是屏蔽原有的事件,但服务端重启后失效</font></p>
<p><strong>参数说明:</strong></p>
<table border="1" width="42%" id="table1">
<tr>
<td width="152">索引</td>
<td>[整型]</td>
<td width="310">道具的索引号</td>
</tr>
<tr>
<td width="152">事件</td>
<td>[整型]或[字符型]</td>
<td width="310">指触发的事件</td>
</tr>
<tr>
<td width="152">函数名</td>
<td>[字符串]</td>
<td width="310">指事件触发时调用的函数名字</td>
</tr>
<tr>
<td width="152">脚本路径</td>
<td>[字符型]</td>
<td width="310">指触发事件调用的函数脚本文件的路径</td>
</tr>
</table>
<p><strong>返回值:</strong></p>
<p>成功则返回
布尔值</a> ,判断是否成功执行</p>
<p><strong>使用例子:</strong></p>
<p><font color="#008000">--设置道具索引的使用事件,双道使用道具时触发函数test,函数位置文件路径为data/ablua/item/test.lua</font><br>
<font color="#00FF00"> item</font>.<font color="#FF8C00">setFunctionPointer</font>(itemindex,
<font color="slategray">"</font>使用事件<font color="slategray">"</font>, <font color="slategray">"test"</font>,
<font color="slategray">"data/ablua/item/test.lua"</font>)</p>
<p><strong>参数说明:</strong></p>
<p>事件可以使用数字编号0~?,也可使用中文字段,建议使用中文,提供的中文字段如下:</p>
<p>未知事件<br>
邮件事件<br>
使用事件<br>
装上事件<br>
卸下事件<br>
丢弃事件<br>
检起事件<br>
死亡事件</p>
</body>
</html>