|
L 11/09/2007 - 19:56:08: [AMXX] Displaying debug trace (plugin "quake_like.amxx")
L 11/09/2007 - 19:56:08: [AMXX] Run time error 10: native error (native "client_cmd")
L 11/09/2007 - 19:56:08: [AMXX] [0] 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>
- [color="Red"]#include <amxmodx> [/color]
- 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/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
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|