【求助】quake_like由官方的amx版本改成amxmodx运行error
L 11/09/2007 - 19:56:08: Displaying debug trace (plugin "quake_like.amxx")L 11/09/2007 - 19:56:08: Run time error 10: native error (native "client_cmd")
L 11/09/2007 - 19:56:08: quake_like.sma::makeDamage (line 64)
运行环境amxmodx1.76d,上述问题如何解决呢?插件编译没任何问题啊。
/*
* AMX Mod script.
*
* Plugin : Quake like
*
* by DanRaZor
*
* Just remember Quake III Arena ...
*
* New Cvar : amx_q3_mode = "abcde" (default)
*
* a : emit sound when enemy damaged
* b : emit sound when teammate damaged
* c : sound at start of round
* d : emit sound when entering game
* e : emit sound when disconnecting
*
* Originals Wavs From the Game. Just Boosted in volume.
*/
//#include <amxmod>
#include <amxmodx>
readSettings( ) {
new flags
get_cvar_string( "amx_q3_mode" , flags ,11)
return read_flags( flags )
}
public client_putinserver(id) {
if ( readSettings( ) & 8 ) {
new param
param = id
set_task ( 2.0 , "enterMsg" , 0 , param , 1)
}
return PLUGIN_CONTINUE
}
public enterMsg (param[])
client_cmd( param , "spk q3/intro" )
public client_disconnect(id) {
if ( readSettings( ) & 16)
client_cmd(0,"spk q3/exit")
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/prepare")
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/hit_teammate")
}
else if ( readSettings( ) & 1 )
client_cmd(attacker,"spk q3/hit")
}
public plugin_precache() {
precache_sound( "q3/hit.wav" )
precache_sound( "q3/hit_teammate.wav" )
precache_sound( "q3/prepare.wav" )
precache_sound( "q3/intro.wav" )
precache_sound( "q3/exit.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
}
回复: 【求助】quake_like由官方的amx版本改成amxmodx运行error
在new teamA = get_user_team ( attacker )
new teamV = get_user_team ( victim )
前面加上判断,判断 attacker 和 victim 是否已连接。
if(!is_user_connected(attacker) || !is_user_connected(victim)) return
回复: 【求助】quake_like由官方的amx版本改成amxmodx运行error
Post by Rulzy在
new teamA = get_user_team ( attacker )
new teamV = get_user_team ( victim )
前面加上判断,判断 attacker 和 victim 是否已连接。
if(!is_user_connected(attacker) || !is_user_connected(victim)) return
:super: :super: 没报错了。。。之前看代码怎么也看不出来是这里的问题。。谢谢。。。
回复: 【求助】quake_like由官方的amx版本改成amxmodx运行error
正为这个问题感到烦恼。。多谢!!! fffffffffffffffffff mmmmmmmmmmmmm 方法方法方法方法方法 仍然仍然仍然仍然仍然 将计就计将计就计经济 方法方法方法方法方法
页:
[1]
2