ZSpawn: Hopefully fix the random deaths.
Seems it all happening together with the game logic caused some random death issues. Hopefully thats fixed now.
This commit is contained in:
parent
6334246ced
commit
35d7190ba2
@ -154,11 +154,9 @@ public Action:EventPlayerTeam(Handle:event, const String:name[], bool:dontBroadc
|
|||||||
InfectOnClientTeam(index, team);
|
InfectOnClientTeam(index, team);
|
||||||
ImmunityOnClientTeam(index);
|
ImmunityOnClientTeam(index);
|
||||||
|
|
||||||
// Bots dont call `joinclass`. So call here.
|
// Fire post joinclass command. (Bots dont joinclass, so we fire it from here instead.)
|
||||||
if (IsFakeClient(index))
|
if (IsFakeClient(index))
|
||||||
{
|
CreateTimer(0.1, CommandPlayerClassPost, index);
|
||||||
ZSpawnOnClientTeam(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
@ -340,9 +338,25 @@ public Action:EventPlayerJumpPost(Handle:timer, any:client)
|
|||||||
*/
|
*/
|
||||||
public Action:CommandPlayerClass(int client, const char[] command, int argc)
|
public Action:CommandPlayerClass(int client, const char[] command, int argc)
|
||||||
{
|
{
|
||||||
if (IsFakeClient(client))
|
// Fire post joinclass command.
|
||||||
return;
|
CreateTimer(0.1, CommandPlayerClassPost, client);
|
||||||
|
}
|
||||||
// Forward event to modules.
|
|
||||||
ZSpawnOnClientTeam(client);
|
/**
|
||||||
|
* Command callback (joinclass)
|
||||||
|
* Client is joining a class. *Post
|
||||||
|
*
|
||||||
|
* @param client The client.
|
||||||
|
* @param command The command performed.
|
||||||
|
* @param argc The amount of arguments.
|
||||||
|
*/
|
||||||
|
public Action:CommandPlayerClassPost(Handle:timer, any:client)
|
||||||
|
{
|
||||||
|
// If client isn't in-game, then stop.
|
||||||
|
if (!IsClientInGame(client))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ZSpawnOnClientClassPost(client);
|
||||||
}
|
}
|
||||||
|
@ -116,11 +116,11 @@ ZSpawnOnClientDeath(client)
|
|||||||
SteamidCacheAddClient(g_hZSpawnSteamIDCache, client);
|
SteamidCacheAddClient(g_hZSpawnSteamIDCache, client);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Client is joining a team/class.
|
* Client joined a class.
|
||||||
*
|
*
|
||||||
* @param client The client index.
|
* @param client The client index.
|
||||||
*/
|
*/
|
||||||
ZSpawnOnClientTeam(client)
|
ZSpawnOnClientClassPost(client)
|
||||||
{
|
{
|
||||||
// Is auto zspawn enabled and is the client death?
|
// Is auto zspawn enabled and is the client death?
|
||||||
new bool:autozspawn = GetConVarBool(g_hCvarsList[CVAR_ZSPAWN_AUTO]);
|
new bool:autozspawn = GetConVarBool(g_hCvarsList[CVAR_ZSPAWN_AUTO]);
|
||||||
@ -136,7 +136,6 @@ ZSpawnOnClientTeam(client)
|
|||||||
// Respawn client.
|
// Respawn client.
|
||||||
CS_RespawnPlayer(client);
|
CS_RespawnPlayer(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user