Manually fixed broken commit. Rev 95 (debbeac5df3b) had wrong parent. Redid changes from previous commit.
This commit is contained in:
parent
035d6182a9
commit
1005aeb0d1
@ -119,8 +119,6 @@ public OnMapStart()
|
|||||||
LoadModelData();
|
LoadModelData();
|
||||||
LoadDownloadData();
|
LoadDownloadData();
|
||||||
|
|
||||||
// Weapons
|
|
||||||
WeaponsOnMapStart();
|
|
||||||
|
|
||||||
new i;
|
new i;
|
||||||
new classindex = GetDefaultClassIndex();
|
new classindex = GetDefaultClassIndex();
|
||||||
@ -129,6 +127,8 @@ public OnMapStart()
|
|||||||
pClass[i] = classindex;
|
pClass[i] = classindex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forward event to modules.
|
||||||
|
WeaponsOnMapStart();
|
||||||
Anticamp_Startup();
|
Anticamp_Startup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,10 +139,7 @@ public OnMapEnd()
|
|||||||
|
|
||||||
public OnConfigsExecuted()
|
public OnConfigsExecuted()
|
||||||
{
|
{
|
||||||
FindMapSky();
|
|
||||||
|
|
||||||
LoadClassData();
|
|
||||||
LoadAmbienceData();
|
|
||||||
|
|
||||||
decl String:mapconfig[PLATFORM_MAX_PATH];
|
decl String:mapconfig[PLATFORM_MAX_PATH];
|
||||||
|
|
||||||
@ -155,10 +152,19 @@ public OnConfigsExecuted()
|
|||||||
if (FileExists(path))
|
if (FileExists(path))
|
||||||
{
|
{
|
||||||
ServerCommand("exec %s", mapconfig);
|
ServerCommand("exec %s", mapconfig);
|
||||||
|
if (LogFlagCheck(LOG_CORE_EVENTS))
|
||||||
|
{
|
||||||
LogMessage("Executed map config file: %s", mapconfig);
|
LogMessage("Executed map config file: %s", mapconfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FindMapSky();
|
||||||
|
ClassLoad();
|
||||||
|
LoadClassData();
|
||||||
|
LoadAmbienceData();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public OnClientPutInServer(client)
|
public OnClientPutInServer(client)
|
||||||
{
|
{
|
||||||
pClass[client] = GetDefaultClassIndex();
|
pClass[client] = GetDefaultClassIndex();
|
||||||
@ -170,11 +176,12 @@ public OnClientPutInServer(client)
|
|||||||
new bool:zhp = GetConVarBool(gCvars[CVAR_ZHP_DEFAULT]);
|
new bool:zhp = GetConVarBool(gCvars[CVAR_ZHP_DEFAULT]);
|
||||||
dispHP[client] = zhp;
|
dispHP[client] = zhp;
|
||||||
|
|
||||||
// Weapon restrict
|
// Forward event to modules.
|
||||||
WeaponRestrictClientInit(client);
|
WeaponRestrictClientInit(client);
|
||||||
|
ClassClientInit(client);
|
||||||
|
if (!IsFakeClient(client)) AmbienceStart(client);
|
||||||
|
|
||||||
ClientHookAttack(client);
|
ClientHookAttack(client);
|
||||||
|
|
||||||
FindClientDXLevel(client);
|
FindClientDXLevel(client);
|
||||||
|
|
||||||
for (new x = 0; x < MAXTIMERS; x++)
|
for (new x = 0; x < MAXTIMERS; x++)
|
||||||
@ -183,17 +190,17 @@ public OnClientPutInServer(client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
RefreshList();
|
RefreshList();
|
||||||
if (!IsFakeClient(client)) AmbienceStart(client);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OnClientDisconnect(client)
|
public OnClientDisconnect(client)
|
||||||
{
|
{
|
||||||
// Weapon restrict
|
|
||||||
WeaponRestrictClientDisconnect(client);
|
|
||||||
|
|
||||||
ClientUnHookAttack(client);
|
ClientUnHookAttack(client);
|
||||||
|
|
||||||
PlayerLeft(client);
|
PlayerLeft(client);
|
||||||
|
|
||||||
|
// Forward event to modules.
|
||||||
|
WeaponRestrictClientDisconnect(client);
|
||||||
|
ClassOnClientDisconnect(client);
|
||||||
ZTeleResetClient(client);
|
ZTeleResetClient(client);
|
||||||
AmbienceStop(client);
|
AmbienceStop(client);
|
||||||
|
|
||||||
@ -235,6 +242,8 @@ ZREnd()
|
|||||||
UnhookCvars();
|
UnhookCvars();
|
||||||
UnhookEvents();
|
UnhookEvents();
|
||||||
|
|
||||||
|
// TODO: Disable all modules! Teleport, ambience, overlays, antistick, etc.
|
||||||
|
|
||||||
new maxplayers = GetMaxClients();
|
new maxplayers = GetMaxClients();
|
||||||
for (new x = 1; x <= maxplayers; x++)
|
for (new x = 1; x <= maxplayers; x++)
|
||||||
{
|
{
|
||||||
|
@ -170,25 +170,11 @@ Zombify_Mother(client)
|
|||||||
gZombie[client] = true;
|
gZombie[client] = true;
|
||||||
motherZombie[client] = true;
|
motherZombie[client] = true;
|
||||||
|
|
||||||
//ApplyZombieHealth(client,true);
|
|
||||||
|
|
||||||
//ApplyZombieSpeed(client);
|
|
||||||
|
|
||||||
CS_SwitchTeam(client, CS_TEAM_T);
|
CS_SwitchTeam(client, CS_TEAM_T);
|
||||||
|
|
||||||
RemoveAllPlayersWeapons(client);
|
RemoveAllPlayersWeapons(client);
|
||||||
GivePlayerItem(client, "weapon_knife");
|
GivePlayerItem(client, "weapon_knife");
|
||||||
|
|
||||||
//ApplyZombieNightVision(client);
|
|
||||||
|
|
||||||
//ZVisionPreCheck(client);
|
|
||||||
|
|
||||||
//ApplyZombieFOV(client);
|
|
||||||
|
|
||||||
//ApplyZombieModel(client);
|
|
||||||
|
|
||||||
//ApplyZombieAlpha(client);
|
|
||||||
|
|
||||||
ClassOnClientInfected(client, true);
|
ClassOnClientInfected(client, true);
|
||||||
InfectionEffects(client);
|
InfectionEffects(client);
|
||||||
|
|
||||||
@ -236,10 +222,20 @@ Zombify_Mother(client)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Zombify(client, attacker)
|
/**
|
||||||
|
* Zombifies a player. Execute events, sets attributes and flags that indicate
|
||||||
|
* that the player is a zombie.
|
||||||
|
*
|
||||||
|
* @param client The player to infect.
|
||||||
|
* @param attacker Optional. The attacker who did the infect.
|
||||||
|
* @param motherinfect Optional. Indicates a mother zombie infect.
|
||||||
|
*/
|
||||||
|
Zombify(client, attacker = -1, bool:motherinfect = false)
|
||||||
{
|
{
|
||||||
if (attacker != 0)
|
// Check if the attacker was specified.
|
||||||
|
if (attacker > 0)
|
||||||
{
|
{
|
||||||
|
// Fire death event and set weapon info.
|
||||||
new Handle:event = CreateEvent("player_death");
|
new Handle:event = CreateEvent("player_death");
|
||||||
if (event != INVALID_HANDLE)
|
if (event != INVALID_HANDLE)
|
||||||
{
|
{
|
||||||
@ -250,44 +246,34 @@ Zombify(client, attacker)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forward global event.
|
||||||
Call_StartForward(hZombify);
|
Call_StartForward(hZombify);
|
||||||
Call_PushCell(client);
|
Call_PushCell(client);
|
||||||
Call_PushCell(false);
|
Call_PushCell(false);
|
||||||
Call_Finish();
|
Call_Finish();
|
||||||
|
|
||||||
|
// Set player status.
|
||||||
gZombie[client] = true;
|
gZombie[client] = true;
|
||||||
|
motherZombie[client] = motherinfect;
|
||||||
|
|
||||||
//ApplyZombieHealth(client, false);
|
// Remove all weapons and give a knife.
|
||||||
|
|
||||||
//ApplyZombieSpeed(client);
|
|
||||||
|
|
||||||
RemoveAllPlayersWeapons(client);
|
RemoveAllPlayersWeapons(client);
|
||||||
GivePlayerItem(client, "weapon_knife");
|
GivePlayerItem(client, "weapon_knife");
|
||||||
|
|
||||||
//ApplyZombieNightVision(client);
|
ztele_count[client] = 0; // In use?
|
||||||
|
|
||||||
//ZVisionPreCheck(client);
|
|
||||||
|
|
||||||
//ApplyZombieFOV(client);
|
|
||||||
|
|
||||||
//ApplyZombieModel(client);
|
|
||||||
|
|
||||||
//ApplyZombieAlpha(client);
|
|
||||||
|
|
||||||
ClassOnClientInfected(client);
|
|
||||||
InfectionEffects(client);
|
|
||||||
|
|
||||||
ztele_count[client] = 0;
|
|
||||||
AbortTeleport(client);
|
|
||||||
|
|
||||||
|
// Terminate the round if the last player was infected.
|
||||||
new ZTeam:team = IsRoundOver();
|
new ZTeam:team = IsRoundOver();
|
||||||
RoundWin(team);
|
RoundWin(team);
|
||||||
|
|
||||||
|
// Switch the player to terrorists.
|
||||||
CS_SwitchTeam(client, CS_TEAM_T);
|
CS_SwitchTeam(client, CS_TEAM_T);
|
||||||
|
|
||||||
|
// Check if random zombie sounds are enabled.
|
||||||
new Float:interval = GetConVarFloat(gCvars[CVAR_EMITSOUNDS]);
|
new Float:interval = GetConVarFloat(gCvars[CVAR_EMITSOUNDS]);
|
||||||
if (interval > 0.0)
|
if (interval > 0.0)
|
||||||
{
|
{
|
||||||
|
// Create timer.
|
||||||
if (tHandles[client][TMOAN] != INVALID_HANDLE)
|
if (tHandles[client][TMOAN] != INVALID_HANDLE)
|
||||||
{
|
{
|
||||||
KillTimer(tHandles[client][TMOAN]);
|
KillTimer(tHandles[client][TMOAN]);
|
||||||
@ -295,6 +281,7 @@ Zombify(client, attacker)
|
|||||||
tHandles[client][TMOAN] = CreateTimer(interval, ZombieMoanTimer, client, TIMER_REPEAT);
|
tHandles[client][TMOAN] = CreateTimer(interval, ZombieMoanTimer, client, TIMER_REPEAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Kill spawn protection timer.
|
||||||
if (tHandles[client][TPROTECT] != INVALID_HANDLE)
|
if (tHandles[client][TPROTECT] != INVALID_HANDLE)
|
||||||
{
|
{
|
||||||
pProtect[client] = false;
|
pProtect[client] = false;
|
||||||
@ -303,21 +290,28 @@ Zombify(client, attacker)
|
|||||||
tHandles[client][TPROTECT] = INVALID_HANDLE;
|
tHandles[client][TPROTECT] = INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Kill HP display timer.
|
||||||
if (tHandles[client][TZHP] != INVALID_HANDLE)
|
if (tHandles[client][TZHP] != INVALID_HANDLE)
|
||||||
{
|
{
|
||||||
KillTimer(tHandles[client][TZHP]);
|
KillTimer(tHandles[client][TZHP]);
|
||||||
tHandles[client][TZHP] = INVALID_HANDLE;
|
tHandles[client][TZHP] = INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start HP display if enabled.
|
||||||
new bool:zhp = GetConVarBool(gCvars[CVAR_ZHP]);
|
new bool:zhp = GetConVarBool(gCvars[CVAR_ZHP]);
|
||||||
if (zhp)
|
if (zhp)
|
||||||
{
|
{
|
||||||
UpdateHPDisplay(client);
|
UpdateHPDisplay(client);
|
||||||
|
|
||||||
tHandles[client][TZHP] = CreateTimer(5.0, ZHPTimer, client, TIMER_REPEAT);
|
tHandles[client][TZHP] = CreateTimer(5.0, ZHPTimer, client, TIMER_REPEAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forward event to modules.
|
||||||
|
ClassOnClientInfected(client);
|
||||||
|
AbortTeleport(client);
|
||||||
AntiStick(attacker, client);
|
AntiStick(attacker, client);
|
||||||
|
|
||||||
|
// Apply effects.
|
||||||
|
InfectionEffects(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
InfectionEffects(client)
|
InfectionEffects(client)
|
||||||
@ -396,47 +390,6 @@ InfectionEffects(client)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ApplyZombieHealth(client, bool:mother)
|
|
||||||
{
|
|
||||||
new health = GetClassHealth(pClass[client]);
|
|
||||||
|
|
||||||
if (mother)
|
|
||||||
{
|
|
||||||
health *= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetEntityHealth(client, health);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*ApplyZombieSpeed(client)
|
|
||||||
{
|
|
||||||
new Float:speed = GetClassSpeed(pClass[client]);
|
|
||||||
SetPlayerSpeed(client, speed);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*ApplyZombieNightVision(client)
|
|
||||||
{
|
|
||||||
new bool:nvgs = GetClassNVGs(pClass[client]);
|
|
||||||
NightVision(client, nvgs);
|
|
||||||
|
|
||||||
if (nvgs)
|
|
||||||
{
|
|
||||||
NightVisionOn(client, nvgs);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*ApplyZombieFOV(client)
|
|
||||||
{
|
|
||||||
new fov = GetClassFOV(pClass[client]);
|
|
||||||
SetPlayerFOV(client, fov);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*ApplyZombieAlpha(client)
|
|
||||||
{
|
|
||||||
new alpha = GetClassAlphaSpawn(pClass[client]);
|
|
||||||
SetPlayerAlpha(client, alpha);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
KnockBack(client, const Float:clientloc[3], const Float:attackerloc[3], Float:power, dmg, bool:grenade)
|
KnockBack(client, const Float:clientloc[3], const Float:attackerloc[3], Float:power, dmg, bool:grenade)
|
||||||
{
|
{
|
||||||
if (!IsPlayerZombie(client))
|
if (!IsPlayerZombie(client))
|
||||||
@ -471,7 +424,7 @@ JumpBoost(client, Float:distance, Float:height)
|
|||||||
|
|
||||||
vel[0] *= distance;
|
vel[0] *= distance;
|
||||||
vel[1] *= distance;
|
vel[1] *= distance;
|
||||||
vel[2] = height;
|
vel[2] *= height;
|
||||||
|
|
||||||
SetPlayerVelocity(client, vel, false);
|
SetPlayerVelocity(client, vel, false);
|
||||||
}
|
}
|
||||||
@ -659,68 +612,6 @@ RemoveObjectives()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ZVisionPreCheck(client)
|
|
||||||
{
|
|
||||||
if (IsFakeClient(client))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
decl String:zvision[128];
|
|
||||||
GetClassZVision(pClass[client], zvision, sizeof(zvision));
|
|
||||||
|
|
||||||
if (strlen(zvision) == 0)
|
|
||||||
{
|
|
||||||
bZVision[client] = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bZVision[client] = true;
|
|
||||||
strcopy(ZVisionOverlay[client], PLATFORM_MAX_PATH, zvision);
|
|
||||||
|
|
||||||
ZVisionStart(client);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*ZVisionStart(client)
|
|
||||||
{
|
|
||||||
//if (tHandles[client][TZVISION] != INVALID_HANDLE)
|
|
||||||
//{
|
|
||||||
// KillTimer(tHandles[client][TZVISION]);
|
|
||||||
// tHandles[client][TZVISION] = INVALID_HANDLE;
|
|
||||||
//}
|
|
||||||
|
|
||||||
DisplayClientOverlay(client, ZVisionOverlay[client]);
|
|
||||||
bZVisionOn[client] = true;
|
|
||||||
|
|
||||||
//new Float:redisplay = GetConVarFloat(gCvars[CVAR_ZVISION_REDISPLAY]);
|
|
||||||
//tHandles[client][TZVISION] = CreateTimer(redisplay, ZVisionTimer, client, TIMER_REPEAT);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*ZVisionStop(client)
|
|
||||||
{
|
|
||||||
if (tHandles[client][TZVISION] != INVALID_HANDLE)
|
|
||||||
{
|
|
||||||
KillTimer(tHandles[client][TZVISION]);
|
|
||||||
tHandles[client][TZVISION] = INVALID_HANDLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ClientCommand(client, "r_screenoverlay \"\"");
|
|
||||||
bZVisionOn[client] = false;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*public Action:ZVisionTimer(Handle:timer, any:client)
|
|
||||||
{
|
|
||||||
if (!IsClientInGame(client) || !IsPlayerZombie(client))
|
|
||||||
{
|
|
||||||
tHandles[client][TZVISION] = INVALID_HANDLE;
|
|
||||||
return Plugin_Stop;
|
|
||||||
}
|
|
||||||
|
|
||||||
DisplayClientOverlay(client, ZVisionOverlay[client]);
|
|
||||||
return Plugin_Continue;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
ZombieMoan(client)
|
ZombieMoan(client)
|
||||||
{
|
{
|
||||||
decl String:sound[64];
|
decl String:sound[64];
|
||||||
@ -746,40 +637,6 @@ public Action:ZombieMoanTimer(Handle:timer, any:index)
|
|||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public Action:Regenerate(Handle:timer, any:index)
|
|
||||||
{
|
|
||||||
if (!IsClientInGame(index) || !IsPlayerZombie(index))
|
|
||||||
{
|
|
||||||
tHandles[index][TREGEN] = INVALID_HANDLE;
|
|
||||||
|
|
||||||
return Plugin_Stop;
|
|
||||||
}
|
|
||||||
|
|
||||||
new health = GetClassRegenHealth(pClass[index]);
|
|
||||||
new maxhealth = GetClassHealth(pClass[index]);
|
|
||||||
|
|
||||||
if (motherZombie[index])
|
|
||||||
{
|
|
||||||
maxhealth *= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
new newhealth = GetClientHealth(index) + health;
|
|
||||||
if (newhealth > maxhealth)
|
|
||||||
{
|
|
||||||
newhealth = maxhealth;
|
|
||||||
|
|
||||||
tHandles[index][TREGEN] = INVALID_HANDLE;
|
|
||||||
|
|
||||||
return Plugin_Stop;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetEntityHealth(index, newhealth);
|
|
||||||
|
|
||||||
UpdateHPDisplay(index);
|
|
||||||
|
|
||||||
return Plugin_Continue;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
UpdateHPDisplay(client)
|
UpdateHPDisplay(client)
|
||||||
{
|
{
|
||||||
new bool:zhp = GetConVarBool(gCvars[CVAR_ZHP]);
|
new bool:zhp = GetConVarBool(gCvars[CVAR_ZHP]);
|
||||||
|
@ -62,9 +62,9 @@ new bool:zombieSpawned;
|
|||||||
new bool:motherZombie[MAXPLAYERS+1];
|
new bool:motherZombie[MAXPLAYERS+1];
|
||||||
new bool:gZombie[MAXPLAYERS+1];
|
new bool:gZombie[MAXPLAYERS+1];
|
||||||
new bool:gBlockMotherInfect[MAXPLAYERS+1];
|
new bool:gBlockMotherInfect[MAXPLAYERS+1];
|
||||||
new bool:bZVision[MAXPLAYERS+1];
|
//new bool:bZVision[MAXPLAYERS+1];
|
||||||
new bool:bZVisionOn[MAXPLAYERS+1];
|
//new bool:bZVisionOn[MAXPLAYERS+1];
|
||||||
new String:ZVisionOverlay[MAXPLAYERS+1][PLATFORM_MAX_PATH];
|
//new String:ZVisionOverlay[MAXPLAYERS+1][PLATFORM_MAX_PATH];
|
||||||
new bool:dispHP[MAXPLAYERS+1];
|
new bool:dispHP[MAXPLAYERS+1];
|
||||||
new bool:pProtect[MAXPLAYERS+1];
|
new bool:pProtect[MAXPLAYERS+1];
|
||||||
new bool:gKilledByWorld[MAXPLAYERS+1] = {false, ...};
|
new bool:gKilledByWorld[MAXPLAYERS+1] = {false, ...};
|
||||||
@ -221,18 +221,6 @@ bool:IsPlayerInList(client)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool:IntToBool(intval)
|
|
||||||
{
|
|
||||||
if (intval == 0)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool:IsClientPlayer(client)
|
bool:IsClientPlayer(client)
|
||||||
{
|
{
|
||||||
if (client > 0 && client <= maxclients)
|
if (client > 0 && client <= maxclients)
|
||||||
|
Loading…
Reference in New Issue
Block a user