|
楼主 |
发表于 2007-6-18 14:30:45
|
显示全部楼层
来自 中国–山东–烟台
回复: 插件中的这一句不明白,register_forward是干什么的
public forward_touch(toucher, touched) {
if (!g_weaponArena || toucher == 0 || touched == 0) //
return FMRES_IGNORED
entity_get_string(toucher, EV_SZ_classname, g_classnames[0], 14)
entity_get_string(touched, EV_SZ_classname, g_classnames[1], 14)
if (!equal(g_classnames[1], "player") || (!equal(g_classnames[0], "weaponbox") && !equal(g_classnames[0], "armoury_entity")))
return FMRES_IGNORED
entity_get_string(toucher, EV_SZ_model, g_model, 63) // models/w_ak47.mdl, check from [9]
// You can touch my C4 any time ;-)
if (equal(g_model, "models/w_backpack.mdl"))
return FMRES_IGNORED
// weapon_ak47
new CsTeams:team = cs_get_user_team(touched)
if (equal(g_model[9], g_weaponString[int:team][7], strlen(g_weaponString[int:team][7]))) {
// If touching own team's weapon, ignore this = let player touch weapon
return FMRES_IGNORED
}
else if (g_randomWeapon && get_cvar_num(CVAR_RANDOMTEAMSPECIFIC) && get_cvar_num(CVAR_STEALRANDOMWEAPON)) {
new CsTeams:otherteam
if (team == CS_TEAM_T)
otherteam = CS_TEAM_CT
else
otherteam = CS_TEAM_T
// If touching other team's weaponbox, and random mode is on and team specific weapons is on and you can steal the other team's weapon, ignore this = let player touch weapon
// This means you can't pick up other team's weapon if it's on ground on map from start (ie, a armoury_entity)
if (equal(g_classnames[0], "weaponbox") && equal(g_model[9], g_weaponString[int:otherteam][7], strlen(g_weaponString[int:otherteam][7]))) {
return FMRES_IGNORED
}
}
//server_print("%s (%s/%d) BLOCKING touch of a %s (%d) strlen of current weapon from 7: %d", g_classnames[0], g_model, toucher, g_classnames[1], touched, strlen(g_weaponString[int:team][7]))
// All else block touch!
return FMRES_SUPERCEDE
}
日志中有以下错误记录
L 06/18/2007 - 11:31:48: Start of error session.
L 06/18/2007 - 11:31:48: Info (map "awp_map_32b") (logfile "error_061807.log")
L 06/18/2007 - 11:31:48: [ENGINE] Invalid entity 118
L 06/18/2007 - 11:31:48: [AMXX] Displaying debug trace (plugin "weaponarena.amxx")
L 06/18/2007 - 11:31:48: [AMXX] Run time error 10: native error (native "entity_get_string")
L 06/18/2007 - 11:31:48: [AMXX] [0] weaponarena.sma::forward_touch (line 2510)
L 06/18/2007 - 11:37:39: [ENGINE] Invalid entity 108
L 06/18/2007 - 11:37:39: [AMXX] Displaying debug trace (plugin "weaponarena.amxx")
L 06/18/2007 - 11:37:39: [AMXX] Run time error 10: native error (native "entity_get_string")
L 06/18/2007 - 11:37:39: [AMXX] [0] weaponarena.sma::forward_touch (line 2510)
L 06/18/2007 - 11:37:39: [ENGINE] Invalid entity 111
L 06/18/2007 - 11:37:39: [AMXX] Displaying debug trace (plugin "weaponarena.amxx")
L 06/18/2007 - 11:37:39: [AMXX] Run time error 10: native error (native "entity_get_string")
L 06/18/2007 - 11:37:39: [AMXX] [0] weaponarena.sma::forward_touch (line 2510)
L 06/18/2007 - 11:39:47: [ENGINE] Invalid entity 130
L 06/18/2007 - 11:39:47: [AMXX] Displaying debug trace (plugin "weaponarena.amxx")
L 06/18/2007 - 11:39:47: [AMXX] Run time error 10: native error (native "entity_get_string")
L 06/18/2007 - 11:39:47: [AMXX] [0] weaponarena.sma::forward_touch (line 2510)
L 06/18/2007 - 11:39:47: [ENGINE] Invalid entity 132
L 06/18/2007 - 11:39:47: [AMXX] Displaying debug trace (plugin "weaponarena.amxx")
L 06/18/2007 - 11:39:47: [AMXX] Run time error 10: native error (native "entity_get_string")
L 06/18/2007 - 11:39:47: [AMXX] [0] weaponarena.sma::forward_touch (line 2510)
L 06/18/2007 - 11:39:53: [ENGINE] Invalid entity 130
其实就是weaponarena.amxx武器竞技场
运行一段时间就出这个错误,时间再长点就出个hlds.exe,什么内存不能读,挂起死在那里。
版本1.9.7 |
|