|
发表于 2006-9-10 18:21:08
|
显示全部楼层
|阅读模式
来自 中国–重庆–重庆–渝北区
插件quake_like.amxx在amxx1,71下可以正常编译和加载,但总提示要加载debug,加入debug后显示
L 09/10/2006 - 16:14:08: [AMXX] Displaying debug trace (plugin "quake_like.amxx")
L 09/10/2006 - 16:14:08: [AMXX] Run time error 10: native error (native "client_cmd")
L 09/10/2006 - 16:14:08: [AMXX] [0] quake_like.sma::makeDamage (line 64)
我把插件源码帖上来,请看看是哪里出错?谢谢!
#include <amxmodx>
readSettings( ) {
new flags[12]
get_cvar_string( "amx_q3_mode" , flags ,11)
return read_flags( flags )
}
public client_putinserver(id) {
if ( readSettings( ) & 8 ) {
new param[2]
param[0] = id
set_task ( 2.0 , "enterMsg" , 0 , param , 1 )
}
return PLUGIN_CONTINUE
}
public enterMsg (param[])
client_cmd( param[0] , "spk q3/en" )
public client_disconnect(id) {
if ( readSettings( ) & 16)
client_cmd(0,"spk q3/le")
return PLUGIN_CONTINUE
}
public newRound ( ) {
new roundtime = floatround( get_cvar_float("mp_roundtime") * 60.0 )
if ( roundtime == read_data(1) && readSettings( ) & 4 )
client_cmd(0,"spk q3/pr")
return PLUGIN_CONTINUE
}
public makeDamage( victim ) {
new wpn, hitzone, attacker = get_user_attacker(victim,wpn,hitzone)
if ( !attacker ) return
new teamA = get_user_team ( attacker )
new teamV = get_user_team ( victim )
if ( teamV == teamA ) {
if ( readSettings( ) & 2 )
client_cmd(attacker,"spk q3/1")
}
else if ( readSettings( ) & 1 )
client_cmd(attacker,"spk q3/2")
}
public plugin_precache() {
precache_sound( "q3/1.wav" )
precache_sound( "q3/2.wav" )
precache_sound( "q3/pr.wav" )
precache_sound( "q3/en.wav" )
precache_sound( "q3/le.wav" )
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin ("Quake like","1.2","DanRaZor")
register_event ("Damage" ,"makeDamage" ,"b","2!0","3=0","4!0")
register_event ("RoundTime" ,"newRound" ,"bc")
register_cvar ("amx_q3_mode" ,"abcde" )
return PLUGIN_CONTINUE
} |
|