Q6Q6Q6 发表于 2007-11-9 20:22:38

【求助】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
}


Rulzy 发表于 2007-11-10 10:53:26

回复: 【求助】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

Q6Q6Q6 发表于 2007-11-10 13:18:10

回复: 【求助】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: 没报错了。。。之前看代码怎么也看不出来是这里的问题。。谢谢。。。

Joseph 发表于 2007-11-10 21:52:48

回复: 【求助】quake_like由官方的amx版本改成amxmodx运行error

正为这个问题感到烦恼。。
多谢!!!

wangyang5008 发表于 2011-4-7 19:49:45

fffffffffffffffffff

wangyang5008 发表于 2011-4-7 19:51:35

mmmmmmmmmmmmm

wangyang5008 发表于 2011-4-9 22:35:16

方法方法方法方法方法

wangyang5008 发表于 2011-4-9 22:36:06

仍然仍然仍然仍然仍然

wangyang5008 发表于 2011-4-9 22:37:37

将计就计将计就计经济

wangyang5008 发表于 2011-4-9 22:38:27

方法方法方法方法方法
页: [1] 2
查看完整版本: 【求助】quake_like由官方的amx版本改成amxmodx运行error