給你一點建議,,
12boss_level.sma
第24-25行 把include位置改好
第189行 在fw_PlayerPreThink加入簡單過濾條件
建議去掉include engine, 然後 第206, 210行 改為統一語法(pev/set_pev)
盡量減少使用Player Think
例如: set rendering, gravity, punchangle 等等
不建議在Player Think用上
尤其是你的改後座力語法, 不太正確, 建議參考Recoil Control的方法
在Player Think或重複性的Task 建議用全局變數預先代入值去代替使用呼叫一個native, 以減輕伺服器負擔
類似這個
複製程式
#include <amxmodx>
#include <engine>
#include <hamsandwich>
new Float:global_maxspeed;
new global_isalive[33 char];
public plugin_init( )
{
RegisterHam( Ham_Spawn, "player", "OnCBasePlayer_Spawn_Killed", true );
RegisterHam( Ham_Killed, "player", "OnCBasePlayer_Spawn_Killed", false );
register_cvar( "MaxSpeed", "250" );
global_maxspeed = get_cvar_float( "MaxSpeed" );
}
public client_disconnect( id ) global_isalive{id} = 0;
public OnCBasePlayer_Spawn_Killed( id )
{
if( is_user_alive(id) ) global_isalive{id} = 1;
else global_isalive{id} = 0;
}
public client_PreThink( id )
if( global_isalive{id} ) entity_set_float(id, EV_FL_maxspeed, global_maxspeed);
另外, 我留意到你的源碼有幾處不知你有何用意
save_load.inc - 行 24 ?
12Box_level.sma - 行 191,194 ?
12Box_foreverguns.sma - 行 75, 99, 123, ... ... 1143 ?