Removed all non-forwarding code from events.inc and moved to appropriate modules.
This commit is contained in:
parent
6e464880f4
commit
a1aebe5ca5
@ -153,32 +153,10 @@ public Action:EventPlayerSpawn(Handle:event, const String:name[], bool:dontBroad
|
||||
// Get all required event info.
|
||||
new index = GetClientOfUserId(GetEventInt(event, "userid"));
|
||||
|
||||
// Reset FOV and overlay.
|
||||
ToolsSetClientDefaultFOV(index, 90);
|
||||
ClientCommand(index, "r_screenoverlay \"\"");
|
||||
|
||||
// Check if client is on a team.
|
||||
if (ZRIsClientOnTeam(index))
|
||||
{
|
||||
// Turn off nightvision.
|
||||
ToolsClientNightVision(index, false, false);
|
||||
|
||||
// Take nightvision away.
|
||||
ToolsClientNightVision(index, false);
|
||||
|
||||
if (g_bZombieSpawned)
|
||||
{
|
||||
if (ZRIsClientOnTeam(index, CS_TEAM_T))
|
||||
{
|
||||
CS_SwitchTeam(index, CS_TEAM_CT);
|
||||
CS_RespawnPlayer(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Forward event to modules.
|
||||
InfectOnClientSpawn(index);
|
||||
ClassOnClientSpawn(index); // Module event depends on infect module.
|
||||
InfectOnClientSpawn(index); // Multiple modules depend on this to finish first.
|
||||
OverlaysOnClientSpawn(index);
|
||||
ClassOnClientSpawn(index);
|
||||
RestrictOnClientSpawn(index);
|
||||
SEffectsOnClientSpawn(index);
|
||||
AccountOnClientSpawn(index);
|
||||
|
@ -213,6 +213,16 @@ InfectOnClientSpawn(client)
|
||||
{
|
||||
// Disable zombie flag on client.
|
||||
bZombie[client] = false;
|
||||
|
||||
// Check if client is spawning on the terrorist team.
|
||||
if (ZRIsClientOnTeam(client, CS_TEAM_T))
|
||||
{
|
||||
if (g_bZombieSpawned)
|
||||
{
|
||||
CS_SwitchTeam(client, CS_TEAM_CT);
|
||||
CS_RespawnPlayer(client);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Client has been hurt.
|
||||
|
@ -129,6 +129,17 @@ public OverlaysQueryClientDXLevel(QueryCookie:cookie, client, ConVarQueryResult:
|
||||
g_iOverlaysDXL[client] = StringToInt(cvarValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Client is spawning into the game.
|
||||
*
|
||||
* @param client The client index.
|
||||
*/
|
||||
OverlaysOnClientSpawn(client)
|
||||
{
|
||||
// Update overlay.
|
||||
OverlaysClientUpdateOverlay(client);
|
||||
}
|
||||
|
||||
/**
|
||||
* The round is starting.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user