Small fixes

This commit is contained in:
BotoX
2019-10-30 23:16:39 +01:00
parent 576a6b5049
commit 0af43b367d
3 changed files with 11 additions and 6 deletions
@@ -247,11 +247,8 @@ public MRESReturn AcceptInput(int pThis, Handle hReturn, Handle hParams)
public void Event_Spawn(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
if(!client)
return;
CreateTimer(0.1, Timer_SpawnPost, client, TIMER_FLAG_NO_MAPCHANGE);
int userid = GetEventInt(event, "userid");
CreateTimer(0.1, Timer_SpawnPost, userid);
}
public void Event_Death(Event event, const char[] name, bool dontBroadcast)
@@ -263,8 +260,12 @@ public void Event_Death(Event event, const char[] name, bool dontBroadcast)
g_Client_bEnabled[client] = false;
}
public Action Timer_SpawnPost(Handle timer, int client)
public Action Timer_SpawnPost(Handle timer, int userid)
{
int client = GetClientOfUserId(userid);
if(!client)
return;
if(!IsClientInGame(client) || !IsPlayerAlive(client))
return Plugin_Stop;