2008-10-04 22:59:11 +02:00
|
|
|
/**
|
|
|
|
* ====================
|
|
|
|
* Zombie:Reloaded
|
|
|
|
* File: zombie.inc
|
|
|
|
* Author: Greyscale
|
|
|
|
* ====================
|
|
|
|
*/
|
|
|
|
|
|
|
|
new String:skyname[32];
|
|
|
|
|
|
|
|
HookCommands()
|
|
|
|
{
|
|
|
|
RegConsoleCmd("nightvision", Command_NightVision);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Action:Command_NightVision(client, argc)
|
|
|
|
{
|
2009-04-20 02:56:26 +02:00
|
|
|
new bool:allow_disable = GetConVarBool(g_hCvarsList[CVAR_ZVISION_ALLOW_DISABLE]);
|
2008-10-04 22:59:11 +02:00
|
|
|
if (!allow_disable)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-04-20 02:56:26 +02:00
|
|
|
new bool:enabled = GetConVarBool(g_hCvarsList[CVAR_ENABLE]);
|
2008-10-04 22:59:11 +02:00
|
|
|
if (!enabled)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!IsPlayerZombie(client))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-04-11 01:56:22 +02:00
|
|
|
bClientOverlayOn[client] = !bClientOverlayOn[client];
|
2008-10-04 22:59:11 +02:00
|
|
|
|
2009-04-11 01:56:22 +02:00
|
|
|
decl String:overlay[256];
|
|
|
|
ClassGetOverlayPath(client, overlay, sizeof(overlay));
|
|
|
|
|
|
|
|
if (strlen(overlay) > 0)
|
2008-10-04 22:59:11 +02:00
|
|
|
{
|
2009-04-11 01:56:22 +02:00
|
|
|
if (bClientOverlayOn[client])
|
|
|
|
{
|
|
|
|
ClassOverlayInitialize(client, overlay);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ClassOverlayStop(client);
|
|
|
|
}
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
FindMapSky()
|
|
|
|
{
|
|
|
|
GetConVarString(FindConVar("sv_skyname"), skyname, sizeof(skyname));
|
|
|
|
}
|
|
|
|
|
|
|
|
ChangeLightStyle()
|
|
|
|
{
|
2009-04-20 02:56:26 +02:00
|
|
|
new bool:dark = GetConVarBool(g_hCvarsList[CVAR_DARK]);
|
2008-10-04 22:59:11 +02:00
|
|
|
if (dark)
|
|
|
|
{
|
|
|
|
decl String:darkness[2];
|
|
|
|
decl String:sky[32];
|
|
|
|
|
2009-04-20 02:56:26 +02:00
|
|
|
GetConVarString(g_hCvarsList[CVAR_DARK_LEVEL], darkness, sizeof(darkness));
|
|
|
|
GetConVarString(g_hCvarsList[CVAR_DARK_SKY], sky, sizeof(sky));
|
2008-10-04 22:59:11 +02:00
|
|
|
|
|
|
|
SetLightStyle(0, darkness);
|
|
|
|
SetConVarString(FindConVar("sv_skyname"), sky, true, false);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SetLightStyle(0, "n");
|
|
|
|
SetConVarString(FindConVar("sv_skyname"), skyname, true, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
JumpBoost(client, Float:distance, Float:height)
|
|
|
|
{
|
|
|
|
new Float:vel[3];
|
|
|
|
|
|
|
|
GetPlayerVelocity(client, vel);
|
|
|
|
|
|
|
|
vel[0] *= distance;
|
|
|
|
vel[1] *= distance;
|
2009-04-13 04:35:11 +02:00
|
|
|
vel[2] *= height;
|
2008-10-04 22:59:11 +02:00
|
|
|
|
2009-03-30 21:40:56 +02:00
|
|
|
SetPlayerVelocity(client, vel, false);
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
RemoveObjectives()
|
|
|
|
{
|
|
|
|
decl String:classname[64];
|
|
|
|
|
|
|
|
new maxentities = GetMaxEntities();
|
|
|
|
for (new x = 0; x <= maxentities; x++)
|
|
|
|
{
|
|
|
|
if(!IsValidEdict(x))
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
GetEdictClassname(x, classname, sizeof(classname));
|
|
|
|
if( StrEqual(classname, "func_bomb_target") ||
|
|
|
|
StrEqual(classname, "func_hostage_rescue") ||
|
|
|
|
StrEqual(classname, "c4") ||
|
|
|
|
StrEqual(classname, "hostage_entity"))
|
|
|
|
{
|
|
|
|
RemoveEdict(x);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool:IsPlayerZombie(client)
|
|
|
|
{
|
2009-04-17 12:16:44 +02:00
|
|
|
return bZombie[client];
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool:IsPlayerHuman(client)
|
|
|
|
{
|
2009-04-17 12:16:44 +02:00
|
|
|
return !bZombie[client];
|
2009-04-18 01:44:41 +02:00
|
|
|
}
|