Quote:
Originally Posted by JackieChan
Those are the wrong convars by the way.
z_versus_boomer_limit
z_versus_charger_limit
z_versus_hunter_limit
z_versus_jockey_limit
z_versus_smoker_limit
z_versus_spitter_limit
Those will do what you want.
|
Thanks dude, how careless am I. I can still implement it using another way, but your method is the best and easiest way though, I tried to use ghost spawn time event to set up a timer then execute my function:
PHP Code:
HookEvent("ghost_spawn_time",event_ghost_spawn_time,EventHookMode_Post);
PHP Code:
public event_ghost_spawn_time(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event,"userid"));
new Float:spawntime = GetEventFloat(event,"spawntime");
if (IsClientConnected(client) && GetClientTeam(client)==3 )
{
CreateTimer(spawntime+1.0,ChangeToBoomer,client); //Delay one second to ensure that player is in ghost mode
}
}
PHP Code:
public Action:ChangeToBoomer(Handle:timer, any:client)
{
if(IsClientConnected(client) && GetClientTeam(client)==3 )
{
if(!IsPlayerGhost(client)){PrintToServer("CTB triggered! But client is not a ghost!"); return;}
new WeaponIndex;
while ((WeaponIndex = GetPlayerWeaponSlot(client, 0)) != -1)
{
RemovePlayerItem(client, WeaponIndex);
RemoveEdict(WeaponIndex);
}
SDKCall(g_hSetClass, client, 2);
AcceptEntityInput(MakeCompatEntRef(GetEntProp(client, Prop_Send, "m_customAbility")), "Kill");
SetEntProp(client, Prop_Send, "m_customAbility", GetEntData(SDKCall(g_hCreateAbility, client), g_oAbility));
SetEntProp(client,Prop_Send,"m_zombieClass",2);
}
}
Anyway, Thanks Marcus101RR and JackieChan for telling me the mistake