|
发表于 2020-2-22 10:08:13
|
显示全部楼层
|阅读模式
来自 中国–河北–石家庄
本帖最后由 dongtianbao 于 2020-2-23 16:27 编辑
L 02/21/2020 - 22:18:27: Start of error session.
L 02/21/2020 - 22:18:27: Info (map "awp_map_32") (file "addons/amxmodx/logs/error_20200221.log")
L 02/21/2020 - 22:18:27: [ENGINE] Invalid entity 117
L 02/21/2020 - 22:18:27: [AMXX] Run time error 10 (plugin "throwing_knives.amxx") (native "entity_get_string") - debug not enabled!
L 02/21/2020 - 22:18:27: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
服务器出现错误如上,刀子击中机器人就当机
下面是代码,如何修改一下呢?
**************************************************************************/
public vexd_pfntouch(pToucher, pTouched) {
if(!get_cvar_num("amx_throwknives"))
return PLUGIN_CONTINUE
new Classname[32]
entity_get_string(pToucher, EV_SZ_classname, Classname, 31)
new owner = entity_get_edict(pToucher, EV_ENT_owner)
new Float:kOrigin[3]
entity_get_vector(pToucher, EV_VEC_origin, kOrigin)
if(equal(Classname,"knife_pickup")) {
check_cvars()
new Class2[32]
entity_get_string(pTouched, EV_SZ_classname, Class2, 31)
if(!equal(Class2,"player") || knifeammo[pTouched] >= get_cvar_num("amx_maxknifeammo"))
return PLUGIN_CONTINUE
if((knifeammo[pTouched] + holdammo[owner]) > get_cvar_num("amx_maxknifeammo")) {
holdammo[owner] -= get_cvar_num("amx_maxknifeammo") - knifeammo[pTouched]
knifeammo[pTouched] = get_cvar_num("amx_maxknifeammo")
emit_sound(pToucher, CHAN_ITEM, "weapons/knife_deploy1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
else {
knifeammo[pTouched] += holdammo[owner]
emit_sound(pToucher, CHAN_ITEM, "weapons/knife_deploy1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
remove_entity(pToucher)
}
client_print(pTouched, print_center,"You have %i knives",knifeammo[pTouched])
}
|
|