Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Zombie Outstanding Addons
- Project started by SideWinder
- (c) November 2018
- www.CsOutStanding.Com/Forum
- This program is free software
- you can redistribute it and/or modify
- it under the terms of the GNU General Public License
- */
- #include amxmodx
- #include amxmisc
- #include cstrike
- #include fun
- #include sqlx
- #include hamsandwich
- #include fakemeta
- #include fakemeta_util
- #include engine
- #include chr_engine
- #include dhudmessage
- #include xs
- native get_user_jetpack( iPlayer );
- native user_drop_jetpack( iPlayer );
- native set_user_fuel( iPlayer, Float: fFuel );
- native set_user_rocket_time( iPlayer, Float: fTime );
- native set_user_jetpack( iPlayer, iJetpack );
- native set_user_model( _index, _model[ ] );
- native get_user_model( _index, _model[ ], _length );
- native reset_user_model( _index );
- #define FADE_IN 0x0000
- #define FADE_OUT 0x0001
- #define FADE_MODULATE 0x0002
- #define FADE_STAYOUT 0x0004
- #define FLAG "m"
- #define HattrickRange(%1,%2) entity_range(%1,%2)
- #define MAX_ENTITIES 600
- #define MAX_PLAYERS 32
- #define MINE_ON 1
- #define MINE_OFF 0
- #define TASK_CREATE 84765
- #define TASK_REMOVE 86766
- #define MINE_CLASSNAME "zp_trip_mine"
- #define MINE_MODEL_EXPLODE "sprites/zerogxplode.spr"
- #define MINE_MODEL_VIEW "models/ZombieOutstanding/z_out_mine.mdl"
- #define MINE_SOUND_ACTIVATE "ZombieOutstanding/mine_activate.wav"
- #define MINE_SOUND_CHARGE "ZombieOutstanding/mine_charge.wav"
- #define MINE_SOUND_DEPLOY "ZombieOutstanding/mine_deploy.wav"
- #define MINE_HEALTH 800.0
- #define entity_get_owner(%0) entity_get_int( %0, EV_INT_iuser2 )
- #define entity_get_status(%0) entity_get_int( %0, EV_INT_iuser1 )
- #define entity_get_classname(%0,%1) entity_get_string( %0, EV_SZ_classname, %1, charsmax( %1 ) )
- #define Date_Format "%d.%m.%Y @ %H:%M"
- #define Errors_File "ZombieOutStanding_Stats_Error.log"
- #define Score_Start 1000
- #define Score_For_Suicide 5
- #define Score_For_Kill 5
- #define Score_For_Head_Shot 10
- #define Score_For_Death 3
- #define Name_Kick_Reason "Stop changing your name that fast."
- #define Name_Change_Interval 7.5
- #define Task_Update_Time 23785321
- #define Task_Id_Update_Time (Id - Task_Update_Time)
- #define Seconds_In_Minute 60
- #define Seconds_In_Hour 3600
- #define Seconds_In_Day 86400
- #define Seconds_In_Week 604800
- static Handle:g_Tuple = Empty_Handle;
- static g_Query[1024] = { 0, ... };
- static g_Name[33][64];
- static g_Steam[33][64];
- static g_Ip[33][64];
- static g_seenString[33][64];
- static g_timeString[33][64];
- static g_Time[33] = { 0, ... };
- static g_Score[33] = { 0, ... };
- static g_Seen[33] = { 0, ... };
- static g_Kills[33] = { 0, ... };
- static g_Deaths[33] = { 0, ... };
- static g_headShots[33] = { 0, ... };
- static g_kmdValue[33] = { 0, ... };
- static Float:g_kpdRatio[33] = { 0.0, ... };
- static g_recordsCount = 0;
- #if cellbits == 32
- const OFFSET_CLIPAMMO = 51
- #else
- const OFFSET_CLIPAMMO = 65
- #endif
- const OFFSET_LINUX_WEAPONS = 4
- #define is_user_valid_connected(%1) (1 <= %1 <= g_iMaxClients && g_bConnected[%1])
- #define is_user_valid_alive(%1) (1 <= %1 <= g_iMaxClients && g_bAlive[%1])
- enum _:Colors
- {
- print_team_default,
- print_team_red,
- print_team_blue,
- print_team_grey
- };
- stock const TeamName [Colors] [ ] =
- {
- "UNASSIGNED",
- "TERRORIST",
- "CT",
- "SPECTATOR"
- };
- enum
- {
- FM_CS_TEAM_UNASSIGNED = 0,
- FM_CS_TEAM_T,
- FM_CS_TEAM_CT,
- FM_CS_TEAM_SPECTATOR
- };
- enum timeUnit
- {
- timeUnit_None = 0,
- timeUnit_Seconds,
- timeUnit_Minutes,
- timeUnit_Hours,
- timeUnit_Days,
- timeUnit_Weeks,
- timeUnit_Count
- };
- const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
- const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
- const ZOMBIE_ALLOWED_WEAPONS_BITSUM = (1<<CSW_KNIFE)|(1<<CSW_HEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_C4);
- new const szObjectives[][] =
- {
- "func_bomb_target",
- "info_bomb_target",
- "info_vip_start",
- "func_vip_safetyzone",
- "func_escapezone",
- "hostage_entity",
- "monster_scientist",
- "func_hostage_rescue",
- "info_hostage_rescue",
- "env_fog",
- "env_rain",
- "env_snow"
- }
- new g_pZombieFall[2][0] =
- {
- "ZombieOutstanding/zombie_hit_01.wav",
- "ZombieOutstanding/zombie_hit_03.wav"
- };
- new g_pZombieHitNormal[4][0] =
- {
- "weapons/knife_hit1.wav",
- "weapons/knife_hit2.wav",
- "weapons/knife_hit3.wav",
- "weapons/knife_hit4.wav"
- };
- new g_pZombieMissSlash[2][0] =
- {
- "weapons/knife_slash1.wav",
- "weapons/knife_slash2.wav"
- };
- new g_pZombieMissWall[2][0] =
- {
- "weapons/knife_slash1.wav",
- "weapons/knife_slash2.wav"
- };
- new g_pZombieDieSounds[5][0] =
- {
- "ZombieOutstanding/zombie_die_01.wav",
- "ZombieOutstanding/zombie_die_02.wav",
- "ZombieOutstanding/zombie_die_03.wav",
- "ZombieOutstanding/zombie_die_04.wav",
- "ZombieOutstanding/zombie_die_05.wav"
- };
- new g_pMonsterHitSounds[3][0] =
- {
- "ZombieOutstanding/monster_hit_01.wav",
- "ZombieOutstanding/monster_hit_02.wav",
- "ZombieOutstanding/monster_hit_03.wav"
- };
- new g_pZombieHitSounds[5][0] =
- {
- "ZombieOutstanding/zombie_hit_01.wav",
- "ZombieOutstanding/zombie_hit_02.wav",
- "ZombieOutstanding/zombie_hit_03.wav",
- "ZombieOutstanding/zombie_hit_04.wav",
- "ZombieOutstanding/zombie_hit_05.wav"
- };
- 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_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 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_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, 0.94, 1.09, 0.57, 1.00, 0.74, 0.60
- }
- new Float:g_fZombieSpeeds[7] =
- {
- 264.0, 309.0, 244.0, 259.0, 249.0, 279.0, 274.0
- }
- new Float:g_fZombieKnockbacks[7] =
- {
- 0.82, 1.29, 0.43, 1.0, 0.88, 0.68, 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_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 const Float: g_flCoords[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 Float:kb_weapon_power[] =
- {
- -1.0, // ---
- 2.4, // P228
- -1.0, // ---
- 6.5, // SCOUT
- -1.0, // ---
- 8.0, // XM1014
- -1.0, // ---
- 2.3, // MAC10
- 5.0, // AUG
- -1.0, // ---
- 2.4, // ELITE
- 2.0, // FIVESEVEN
- 2.4, // UMP45
- 5.3, // SG550
- 5.5, // GALIL
- 5.5, // FAMAS
- 2.2, // USP
- 2.0, // GLOCK18
- 10.0, // AWP
- 2.5, // MP5NAVY
- 5.2, // M249
- 8.0, // M3
- 5.0, // M4A1
- 2.4, // TMP
- 6.5, // G3SG1
- -1.0, // ---
- 5.3, // DEAGLE
- 5.0, // SG552
- 6.0, // AK47
- -1.0, // ---
- 2.0 // P90
- }
- new const MAXCLIP[] =
- {
- -1,
- 13,
- -1,
- 10,
- 1,
- 7,
- -1,
- 30,
- 30,
- 1,
- 30,
- 20,
- 25,
- 30,
- 35,
- 25,
- 12,
- 20,
- 10,
- 30,
- 100,
- 8,
- 30,
- 30,
- 20,
- 2,
- 7,
- 30,
- 30,
- -1,
- 50
- };
- new const Float:sizez[][3] =
- {
- {0.0, 0.0, 1.0},
- {0.0, 0.0, -1.0},
- {0.0, 1.0, 0.0},
- {0.0, -1.0, 0.0},
- {1.0, 0.0, 0.0},
- {-1.0, 0.0, 0.0},
- {-1.0, 1.0, 1.0},
- {1.0, 1.0, 1.0},
- {1.0, -1.0, 1.0},
- {1.0, 1.0, -1.0},
- {-1.0, -1.0, 1.0},
- {1.0, -1.0, -1.0},
- {-1.0, 1.0, -1.0},
- {-1.0, -1.0, -1.0},
- {0.0, 0.0, 2.0},
- {0.0, 0.0, -2.0},
- {0.0, 2.0, 0.0},
- {0.0, -2.0, 0.0},
- {2.0, 0.0, 0.0},
- {-2.0, 0.0, 0.0},
- {-2.0, 2.0, 2.0},
- {2.0, 2.0, 2.0},
- {2.0, -2.0, 2.0},
- {2.0, 2.0, -2.0},
- {-2.0, -2.0, 2.0},
- {2.0, -2.0, -2.0},
- {-2.0, 2.0, -2.0},
- {-2.0, -2.0, -2.0},
- {0.0, 0.0, 3.0},
- {0.0, 0.0, -3.0},
- {0.0, 3.0, 0.0},
- {0.0, -3.0, 0.0},
- {3.0, 0.0, 0.0},
- {-3.0, 0.0, 0.0},
- {-3.0, 3.0, 3.0},
- {3.0, 3.0, 3.0},
- {3.0, -3.0, 3.0},
- {3.0, 3.0, -3.0},
- {-3.0, -3.0, 3.0},
- {3.0, -3.0, -3.0},
- {-3.0, 3.0, -3.0},
- {-3.0, -3.0, -3.0},
- {0.0, 0.0, 4.0},
- {0.0, 0.0, -4.0},
- {0.0, 4.0, 0.0},
- {0.0, -4.0, 0.0},
- {4.0, 0.0, 0.0},
- {-4.0, 0.0, 0.0},
- {-4.0, 4.0, 4.0},
- {4.0, 4.0, 4.0},
- {4.0, -4.0, 4.0},
- {4.0, 4.0, -4.0},
- {-4.0, -4.0, 4.0},
- {4.0, -4.0, -4.0},
- {-4.0, 4.0, -4.0},
- {-4.0, -4.0, -4.0},
- {0.0, 0.0, 5.0},
- {0.0, 0.0, -5.0},
- {0.0, 5.0, 0.0},
- {0.0, -5.0, 0.0},
- {5.0, 0.0, 0.0},
- {-5.0, 0.0, 0.0},
- {-5.0, 5.0, 5.0},
- {5.0, 5.0, 5.0},
- {5.0, -5.0, 5.0},
- {5.0, 5.0, -5.0},
- {-5.0, -5.0, 5.0},
- {5.0, -5.0, -5.0},
- {-5.0, 5.0, -5.0},
- {-5.0, -5.0, -5.0}
- };
- 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_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\y (100ap)",
- "Armor\y (200ap)",
- "Multijump +1",
- "Tryder",
- "Golden Kalashnikov\y (AK-47)",
- "Golden Deagle\y (Night Hawk)",
- "Survivor",
- "Sniper",
- "Nemesis",
- "Assassin",
- "Knife Blink"
- };
- new g_iExtraItemsPrices[25] =
- {
- 15, 4, 3, 4, 26, 30, 9, 11, 10, 9, 2, 15, 30, 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[30 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 bool:g_bConnected[33], g_cName[33][32], g_iTimeLimit, bool:g_bAlive[33], bool:g_bZombie[33], g_iMaxClients, bool:g_bRoundEnd, g_iPlayerType[33],
- bool:g_bSwitching, g_iAntidoteSync, g_iZombieNextClass[33], bool:g_bFake[33], g_iZombieClass[33], g_iGameMenu, g_iMenuZombieClasses, g_iWeapon[33],
- Float:g_fLastChangedModel, bool:g_bRoundStart, g_iRoundType, g_iTopMessageSync, g_iRoundsCount, g_iRounds[1024], bool:g_bModeStarted, g_iCounter ,
- g_iCounterMessage, g_iAliveCount, g_iLastMode, Float:g_fLastLeapTime[33], bool:g_bFlash[33], bool:g_bFlashEnabled[33], Float:g_fLastTime[33], g_iSecondaryMenu,
- g_iPrimaryMenu, g_iSecondaryWeapons[64], g_iPrimaryWeapons[64], bool:g_bNoDamage[33], g_iPosition[33], g_iSize, g_bFrozen[33], g_iJumps[33],
- g_iMaxJumps[33], g_iPacks[33], Float:g_fDamage[33], g_iShopMenu, g_iPoints[33], g_iCenterMessageSync, g_iDownMessageSync, g_cClass[33][14], g_iVersusSync,
- Array:g_aNameData, Array:g_aAmmoData, g_iShopEventHudmessage, bool:g_bDoubleDamage[33], bool:g_bServerSlot[33], bool:g_bAdminModel[33], g_iMenuExtraItems,
- g_bUnlimitedClip[33], bool:g_bTryder[33], g_iEventsHudmessage, g_iSurvivors, g_iModeRecordings, g_cModeRecordings[52][32], Float:g_fRoundStartTime, g_iSnipers,
- g_iBlinks[33], bool:g_bGolden[33], bool:g_bGoldenDeagle[33], SpriteTexture, bool:g_bGaveThisRound[33], iFwSpawnHook, g_Argping[33][3], g_Offset[33][2],
- g_iLaser, g_cRegisteredCharacter[32], g_Secret[32], Array:g_vname, Array:g_vflags, Array:g_vpwd, bool:g_vip[33], g_vip_flags[33][32], g_ip[33][64], g_steam[33][64],
- jumpnum[33] = 0, bool:dojump[33] = false, ExploSpr, FlameSpr, SmokeSpr, GlassSpr, HExplode, g_iBurningDuration[33], TrailSpr, bool:g_bKilling[33], on_stuck[33], FreezeTime,
- g_iTripMines[ 33 ], g_iPlantedMines[ 33 ], g_iPlanting[ 33 ], g_iRemoving[ 33 ], g_hExplode, g_iMineMessage, g_iSecondMineMessage, g_iVariable, g_iKillsThisRound[33], g_iMenu, g_cQuery[256], bool:g_bRanked[33],
- Float:g_fLastRankQuery, g_iRemainingSync;
- StartSwarmMode(bool:bForced)
- {
- if ((g_iAliveCount > 9 && g_iLastMode != 64 && random_num(1, 22) == 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] || cs_get_user_team(i) == CS_TEAM_CT)
- {
- }
- 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.00, "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_user_health(i, 5750);
- }
- }
- while (iNemesis < iMaxNemesis)
- {
- i = GetRandomAlive();
- if (!(g_iPlayerType[i] & 4 || g_iPlayerType[i] & 1))
- {
- MakeZombie(0, i, false, true, false);
- iNemesis += 1;
- set_user_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 (cs_get_user_team(i) != CS_TEAM_CT)
- {
- g_bSwitching = true;
- cs_set_user_team(i, CS_TEAM_CT);
- 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 Round !!");
- remove_task(600, 0);
- set_task(2.00, "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)
- {
- i += 1;
- if (i > g_iMaxClients)
- {
- i = 1;
- }
- if (!(!g_bAlive[i] || g_bZombie[i]))
- {
- 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])
- {
- }
- else
- {
- if (cs_get_user_team(i) != CS_TEAM_CT)
- {
- g_bSwitching = true;
- cs_set_user_team(i, CS_TEAM_CT);
- g_bSwitching = false;
- }
- }
- i += 1;
- }
- 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 Infections !!");
- remove_task(600, 0);
- set_task(2.00, "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_user_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_user_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 Round !!");
- remove_task(600, 0);
- set_task(2.00, "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_user_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_user_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_user_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_user_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.00, "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 (cs_get_user_team(i))
- {
- case 1:
- {
- MakeZombie(0, i, false, false, true);
- set_user_health(i, 31000);
- }
- case 2:
- {
- MakeHuman(i, false, true);
- set_user_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.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
- ShowSyncHudMsg(0, g_iTopMessageSync, "Assassins vs Snipers Round !!");
- remove_task(600, 0);
- set_task(2.00, "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);
- }
- 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(221, 13, 64, -1.00, 0.17, 1, 0.00, 5.00, 1.00, 1.00, -1);
- ShowSyncHudMsg(0, g_iTopMessageSync, "%s is Sniper !!", g_cName[j]);
- remove_task(600, 0);
- set_task(2.00, "TaskAmbience", 600, "", 0, "", 0);
- g_bModeStarted = true;
- return 0;
- }
- StartSurvivorMode(0);
- return 0;
- }
- StartSurvivorMode(iPlayer)
- {
- if ((g_iLastMode != 4 && random_num(1, 35) == 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(221, 13, 64, -1.00, 0.17, 1, 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.00, "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] && cs_get_user_team(i) == CS_TEAM_T)
- {
- g_bSwitching = true;
- cs_set_user_team(i, 2);
- g_bSwitching = false;
- }
- i += 1;
- }
- set_lights ( "a" );
- client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
- set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 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.00, "TaskAmbience", 600, "", 0, "", 0);
- set_task(30.0, "TaskReminder", 0, "", 0, "b");
- 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] && cs_get_user_team(i) == CS_TEAM_T)
- {
- g_bSwitching = true;
- cs_set_user_team(i, CS_TEAM_CT);
- g_bSwitching = false;
- }
- i += 1;
- }
- client_cmd(0, "spk %s", g_cStartRoundNemesisSounds[random_num(0, 1)]);
- set_hudmessage(221, 13, 64, -1.00, 0.17, 1, 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.00, "TaskAmbience", 600, "", 0, "", 0);
- g_bModeStarted = true;
- 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] & 1)
- {
- iHealth = get_user_health(i);
- AddCommas(iHealth, cHealth, 14);
- client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^1 A^3 Rapture^1 Reminder^3 %s^4 Nemesis^1 still has^3 %s^4 health points!", g_Secret, 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] && cs_get_user_team(i) == CS_TEAM_T)
- {
- g_bSwitching = true;
- cs_set_user_team(i, CS_TEAM_CT);
- g_bSwitching = false;
- }
- i += 1;
- }
- set_hudmessage(255, 0, 0, -1.00, 0.17, 1, 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.00, "TaskAmbience", 600, "", 0, "", 0);
- g_bModeStarted = true;
- return 0;
- }
- public plugin_precache ( )
- {
- new Entity;
- Entity = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "hostage_entity" ) );
- if ( pev_valid ( Entity ) )
- {
- engfunc ( EngFunc_SetOrigin, Entity, Float: {8192.0,8192.0,8192.0} );
- dllfunc ( DLLFunc_Spawn, Entity );
- }
- Entity = engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "env_fog" ) );
- if ( pev_valid ( Entity ) )
- {
- fm_set_kvd ( Entity, "density", "0.00084655", "env_fog" );
- fm_set_kvd ( Entity, "rendercolor", "121 121 121", "env_fog" );
- }
- set_lights ( "d" );
- server_cmd ( "sv_skyname space");
- set_cvar_num("sv_skycolor_r", 0)
- set_cvar_num("sv_skycolor_g", 0)
- set_cvar_num("sv_skycolor_b", 0)
- g_vflags = ArrayCreate(64, 1)
- g_vname = ArrayCreate(64, 1)
- g_vpwd = ArrayCreate(64, 1)
- iFwSpawnHook = register_forward (FM_Spawn, "OnFakemetaSpawn", 0 )
- precache_model( "models/ZombieOutstanding/p_golden_ak47.mdl" );
- precache_model( "models/ZombieOutstanding/v_golden_ak47.mdl" );
- precache_model( "models/ZombieOutstanding/p_golden_deagle.mdl" );
- precache_model( "models/ZombieOutstanding/v_golden_deagle.mdl" );
- precache_model( "models/rpgrocket.mdl" );
- precache_model( "models/p_egon.mdl" );
- precache_model( "models/v_egon.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_nemesis_claws.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_assassin_claws.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_clasic_claws.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_raptor_claws.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_mutant_claws.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_tight_claws.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_hunter_claws.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_predator_blue_claws.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_v_grenade_infection.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_p_grenade_infection.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_v_awp_sniper.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_p_awp_sniper.mdl" );
- precache_model( "models/player/DanDiaconescu/DanDiaconescu.mdl" );
- precache_model( "models/player/z_out_nemesis/z_out_nemesis.mdl" );
- precache_model( "models/player/z_out_survivor/z_out_survivor.mdl" );
- precache_model( "models/player/z_out_assassin/z_out_assassin.mdl" );
- precache_model( "models/player/z_out_admin/z_out_admin.mdl" );
- precache_model( "models/player/z_out_clasic/z_out_clasic.mdl" );
- precache_model( "models/player/z_out_raptor/z_out_raptor.mdl" );
- precache_model( "models/player/z_out_mutant/z_out_mutant.mdl" );
- precache_model( "models/player/z_out_tight/z_out_tight.mdl" );
- precache_model( "models/player/z_out_regenerator/z_out_regenerator.mdl" );
- precache_model( "models/player/z_out_predator_blue/z_out_predator_blue.mdl" );
- precache_model( "models/player/z_out_hunter/z_out_hunter.mdl" );
- precache_model( "models/ZombieOutstanding/z_out_mine.mdl" );
- precache_sound( "ZombieOutstanding/armor_hit.wav" );
- precache_sound( "ZombieOutstanding/ambience_survivor.wav" );
- precache_sound( "ZombieOutstanding/ambience_normal.wav" );
- precache_sound( "ZombieOutstanding/monster_hit_01.wav" );
- precache_sound( "ZombieOutstanding/monster_hit_02.wav" );
- precache_sound( "ZombieOutstanding/monster_hit_03.wav" );
- precache_sound( "ZombieOutstanding/zombie_hit_01.wav" );
- precache_sound( "ZombieOutstanding/zombie_hit_02.wav" );
- precache_sound( "ZombieOutstanding/zombie_hit_03.wav" );
- precache_sound( "ZombieOutstanding/zombie_hit_04.wav" );
- precache_sound( "ZombieOutstanding/zombie_hit_05.wav" );
- precache_sound( "ZombieOutstanding/zombie_die_01.wav" );
- precache_sound( "ZombieOutstanding/zombie_die_02.wav" );
- precache_sound( "ZombieOutstanding/zombie_die_03.wav" );
- precache_sound( "ZombieOutstanding/zombie_die_04.wav" );
- precache_sound( "ZombieOutstanding/zombie_die_05.wav" );
- precache_sound( "ZombieOutstanding/zombie_infect_01.wav" );
- precache_sound( "ZombieOutstanding/zombie_infect_02.wav" );
- precache_sound( "ZombieOutstanding/zombie_infect_03.wav" );
- precache_sound( "ZombieOutstanding/zombie_infect_04.wav" );
- precache_sound( "ZombieOutstanding/zombie_infect_05.wav" );
- precache_sound( "ZombieOutstanding/end_round_win_zombies_01.wav" );
- precache_sound( "ZombieOutstanding/end_round_win_zombies_02.wav" );
- precache_sound( "ZombieOutstanding/end_round_win_zombies_03.wav" );
- precache_sound( "ZombieOutstanding/end_round_win_zombies_04.wav" );
- precache_sound( "ZombieOutstanding/end_round_win_humans_01.wav" );
- precache_sound( "ZombieOutstanding/end_round_win_humans_02.wav" );
- precache_sound( "ZombieOutstanding/end_round_win_humans_03.wav" );
- precache_sound( "ZombieOutstanding/end_round_win_no_one.wav" );
- precache_sound( "ZombieOutstanding/round_start_survivor_01.wav" );
- precache_sound( "ZombieOutstanding/round_start_survivor_02.wav" );
- precache_sound( "ZombieOutstanding/round_start_nemesis_01.wav" );
- precache_sound( "ZombieOutstanding/round_start_nemesis_02.wav" );
- precache_sound( "ZombieOutstanding/round_start_plague.wav" );
- precache_sound( "ZombieOutstanding/grenade_infection_explode.wav" );
- precache_sound( "ZombieOutstanding/grenade_fire_explode.wav" );
- precache_sound( "ZombieOutstanding/grenade_frost_explode.wav" );
- precache_sound( "ZombieOutstanding/grenade_frost_freeze.wav" );
- precache_sound( "ZombieOutstanding/grenade_frost_break.wav" );
- precache_sound( "ZombieOutstanding/jetpack_fly.wav" );
- precache_sound( "ZombieOutstanding/jetpack_blow.wav" );
- precache_sound( "ZombieOutstanding/rocket_fire.wav" );
- precache_sound( "ZombieOutstanding/gun_pickup.wav" );
- precache_sound( "ZombieOutstanding/zombie_burn_01.wav" );
- precache_sound( "ZombieOutstanding/zombie_burn_02.wav" );
- precache_sound( "ZombieOutstanding/zombie_burn_03.wav" );
- precache_sound( "ZombieOutstanding/zombie_burn_04.wav" );
- precache_sound( "ZombieOutstanding/zombie_burn_05.wav" );
- precache_sound( "ZombieOutstanding/human_nade_infect_scream_01.wav" );
- precache_sound( "ZombieOutstanding/human_nade_infect_scream_02.wav" );
- precache_sound( "ZombieOutstanding/human_nade_infect_scream_03.wav" );
- precache_sound( "ZombieOutstanding/zombie_madness.wav" );
- precache_sound( "ZombieOutstanding/antidote.wav" );
- precache_sound( "ZombieOutstanding/mine_activate.wav" );
- precache_sound( "ZombieOutstanding/mine_deploy.wav" );
- precache_sound( "ZombieOutstanding/mine_charge.wav" );
- precache_sound( "ZombieOutstanding/armor_equip.wav" );
- precache_sound( "fvox/flatline.wav" );
- SpriteTexture = precache_model("sprites/lgtning.spr");
- g_iLaser = precache_model("sprites/laserbeam.spr");
- ExploSpr = engfunc(EngFunc_PrecacheModel, "sprites/shockwave.spr");
- FlameSpr = engfunc(EngFunc_PrecacheModel, "sprites/ZombieOutstanding/z_out_flame.spr");
- SmokeSpr = engfunc(EngFunc_PrecacheModel, "sprites/black_smoke3.spr");
- GlassSpr = engfunc(EngFunc_PrecacheModel, "models/glassgibs.mdl");
- HExplode = engfunc(EngFunc_PrecacheModel, "sprites/zerogxplode.spr");
- TrailSpr = engfunc(EngFunc_PrecacheModel, "sprites/laserbeam.spr");
- engfunc(EngFunc_PrecacheModel, MINE_MODEL_VIEW);
- engfunc(EngFunc_PrecacheSound, MINE_SOUND_ACTIVATE);
- engfunc(EngFunc_PrecacheSound, MINE_SOUND_CHARGE);
- engfunc(EngFunc_PrecacheSound, MINE_SOUND_DEPLOY);
- g_hExplode = engfunc(EngFunc_PrecacheModel, MINE_MODEL_EXPLODE);
- }
- #define SQL_Server "93.119.27.56"
- #define SQL_Person "gpkr_4502"
- #define SQL_Password "ampulamarede28cm"
- #define SQL_Database "gpkr_4502"
- computeTimeLength(Time, timeUnit:unitType, Output[], outputSize)
- {
- static Weeks = 0, Days = 0, Hours = 0, Minutes = 0, Seconds = 0, \
- maxElementId = 0, timeElement[5][64], Length = 0;
- if (Time > 0)
- {
- maxElementId = 0;
- switch (unitType)
- {
- case timeUnit_Seconds: Seconds = Time;
- case timeUnit_Minutes: Seconds = Time * Seconds_In_Minute;
- case timeUnit_Hours: Seconds = Time * Seconds_In_Hour;
- case timeUnit_Days: Seconds = Time * Seconds_In_Day;
- case timeUnit_Weeks: Seconds = Time * Seconds_In_Week;
- }
- Weeks = Seconds / Seconds_In_Week;
- Seconds -= (Weeks * Seconds_In_Week);
- Days = Seconds / Seconds_In_Day;
- Seconds -= (Days * Seconds_In_Day);
- Hours = Seconds / Seconds_In_Hour;
- Seconds -= (Hours * Seconds_In_Hour);
- Minutes = Seconds / Seconds_In_Minute;
- Seconds -= (Minutes * Seconds_In_Minute);
- if (Weeks > 0)
- formatex(timeElement[maxElementId++], charsmax(timeElement[]), "%d w", Weeks);
- if (Days > 0)
- formatex(timeElement[maxElementId++], charsmax(timeElement[]), "%d d", Days);
- if (Hours > 0)
- formatex(timeElement[maxElementId++], charsmax(timeElement[]), "%d h", Hours);
- if (Minutes > 0)
- formatex(timeElement[maxElementId++], charsmax(timeElement[]), "%d m", Minutes);
- if (Seconds > 0)
- formatex(timeElement[maxElementId++], charsmax(timeElement[]), "%d s", Seconds);
- switch (maxElementId)
- {
- case 1: Length = formatex(Output, outputSize, "%s", timeElement[0]);
- case 2: Length = formatex(Output, outputSize, "%s %s", timeElement[0], timeElement[1]);
- case 3: Length = formatex(Output, outputSize, "%s %s %s", timeElement[0], timeElement[1], \
- timeElement[2]);
- case 4: Length = formatex(Output, outputSize, "%s %s %s %s", timeElement[0], timeElement[1], \
- timeElement[2], timeElement[3]);
- case 5: Length = formatex(Output, outputSize, "%s %s %s %s %s", timeElement[0], timeElement[1], \
- timeElement[2], timeElement[3], timeElement[4]);
- }
- return Length;
- }
- Length = formatex(Output, outputSize, "0 m");
- return Length;
- }
- bool:isValidPlayer(Player)
- {
- return bool:(Player >= 1 && Player <= g_iMaxClients);
- }
- resetPlayer(Player)
- {
- static timeNow = 0;
- if (isValidPlayer(Player) && !is_user_bot(Player) && !is_user_hltv(Player))
- {
- timeNow = get_systime();
- g_Score[Player] = Score_Start;
- g_Kills[Player] = 0;
- g_Deaths[Player] = 0;
- g_headShots[Player] = 0;
- g_Time[Player] = 0;
- computeTimeLength(g_Time[Player], timeUnit_Minutes, g_timeString[Player], charsmax(g_timeString[]));
- g_Seen[Player] = timeNow;
- format_time(g_seenString[Player], charsmax(g_seenString[]), Date_Format);
- g_kpdRatio[Player] = 0.0;
- g_kmdValue[Player] = 0;
- }
- }
- Float:computeKpdRatio(Player)
- {
- if (isValidPlayer(Player) && is_user_connected(Player) && is_user_bot(Player) == 0 && is_user_hltv(Player) == 0)
- {
- if (g_Deaths[Player] == 0)
- {
- return float(g_Kills[Player]);
- }
- else
- {
- return float(g_Kills[Player] / g_Deaths[Player]);
- }
- }
- return 0.0;
- }
- computeKmdValue(Player)
- {
- if (isValidPlayer(Player) && is_user_connected(Player) && is_user_bot(Player) == 0 && is_user_hltv(Player) == 0)
- {
- return g_Kills[Player] - g_Deaths[Player];
- }
- return 0;
- }
- updateRank(Client)
- {
- if (isValidPlayer(Client) && is_user_connected(Client) && is_user_bot(Client) == 0 && is_user_hltv(Client) == 0)
- {
- formatex(g_Query, charsmax(g_Query), "UPDATE Players SET Ip = '%s', Score = %d, Kills = %d, Deaths = %d, \
- headShots = %d, Seen = %d, seenString = '%s', kpdRatio = %f, kmdValue = %d WHERE Name = '%s';", \
- g_Ip[Client], g_Score[Client], g_Kills[Client], g_Deaths[Client], g_headShots[Client], \
- g_Seen[Client], g_seenString[Client], g_kpdRatio[Client], g_kmdValue[Client], g_Name[Client]);
- SQL_ThreadQuery(g_Tuple, "emptyFunction", g_Query);
- }
- }
- public NewStats_GetTop15(pluginId, parametersCount)
- {
- static Name[15][64], Total, Error[256], errorId, Handle:Connection, Handle:Query, Iterator;
- Connection = SQL_Connect(g_Tuple, errorId, Error, charsmax(Error));
- if (errorId)
- {
- log_to_file(Errors_File, "NewStats_GetTop15() failed because SQL has encountered an error.");
- log_to_file(Errors_File, "The error is listed below.");
- log_to_file(Errors_File, "[%d] %s", errorId, Error);
- return 0;
- }
- Query = SQL_PrepareQuery(Connection, "SELECT Name FROM Players ORDER BY kmdValue DESC LIMIT 15;");
- SQL_Execute(Query);
- if (SQL_NumResults(Query) == 0)
- {
- SQL_FreeHandle(Query);
- SQL_FreeHandle(Connection);
- return 0;
- }
- Total = 0;
- while (SQL_MoreResults(Query))
- {
- SQL_ReadResult(Query, 0, Name[Total++], charsmax(Name[]));
- SQL_NextRow(Query);
- }
- SQL_FreeHandle(Query);
- SQL_FreeHandle(Connection);
- for (Iterator = 0; Iterator < Total; Iterator++)
- set_string(Iterator + 1, Name[Iterator], charsmax(Name[]));
- return Total;
- }
- public NewStats_GetStats(pluginId, parametersCount)
- {
- static Name[64], Error[256], errorId, Handle:Connection, Handle:Query, Kills[16], Deaths[16], \
- headShots[16], Score[16], Ip[64], Steam[64], Time[16], timeString[64], Seen[16], \
- seenString[64], kpdRatio[16], kmdValue[16], Kills_i, Deaths_i, headShots_i, Score_i, \
- Time_i, Seen_i, Float:kpdRatio_f, kmdValue_i, Rank[16], Rank_i, totalPositions[16];
- get_string(1, Name, charsmax(Name));
- replace_all(Name, charsmax(Name), "`", "*");
- replace_all(Name, charsmax(Name), "'", "*");
- replace_all(Name, charsmax(Name), "\", "*");
- Connection = SQL_Connect(g_Tuple, errorId, Error, charsmax(Error));
- if (errorId)
- {
- log_to_file(Errors_File, "NewStats_GetStats() failed because SQL has encountered an error.");
- log_to_file(Errors_File, "The error is listed below.");
- log_to_file(Errors_File, "[%d] %s", errorId, Error);
- return 0;
- }
- formatex(g_Query, charsmax(g_Query), "SELECT Steam, Ip, Score, Kills, Deaths, headShots, Time, timeString, Seen, seenString, kpdRatio, kmdValue FROM Players WHERE Name = '%s';", Name);
- Query = SQL_PrepareQuery(Connection, g_Query);
- SQL_Execute(Query);
- if (SQL_NumResults(Query) == 0)
- {
- SQL_FreeHandle(Query);
- SQL_FreeHandle(Connection);
- return 0;
- }
- SQL_ReadResult(Query, 0, Steam, charsmax(Steam));
- SQL_ReadResult(Query, 1, Ip, charsmax(Ip));
- Score_i = SQL_ReadResult(Query, 2);
- num_to_str(Score_i, Score, charsmax(Score));
- Kills_i = SQL_ReadResult(Query, 3);
- num_to_str(Kills_i, Kills, charsmax(Kills));
- Deaths_i = SQL_ReadResult(Query, 4);
- num_to_str(Deaths_i, Deaths, charsmax(Deaths));
- headShots_i = SQL_ReadResult(Query, 5);
- num_to_str(headShots_i, headShots, charsmax(headShots));
- Time_i = SQL_ReadResult(Query, 6);
- num_to_str(Time_i, Time, charsmax(Time));
- SQL_ReadResult(Query, 7, timeString, charsmax(timeString));
- Seen_i = SQL_ReadResult(Query, 8);
- num_to_str(Seen_i, Seen, charsmax(Seen));
- SQL_ReadResult(Query, 9, seenString, charsmax(seenString));
- SQL_ReadResult(Query, 10, kpdRatio_f);
- float_to_str(kpdRatio_f, kpdRatio, charsmax(kpdRatio));
- kmdValue_i = SQL_ReadResult(Query, 11);
- num_to_str(kmdValue_i, kmdValue, charsmax(kmdValue));
- SQL_FreeHandle(Query);
- set_string(2, Steam, charsmax(Steam));
- set_string(3, Ip, charsmax(Ip));
- set_string(4, Score, charsmax(Score));
- set_string(5, Kills, charsmax(Kills));
- set_string(6, Deaths, charsmax(Deaths));
- set_string(7, headShots, charsmax(headShots));
- set_string(8, Time, charsmax(Time));
- set_string(9, timeString, charsmax(timeString));
- set_string(10, Seen, charsmax(Seen));
- set_string(11, seenString, charsmax(seenString));
- set_string(12, kpdRatio, charsmax(kpdRatio));
- set_string(13, kmdValue, charsmax(kmdValue));
- formatex(g_Query, charsmax(g_Query), "SELECT DISTINCT kmdValue FROM Players WHERE kmdValue >= %d ORDER BY kmdValue ASC;", kmdValue_i);
- Query = SQL_PrepareQuery(Connection, g_Query);
- SQL_Execute(Query);
- Rank_i = SQL_NumResults(Query);
- num_to_str(Rank_i, Rank, charsmax(Rank));
- SQL_FreeHandle(Query);
- SQL_FreeHandle(Connection);
- set_string(14, Rank, charsmax(Rank));
- num_to_str(g_recordsCount, totalPositions, charsmax(totalPositions));
- set_string(15, totalPositions, charsmax(totalPositions));
- return 1;
- }
- public recordsCount(failState, Handle:Query, Error[], errorId, Data[], dataSize, Float:queueTime)
- {
- if (failState != 0 || errorId != 0)
- {
- log_to_file(Errors_File, "SQL_ThreadQuery() failed @ recordsCount()");
- log_to_file(Errors_File, "[%d] %s", errorId, Error);
- }
- else if (queueTime > 15.0)
- {
- log_to_file(Errors_File, "SQL_ThreadQuery() @ recordsCount() : This query took 15.0 seconds. \
- Talk to the game host company tell them the MySQL database works too slow.");
- }
- g_recordsCount = SQL_NumResults(Query);
- }
- public emptyFunction(failState, Handle:Query, Error[], errorId, Data[], dataSize, Float:queueTime)
- {
- if (failState != 0 || errorId != 0)
- {
- log_to_file(Errors_File, "SQL_ThreadQuery() failed @ emptyFunction()");
- log_to_file(Errors_File, "[%d] %s", errorId, Error);
- }
- else if (queueTime > 15.0)
- {
- log_to_file(Errors_File, "SQL_ThreadQuery() @ emptyFunction() : This query took 15.0 seconds. \
- Talk to the game host company tell them the MySQL database works too slow.");
- }
- }
- public retrieveOrCreatePlayer(failState, Handle:Query, Error[], errorId, Data[], dataSize, Float:queueTime)
- {
- static Client = 0;
- if (failState != 0 || errorId != 0)
- {
- log_to_file(Errors_File, "SQL_ThreadQuery() failed @ retrieveOrCreatePlayer()");
- log_to_file(Errors_File, "[%d] %s", errorId, Error);
- }
- else if (queueTime > 15.0)
- {
- log_to_file(Errors_File, "SQL_ThreadQuery() @ retrieveOrCreatePlayer() : This query took 15.0 seconds. \
- Talk to the game host company tell them the MySQL database works too slow.");
- }
- Client = str_to_num(Data);
- if (is_user_connected(Client) == 1 && is_user_bot(Client) == 0 && is_user_hltv(Client) == 0)
- {
- resetPlayer(Client);
- switch (SQL_NumResults(Query))
- {
- case 0:
- {
- formatex(g_Query, charsmax(g_Query), "INSERT INTO Players VALUES ('%s', \
- '%s', '%s', %d, %d, %d, %d, %d, '%s', %d, '%s', %f, %d);", g_Name[Client], \
- g_Steam[Client], g_Ip[Client], g_Score[Client], g_Kills[Client], \
- g_Deaths[Client], g_headShots[Client], g_Time[Client], g_timeString[Client], g_Seen[Client], \
- g_seenString[Client], g_kpdRatio[Client], g_kmdValue[Client]);
- SQL_ThreadQuery(g_Tuple, "emptyFunction", g_Query);
- g_recordsCount++;
- }
- default:
- {
- g_Score[Client] = SQL_ReadResult(Query, 0);
- g_Kills[Client] = SQL_ReadResult(Query, 1);
- g_Deaths[Client] = SQL_ReadResult(Query, 2);
- g_headShots[Client] = SQL_ReadResult(Query, 3);
- g_Time[Client] = SQL_ReadResult(Query, 4);
- SQL_ReadResult(Query, 5, g_timeString[Client], charsmax(g_timeString[]));
- g_Seen[Client] = SQL_ReadResult(Query, 6);
- SQL_ReadResult(Query, 7, g_seenString[Client], charsmax(g_seenString[]));
- SQL_ReadResult(Query, 8, g_kpdRatio[Client]);
- g_kmdValue[Client] = SQL_ReadResult(Query, 9);
- }
- }
- set_task(5.0, "rankPrepared", Client);
- set_task(120.0, "timeUpdate", Client + Task_Update_Time, .flags = "b");
- }
- }
- public timeUpdate(Id)
- {
- if (is_user_connected(Task_Id_Update_Time) && !is_user_bot(Task_Id_Update_Time) && !is_user_hltv(Task_Id_Update_Time))
- {
- g_Time[Task_Id_Update_Time] += 2;
- computeTimeLength(g_Time[Task_Id_Update_Time], \
- timeUnit_Minutes, g_timeString[Task_Id_Update_Time], charsmax(g_timeString[]));
- formatex(g_Query, charsmax(g_Query), \
- "UPDATE Players SET Time = %d, timeString = '%s' WHERE Name = '%s';", \
- g_Time[Task_Id_Update_Time], g_timeString[Task_Id_Update_Time], g_Name[Task_Id_Update_Time]);
- SQL_ThreadQuery(g_Tuple, "emptyFunction", g_Query);
- }
- }
- public rankPrepared(Client)
- {
- static queryData[32] = { 0, ... };
- if (is_user_connected(Client) == 1 && is_user_bot(Client) == 0 && is_user_hltv(Client) == 0)
- {
- set_dhudmessage(0, 255, 0, 0.03, 0.70, 2, 6.0, 3.0);
- show_dhudmessage(Client, "You are now ranked!");
- num_to_str(Client, queryData, charsmax(queryData));
- formatex(g_Query, charsmax(g_Query), "SELECT DISTINCT kmdValue \
- FROM Players WHERE kmdValue >= %d ORDER BY kmdValue ASC;", g_kmdValue[Client]);
- SQL_ThreadQuery(g_Tuple, "showRank", g_Query, queryData, sizeof(queryData));
- g_bRanked[Client] = true;
- }
- }
- public showRank(failState, Handle:Query, Error[], errorId, Data[], dataSize, Float:queueTime)
- {
- static Client = 0, Rank = 0, rankString[16], recordsString[16], scoreString[16], killsString[16], deathsString[16], headShotsString[16];
- if (failState != 0 || errorId != 0)
- {
- log_to_file(Errors_File, "SQL_ThreadQuery() failed @ showRank()");
- log_to_file(Errors_File, "[%d] %s", errorId, Error);
- }
- else if (queueTime > 15.0)
- {
- log_to_file(Errors_File, "SQL_ThreadQuery() @ showRank() : This query took 15.0 seconds. \
- Talk to the game host company tell them the MySQL database works too slow.");
- }
- Client = str_to_num(Data);
- if (is_user_connected(Client) == 1 && is_user_bot(Client) == 0 && is_user_hltv(Client) == 0)
- {
- Rank = SQL_NumResults(Query);
- AddCommas(Rank, rankString, charsmax(rankString));
- AddCommas(g_recordsCount, recordsString, charsmax(recordsString));
- AddCommas(g_Kills[Client], killsString, charsmax(killsString));
- AddCommas(g_Deaths[Client], deathsString, charsmax(deathsString));
- AddCommas(g_Score[Client], scoreString, charsmax(scoreString));
- AddCommas(g_headShots[Client], headShotsString, charsmax(headShotsString));
- new HostName [64]; get_cvar_string ( "hostname", HostName, charsmax ( HostName ) );
- set_dhudmessage(0, 255, 0, 0.05, 0.22, 2, 0.02, 1.0, 0.05, 6.0);
- show_dhudmessage(Client, "Welcome, %s^nRank: %s of %s Score: %d^nKills: %s Deaths: %s KPD: %0.2f^nOnline: %s^nWe hope you enjoy!",
- g_Name[Client], rankString, recordsString, g_Score[Client] = Score_Start, \
- killsString, deathsString, g_kpdRatio[Client], g_timeString[Client]);
- set_dhudmessage(157, 103, 200, 0.03, 0.5, 2, 2.0, 3.0)
- show_dhudmessage(Client, "%s^nDon't forget to add us to your favourites!",HostName);
- }
- }
- public printRankChat(failState, Handle:Query, Error[], errorId, Data[], dataSize, Float:queueTime)
- {
- static cScore[15];
- static cDeaths[15];
- static cKills[15];
- static cTotal[15];
- static cRank[15];
- static Rank;
- static iPlayer;
- iPlayer = str_to_num(Data);
- Rank = SQL_NumResults(Query);
- AddCommas(Rank, cRank, 15);
- AddCommas(g_recordsCount, cTotal, 15);
- AddCommas(g_Deaths[iPlayer], cDeaths, 15);
- AddCommas(g_Kills[iPlayer], cKills, 15);
- AddCommas(g_Score[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);
- if (failState != 0 || errorId != 0)
- {
- log_to_file(Errors_File, "SQL_ThreadQuery() failed @ printRankChat()");
- log_to_file(Errors_File, "[%d] %s", errorId, Error);
- }
- else if (queueTime > 15.0)
- {
- log_to_file(Errors_File, "SQL_ThreadQuery() @ printRankChat() : This query took 15.0 seconds. \
- Talk to the game host company tell them the MySQL database works too slow.");
- }
- formatex(g_cQuery, 255, "Kills: %s Deaths: %s KPD: %0.2f", cKills, cDeaths, g_kpdRatio[iPlayer]);
- menu_additem(g_iMenu, g_cQuery, "2", 0, -1);
- formatex(g_cQuery, 255, "Online: %s", g_timeString[iPlayer]);
- menu_additem(g_iMenu, g_cQuery, "3", 0, -1);
- menu_setprop(g_iMenu, 6, -1);
- menu_display(iPlayer, g_iMenu, 0);
- 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, g_kpdRatio[iPlayer]);
- return 0;
- }
- public EmptyPanel(iPlayer, iMenu, iItem)
- {
- return 0;
- }
- public plugin_init()
- {
- register_plugin("Zombie Plague", "v2.0", "SideWinder");
- new i = 0;
- new cNumber[3];
- new cLine[128];
- g_iSize = sizeof( g_flCoords );
- RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1);
- RegisterHam(Ham_TakeDamage, "player", "OnTakeDamage", 0);
- RegisterHam(Ham_TakeDamage, "player", "OnTakeDamagePost", 1);
- RegisterHam(Ham_Killed, "player", "OnKilled", 0);
- RegisterHam(Ham_TraceAttack, "player", "OnTraceAttack", 0);
- RegisterHam(Ham_Touch, "weaponbox", "OnTouch");
- RegisterHam(Ham_Touch, "armoury_entity", "OnTouch");
- RegisterHam(Ham_Touch, "weapon_shield", "OnTouch")
- RegisterHam(Ham_Think, "grenade", "OnGrenadeThink", 0);
- RegisterHam(Ham_Player_Jump, "player", "OnPlayerJump", 0);
- RegisterHam(Ham_TraceAttack, "player", "Golden_Ak_Tracer", 1 );
- RegisterHam(Ham_TraceAttack, "player", "Golden_Deagle_Tracer", 1 );
- register_forward(FM_SetModel, "fwSetModel");
- register_forward(FM_PlayerPreThink, "OnPlayerDuck");
- register_forward(FM_EmitSound, "fwEmitSound");
- register_forward(FM_UpdateClientData,"Data");
- register_forward(FM_PlayerPreThink, "PlayerPreThink" );
- register_think(MINE_CLASSNAME, "Forward_Think");
- unregister_forward(FM_Spawn, iFwSpawnHook)
- register_logevent("EventRoundEnd", 2, "1=Round_End");
- register_logevent("EventRoundStart", 2, "1=Round_Start");
- register_logevent("Event_RoundStart", 2, "1=Round_Start");
- register_event("HLTV", "EventHLTV", "a", "1=0", "2=0");
- register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
- register_event("StatusValue", "EventStatusValue", "be", "1=2", "2!0");
- register_event("StatusValue", "EventStatusValueHide", "be", "1=1", "2=0");
- register_event("CurWeapon", "EventCurWeapon", "be", "1=1");
- register_event("CurWeapon", "UpdateWeapon", "be", "1=1", "3=13", "3=15", "3=20", "3=25", "3=30", "3=35", "3=12", "3=10", "3=100", "3=8", "3=7", "3=50");
- register_event("DeathMsg","Fix","a");
- register_event("TeamInfo","Fix","a");
- register_event("DeathMsg", "OnDeathMsg", "a");
- register_message(get_user_msgid("Scenario"), "MessageScenario");
- register_message(get_user_msgid("HostagePos"), "MessageHostagepos");
- register_message(get_user_msgid("Health"), "MessageHealth");
- register_message(get_user_msgid("TeamInfo"), "MessageTeamInfo");
- register_message(get_user_msgid("Money"), "MessageMoney");
- register_message(get_user_msgid("CurWeapon"), "message_cur_weapon");
- 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_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++;
- }
- set_task(5.00, "TaskLight", 0, "", 0, "b", 0);
- g_aNameData = ArrayCreate(32, 1);
- g_aAmmoData = ArrayCreate(1, 1);
- g_iAntidoteSync = CreateHudSyncObj(0);
- g_iTopMessageSync = CreateHudSyncObj(0);
- g_iCounterMessage = CreateHudSyncObj(0);
- g_iCenterMessageSync = CreateHudSyncObj(0);
- g_iDownMessageSync = CreateHudSyncObj(0);
- g_iVersusSync = CreateHudSyncObj(0);
- g_iShopEventHudmessage = CreateHudSyncObj(0);
- g_iEventsHudmessage = CreateHudSyncObj(0);
- g_iMineMessage = CreateHudSyncObj(0);
- g_iSecondMineMessage = CreateHudSyncObj(0);
- g_iRemainingSync = CreateHudSyncObj(0);
- g_iTimeLimit = get_cvar_pointer("mp_timelimit");
- g_iMaxClients = get_maxplayers();
- register_concmd("amx_human", "CmdHuman", -1, "", -1);
- register_concmd("amx_zombie", "CmdZombie", -1, "", -1);
- register_concmd("amx_nemesis", "CmdNemesis", -1, "", -1);
- register_concmd("amx_swarm", "CmdSwarm", -1, "", -1);
- register_concmd("amx_plague", "CmdPlague", -1, "", -1);
- register_concmd("amx_armageddon", "CmdArmageddon", -1, "", -1);
- register_concmd("amx_nightmare", "CmdNightMare", -1, "", -1);
- register_concmd("amx_multiple", "CmdMulti", -1, "", -1);
- register_concmd("amx_sniper", "CmdSniper", -1, "", -1);
- register_concmd("amx_survivor", "CmdSurvivor", -1, "", -1);
- register_concmd("amx_assassins_vs_snipers", "CmdAvS", -1, "", -1);
- register_concmd("amx_assassin", "CmdAssaSsin", -1, "", -1);
- register_concmd("amx_respawn", "CmdRespawn", -1, "", -1);
- register_concmd("amx_points", "CmdPoints", -1, "", -1);
- register_concmd("amx_chat", "CmdChat", -1, "", -1);
- register_concmd("amx_say", "CmdSayChat", -1, "", -1);
- register_clcmd("drop", "CmdDrop", -1, "", -1);
- register_clcmd("cl_setautobuy", "CmdBlock", -1, "", -1);
- register_clcmd("cl_setrebuy", "CmdBlock", -1, "", -1);
- register_clcmd("amx_password_for_slot", "CommandGetSlot", -1, "", -1);
- register_clcmd("amx_password_for_model", "CommandGetModel", -1, "", -1);
- register_clcmd("plant_mine", "CmdPlantMine", -1, "", -1);
- register_clcmd("take_mine", "CmdTakeMine", -1, "", -1);
- register_clcmd("nightvision", "CmdNightVision", -1, "", -1);
- register_clcmd("jointeam", "CmdJoinTeam", -1, "", -1);
- register_clcmd("chooseteam", "CmdJoinTeam", -1, "", -1);
- register_clcmd("say", "Client_Say", -1, "", -1);
- set_task(2.0, "Calcu", 232222, _, _, "b");
- set_task(0.01, "TaskAxaxa", 0, "", 0, "", 0);
- set_task(10.0, "Rays", .flags="b");
- new cfgs[128];
- get_configsdir(cfgs, 127)
- add(cfgs, 127, "/vips.ini")
- new file = fopen(cfgs, "r")
- if (file)
- {
- new line[512], name[64], pwd[64], flags[64]
- while (!feof(file))
- {
- fgets(file, line ,511)
- trim(line)
- if (!line[0] || line[0] == '/' || line[0] == ';' || line[0] == '#')
- continue;
- new r=parse(line, name,63,pwd,63,flags,63)
- if (r < 3) continue;
- ArrayPushString(g_vname, name)
- ArrayPushString(g_vpwd, pwd)
- ArrayPushString(g_vflags, flags)
- }
- fclose(file)
- }
- g_Tuple = SQL_MakeDbTuple(SQL_Server, SQL_Person, SQL_Password, SQL_Database);
- if (g_Tuple == Empty_Handle)
- {
- g_Tuple = SQL_MakeDbTuple(SQL_Server, SQL_Person, SQL_Password, SQL_Database);
- if (g_Tuple == Empty_Handle)
- {
- log_to_file(Errors_File, "SQL_MakeDbTuple() failed @ plugin_init()");
- return set_fail_state("SQL_MakeDbTuple() failed @ plugin_init()");
- }
- }
- SQL_ThreadQuery(g_Tuple, "emptyFunction", "CREATE TABLE IF NOT EXISTS Players \
- (Name TEXT, Steam TEXT, Ip TEXT, Score NUMERIC, Kills NUMERIC, Deaths NUMERIC, \
- headShots NUMERIC, Time NUMERIC, timeString TEXT, Seen NUMERIC, seenString TEXT, kpdRatio FLOAT, \
- kmdValue NUMERIC);");
- SQL_ThreadQuery(g_Tuple, "recordsCount", "SELECT Kills FROM Players");
- return 0;
- }
- public plugin_natives()
- {
- register_library("NewStats");
- register_native("NewStats_GetStats", "NewStats_GetStats");
- register_native("NewStats_GetTop15", "NewStats_GetTop15");
- }
- public CmdBlock()
- {
- return 1;
- }
- public ChangeModel(iTask)
- {
- static bool:bChange;
- static cModel[24];
- static i;
- static iPlayer;
- iPlayer = iTask + -250;
- bChange = true;
- get_user_model(iPlayer, cModel, 24);
- static iFlags;
- iFlags = get_user_flags(iPlayer, 0);
- if (!g_bZombie[iPlayer])
- {
- if (!g_iPlayerType[iPlayer])
- {
- if (iFlags & read_flags ("b"))
- {
- if (equal(cModel, "z_out_admin", 0))
- {
- bChange = false;
- }
- }
- if (g_vip[iPlayer])
- {
- if (equal(cModel, "DanDiaconescu", 0))
- {
- bChange = false;
- }
- }
- else
- {
- for (i = 0; i < 4; i++)
- {
- if (equal(cModel, g_cHumanModels[i], 0))
- {
- bChange = false;
- }
- }
- }
- }
- }
- else if (bChange)
- {
- if (!g_bZombie[iPlayer])
- {
- switch (g_iPlayerType[iPlayer])
- {
- case 0:
- {
- if (iFlags & read_flags ("b"))
- {
- set_user_model(iPlayer, "z_out_admin");
- }
- if (g_vip[iPlayer])
- {
- set_user_model(iPlayer, "DanDiaconescu");
- }
- else
- {
- set_user_model(iPlayer, g_cHumanModels[random_num(0, 3)]);
- }
- }
- case 4:
- {
- set_user_model(iPlayer, "z_out_survivor");
- }
- case 8:
- {
- if (!equal(cModel, "arctic", 0))
- {
- set_user_model(iPlayer, "arctic");
- }
- }
- default:
- {
- }
- }
- }
- switch (g_iPlayerType[iPlayer])
- {
- case 0:
- {
- set_user_model(iPlayer, g_cZombieModels[g_iZombieClass[iPlayer]]);
- }
- case 1:
- {
- set_user_model(iPlayer, "z_out_nemesis");
- }
- case 2:
- {
- set_user_model(iPlayer, "z_out_assassin");
- }
- default:
- {
- }
- }
- }
- 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 ShowMenuClasses(iPlayer)
- {
- if (!g_bFake[iPlayer])
- {
- menu_display(iPlayer, g_iMenuZombieClasses, 0);
- }
- return 0;
- }
- Float:GetTimeLeft()
- {
- return floatsub(floatmul(60.0, get_cvar_float("mp_timelimit")), get_gametime());
- }
- public Client_Say(iPlayer)
- {
- static cMessage[150];
- static name[32];
- static motd[2048];
- static len = 0;
- static queryData[32] = { 0, ... }
- static Float:fGameTime;
- fGameTime = get_gametime();
- read_args(cMessage, 149);
- remove_quotes(cMessage);
- 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.00)
- {
- 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.00 - fGameTime);
- }
- g_fLastRankQuery = fGameTime;
- num_to_str(iPlayer, queryData, charsmax(queryData));
- formatex(g_Query, charsmax(g_Query), "SELECT DISTINCT kmdValue FROM Players WHERE kmdValue >= %d ORDER BY kmdValue ASC;", g_kmdValue[iPlayer]);
- SQL_ThreadQuery(g_Tuple, "printRankChat", g_Query, queryData, sizeof(queryData));
- }
- }
- else
- {
- if (equali(cMessage, "/gold", 5) || equali(cMessage, "/vip", 4) || equali(cMessage, "vip", 3) || equali(cMessage, "gold", 4))
- {
- new Text[1501];
- add(Text, 1500, "<body bgcolor=#000000><font color=AAE500><pre>Contact Skype : robythedude<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", 3))
- {
- }
- if (equali(cMessage, "/bans", 0) || equali(cMessage, "bans", 0))
- {
- len = formatex(motd, charsmax(motd), "<body bgcolor=#000000><center><font color=red size=4><b>* BANS *</b></font><br />");
- new file=fopen("cstrike/banned.cfg","r");
- if (file)
- {
- while (!feof(file))
- {
- fgets(file,name,31)
- trim(name);
- if (strlen(name)<1||name[0]=='/'||name[0]=='#'||name[0]==';')
- continue
- len += formatex(motd[len], charsmax(motd) - len, "<font color=gray size=3><b>%s</b></font><br />", name);
- }
- fclose(file);
- }
- len += formatex(motd[len], charsmax(motd) - len, "</center></body>");
- show_motd(iPlayer, motd, "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))
- {
- len = formatex(motd, charsmax(motd), "<body bgcolor=#000000><center><font color=red size=4><b>* MAPS *</b></font><br />");
- new file=fopen("addons/amxmodx/configs/maps.ini","r");
- if (file)
- {
- while (!feof(file))
- {
- fgets(file,name,31)
- trim(name);
- if (strlen(name)<1||name[0]=='/'||name[0]=='#'||name[0]==';')
- continue
- len += formatex(motd[len], charsmax(motd) - len, "<font color=gray size=3><b>%s</b></font><br />", name);
- }
- fclose(file);
- }
- len += formatex(motd[len], charsmax(motd) - len, "</center></body>");
- show_motd(iPlayer, motd, "Server's Maps");
- }
- if (equali(cMessage, "/rs", 3) || equali(cMessage, "Rs", 2) || equali(cMessage, "Reset", 5) || equali(cMessage, "Reset", 5))
- {
- get_user_name(iPlayer, name, charsmax(name));
- set_user_frags(iPlayer, 0);
- cs_set_user_deaths(iPlayer, 0);
- set_user_frags(iPlayer, 0);
- cs_set_user_deaths(iPlayer, 0);
- client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 has reset their score!", name);
- }
- if (equali(cMessage, "/timeleft", 0) || equali(cMessage, "timeleft", 0))
- {
- static iTimeleft;
- iTimeleft = floatround(GetTimeLeft(), floatround_round);
- 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_default, "^1Next map:^4 %s", cMap);
- }
- else
- {
- client_print_color(iPlayer, print_team_default, "^1Next map:^4 [not yet voted on]");
- }
- }
- if (equali(cMessage, "/thetime", 0) || equali(cMessage, "thetime", 0))
- {
- static cTime[64];
- get_time("%d/%m/%Y - %H:%M:%S", cTime, 63);
- client_print_color(0, print_team_grey, "^1The Time:^1 %s", cTime);
- }
- if (equali(cMessage, "/currentmap", 0) || equali(cMessage, "currentmap", 0))
- {
- static cMap[32];
- get_mapname(cMap, 32);
- client_print_color(0, print_team_grey, "Current map:^4 %s", cMap);
- }
- 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 = cmd_target(iPlayer, cTarget,(CMDTARGET_ALLOW_SELF));
- iAmmo = str_to_num(cAmmo);
- if (!iTarget)
- {
- client_print_color(iPlayer, print_team_grey, "^4[ZP]^1 Invalid player or matching multiple targets!");
- }
- if (0 >= iAmmo)
- {
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 Invalid value of packs to send!");
- }
- if (g_iPacks[iPlayer] < iAmmo)
- {
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are trying to send too many packs!");
- }
- if (iTarget == iPlayer)
- {
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are trying to send packs to you!");
- }
- AddCommas(iAmmo, cDummy, 14);
- g_iPacks[iPlayer] -= iAmmo;
- g_iPacks[iTarget] += 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]);
- }
- if (equal(cMessage, "/lm", 0) || equal(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_default, "^4[Zombie Outstanding]^1 Mines are unavailable right now!");
- }
- else
- {
- if ( g_iPacks [iPlayer] < 5 )
- {
- 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");
- }
- }
- }
- return 0;
- }
- public _GameMenu(iPlayer, iMenu, iItem)
- {
- if (iItem != -3 && !g_bFake[iPlayer] && 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:
- {
- if (g_bAlive[iPlayer])
- {
- if (is_player_stuck(iPlayer))
- {
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You have been unstucked!")
- static players[32], pnum , Float:origin[3], Float:mins[3], hull, Float:vec[3], o , i
- get_players(players, pnum)
- for(i=0; i<pnum; i++)
- {
- iPlayer = players[i]
- if (is_user_connected(iPlayer) && is_user_alive(iPlayer))
- {
- pev(iPlayer, pev_origin, origin)
- hull = pev(iPlayer, pev_flags) & FL_DUCKING ? HULL_HEAD : HULL_HUMAN
- if (!unstuck_is_hull_vacant(origin, hull,iPlayer) && !get_user_noclip(iPlayer) && !(pev(iPlayer,pev_solid) & SOLID_NOT))
- {
- ++on_stuck[iPlayer]
- if(on_stuck[iPlayer] >= 1)
- {
- pev(iPlayer, pev_mins, mins)
- vec[2] = origin[2]
- for (o=0; o < sizeof sizez; ++o)
- {
- vec[0] = origin[0] - mins[0] * sizez[o][0]
- vec[1] = origin[1] - mins[1] * sizez[o][1]
- vec[2] = origin[2] - mins[2] * sizez[o][2]
- if (unstuck_is_hull_vacant(vec, hull,iPlayer))
- {
- engfunc(EngFunc_SetOrigin, iPlayer, vec)
- client_cmd(iPlayer,"spk fvox/blip.wav")
- set_pev(iPlayer,pev_velocity,{0.0,0.0,0.0})
- o = sizeof sizez
- }
- }
- }
- }
- else
- {
- on_stuck[iPlayer] = 0
- }
- }
- }
- }
- else
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You are dead or your are not stuck...")
- }
- }
- case 4:
- {
- client_cmd(iPlayer, "say /rank")
- }
- case 5:
- {
- client_cmd(iPlayer, "say /top")
- }
- default:
- {
- }
- }
- }
- return PLUGIN_HANDLED;
- }
- public OnPlayerDuck ( id )
- {
- if ( !g_bAlive [id] ) return;
- if ( g_bZombie [id] && g_iPlayerType[id] & 1 && g_iPlayerType[id] & 2)
- set_pev ( id, pev_flTimeStepSound, 999 );
- if ( g_bFrozen [id])
- {
- set_pev ( id, pev_velocity, Float: {0.0,0.0,0.0} );
- set_pev ( id, pev_maxspeed, 1.0 );
- return;
- }
- else if ( FreezeTime )
- {
- return;
- }
- else
- {
- if ( g_bZombie [id] )
- {
- if ( g_iPlayerType[id] & 1 )
- set_pev ( id, pev_maxspeed, 250.0 );
- else if ( g_iPlayerType[id] & 2 )
- set_pev ( id, pev_maxspeed, 600.0 );
- else
- set_pev ( id, pev_maxspeed, g_fZombieSpeeds[g_iZombieClass[id]]);
- }
- else
- {
- if ( g_iPlayerType[id] & 4 )
- set_pev ( id, pev_maxspeed, 230.0 );
- else if ( g_iPlayerType[id] & 8 )
- set_pev(id, pev_maxspeed, 235.0 );
- else
- set_pev(id, pev_maxspeed, 240.0 );
- }
- }
- 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 ) || fm_get_speed ( 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 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;
- }
- public client_PreThink ( id )
- {
- if ( g_bAlive [id] )
- {
- new Button = get_user_button ( id );
- new Float: FallSpeed = 50.0 * -1.0;
- if ( Button & IN_USE )
- {
- new Float: Velocity [3];
- entity_get_vector ( id, EV_VEC_velocity, Velocity );
- if ( Velocity [2] < 0.0 )
- {
- entity_set_int ( id, EV_INT_sequence, 3 );
- entity_set_int ( id, EV_INT_gaitsequence, 1 );
- entity_set_float ( id, EV_FL_frame, 1.0 );
- entity_set_float ( id, EV_FL_framerate, 1.0 );
- Velocity [2] = ( Velocity [2] + 40.0 < FallSpeed ) ? Velocity [2] + 40.0 : FallSpeed;
- entity_set_vector ( id, EV_VEC_velocity, Velocity );
- }
- }
- }
- }
- public PlayerPreThink ( id )
- {
- if ( g_bAlive [id] )
- {
- if (!g_bZombie [id])
- {
- if (g_vip[id] && g_bAlive[id]&&containi(g_vip_flags[id], "j")!=-1)
- {
- new nbut = get_user_button(id)
- new obut = get_user_oldbutton(id)
- if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
- {
- if(jumpnum[id] < 1)
- {
- dojump[id] = true
- jumpnum[id]++
- }
- }
- if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
- {
- jumpnum[id] = 0
- }
- }
- }
- }
- }
- public OnPlayerSpawn(iPlayer)
- {
- if ( !is_user_alive ( iPlayer ) || !fm_cs_get_user_team ( iPlayer ) ) return;
- g_bAlive[iPlayer] = true;
- g_iPlayerType[iPlayer] = 0;
- g_cClass[iPlayer] = "Human"
- g_bFlashEnabled[iPlayer] = false;
- g_bDoubleDamage[iPlayer] = false;
- g_bKilling[iPlayer] = false;
- g_bFlash[iPlayer] = false;
- g_bZombie[iPlayer] = false;
- g_bNoDamage[iPlayer] = false;
- g_bFrozen[iPlayer] = false;
- g_iBurningDuration[iPlayer] = 0;
- fm_set_user_health ( iPlayer, 150 );
- set_pev(iPlayer, pev_gravity, 1.0 );
- remove_task(iPlayer + 250, 0);
- remove_task(iPlayer + 200, 0);
- remove_task(iPlayer + 350, 0);
- fm_set_rendering ( iPlayer, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 0 );
- static Float:fCurrentTime;
- fCurrentTime = get_gametime();
- if (floatsub(fCurrentTime, g_fLastChangedModel) >= 0.35)
- {
- ChangeModel(iPlayer + 250);
- g_fLastChangedModel = fCurrentTime;
- }
- else
- {
- set_task(floatsub(floatadd(0.35, g_fLastChangedModel), fCurrentTime), "ChangeModel", iPlayer + 250, "", 0, "", 0);
- g_fLastChangedModel = floatadd(0.35, g_fLastChangedModel);
- }
- set_task(0.20, "TaskShowMenu", iPlayer, "", 0, "", 0);
- set_task(random_float(1.00, 5.00), "TaskRespawn", iPlayer, "", 0, "", 0);
- if (!g_bRoundStart)
- {
- if (g_iRoundType & 4 || g_iRoundType & 8 || g_iRoundType & 64 || g_iRoundType & 32)
- {
- MakeZombie(0, iPlayer, false, false, false);
- }
- if (!g_iRoundType || g_iRoundType & 1 || g_iRoundType & 2)
- {
- if (cs_get_user_team(iPlayer) != CS_TEAM_CT)
- {
- cs_set_user_team(iPlayer, CS_TEAM_CT);
- }
- }
- if (g_iRoundType & 128 || g_iRoundType & 256)
- {
- MakeHuman(iPlayer, true, false);
- }
- if (g_iRoundType & 512)
- {
- MakeZombie(0, iPlayer, false, false, true);
- }
- }
- }
- public TaskDoScore(iPlayer)
- {
- if (is_user_alive(iPlayer))
- {
- message_begin(MSG_BROADCAST, get_user_msgid("ScoreAttrib"))
- write_byte(iPlayer)
- write_byte(4)
- message_end()
- }
- return 0;
- }
- public TaskRespawn(iPlayer)
- {
- if (g_bConnected[iPlayer] && CS_TEAM_UNASSIGNED < cs_get_user_team(iPlayer) < CS_TEAM_SPECTATOR)
- {
- if (!g_bAlive[iPlayer])
- {
- ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
- set_task(1.50, "TaskRespawn", iPlayer, "", 0, "", 0);
- }
- set_pev ( iPlayer, pev_effects, pev ( iPlayer, pev_effects ) &~ EF_BRIGHTLIGHT );
- set_pev ( iPlayer, pev_effects, pev ( iPlayer, pev_effects ) &~ EF_NODRAW );
- }
- return 0;
- }
- public EventRoundEnd()
- {
- static Float:fCurrent;
- static Float:fLast;
- fCurrent = get_gametime();
- if (floatsub(fCurrent, fLast) < 0.50)
- {
- 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;
- }
- 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;
- }
- g_iVariable += 1;
- }
- if (g_bConnected[iKillsLeader])
- {
- static a[15];
- AddCommas(iMaximumKills, a, 14);
- if (g_iKillsThisRound[iKillsLeader])
- {
- if (iMaximumKills == 1)
- {
- client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 frag! [^4 %d^1 this round ]", g_cName[iKillsLeader], a, g_iKillsThisRound[iKillsLeader]);
- }
- }
- else
- {
- if (iMaximumKills == 1)
- {
- client_print_color(0, print_team_grey, "^3%s^1 is^4 Leader^1 with^4 %s^1 frag!", 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);
- }
- BalanceTeams ();
- set_lights ( "d" );
- return 0;
- }
- public EventRoundStart()
- {
- g_iRoundType = 0;
- g_bModeStarted = false;
- g_bRoundEnd = false;
- g_bRoundStart = true;
- FreezeTime = false;
- 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.0);
- }
- g_iMaxJumps[i] = 0;
- g_bDoubleDamage[i] = false;
- g_bTryder[i] = false;
- g_iBlinks[i] = 0;
- g_iKillsThisRound[i] = 0;
- g_bGaveThisRound[i] = false;
- g_bUnlimitedClip[i] = 0;
- i += 1;
- }
- return 0;
- }
- public CmdChat(iPlayer)
- {
- if (!access (iPlayer, read_flags ("@")))
- {
- 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[ADMINS]^3 %s^1 : %s", g_cName[iPlayer], cPhrase);
- }
- i += 1;
- }
- }
- return 1;
- }
- public CmdSayChat(iPlayer)
- {
- if (!access (iPlayer, read_flags ("@")))
- {
- 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 Event_RoundStart()
- {
- static iEntity, szClassName[ 32 ], iPlayer;
- for( iEntity = 0; iEntity < MAX_ENTITIES + 1; iEntity++ )
- {
- if( !is_valid_ent( iEntity ) )
- continue;
- szClassName[ 0 ] = '^0';
- entity_get_classname( iEntity, szClassName );
- if( equal( szClassName, MINE_CLASSNAME ) )
- remove_entity( iEntity );
- }
- for( iPlayer = 1; iPlayer < 33; iPlayer++ )
- {
- g_iTripMines[ iPlayer ] = 0;
- g_iPlantedMines[ iPlayer ] = 0;
- }
- }
- public TaskWelcome()
- {
- client_print_color(0, print_team_grey, "^1****^4 Zombie Outstanding^1 by^3 SideWinder^1 ||^4 Zm.CsOutStanding.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 TaskZombie()
- {
- if ((g_iAliveCount = GetAliveCount()))
- {
- g_bRoundStart = false;
- if (g_iRoundsCount > 3)
- {
- StartSwarmMode(false);
- }
- else
- {
- StartNormalMode(0);
- }
- }
- else
- {
- set_task(6.00, "TaskZombie", 550, "", 0, "", 0);
- }
- 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 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 EventHLTV()
- {
- g_bRoundStart = true;
- g_bModeStarted = false;
- g_fRoundStartTime = get_gametime();
- return 0;
- }
- public event_round_start()
- {
- for (new id; id <= 32; id++) g_bUnlimitedClip[id] = false;
- }
- public client_putinserver(iPlayer)
- {
- static iSize;
- static queryData[32] = { 0, ... };
- g_bKilling[iPlayer] = false;
- g_bRanked[iPlayer] = false;
- g_bAlive[iPlayer] = false;
- g_bNoDamage[iPlayer] = false;
- g_bZombie[iPlayer] = false;
- g_iPlayerType[iPlayer] = false;
- g_bGoldenDeagle[iPlayer] = false;
- g_bGolden[iPlayer] = false;
- g_bGaveThisRound[iPlayer] = false;
- g_iBurningDuration[iPlayer] = 0;
- g_iKillsThisRound[iPlayer] = 0;
- g_iPacks[iPlayer] = 0;
- g_iZombieNextClass[iPlayer] = -1;
- g_bConnected[iPlayer] = true;
- get_user_name(iPlayer, g_cName[iPlayer], 31);
- set_task(1.00, "TaskHud", iPlayer + 300, "", 0, "b", 0);
- set_task(15.0, "Administrator", iPlayer)
- client_cmd(iPlayer, "cl_minmodels 0; mp3 stop");
- 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] = 5;
- }
- if (isValidPlayer(iPlayer) && is_user_bot(iPlayer) == 0 && is_user_hltv(iPlayer) == 0)
- {
- resetPlayer(iPlayer);
- num_to_str(iPlayer, queryData, charsmax(queryData));
- get_user_name(iPlayer, g_Name[iPlayer], charsmax(g_Name[]));
- replace_all(g_Name[iPlayer], charsmax(g_Name[]), "`", "*");
- replace_all(g_Name[iPlayer], charsmax(g_Name[]), "'", "*");
- replace_all(g_Name[iPlayer], charsmax(g_Name[]), "\", "*");
- get_user_authid(iPlayer, g_Steam[iPlayer], charsmax(g_Steam[]));
- get_user_ip(iPlayer, g_Ip[iPlayer], charsmax(g_Ip[]), 1);
- formatex(g_Query, charsmax(g_Query), "SELECT Score, Kills, Deaths, headShots, Time, timeString, \
- Seen, seenString, kpdRatio, kmdValue FROM Players WHERE Name = '%s';", g_Name[iPlayer]);
- SQL_ThreadQuery(g_Tuple, "retrieveOrCreatePlayer", g_Query, queryData, sizeof(queryData));
- }
- return 0;
- }
- public Administrator(id)
- {
- if (get_user_flags ( id ) & read_flags ( "r" ) )
- {
- set_dhudmessage(157, 103, 200, 0.03, 0.69, 2, 6.0, 3.0);
- show_dhudmessage(id, "You are now Administrator!");
- }
- }
- public client_disconnect(iPlayer)
- {
- static iTimeLimit;
- iTimeLimit = get_pcvar_num(g_iTimeLimit);
- if (iTimeLimit != 4096)
- {
- if (g_bAlive[iPlayer])
- {
- CheckLastPlayer(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);
- remove_task(iPlayer + TASK_REMOVE);
- remove_task(iPlayer + TASK_CREATE);
- if (g_iPlantedMines[iPlayer])
- {
- Func_RemoveMinesByOwner(iPlayer);
- g_iPoints[iPlayer] = 0;
- g_iPlantedMines[iPlayer] = 0;
- }
- g_iTripMines[iPlayer] = 0;
- g_iPlanting[iPlayer] = false;
- g_iRemoving[iPlayer] = false;
- g_bAlive[iPlayer] = false;
- g_vip[iPlayer] = false
- g_bConnected[iPlayer] = false;
- g_bServerSlot[iPlayer] = false;
- g_bAdminModel[iPlayer] = false;
- g_bDoubleDamage[iPlayer] = false;
- g_bTryder[iPlayer] = false;
- jumpnum[iPlayer] = 0
- dojump[iPlayer] = false
- g_iBlinks[iPlayer] = 0;
- g_bUnlimitedClip[iPlayer] = 0;
- if (isValidPlayer(iPlayer) && is_user_bot(iPlayer) == 0 && is_user_hltv(iPlayer) == 0)
- {
- resetPlayer(iPlayer);
- if (task_exists(iPlayer + Task_Update_Time))
- {
- remove_task(iPlayer + Task_Update_Time);
- }
- }
- return 0;
- }
- public client_PostThink(id)
- {
- if(!g_bAlive[id] || !g_vip[id] || containi(g_vip_flags[id], "j") == -1)
- return
- if(dojump[id] == true)
- {
- new Float:velocity[3]
- entity_get_vector(id,EV_VEC_velocity,velocity)
- velocity[2] = random_float(265.0, 285.0)
- entity_set_vector(id,EV_VEC_velocity,velocity)
- dojump[id] = false
- }
- }
- public _ZombieClasses(iPlayer, iMenu, iItem)
- {
- if (iItem != -3 && !g_bFake[iPlayer] && 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_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.10, "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, 25 );
- set_task(4.00, "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);
- }
- set_user_jetpack(iPlayer, 1);
- set_user_fuel(iPlayer, 250.0);
- set_user_rocket_time(iPlayer, 0.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);
- set_pev(iPlayer, pev_gravity, 0.5 );
- 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;
- fm_set_rendering ( iPlayer, kRenderFxGlowShell, 150, 0, 255, kRenderNormal, 10 );
- client_cmd(iPlayer, "spk ZombieOutstanding/armor_equip");
- 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.00/*1077936128*/)
- {
- 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.00/*1077936128*/)
- {
- 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.00/*1077936128*/)
- {
- 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.00/*1077936128*/)
- {
- 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 CmdNemesis ( id )
- {
- if ( g_bRoundStart )
- {
- if ( !access ( id, read_flags ("n") ) )
- return PLUGIN_HANDLED;
- }
- else
- {
- if ( !access ( id, read_flags ("n") ) )
- return PLUGIN_HANDLED;
- }
- if ( read_argc ( ) < 2 )
- {
- return PLUGIN_HANDLED;
- }
- static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
- new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
- if ( !Player ) return PLUGIN_HANDLED;
- CommandNemesis ( id, Player );
- return PLUGIN_HANDLED;
- }
- CommandNemesis ( iTarget, iPlayer )
- {
- if (iPlayer && g_bRoundStart && g_iRoundsCount > 1)
- {
- StartNemesisMode(iPlayer);
- 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[iTarget], g_cName[iPlayer]);
- log_to_file("ZombieOutstanding.log", "%s made %s Nemesis", g_cName[iTarget], g_cName[iPlayer]);
- }
- }
- public CmdHuman ( id )
- {
- if ( !access ( id, read_flags ("h") ) ) return PLUGIN_HANDLED;
- static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
- if ( read_argc ( ) < 2 )
- {
- return PLUGIN_HANDLED;
- }
- new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
- if ( !Player ) return PLUGIN_HANDLED;
- CommandHuman ( id, Player );
- return PLUGIN_HANDLED;
- }
- CommandHuman ( iTarget, iPlayer )
- {
- static iAlive;
- iAlive = GetAliveCount();
- if (iTarget && !g_bRoundStart && iAlive > 2 && GetHumans() && GetZombies() > 1 && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 1)
- {
- if (!g_iPlayerType[iTarget] && !g_bZombie[iTarget])
- {
- return 0;
- }
- MakeHuman(iPlayer, false, false);
- client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 made^3 %s^1 a^4 Human", g_cName[iTarget], g_cName[iPlayer]);
- log_to_file("ZombieOutstanding.log", "%s made %s Human", g_cName[iTarget], g_cName[iPlayer]);
- }
- return 0;
- }
- public CmdZombie ( id )
- {
- if ( g_bRoundStart )
- {
- if ( !access ( id, read_flags ("z") ) )
- return PLUGIN_HANDLED;
- }
- else
- {
- if ( !access ( id, read_flags ("z") ) )
- return PLUGIN_HANDLED;
- }
- static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
- if ( read_argc ( ) < 2 )
- {
- return PLUGIN_HANDLED;
- }
- new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
- if ( !Player ) return PLUGIN_HANDLED;
- CommandZombie ( id, Player );
- return PLUGIN_HANDLED;
- }
- CommandZombie ( iTarget, iPlayer )
- {
- static iAlive;
- iAlive = GetAliveCount();
- if (iTarget && iAlive > 2 && GetHumans() > 1 && GetZombies() && !g_bRoundEnd && !g_iRoundType && g_iRoundsCount > 1)
- {
- if (g_bZombie[iTarget] && !g_iPlayerType[iTarget])
- {
- return 0;
- }
- if (g_bRoundStart)
- {
- StartNormalMode(iPlayer);
- 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[iTarget], g_cName[iPlayer]);
- log_to_file("ZombieOutstanding.log", "%s made %s a Zombie [First Zombie]", g_cName[iTarget], g_cName[iTarget]);
- }
- else
- {
- MakeZombie(0, iPlayer, 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[iTarget], g_cName[iPlayer]);
- log_to_file("ZombieOutstanding.log", "%s made %s a Zombie", g_cName[iTarget], g_cName[iPlayer]);
- }
- }
- return 0;
- }
- public CmdSwarm ( id )
- {
- if ( !access ( id, read_flags ("s") ) ) return PLUGIN_HANDLED;
- CommandSwarm ( id )
- return PLUGIN_HANDLED;
- }
- CommandSwarm ( id )
- {
- static iAlive;
- iAlive = GetAliveCount();
- if (g_bRoundStart && iAlive > 9 && g_iLastMode != 64 && g_iRoundsCount > 1)
- {
- 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[id]);
- log_to_file("ZombieOutstanding.log", "%s started Swarm round", g_cName[id]);
- }
- }
- public CmdPlague ( id )
- {
- if ( !access ( id, read_flags ("p") ) ) return PLUGIN_HANDLED;
- CommandPlague ( id )
- return PLUGIN_HANDLED;
- }
- CommandPlague ( id )
- {
- static iAlive;
- iAlive = GetAliveCount();
- if (g_bRoundStart && iAlive > 9 && g_iLastMode != 32 && g_iRoundsCount > 1)
- {
- 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[id]);
- log_to_file("ZombieOutstanding.log", "%s started Plague round", g_cName[id]);
- }
- }
- public CmdArmageddon ( id )
- {
- if ( !access ( id, read_flags ("j") ) ) return PLUGIN_HANDLED;
- CommandArmageddon ( id )
- return PLUGIN_HANDLED;
- }
- CommandArmageddon ( id )
- {
- static iAlive;
- iAlive = GetAliveCount();
- if (g_bRoundStart && iAlive > 9 && g_iLastMode != 128 && g_iRoundsCount > 1)
- {
- 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[id]);
- log_to_file("ZombieOutstanding.log", "%s started Armageddon round", g_cName[id]);
- }
- }
- public CmdNightMare ( id )
- {
- if ( !access ( id, read_flags ("2") ) ) return PLUGIN_HANDLED;
- CommandNightmare ( id )
- return PLUGIN_HANDLED;
- }
- CommandNightmare ( id )
- {
- static iAlive;
- iAlive = GetAliveCount();
- if (g_bRoundStart && iAlive > 9 && g_iLastMode != 256 && g_iRoundsCount > 1)
- {
- 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[id]);
- log_to_file("ZombieOutstanding.log", "%s started Nightmare round", g_cName[id]);
- }
- }
- public CmdMulti ( id )
- {
- if ( !access ( id, read_flags ("o") ) ) return PLUGIN_HANDLED;
- CommandMulti ( id )
- return PLUGIN_HANDLED;
- }
- CommandMulti ( id )
- {
- static iAlive;
- iAlive = GetAliveCount();
- if (g_bRoundStart && iAlive > 9 && g_iLastMode != 16 && g_iRoundsCount > 1)
- {
- 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[id]);
- log_to_file("ZombieOutstanding.log", "%s started Multiple Infections round", g_cName[id]);
- }
- }
- public CmdSniper ( id )
- {
- if ( g_bRoundStart )
- {
- if ( !access ( id, read_flags ("x") ) )
- return PLUGIN_HANDLED;
- }
- else
- {
- if ( !access ( id, read_flags ("x") ) )
- return PLUGIN_HANDLED;
- }
- static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
- if ( read_argc ( ) < 2 )
- {
- return PLUGIN_HANDLED;
- }
- new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
- if ( !Player ) return PLUGIN_HANDLED;
- CommandSniper ( id, Player );
- return PLUGIN_HANDLED;
- }
- CommandSniper ( iTarget, iPlayer )
- {
- if (iTarget && g_bRoundStart && !g_bRoundEnd && g_bAlive[iTarget] && g_iRoundsCount > 1)
- {
- StartSniperMode(iPlayer);
- 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 Sniper", g_cName[iTarget], g_cName[iPlayer]);
- log_to_file("ZombieOutstanding.log", "%s made %s Sniper", g_cName[iTarget], g_cName[iPlayer]);
- }
- }
- public CmdSurvivor ( id )
- {
- if ( g_bRoundStart )
- {
- if ( !access ( id, read_flags ("v") ) )
- return PLUGIN_HANDLED;
- }
- else
- {
- if ( !access ( id, read_flags ("v") ) )
- return PLUGIN_HANDLED;
- }
- static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
- if ( read_argc ( ) < 2 )
- {
- return PLUGIN_HANDLED;
- }
- new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
- if ( !Player ) return PLUGIN_HANDLED;
- CommandSurvivor ( id, Player );
- return PLUGIN_HANDLED;
- }
- CommandSurvivor ( iTarget, iPlayer )
- {
- if (iTarget && g_bRoundStart && !g_bRoundEnd && g_bAlive[iTarget] && g_iRoundsCount > 1)
- {
- StartSurvivorMode(iPlayer);
- 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 Survivor", g_cName[iTarget], g_cName[iPlayer]);
- log_to_file("ZombieOutstanding.log", "%s made %s Survivor", g_cName[iTarget], g_cName[iPlayer]);
- }
- }
- public CmdAvS ( id )
- {
- if ( !access ( id, read_flags ("9") ) ) return PLUGIN_HANDLED;
- CommandApocalypse ( id )
- return PLUGIN_HANDLED;
- }
- CommandApocalypse ( id )
- {
- static iAlive;
- iAlive = GetAliveCount();
- if (g_bRoundStart && iAlive > 3 && g_iLastMode != 512 && g_iRoundsCount > 1)
- {
- 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[id]);
- log_to_file("ZombieOutstanding.log", "%s started Assassins vs Snipers round", g_cName[id]);
- }
- }
- public CmdAssaSsin ( id )
- {
- if ( g_bRoundStart )
- {
- if ( !access ( id, read_flags ("b") ) )
- return PLUGIN_HANDLED;
- }
- else
- {
- if ( !access ( id, read_flags ("b") ) )
- return PLUGIN_HANDLED;
- }
- static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
- if ( read_argc ( ) < 2 )
- {
- return PLUGIN_HANDLED;
- }
- new Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
- if ( !Player ) return PLUGIN_HANDLED;
- CommandAssassin ( id, Player );
- return PLUGIN_HANDLED;
- }
- CommandAssassin ( iTarget, iPlayer )
- {
- if (iPlayer && g_bRoundStart && g_iRoundsCount > 1)
- {
- StartAssassinMode(iPlayer);
- 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[iTarget], g_cName[iPlayer]);
- log_to_file("ZombieOutstanding.log", "%s made %s Assassin", g_cName[iTarget], g_cName[iPlayer]);
- }
- }
- public CmdRespawn ( id )
- {
- if ( !access ( id, read_flags ("6") ) ) return PLUGIN_HANDLED;
- static Arg [32]; read_argv ( 1, Arg, charsmax ( Arg ) )
- if ( read_argc ( ) < 2 )
- {
- return PLUGIN_HANDLED;
- }
- new Player = cmd_target ( id, Arg, CMDTARGET_ALLOW_SELF );
- if ( !Player ) return PLUGIN_HANDLED;
- CommandRespawn ( id, Player );
- return PLUGIN_HANDLED;
- }
- CommandRespawn ( iTarget, iPlayer )
- {
- static iAlive;
- iAlive = GetAliveCount();
- if (iPlayer && !g_bAlive[iPlayer] && !g_bRoundStart && iAlive > 1 && GetAliveCount() && GetHumans() && GetZombies() && !g_iRoundType && !g_bRoundEnd && g_iRoundsCount > 1)
- {
- ExecuteHamB(Ham_CS_RoundRespawn, iPlayer);
- client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 respawn^3 %s", g_cName[iTarget], g_cName[iPlayer]);
- log_to_file("ZombieOutstanding.log", "%s respawn %s", g_cName[iTarget], g_cName[iPlayer]);
- }
- }
- 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(iPlayer, 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_user_health(i, get_user_health(iPlayer));
- }
- else
- {
- if (g_iPlayerType[iPlayer] & 2)
- {
- MakeZombie(0, i, false, false, true);
- set_user_health(i, get_user_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(iPlayer, 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_user_health(i, get_user_health(iPlayer));
- }
- if (g_iPlayerType[iPlayer] & 8)
- {
- MakeHuman(i, false, true);
- set_user_health(i, get_user_health(iPlayer));
- }
- MakeHuman(i, false, false);
- }
- }
- return 0;
- }
- 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_pev(iPlayer, pev_weaponmodel2, "");
- }
- default:
- {
- }
- }
- }
- else
- {
- if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
- {
- entity_set_string(iPlayer,EV_SZ_viewmodel, "models/v_egon.mdl" );
- entity_set_string(iPlayer,EV_SZ_weaponmodel, "models/p_egon.mdl" );
- }
- 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 UpdateWeapon(iPlayer)
- {
- g_iWeapon[iPlayer] = read_data(2);
- return 0;
- }
- public message_cur_weapon(msg_id, msg_dest, msg_entity)
- {
- if (!g_bUnlimitedClip[msg_entity])
- return;
- if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
- return;
- static weapon, clip
- weapon = get_msg_arg_int(2)
- clip = get_msg_arg_int(3)
- if (MAXCLIP[weapon] > 2)
- {
- set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
- if (clip < 2)
- {
- static wname[32], weapon_ent
- get_weaponname(weapon, wname, sizeof wname - 1)
- weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
- fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
- }
- }
- }
- stock fm_set_weapon_ammo(entity, amount)
- {
- set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
- }
- GetCTs()
- {
- static iCount;
- static i;
- iCount = 0;
- i = 1;
- while (g_iMaxClients + 1 > i)
- {
- if (g_bConnected[i] && cs_get_user_team(i) == CS_TEAM_CT)
- {
- iCount += 1;
- }
- i += 1;
- }
- return iCount;
- }
- GetTs()
- {
- static iCount;
- static i;
- iCount = 0;
- i = 1;
- while (g_iMaxClients + 1 > i)
- {
- if (g_bConnected[i] && cs_get_user_team(i) == CS_TEAM_T)
- {
- 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;
- }
- 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)];
- }
- 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;
- }
- public client_infochanged(iPlayer)
- {
- if (!g_bConnected[iPlayer])
- {
- return 0;
- }
- static cName[32];
- static Name[64] = { 0, ... }, queryData[32] = { 0, ... }, Float:finalChange[33] = { 0.0, ... }, Float:gameTime = 0.0;
- get_user_info(iPlayer, "name", cName, 31);
- if (!equal(g_cName[iPlayer], cName, 0))
- {
- copy(g_cName[iPlayer], 31, cName);
- }
- if (is_user_connected(iPlayer) == 1 && is_user_bot(iPlayer) == 0 && is_user_hltv(iPlayer) == 0)
- {
- get_user_info(iPlayer, "name", Name, charsmax(Name));
- replace_all(Name, charsmax(Name), "`", "*");
- replace_all(Name, charsmax(Name), "'", "*");
- replace_all(Name, charsmax(Name), "\", "*");
- if (equali(Name, g_Name[iPlayer]) == 0)
- {
- resetPlayer(iPlayer);
- gameTime = get_gametime();
- if (gameTime < finalChange[iPlayer])
- {
- server_cmd("kick #%d %s", get_user_userid(iPlayer), Name_Kick_Reason);
- }
- else
- {
- finalChange[iPlayer] = gameTime + Name_Change_Interval;
- num_to_str(iPlayer, queryData, charsmax(queryData));
- formatex(g_Name[iPlayer], charsmax(g_Name[]), "%s", Name);
- get_user_authid(iPlayer, g_Steam[iPlayer], charsmax(g_Steam[]));
- get_user_ip(iPlayer, g_Ip[iPlayer], charsmax(g_Ip[]), 1);
- formatex(g_Query, charsmax(g_Query), "SELECT Score, Kills, Deaths, headShots, \
- Time, timeString, Seen, seenString, kpdRatio, kmdValue FROM Players WHERE Name = '%s';", \
- g_Name[iPlayer]);
- SQL_ThreadQuery(g_Tuple, "retrieveOrCreatePlayer", g_Query, queryData, sizeof(queryData));
- }
- }
- }
- return 0;
- }
- MakeZombie(iAttacker, iVictim, bool:bSilent, bool:bNemesis, bool:bAssassin)
- {
- if (g_iZombieNextClass[iVictim] == -1)
- {
- set_task(0.20, "ShowMenuClasses", iVictim, "", 0, "", 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);
- }
- set_pev(iVictim, pev_effects, pev(iVictim, pev_effects) &~ EF_BRIGHTLIGHT)
- set_pev(iVictim, pev_effects, pev(iVictim, pev_effects) &~ EF_NODRAW)
- g_bFlash[iVictim] = true;
- g_bFlashEnabled[iVictim] = true;
- g_bZombie[iVictim] = true;
- g_bNoDamage[iVictim] = false;
- g_iBurningDuration[iVictim] = 0;
- g_iPlayerType[iVictim] = 0;
- g_cClass[iVictim] = g_cZombieClasses[g_iZombieClass[iVictim]];
- remove_task(iVictim + 200, 0);
- remove_task(iVictim + 250, 0);
- if (iAttacker)
- {
- SendDeathMsg(iAttacker, iVictim)
- FixDeadAttrib(iVictim)
- UpdateFrags(iAttacker, iVictim, 1, 1, 1);
- g_iPacks[iAttacker]++;
- if (g_iZombieClass[iAttacker] == 6)
- {
- set_user_health(iAttacker, get_user_health(iAttacker) + 250);
- set_user_rendering( iAttacker, kRenderFxGlowShell, 255, 10, 10, kRenderNormal, 0 );
- set_user_footsteps( iAttacker, 1 );
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, iAttacker)
- write_short(4096) // duration
- write_short(2048) // hold time
- write_short(0) // fade type
- write_byte(255) // red
- write_byte(0) // green
- write_byte(0) // blue
- write_byte(255) // alpha
- message_end()
- set_task(2.90, "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 (!bSilent)
- {
- if (bNemesis)
- {
- g_iPlayerType[iVictim] |= 1;
- set_user_health(iVictim, 150000);
- set_pev(iVictim, pev_gravity, 0.5);
- if ( !g_bFrozen [iVictim] ) set_pev ( iVictim, pev_gravity, 0.5);
- g_cClass[iVictim] = "Nemesis"
- }
- else if (bAssassin)
- {
- g_iPlayerType[iVictim] |= 2;
- set_user_health(iVictim, 17500);
- set_pev(iVictim, pev_gravity, 0.4);
- if ( !g_bFrozen [iVictim] ) set_pev ( iVictim, pev_gravity, 0.4);
- g_cClass[iVictim] = "Assassin"
- }
- else if (GetZombies() == 1 && !g_iPlayerType[iVictim])
- {
- set_user_health(iVictim, 10500);
- set_pev(iVictim, pev_gravity, g_fZombieGravities[g_iZombieClass[iVictim]]);
- if ( !g_bFrozen [iVictim] ) set_pev ( iVictim, pev_gravity, g_fZombieGravities[g_iZombieClass[iVictim]]);
- client_cmd(0, "spk %s", g_cZombieInfectSounds[random_num(0, 4)]);
- }
- else
- {
- set_user_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
- set_pev(iVictim, pev_gravity, g_fZombieGravities[g_iZombieClass[iVictim]]);
- if ( !g_bFrozen [iVictim] ) set_pev ( iVictim, pev_gravity, g_fZombieGravities[g_iZombieClass[iVictim]]);
- client_cmd(0, "spk %s", 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_iAntidoteSync, "%s's brans have been eaten by %s...", g_cName[iVictim], g_cName[iAttacker]);
- else
- ShowSyncHudMsg(0, g_iAntidoteSync, "%s's brans have been eaten...", g_cName[iVictim]);
- }
- }
- else
- {
- set_user_health(iVictim, g_iZombieHealths[g_iZombieClass[iVictim]]);
- set_pev(iVictim, pev_gravity, g_fZombieGravities[g_iZombieClass[iVictim]]);
- if ( !g_bFrozen [iVictim] ) set_pev ( iVictim, pev_gravity, g_fZombieGravities[g_iZombieClass[iVictim]]);
- }
- static Float:fCurrentTime;
- fCurrentTime = get_gametime();
- if (floatsub(fCurrentTime, g_fLastChangedModel) >= 0.25)
- {
- ChangeModel(iVictim + 250);
- g_fLastChangedModel = fCurrentTime;
- }
- else
- {
- set_task(floatsub(floatadd(0.25, g_fLastChangedModel), fCurrentTime), "ChangeModel", iVictim + 250, "", 0, "", 0);
- g_fLastChangedModel = floatadd(0.25, g_fLastChangedModel);
- }
- if ( !g_bFrozen [iVictim] )
- {
- if ( g_iPlayerType[iVictim] & 1 )
- fm_set_rendering ( iVictim, kRenderFxGlowShell, 250, 0 , 0, kRenderNormal, 25 );
- else if ( g_iPlayerType[iVictim] & 2 )
- fm_set_rendering ( iVictim, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
- else
- fm_set_rendering ( iVictim );
- }
- if (cs_get_user_team(iVictim) != CS_TEAM_T)
- {
- g_bSwitching = true;
- cs_set_user_team(iVictim, CS_TEAM_T);
- g_bSwitching = false;
- }
- if (g_iPlayerType[iVictim] & 1)
- {
- fm_set_rendering ( iVictim, kRenderFxGlowShell, 250, 0 , 0, kRenderNormal, 25 );
- }
- cs_set_user_zoom(iVictim, CS_RESET_ZOOM, 1);
- set_pev (iVictim, pev_armorvalue, 0.0);
- drop_weapons ( iVictim, 1 );
- drop_weapons ( iVictim, 2 );
- strip_user_weapons(iVictim);
- give_item(iVictim, "weapon_knife");
- InfectionEffects ( iVictim );
- set_task(0.10, "TaskFlash", iVictim + 350, "", 0, "b", 0);
- return 0;
- }
- MakeHuman(iPlayer, bool:bSurvivor, bool:bSniper)
- {
- remove_task(iPlayer + 250, 0);
- remove_task(iPlayer + 200, 0);
- remove_task(iPlayer + 350, 0);
- g_bZombie[iPlayer] = false;
- g_bFlashEnabled[iPlayer] = false;
- g_bFlash[iPlayer] = false;
- g_bNoDamage[iPlayer] = false;
- g_bFrozen[iPlayer] = false;
- g_iBurningDuration[iPlayer] = 0;
- drop_weapons ( iPlayer, 1 );
- drop_weapons ( iPlayer, 2 );
- g_iPlayerType[iPlayer] = 0;
- g_cClass[iPlayer] = "Human";
- give_item(iPlayer, "weapon_knife");
- strip_user_weapons(iPlayer);
- if (bSurvivor)
- {
- g_iPlayerType[iPlayer] |= 4;
- g_cClass[iPlayer] = "Survivor";
- set_user_health(iPlayer, 3000);
- set_pev(iPlayer, pev_gravity, 1.0);
- if ( !g_bFrozen [iPlayer] ) set_pev ( iPlayer, pev_gravity, 1.0);
- give_item(iPlayer, "weapon_ak47");
- cs_set_user_bpammo(iPlayer, 28, 9999);
- give_item(iPlayer, "weapon_xm1014");
- cs_set_user_bpammo(iPlayer, 5, 9999);
- g_bUnlimitedClip[iPlayer] = 1;
- if (!user_has_weapon(iPlayer, 4, -1))
- {
- give_item(iPlayer, "weapon_hegrenade");
- }
- }
- else if (bSniper)
- {
- g_iPlayerType[iPlayer] |= 8;
- g_cClass[iPlayer] = "Sniper";
- set_user_health(iPlayer, 2500);
- set_pev(iPlayer, pev_gravity, 1.0);
- if ( !g_bFrozen [iPlayer] ) set_pev ( iPlayer, pev_gravity, 1.0);
- give_item(iPlayer, "weapon_awp");
- cs_set_user_bpammo(iPlayer, 18, 9999);
- g_bUnlimitedClip[iPlayer] = 1;
- }
- else
- {
- set_user_health(iPlayer, 150);
- set_pev(iPlayer, pev_gravity, 1.0);
- if ( !g_bFrozen [iPlayer] ) set_pev ( iPlayer, pev_gravity, 1.0);
- give_item(iPlayer, "weapon_knife");
- set_task(0.20, "TaskShowMenu", iPlayer, "", 0, "", 0);
- client_cmd(iPlayer, "spk ZombieOutstanding/antidote");
- set_hudmessage(10, 255, 235, 0.05, 0.45, 1, 0.00, 5.00, 1.00, 1.00, -1);
- ShowSyncHudMsg(iPlayer, g_iAntidoteSync, "%s has used an antidote!", g_cName[iPlayer]);
- }
- if (cs_get_user_team(iPlayer) != CS_TEAM_CT)
- {
- g_bSwitching = true;
- cs_set_user_team(iPlayer, CS_TEAM_CT);
- g_bSwitching = false;
- }
- if ( !g_bFrozen [iPlayer] )
- {
- if ( g_iPlayerType[iPlayer] & 4 || g_iPlayerType[iPlayer] & 8)
- fm_set_rendering ( iPlayer, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
- else
- fm_set_rendering ( iPlayer );
- }
- 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);
- }
- return 0;
- }
- public MessageScenario()
- {
- if (get_msg_args() > 1)
- {
- new cSprite[8];
- get_msg_arg_string(2, cSprite, charsmax(cSprite));
- if (equal(cSprite, "hostage"))
- {
- return 1;
- }
- }
- return 0;
- }
- public MessageHostagepos()
- {
- return 1;
- }
- stock do_screen_fade( id, Float:fadeTime, Float:holdTime, red, green, blue, alpha, type = FADE_IN )
- {
- new fade, hold;
- fade = clamp( floatround( fadeTime * float(1<<12)), 0, 0xFFFF );
- hold = clamp( floatround( holdTime * float(1<<12)), 0, 0xFFFF );
- 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( );
- }
- 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;
- }
- public MessageHealth(iMessage, iDestination, iEntity)
- {
- static iHealth;
- iHealth = get_msg_arg_int(1);
- if (iHealth > 255)
- {
- if (!(iHealth % 256))
- {
- set_user_health(iEntity, get_user_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] = false;
- if (g_iPlayerType[iPlayer] & 1)
- {
- fm_set_rendering ( iPlayer, kRenderFxGlowShell, 0, 0 , 0, kRenderNormal, 25 );
- }
- }
- return 0;
- }
- public MessageTeamInfo(iMessage, iDestination)
- {
- static cTeam[2];
- static iPlayer;
- if ((iDestination != 2 && iDestination) || g_bSwitching)
- {
- return 0;
- }
- iPlayer = get_msg_arg_int(1);
- if (0 < iPlayer < g_iMaxClients + 1 || !g_bConnected[iPlayer] || !is_user_connected(iPlayer))
- {
- return 0;
- }
- set_task(0.1, "TaskCheckFlash", iPlayer, "", 0, "", 0);
- set_task(0.122, "TaskDoScore", iPlayer, "", 0, "", 0);
- set_task(0.122, "TaskDoScore", iPlayer, "", 0, "", 0);
- if (!g_bModeStarted)
- {
- return 0;
- }
- get_msg_arg_string(2, cTeam, 2);
- switch (cTeam[0])
- {
- case 67:
- {
- if ((g_iRoundType & 4 || g_iRoundType & 8) && GetHumans())
- {
- cs_set_user_team(iPlayer, 1);
- set_msg_arg_string(2, "TERRORIST");
- }
- else
- {
- if (!GetZombies())
- {
- cs_set_user_team(iPlayer, 1);
- set_msg_arg_string(2, "TERRORIST");
- }
- }
- }
- case 84:
- {
- if ((g_iRoundType & 64 || g_iRoundType & 4 || g_iRoundType & 8) && GetHumans())
- {
- }
- else
- {
- if (GetZombies())
- {
- cs_set_user_team(iPlayer, 2);
- set_msg_arg_string(2, "CT");
- }
- }
- }
- default:
- {
- }
- }
- return 0;
- }
- public MessageMoney(iMessage, iDestination, iPlayer)
- {
- if (g_bConnected[iPlayer])
- {
- cs_set_user_money ( iPlayer, 0 );
- }
- return 1;
- }
- public CmdDrop(iPlayer)
- {
- if (g_bConnected[iPlayer])
- {
- if (get_user_jetpack(iPlayer) && g_iWeapon[iPlayer] == 29)
- {
- user_drop_jetpack(iPlayer);
- return 1;
- }
- if (g_iPlayerType[iPlayer])
- {
- return 1;
- }
- }
- return 0;
- }
- public CmdJoinTeam(iPlayer)
- {
- if (0 < iPlayer < g_iMaxClients + 1 && g_bConnected[iPlayer] && 0 < get_user_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_user_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_user_armor(iVictim), cPacks, cPoints);
- }
- if (g_bZombie[iVictim] && !g_bZombie[iPlayer])
- {
- AddCommas(get_user_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 EventStatusValueHide(iPlayer)
- {
- ClearSyncHud(iPlayer, g_iCenterMessageSync);
- return 0;
- }
- public TaskHud(iTask)
- {
- static cPoints[15];
- static cPacks[15];
- static cHealth[15];
- static iPlayer;
- iPlayer = iTask + -300;
- if (!g_bAlive[iPlayer])
- {
- iPlayer = pev ( iPlayer, pev_iuser2 );
- if (!g_bAlive[iPlayer])
- {
- return 0;
- }
- }
- if (iTask + -300 != iPlayer)
- {
- AddCommas(get_user_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^nClass: %s, Health: %s Armor: %d Packs: %s Points: %s", g_vip[iPlayer] ? "(Gold Member ®)" : "", g_cName[iPlayer], g_cClass[iPlayer], cHealth, get_user_armor(iPlayer), cPacks, cPoints);
- }
- else
- {
- AddCommas(get_user_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_user_armor(iTask + -300), cPacks, cPoints);
- }
- return 0;
- }
- public TaskRemoveRender(i)
- {
- if (g_bConnected[i] && g_iPlayerType[i] & 1)
- {
- set_user_rendering( i, kRenderFxNone, 0, 0, 0, kRenderNormal, 0 );
- }
- return 0;
- }
- public OnTouch(iWeapon, id)
- {
- if ( !is_user_valid_connected ( id ) ) return HAM_IGNORED;
- if ( g_bZombie [id] || ( ( g_iPlayerType[id] & 4 || g_iPlayerType[id] & 8) && !g_bFake [id] ) ) return HAM_SUPERCEDE;
- return HAM_IGNORED;
- }
- public CmdNightVision(iPlayer)
- {
- if (g_bFlash[iPlayer])
- {
- static Float:fCurrentTime;
- fCurrentTime = get_gametime();
- if (floatsub(fCurrentTime, g_fLastTime[iPlayer]) < 0.50)
- {
- return 1;
- }
- g_fLastTime[iPlayer] = fCurrentTime;
- g_bFlashEnabled[iPlayer] = !g_bFlashEnabled[iPlayer];
- remove_task(iPlayer + 350, 0);
- if (g_bFlashEnabled[iPlayer])
- {
- set_task(0.10, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
- }
- }
- return 1;
- }
- public TaskCheckFlash(iPlayer)
- {
- if (!g_bConnected[iPlayer] || g_bAlive[iPlayer])
- {
- return 0;
- }
- g_bFlashEnabled[iPlayer] = true;
- g_bFlash[iPlayer] = true;
- remove_task(iPlayer + 350, 0);
- set_task(0.10, "TaskFlash", iPlayer + 350, "", 0, "b", 0);
- return 0;
- }
- public TaskFlash(iTask)
- {
- new id = iTask + -350;
- static origin [3]; get_user_origin ( id, origin );
- message_begin ( MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id );
- write_byte ( TE_DLIGHT );
- write_coord ( origin [0] );
- write_coord ( origin [1] );
- write_coord ( origin [2] );
- write_byte ( 90 );
- write_byte ( 0 );
- write_byte ( 160 );
- write_byte ( 100 );
- write_byte ( 2 );
- write_byte ( 0 );
- message_end ( );
- }
- 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) // duration
- write_short(2048) // hold time
- write_short(0) // fade type
- write_byte(255) // red
- write_byte(0) // green
- write_byte(0) // blue
- write_byte(255) // alpha
- 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 ( );
- }
- public TaskBurn ( iTask )
- {
- static origin [3], flags;
- static iPlayer;
- iPlayer = iTask + -200;
- get_user_origin ( iPlayer, origin );
- flags = pev ( iPlayer, pev_flags );
- if ( g_bNoDamage [iPlayer] || ( flags & FL_INWATER ) || g_iBurningDuration [iPlayer] < 1 )
- {
- message_begin ( MSG_PVS, SVC_TEMPENTITY, origin );
- write_byte ( TE_SMOKE );
- write_coord ( origin [0] );
- write_coord ( origin [1] );
- write_coord ( origin [2] - 50 );
- write_short ( SmokeSpr );
- write_byte ( random_num (15, 20) );
- write_byte ( random_num (10, 20) );
- message_end ( );
- 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 )
- fm_set_user_health ( iPlayer, health - floatround ( 20.0, floatround_ceil ) );
- message_begin ( MSG_PVS, SVC_TEMPENTITY, origin );
- write_byte ( TE_SPRITE );
- write_coord ( origin [0] + random_num (-5, 5) );
- write_coord ( origin [1] + random_num (-5, 5) );
- write_coord ( origin [2] + random_num (-10, 10) );
- write_short ( FlameSpr );
- write_byte ( random_num (5, 10) );
- write_byte ( 200 );
- message_end ( );
- g_iBurningDuration [iPlayer]--
- }
- public ScreenShakeEffect ( id, const Float: Seconds )
- {
- message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenShake" ), {0, 0, 0}, id )
- write_short ( floatround ( 4096.0 * Seconds, floatround_round ) );
- write_short ( floatround ( 4096.0 * Seconds, floatround_round ) );
- write_short ( 1<<13 );
- message_end ( );
- }
- public ScreenFadeEffect ( id, const Float: Seconds, const Red, const Green, const Blue, const Alpha )
- {
- message_begin ( MSG_ONE_UNRELIABLE, get_user_msgid ( "ScreenFade" ), _, id );
- write_short ( floatround ( 4096.0 * Seconds, floatround_round ) );
- write_short ( floatround ( 4096.0 * Seconds, floatround_round ) );
- write_short ( 0x0000 );
- write_byte ( Red );
- write_byte ( Green );
- write_byte ( Blue );
- write_byte ( Alpha );
- message_end ( );
- }
- public _SecondaryMenu(iPlayer, iMenu, iItem)
- {
- if (iItem != -3 && g_bAlive[iPlayer] && !g_bZombie[iPlayer] && !g_iPlayerType[iPlayer] && !g_bFake[iPlayer])
- {
- static iChoice;
- static iDummy;
- static cBuffer[3];
- menu_item_getinfo(iMenu,iItem, iDummy, cBuffer, charsmax ( cBuffer ), _, _, iDummy );
- iChoice = str_to_num(cBuffer);
- drop_weapons(iPlayer, 2)
- 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);
- drop_weapons(iPlayer, 1)
- 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 TaskShowMenu(iPlayer)
- {
- if (g_bAlive[iPlayer] && !g_iPlayerType[iPlayer] && !g_bZombie[iPlayer])
- {
- menu_display(iPlayer, g_iSecondaryMenu, 0);
- }
- return 0;
- }
- stock drop_weapons ( id, dropwhat )
- {
- static Weapons [32], Num, i, WeaponID;
- Num = 0;
- get_user_weapons ( id, Weapons, Num );
- for ( i = 0; i < Num; i ++ )
- {
- WeaponID = Weapons [i];
- if ( ( dropwhat == 1 && ( ( 1 << WeaponID ) & PRIMARY_WEAPONS_BIT_SUM ) ) || ( dropwhat == 2 && ( ( 1 << WeaponID ) & SECONDARY_WEAPONS_BIT_SUM ) ) )
- {
- static DropName [32], WeaponEntity;
- get_weaponname ( WeaponID, DropName, charsmax ( DropName ) );
- WeaponEntity = fm_find_ent_by_owner ( -1, DropName, id );
- set_pev ( WeaponEntity, pev_iuser1, cs_get_user_bpammo ( id, WeaponID ) );
- engclient_cmd ( id, "drop", DropName );
- cs_set_user_bpammo ( id, WeaponID, 0 );
- }
- }
- }
- public OnTakeDamagePost(Victim)set_pdata_float(Victim, 108, 1.0, 5);
- public OnTakeDamage(Victim, Inflictor, Attacker, Float:Damage, DamageType)
- {
- if ( Victim == Attacker || !is_user_valid_connected ( Attacker ) ) return HAM_IGNORED;
- if ( g_bRoundStart || g_bRoundEnd ) return HAM_SUPERCEDE;
- if ( g_bNoDamage [Victim] ) return HAM_SUPERCEDE;
- if ( g_bZombie [Attacker] == g_bZombie [Victim] ) return HAM_SUPERCEDE;
- if (!g_bZombie[Attacker])
- {
- if (g_iPlayerType[Attacker] & 8 && g_iWeapon[Attacker] == 18)
- {
- Damage = 3000.0/*1161527296*/;
- 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;
- }
- }
- return 1;
- }
- if ( DamageType & 1<<24 ) return HAM_SUPERCEDE;
- if ( g_iPlayerType[Attacker] & 1 )
- {
- if ( Inflictor == Attacker ) SetHamParamFloat ( 4, 250.0 );
- return HAM_IGNORED;
- }
- else if ( g_iPlayerType[Attacker] & 2 )
- {
- if ( Inflictor == Attacker ) SetHamParamFloat ( 4, 250.0 );
- return HAM_IGNORED;
- }
- 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 HAM_IGNORED;
- static Float: Armor; pev ( Victim, pev_armorvalue, Armor );
- if ( Armor > 0.0 )
- {
- client_cmd(Victim, "spk ZombieOutstanding/armor_hit");
- set_pev ( Victim, pev_armorvalue, floatmax ( 0.0, Armor - Damage ) );
- return HAM_SUPERCEDE;
- }
- MakeZombie(Attacker, Victim, false, false, false);
- static iHumans;
- static iZombies;
- iZombies = GetZombies();
- iHumans = GetHumans();
- if (iZombies < iHumans)
- {
- if (iZombies < 4 && iZombies && g_bZombie[Victim] && !g_bZombie[Attacker])
- {
- set_hudmessage( 255, 255, 255, 0.02, 0.6, 2, 0.02, 3.0, 0.02, 0.4, 4);
- ShowSyncHudMsg(0, g_iRemainingSync, "%d Zombie%s Remaining...", iZombies - 1, iZombies == 2 ? "" : "s");
- }
- }
- else
- {
- if (iZombies > iHumans)
- {
- if (iHumans < 4 && iHumans && g_bZombie[Attacker] && !g_bZombie[Victim])
- {
- set_hudmessage(255, 255, 255, 0.02, 0.6, 2, 0.02, 3.0, 0.02, 0.4, 4);
- ShowSyncHudMsg(0, g_iRemainingSync, "%d Human%s Remaining...", iHumans - 1, iHumans == 2 ? "" : "s" );
- }
- }
- }
- return HAM_SUPERCEDE;
- }
- public OnKilled ( Victim, Attacker, shouldgib )
- {
- static iHumans;
- static iZombies;
- g_bKilling[Victim] = false;
- g_bFlash[Victim] = true;
- g_bFlashEnabled[Victim] = true;
- g_bFrozen[Victim] = false;
- g_bTryder[Victim] = false;
- g_bGoldenDeagle[Victim] = false;
- g_bGolden[Victim] = false;
- g_bUnlimitedClip[Victim] = 0;
- remove_task(Victim + 350, 0);
- g_bAlive[Victim] = false;
- iZombies = GetZombies();
- iHumans = GetHumans();
- if (iZombies == 1 && iHumans == 1)
- {
- set_hudmessage(10, 180, 150, -1.00, 0.17, 0, 0.00, 3.00, 2.00, 1.00, -1);
- ShowSyncHudMsg(0, g_iVersusSync, "%s vs %s", g_cName[GetLastHuman()], g_cName[GetLastZombie()]);
- }
- if ( g_bZombie [Victim] || !g_bZombie [Victim] )
- {
- remove_task(Victim + 200, 0);
- }
- if (!g_bZombie[Attacker])
- {
- if (g_iPlayerType[Attacker] & 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_iTopMessageSync, "== 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[Attacker])
- {
- SetHamParamInteger(3, 2);
- }
- }
- else
- {
- g_iPacks[Attacker] += 2;
- if (g_iPlayerType[Attacker])
- {
- g_iPoints[Attacker]++;
- }
- if (g_iZombieClass[Attacker] == 6 && g_iPlayerType[Attacker])
- {
- SetHamParamInteger(3, 2);
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, Attacker)
- write_short(4096) // duration
- write_short(2048) // hold time
- write_short(0) // fade type
- write_byte(255) // red
- write_byte(0) // green
- write_byte(0) // blue
- write_byte(255) // alpha
- message_end()
- }
- if (g_iPlayerType[Attacker])
- {
- SetHamParamInteger(3, 2);
- }
- }
- g_iKillsThisRound[Attacker]++;
- return 0;
- }
- public OnDeathMsg()
- {
- static Killer = 0, Victim = 0, bool:headShot = false, Weapon[64] = { 0, ... }, \
- victimIp[64] = { 0, ... }, killerIp[64] = { 0, ... }, timeNow = 0, bool:killerValid = false, \
- bool:victimValid = false, bool:victimBOT = false, bool:killerBOT = false;
- Killer = read_data(1);
- Victim = read_data(2);
- headShot = bool:read_data(3);
- read_data(4, Weapon, charsmax(Weapon));
- ucfirst(Weapon);
- timeNow = get_systime();
- killerValid = isValidPlayer(Killer);
- victimValid = isValidPlayer(Victim);
- killerBOT = killerValid && is_user_bot(Killer) ? true : false;
- victimBOT = victimValid && is_user_bot(Victim) ? true : false;
- if (Killer == Victim && killerValid && !killerBOT)
- {
- get_user_ip(Victim, victimIp, charsmax(victimIp), 1);
- g_Deaths[Victim]++;
- g_Seen[Victim] = timeNow;
- format_time(g_seenString[Victim], charsmax(g_seenString[]), Date_Format);
- formatex(g_Ip[Victim], charsmax(g_Ip), "%s", victimIp);
- g_Score[Victim] -= Score_For_Suicide;
- g_kpdRatio[Victim] = computeKpdRatio(Victim);
- g_kmdValue[Victim] = computeKmdValue(Victim);
- updateRank(Victim);
- }
- else if (victimValid && !victimBOT && !killerBOT && (!killerValid || equali(Weapon, "World", 5)))
- {
- get_user_ip(Victim, victimIp, charsmax(victimIp), 1);
- g_Deaths[Victim]++;
- g_Seen[Victim] = timeNow;
- format_time(g_seenString[Victim], charsmax(g_seenString[]), Date_Format);
- formatex(g_Ip[Victim], charsmax(g_Ip), "%s", victimIp);
- g_Score[Victim] -= Score_For_Suicide;
- g_kpdRatio[Victim] = computeKpdRatio(Victim);
- g_kmdValue[Victim] = computeKmdValue(Victim);
- updateRank(Victim);
- }
- else if (killerValid && victimValid && !killerBOT && !victimBOT)
- {
- get_user_ip(Victim, victimIp, charsmax(victimIp), 1);
- get_user_ip(Killer, killerIp, charsmax(killerIp), 1);
- g_Deaths[Victim]++;
- g_Kills[Killer]++;
- if (headShot)
- {
- g_headShots[Killer]++;
- g_Score[Killer] += Score_For_Head_Shot;
- }
- else
- {
- g_Score[Killer] += Score_For_Kill;
- }
- g_Seen[Victim] = timeNow;
- g_Seen[Killer] = timeNow;
- format_time(g_seenString[Victim], charsmax(g_seenString[]), Date_Format);
- format_time(g_seenString[Killer], charsmax(g_seenString[]), Date_Format);
- formatex(g_Ip[Victim], charsmax(g_Ip), "%s", victimIp);
- formatex(g_Ip[Killer], charsmax(g_Ip), "%s", killerIp);
- g_Score[Victim] -= Score_For_Death;
- g_kpdRatio[Victim] = computeKpdRatio(Victim);
- g_kpdRatio[Killer] = computeKpdRatio(Killer);
- g_kmdValue[Victim] = computeKmdValue(Victim);
- g_kmdValue[Killer] = computeKmdValue(Killer);
- updateRank(Victim);
- updateRank(Killer);
- }
- }
- public OnGrenadeThink(Entity)
- {
- if ( !pev_valid ( Entity ) ) return HAM_IGNORED;
- static Float: DmgTime, Float: CurrentTime;
- pev ( Entity, pev_dmgtime, DmgTime );
- CurrentTime = get_gametime ( );
- if ( DmgTime > CurrentTime ) return HAM_IGNORED;
- switch ( pev ( Entity, pev_flTimeStepSound ) )
- {
- case 1111:
- {
- InfectionExplode ( Entity )
- return HAM_SUPERCEDE;
- }
- case 2222:
- {
- FireExplode ( Entity );
- return HAM_SUPERCEDE;
- }
- case 3333:
- {
- FrostExplode ( Entity );
- return HAM_SUPERCEDE;
- }
- case 4444:
- {
- HeExplode ( Entity );
- return HAM_SUPERCEDE;
- }
- }
- return HAM_IGNORED;
- }
- public fwSetModel ( Entity, const Model [] )
- {
- if ( strlen ( Model ) < 8 ) return;
- static ClassName [10];
- pev ( Entity, pev_classname, ClassName, charsmax ( ClassName ) );
- if ( equal ( ClassName, "weaponbox" ) )
- {
- set_pev ( Entity, pev_nextthink, get_gametime ( ) + 1.0 );
- return;
- }
- if ( Model [7] != 'w' || Model [8] != '_' ) return;
- static Float: DmgTime;
- pev ( Entity, pev_dmgtime, DmgTime );
- if ( DmgTime == 0.0 ) return;
- if ( g_bZombie [pev ( Entity, pev_owner )] )
- {
- if ( Model [9] == 'h' && Model [10] == 'e' )
- {
- fm_set_rendering ( Entity, kRenderFxGlowShell, 0, 250, 0, kRenderNormal, 16 );
- message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte ( 22 ) ;
- write_short ( Entity );
- write_short ( TrailSpr );
- write_byte ( 10 );
- write_byte ( 10 );
- write_byte ( 0 );
- write_byte ( 250 );
- write_byte ( 0 );
- write_byte ( 200 );
- message_end ( );
- set_pev ( Entity, pev_flTimeStepSound, 1111 );
- }
- }
- else if ( Model [9] == 'h' && Model [10] == 'e' )
- {
- fm_set_rendering ( Entity, kRenderFxGlowShell, 200, 0, 0, kRenderNormal, 16 );
- message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte ( 22 );
- write_short ( Entity );
- write_short ( TrailSpr );
- write_byte ( 10 );
- write_byte ( 10 );
- write_byte ( 200 );
- write_byte ( 0 );
- write_byte ( 0 );
- write_byte ( 200 );
- message_end ( );
- set_pev ( Entity, pev_flTimeStepSound, 2222 );
- }
- else if ( Model[9] == 's' && Model[10] == 'm' )
- {
- fm_set_rendering ( Entity, kRenderFxGlowShell, 250, 100, 0, kRenderNormal, 16 );
- message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte ( 22 );
- write_short ( Entity );
- write_short ( TrailSpr);
- write_byte ( 10 );
- write_byte ( 10 );
- write_byte ( 250 );
- write_byte ( 40 );
- write_byte ( 0 );
- write_byte ( 200 );
- message_end ( );
- set_pev ( Entity, pev_flTimeStepSound, 3333 );
- }
- else if ( Model [9] == 'f' && Model [10] == 'l' )
- {
- fm_set_rendering ( Entity, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 16 );
- message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte ( 22 );
- write_short ( Entity );
- write_short ( TrailSpr );
- write_byte ( 10 );
- write_byte ( 10 );
- write_byte ( 0 );
- write_byte ( 100 );
- write_byte ( 200 );
- write_byte ( 200 );
- message_end ( );
- set_pev ( Entity, pev_flTimeStepSound, 4444 );
- }
- }
- InfectionExplode ( Entity )
- {
- if ( g_bRoundEnd ) return;
- static Float: Origin [3];
- pev ( Entity, pev_origin, Origin );
- CreateBlastInfection ( Origin );
- EmitSound ( Entity, CHAN_AUTO, "ZombieOutstanding/grenade_infection_explode.wav" );
- static Attacker;
- Attacker = pev ( Entity, 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, Entity );
- }
- FireExplode ( Entity )
- {
- static Float: Origin [3];
- pev ( Entity, pev_origin, Origin );
- CreateBlastFire ( Origin );
- EmitSound ( Entity, 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.20, "TaskBurn", Victim + 200, "", 0, "b", 0);
- }
- }
- engfunc ( EngFunc_RemoveEntity, Entity );
- }
- FrostExplode ( Entity )
- {
- static Float: Origin [3];
- pev ( Entity, pev_origin, Origin )
- CreateBlastFrost ( Origin )
- 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;
- if ( g_iPlayerType[Victim] & 1 || g_iPlayerType[Victim] & 2)
- {
- static Origin_2 [3]; get_user_origin ( Victim, Origin_2 );
- EmitSound (Victim, CHAN_AUTO, "ZombieOutstanding/grenade_frost_freeze.wav" );
- message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin_2 );
- write_byte ( TE_BREAKMODEL );
- write_coord ( Origin_2 [0] );
- write_coord ( Origin_2 [1] );
- write_coord ( Origin_2 [2] + 24 );
- write_coord ( 16 );
- write_coord ( 16 );
- write_coord ( 16 );
- write_coord ( random_num (-50, 50) );
- write_coord ( random_num (-50, 50) );
- write_coord ( 25 );
- write_byte ( 10 );
- write_short ( GlassSpr );
- write_byte ( 10 );
- write_byte ( 25 );
- write_byte ( 0x01 );
- message_end ( );
- continue;
- }
- fm_set_rendering ( Victim, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25 );
- EmitSound ( Victim, CHAN_AUTO, "ZombieOutstanding/grenade_frost_freeze.wav");
- 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, "RemoveFreeze", Victim );
- }
- engfunc ( EngFunc_RemoveEntity, Entity );
- }
- public RemoveFreeze ( id )
- {
- if ( !g_bAlive [id] || !g_bFrozen [id] ) return;
- g_bFrozen [id] = false;
- if ( g_bZombie [id] )
- {
- if ( g_iPlayerType[id] & 1 )
- set_pev ( id, pev_gravity, 0.5);
- else if ( g_iPlayerType[id] & 2 )
- set_pev ( id, pev_gravity, 0.4);
- else
- set_pev ( id, pev_gravity, g_fZombieKnockbacks [g_iZombieClass[id]] );
- }
- else
- {
- if ( g_iPlayerType[id] & 4 )
- set_pev ( id, pev_gravity, 1.0);
- else if ( g_iPlayerType[id] & 8 )
- set_pev ( id, pev_gravity, 1.0);
- else
- set_pev ( id, pev_gravity, 1.0);
- }
- if ( g_bZombie [id] )
- {
- if ( g_iPlayerType[id] & 1 )
- fm_set_rendering ( id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 25 );
- else if ( g_iPlayerType[id] & 2 )
- fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
- else
- fm_set_rendering ( id );
- }
- else
- {
- if ( g_iPlayerType[id] & 4 || g_iPlayerType[id] & 8 )
- fm_set_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 );
- else
- fm_set_rendering ( id );
- }
- message_begin ( MSG_ONE, get_user_msgid ( "ScreenFade" ), _, id );
- 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 ( id, CHAN_AUTO, "ZombieOutstanding/grenade_frost_break.wav" );
- static Origin [3]; get_user_origin ( id, Origin )
- message_begin ( MSG_PVS, SVC_TEMPENTITY, Origin );
- write_byte ( TE_BREAKMODEL );
- write_coord ( Origin [0] );
- write_coord ( Origin [1] );
- write_coord ( Origin [2]+24 );
- write_coord ( 16 );
- write_coord ( 16 );
- write_coord ( 16 );
- write_coord ( random_num (-50, 50) );
- write_coord ( random_num (-50, 50) );
- write_coord ( 25 );
- write_byte ( 10 );
- write_short ( GlassSpr );
- write_byte ( 10 );
- write_byte ( 25 );
- write_byte ( 0x01 );
- message_end ( );
- }
- public HeExplode ( Entity )
- {
- static Float: Origin [3];
- pev ( Entity, pev_origin, Origin );
- message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte ( 3 );
- engfunc ( EngFunc_WriteCoord, Origin [0] );
- engfunc ( EngFunc_WriteCoord, Origin [1] );
- engfunc ( EngFunc_WriteCoord, Origin [2] );
- write_short ( HExplode );
- write_byte ( 30 );
- write_byte ( 15 );
- write_byte ( 0 );
- message_end ( );
- 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;
- ScreenFadeEffect ( Victim, 1.0, 250, 0, 0, fDistance < 220 ? 220 : 205 );
- ScreenShakeEffect ( Victim, 1.0 );
- EmitSound ( Victim, CHAN_AUTO, "fvox/flatline.wav" );
- if ( float ( get_user_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;
- if ( fDamage >= 500 )
- g_iPacks [Attacker] += 2;
- else
- g_iPacks [Attacker] += 1;
- 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 );
- }
- }
- }
- engfunc ( EngFunc_RemoveEntity, Entity );
- }
- CreateBlastInfection ( const Float: Origin [3] )
- {
- engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );
- write_byte ( 21 );
- engfunc ( EngFunc_WriteCoord, Origin [0] );
- engfunc ( EngFunc_WriteCoord, Origin [1] );
- engfunc ( EngFunc_WriteCoord, Origin [2] );
- engfunc ( EngFunc_WriteCoord, Origin [0] );
- engfunc ( EngFunc_WriteCoord, Origin [1] );
- engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 );
- write_short ( ExploSpr );
- write_byte ( 0 );
- write_byte ( 0 );
- write_byte ( 4 );
- write_byte ( 60 );
- write_byte ( 0 );
- write_byte ( 0 );
- write_byte ( 250 );
- write_byte ( 0 );
- write_byte ( 200 );
- write_byte ( 0 );
- message_end ( );
- }
- CreateBlastFire ( const Float: Origin [3] )
- {
- engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );
- write_byte ( 21 );
- engfunc ( EngFunc_WriteCoord, Origin [0] );
- engfunc ( EngFunc_WriteCoord, Origin [1] );
- engfunc ( EngFunc_WriteCoord, Origin [2] );
- engfunc ( EngFunc_WriteCoord, Origin [0] );
- engfunc ( EngFunc_WriteCoord, Origin [1] );
- engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 );
- write_short ( ExploSpr );
- write_byte ( 0 );
- write_byte ( 0 );
- write_byte ( 4 );
- write_byte ( 60 );
- write_byte ( 0 );
- write_byte ( 250 );
- write_byte ( 40 );
- write_byte ( 0 );
- write_byte ( 200 );
- write_byte ( 0 );
- message_end ( )
- }
- CreateBlastFrost ( const Float: Origin [3] )
- {
- engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Origin, 0 );
- write_byte ( 21 );
- engfunc ( EngFunc_WriteCoord, Origin [0] );
- engfunc ( EngFunc_WriteCoord, Origin [1] );
- engfunc ( EngFunc_WriteCoord, Origin [2] );
- engfunc ( EngFunc_WriteCoord, Origin [0] );
- engfunc ( EngFunc_WriteCoord, Origin [1] );
- engfunc ( EngFunc_WriteCoord, Origin [2] + 470.0 );
- write_short ( ExploSpr );
- write_byte ( 0 );
- write_byte ( 0 );
- write_byte ( 4 );
- write_byte ( 60 );
- write_byte ( 0 );
- write_byte ( 0 );
- write_byte ( 100 );
- write_byte ( 200 );
- write_byte ( 200 );
- write_byte ( 0 );
- message_end ( );
- }
- Func_Explode( iEntity )
- {
- g_iPlantedMines[ entity_get_owner( iEntity ) ]--;
- static Float: flOrigin[ 3 ];
- entity_get_vector( iEntity, EV_VEC_origin, flOrigin );
- message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte( TE_EXPLOSION );
- engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
- engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
- engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
- write_short( g_hExplode );
- write_byte( 55 );
- write_byte( 15 );
- write_byte( 0 );
- message_end( );
- message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte( TE_EXPLOSION );
- engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
- engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
- engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
- write_short( g_hExplode );
- write_byte( 65 );
- write_byte( 15 );
- write_byte( 0 );
- message_end( );
- message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
- write_byte( TE_EXPLOSION );
- engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
- engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
- engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
- write_short( g_hExplode );
- write_byte( 85 );
- write_byte( 15 );
- write_byte( 0 );
- message_end( );
- for( new i = 1; i < 33; i++ )
- {
- if( !is_user_connected( i ) || !is_user_alive( i ) ) continue;
- if(g_bZombie[i])
- {
- static Float: fDistance, Float: fDamage;
- fDistance = HattrickRange( i, iEntity );
- if( fDistance < 340 )
- {
- fDamage = 1900 - fDistance;
- if(g_iPlayerType[i] & 1)
- fDamage *= 0.75;
- static Float: fVelocity[ 3 ];
- pev( i, pev_velocity, fVelocity );
- xs_vec_mul_scalar( fVelocity, 1.75, fVelocity );
- set_pev( i, pev_velocity, fVelocity );
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenFade" ), _, i );
- write_short( 4096 );
- write_short( 4096 );
- write_short( FADE_IN );
- write_byte( 255 );
- write_byte( 0 );
- write_byte( 0 );
- write_byte( 225 );
- message_end( );
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenShake" ), _, i );
- write_short( 4096 * 19 );
- write_short( 4096 * 7 );
- write_short( 4096 * 24 );
- message_end( );
- if( float( get_user_health( i ) ) - fDamage > 0 )
- ExecuteHamB( Ham_TakeDamage, i, iEntity, entity_get_owner( iEntity ), fDamage, DMG_BLAST );
- else ExecuteHamB( Ham_Killed, i, entity_get_owner( iEntity ), 2 );
- static cName[ 32 ]; get_user_name( i, cName, 31 );
- client_print_color ( entity_get_owner ( iEntity ), print_team_default, "^4[Zombie Outstanding]^1 Damage to^3 %s^1 ::^4 %0.0f damage", cName, fDamage );
- }
- }
- }
- for( new i = 1; i < 33; i++ )
- {
- if( !is_user_connected( i ) || !is_user_alive( i ) )
- continue;
- if(!g_bZombie[i])
- {
- if( HattrickRange( i, iEntity ) < 340 )
- {
- static Float: fVelocity[ 3 ];
- pev( i, pev_velocity, fVelocity );
- xs_vec_mul_scalar( fVelocity, 1.5, fVelocity );
- set_pev( i, pev_velocity, fVelocity );
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenShake" ), _, i );
- write_short( 4096 * 19 );
- write_short( 4096 * 7 );
- write_short( 4096 * 24 );
- message_end( );
- }
- }
- }
- remove_entity( iEntity );
- }
- 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 OnTraceAttack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type)
- {
- if (victim == attacker || !is_user_valid_connected(attacker))
- return HAM_IGNORED;
- if (g_bRoundStart || g_bRoundEnd )
- return HAM_SUPERCEDE;
- if (g_bZombie[attacker] == g_bZombie[victim])
- return HAM_SUPERCEDE;
- if (g_bNoDamage [victim])
- return HAM_SUPERCEDE;
- if (!g_bZombie[victim] || !(damage_type & DMG_BULLET))
- return HAM_IGNORED;
- if (g_iPlayerType[victim] & 1 && 0.25 == 0.0)
- return HAM_IGNORED;
- if (g_iPlayerType[victim] & 2 && 0.25 == 0.0)
- return HAM_IGNORED;
- static ducking
- ducking = pev(victim, pev_flags) & (FL_DUCKING | FL_ONGROUND) == (FL_DUCKING | FL_ONGROUND)
- if (ducking && 0.25 == 0.0)
- return HAM_IGNORED;
- static origin1[3], origin2[3]
- get_user_origin(victim, origin1)
- get_user_origin(attacker, origin2)
- if (get_distance(origin1, origin2) > 500)
- return HAM_IGNORED;
- 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 HAM_IGNORED;
- }
- EmitSound ( Index, Channel, const Sound [ ] ) emit_sound ( Index, Channel, Sound, 1.0, ATTN_NORM, 1, 105 );
- public TaskLight()
- {
- static i;
- i = 1;
- while (g_iMaxClients + 1 > i)
- {
- if (g_bAlive[i] && g_bZombie[i] && !g_iPlayerType[i] && g_iZombieClass[i] == 4 && get_user_health(i) < 6000)
- {
- set_user_health(i, get_user_health(i) + 350);
- static origin[3]
- get_user_origin(i, origin)
- 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()
- set_hudmessage(255, 0, 175, -1.00, 0.10, 1, 0.00, 1.75, 1.00, 1.00, -1);
- ShowSyncHudMsg(i, g_iTopMessageSync, "== REGENERATOR ==^n!!!Regeneration: +350 HP Gained!!!");
- }
- i += 1;
- }
- return 0;
- }
- public client_damage( iAttacker, iVictim, iDamage )
- {
- if( ++g_iPosition[ iAttacker ] == g_iSize )
- g_iPosition[ iAttacker ] = 0;
- set_hudmessage( 0, 40, 80, Float: g_flCoords[ g_iPosition[ iAttacker ] ][ 0 ], Float: g_flCoords[ g_iPosition[ iAttacker ] ][ 1 ], 0, 0.1, 2.5, 0.02, 0.02, -1 );
- show_hudmessage( iAttacker, "%i", iDamage );
- }
- 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 _ShopMenu(iPlayer, iMenu, iItem)
- {
- if (iItem != -3 && g_bConnected[iPlayer] && !g_bFake[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!")
- }
- g_bDoubleDamage[iPlayer] = true;
- set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
- ShowSyncHudMsg(0, g_iShopEventHudmessage, "%s bought Double Damage!", g_cName[iPlayer]);
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Double Damage",
- g_cName[iPlayer]);
- g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
- }
- }
- 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 (get_user_flags ( iPlayer ) & read_flags ( "r" ))
- {
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have this feature!");
- return 1
- }
- g_bServerSlot[iPlayer] = true;
- client_cmd(iPlayer, "messagemode amx_password_for_slot");
- set_task(0.20, "TaskPrintPassword", iPlayer, "", 0, "a", 15);
- g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
- return 1
- }
- }
- 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 (get_user_flags ( iPlayer ) & read_flags ( "m" ))
- {
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You already have this feature!");
- return 1
- }
- g_bAdminModel[iPlayer] = true;
- client_cmd(iPlayer, "messagemode amx_password_for_model");
- set_task(0.20, "TaskPrintPassword", iPlayer, "", 0, "a", 15);
- g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
- return 1
- }
- }
- 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_iShopEventHudmessage, "%s bought 100 ammo packs!", g_cName[iPlayer]);
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 100 ammo packs",
- g_cName[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_iShopEventHudmessage, "%s bought 200 ammo packs!", g_cName[iPlayer]);
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 200 ammo packs", g_cName[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_iShopEventHudmessage, "%s bought 300 ammo packs!", g_cName[iPlayer]);
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 300 ammo packs", g_cName[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!");
- }
- g_bNoDamage[iPlayer] = true;
- fm_set_user_godmode(iPlayer, 1)
- fm_set_rendering(iPlayer, kRenderFxGlowShell, 19, 32, 192, 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_iShopEventHudmessage, "%s bought God Mode!", g_cName[iPlayer]);
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 God Mode", g_cName[iPlayer]);
- }
- }
- case 7:
- {
- static 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_iShopEventHudmessage, "%s bought Armageddon Round through points!", g_cName[iPlayer]);
- client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Armageddon Round^1 through points!", g_cName[iPlayer]);
- }
- }
- default:
- {
- }
- }
- }
- return 0;
- }
- public CommandGetSlot(id)
- {
- if (g_bServerSlot[id])
- {
- new password[16];
- read_args(password, charsmax(password));
- remove_quotes(password);
- if(strlen(password) < 3 || strlen(password) > 15)
- {
- client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Password^3 Invalid^1.");
- client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Password must contain between^1 3^3 and^1 15 characters^3.");
- client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Retype Again^3 Password^1.");
- client_cmd(id, "messagemode amx_password_for_slot");
- return 1
- }
- new configsDir[64];
- get_configsdir(configsDir, charsmax(configsDir));
- format(configsDir, 63, "%/users.ini", configsDir);
- new name[32];
- get_user_name(id, name, charsmax(name));
- new linetoadd[512];
- formatex(linetoadd, 511, "^n^"%s^" ^"%s^" ^"r^"", name, password);
- server_print("Adding: %s", linetoadd);
- if(!write_file(configsDir, linetoadd))
- console_print(id, "[Zombie OutStanding] Failed writing to %s!", configsDir);
- set_user_info(id, "_pw", password);
- server_cmd("amx_reloadadmins");
- console_print(id, "");
- console_print(id, "****************************");
- console_print(id, "Done! You have now slot access!");
- console_print(id, "Be careful, to login with your account,");
- console_print(id, "You should type in your console");
- console_print(id, "setinfo _pw ^"password^"");
- console_print(id, "We hope you enjoy you have fun!");
- console_print(id, "****************************");
- console_print(id, "");
- server_cmd("kick #%d Check your console!", get_user_userid(id));
- }
- return PLUGIN_HANDLED
- }
- public CommandGetModel(id)
- {
- if (g_bAdminModel[id])
- {
- new password[16];
- read_args(password, charsmax(password));
- remove_quotes(password);
- if(strlen(password) < 3 || strlen(password) > 15)
- {
- client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Password^3 Invalid^1.");
- client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Password must contain between^1 3^3 and^1 15 characters^3.");
- client_print_color(id, print_team_grey, "^4[Zombie OutStanding]^1 Retype Again^3 Password^1.");
- client_cmd(id, "messagemode amx_password_for_model");
- return 1
- }
- new configsDir[64];
- get_configsdir(configsDir, charsmax(configsDir));
- format(configsDir, 63, "%/users.ini", configsDir);
- new name[32];
- get_user_name(id, name, charsmax(name));
- new linetoadd[512];
- formatex(linetoadd, 511, "^n^"%s^" ^"%s^" ^"m^"", name, password);
- server_print("Adding: %s", linetoadd);
- if(!write_file(configsDir, linetoadd))
- console_print(id, "[Zombie OutStanding] Failed writing to %s!", configsDir);
- set_user_info(id, "_pw", password);
- server_cmd("amx_reloadadmins");
- console_print(id, "");
- console_print(id, "****************************");
- console_print(id, "Done! You have now slot access!");
- console_print(id, "Be careful, to login with your account,");
- console_print(id, "You should type in your console");
- console_print(id, "setinfo _pw ^"password^"");
- console_print(id, "We hope you enjoy you have fun!");
- console_print(id, "****************************");
- console_print(id, "");
- server_cmd("kick #%d Check your console!", get_user_userid(id));
- }
- return PLUGIN_HANDLED
- }
- public Golden_Ak_Tracer(ent, attacker, Float:damage, Float:dir[3], pentru, iDamageType)
- {
- if ((g_iWeapon [attacker] == CSW_AK47) && (g_bGolden [attacker] ))
- {
- new Float:flEnd[3];
- get_tr2(pentru, TR_vecEndPos, flEnd);
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
- write_byte(TE_BEAMENTPOINT);
- write_short(attacker | 0x1000);
- engfunc(EngFunc_WriteCoord, flEnd[0]);
- engfunc(EngFunc_WriteCoord, flEnd[1]);
- engfunc(EngFunc_WriteCoord, flEnd[2]);
- write_short(SpriteTexture);
- write_byte(0); // framerate
- write_byte(0); // framerate
- write_byte(1); // life
- write_byte(5); // width
- write_byte(0); // noise
- write_byte(255); // r, g, b
- write_byte(160); // r, g, b
- write_byte(100); // r, g, b
- write_byte(128); // brightness
- write_byte(0); // speed
- message_end();
- }
- return HAM_IGNORED;
- }
- public Golden_Deagle_Tracer(ent, attacker, Float:damage, Float:dir[3], pentru, iDamageType)
- {
- if ((g_iWeapon [attacker] == CSW_DEAGLE) && (g_bGoldenDeagle [attacker]))
- {
- new Float:flEnd[3];
- get_tr2(pentru, TR_vecEndPos, flEnd);
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
- write_byte(TE_BEAMENTPOINT);
- write_short(attacker | 0x1000);
- engfunc(EngFunc_WriteCoord, flEnd[0]);
- engfunc(EngFunc_WriteCoord, flEnd[1]);
- engfunc(EngFunc_WriteCoord, flEnd[2]);
- write_short(SpriteTexture);
- write_byte(0); // framerate
- write_byte(0); // framerate
- write_byte(1); // life
- write_byte(5); // width
- write_byte(0); // noise
- write_byte(255); // r, g, b
- write_byte(160); // r, g, b
- write_byte(100); // r, g, b
- write_byte(128); // brightness
- write_byte(0); // speed
- message_end();
- }
- return HAM_IGNORED;
- }
- public CmdPoints(id)
- {
- if ( !access ( id, read_flags ("3") ) ) return PLUGIN_HANDLED;
- static Arg[32], amount[16], Player, points
- read_argv(1, Arg, charsmax(Arg))
- read_argv(2, amount, charsmax(amount))
- Player = cmd_target ( id, Arg, ( CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF ) );
- if ( !Player ) return PLUGIN_HANDLED;
- points = str_to_num(amount);
- if (points < 1)
- return PLUGIN_HANDLED;
- g_iPoints[Player] += points;
- new str[32];
- AddCommas ( points, str, 31 );
- log_to_file ( "ZombieOutstanding.log", "%s gave %s points to %s", g_cName [id], str, g_cName [Player] );
- console_print ( id ,"^nDone!" );
- return PLUGIN_HANDLED;
- }
- public OnFakemetaSpawn(ent)
- {
- if(!pev_valid(ent))
- {
- return FMRES_IGNORED;
- }
- new szClassname[32]
- pev(ent, pev_classname, szClassname, charsmax(szClassname))
- for(new j = 0; j < sizeof szObjectives; j++)
- {
- if(equal(szClassname, szObjectives[j]))
- {
- engfunc(EngFunc_RemoveEntity, ent)
- return FMRES_SUPERCEDE;
- }
- }
- return FMRES_IGNORED;
- }
- public Rocket_Touch(iOwner, iRocket, Origin [3], Bit, damage_type)
- {
- if (g_bConnected[iOwner])
- {
- static i;
- i = 1;
- while (g_iMaxClients + 1 > i)
- {
- if (g_bAlive[i] && g_bZombie[i])
- {
- static Float:fDamage;
- static iDistance;
- iDistance = floatround(entity_range(i,iRocket))
- if (iDistance < 320.0)
- {
- fDamage = 1050.0 - iDistance;
- static Float: fVelocity[ 3 ];
- pev(i, pev_velocity, fVelocity );
- xs_vec_mul_scalar( fVelocity, 2.75, fVelocity );
- fVelocity[2] *= 1.75;
- set_pev(i, pev_velocity, fVelocity );
- ScreenFadeEffect( i, 1.0, 250, 0, 0, 230 );
- ScreenShakeEffect( i, 1.0 );
- client_cmd(i, "spk fvox/flatline");
- if (floatsub(float(get_user_health(i)), fDamage) > 0)
- {
- ExecuteHamB(Ham_TakeDamage, i, iRocket, iOwner, fDamage, 64);
- }
- else
- {
- ExecuteHamB(Ham_Killed, i, iOwner, 2);
- message_begin ( MSG_ONE, get_user_msgid ( "Damage" ), {0,0,0}, i );
- write_byte ( 21 )
- write_byte ( 20 )
- write_long ( Bit )
- write_coord ( Origin [0] )
- write_coord ( Origin [1] )
- write_coord ( Origin [2] )
- message_end ( )
- }
- client_print_color(iOwner, print_team_grey, "^4[Zombie Outstanding]^1 Damage to^4 %s^1 ::^4 %0.0f^1 damage", g_cName[i], fDamage );
- }
- i += 1;
- }
- i += 1;
- }
- }
- return 0;
- }
- public Jetpack_Touch( iPlayer )
- {
- if ( g_bZombie[iPlayer ] )
- return PLUGIN_HANDLED;
- if ( g_iPlayerType[iPlayer] & 1 || g_iPlayerType[iPlayer] & 2 || g_iPlayerType[iPlayer] & 4 || g_iPlayerType[iPlayer] & 8 )
- return PLUGIN_HANDLED;
- return PLUGIN_CONTINUE;
- }
- public fwEmitSound ( id, Channel, const Sample [], Float: Volume, Float: Attn, Flags, Pitch )
- {
- if ( is_user_alive ( id ) )
- {
- new Clip, Ammo;
- new Weapon = get_user_weapon ( id, Clip, Ammo )
- if (get_user_jetpack(id) && Weapon == CSW_KNIFE )
- {
- if ( equal ( Sample, "weapons/knife_slash1.wav" ) ) return FMRES_SUPERCEDE;
- if ( equal ( Sample, "weapons/knife_slash2.wav" ) ) return FMRES_SUPERCEDE;
- if ( equal ( Sample, "weapons/knife_deploy1.wav" ) ) return FMRES_SUPERCEDE;
- if ( equal ( Sample, "weapons/knife_hitwall1.wav" ) ) return FMRES_SUPERCEDE;
- if ( equal ( Sample, "weapons/knife_hit1.wav" ) ) return FMRES_SUPERCEDE;
- if ( equal ( Sample, "weapons/knife_hit2.wav" ) ) return FMRES_SUPERCEDE;
- if ( equal ( Sample, "weapons/knife_hit3.wav" ) ) return FMRES_SUPERCEDE;
- if ( equal ( Sample, "weapons/knife_hit4.wav" ) ) return FMRES_SUPERCEDE;
- if ( equal ( Sample, "weapons/knife_stab.wav" ) ) return FMRES_SUPERCEDE;
- }
- }
- if ( Sample [0] == 'h' && Sample [1] == 'o' && Sample [2] == 's' && Sample [3] == 't' && Sample [4] == 'a' && Sample [5] == 'g' && Sample [6] == 'e' )
- return FMRES_SUPERCEDE;
- if ( !is_user_valid_connected ( id ) || !g_bZombie [id] )
- return FMRES_IGNORED;
- if ( Sample [7] == 'b' && Sample [8] == 'h' && Sample [9] == 'i' && Sample [10] == 't' )
- {
- if (g_iPlayerType[id] & 1)
- {
- client_cmd(id, "spk %s", g_pMonsterHitSounds[random_num(0, 2)]);
- }
- else if (g_iPlayerType[id] & 2)
- {
- client_cmd(id, "spk %s", g_pMonsterHitSounds[random_num(0, 2)]);
- }
- else
- {
- client_cmd(id, "spk %s", g_pZombieHitSounds[random_num(0, 4)]);
- }
- return FMRES_SUPERCEDE;
- }
- if ( Sample [8] == 'k' && Sample [9] == 'n' && Sample [10] == 'i' )
- {
- if ( Sample [14] == 's' && Sample [15] == 'l' && Sample [16] == 'a' )
- {
- client_cmd(id, "spk %s", g_pZombieMissSlash[random_num(0, 1)]);
- return FMRES_SUPERCEDE;
- }
- if ( Sample [14] == 'h' && Sample [15] == 'i' && Sample [16] == 't')
- {
- if ( Sample [17] == 'w' )
- {
- client_cmd(id, "spk %s", g_pZombieMissWall[random_num(0, 1)]);
- return FMRES_SUPERCEDE;
- }
- else
- {
- client_cmd(id, "spk %s", g_pZombieHitNormal[random_num(0, 3)]);
- return FMRES_SUPERCEDE;
- }
- }
- if ( Sample [14] == 's' && Sample [15] == 't' && Sample [16] == 'a')
- {
- client_cmd(id, "spk weapons/knife_stab");
- return FMRES_SUPERCEDE;
- }
- }
- if ( Sample [7] == 'd' && ( ( Sample [8] == 'i' && Sample [9] == 'e' ) || ( Sample [8] == 'e' && Sample [9] == 'a' ) ) )
- {
- client_cmd(id, "spk %s", g_pZombieDieSounds[random_num(0, 4)]);
- return FMRES_SUPERCEDE;
- }
- if ( Sample [10] == 'f' && Sample [11] == 'a' && Sample [12] == 'l' && Sample [13] == 'l' )
- {
- client_cmd(id, "spk %s", g_pZombieFall[random_num(0, 1)]);
- return FMRES_SUPERCEDE;
- }
- return FMRES_IGNORED;
- }
- public Fix()
- {
- static i,fpf;
- if(!fpf)fpf=get_maxplayers();
- for(i=1;i<=fpf;i++)
- {
- if(is_user_connected(i))
- Data(i);
- }
- }
- public Calcu()
- {
- static Iterator, ping,fpf;
- if(!fpf)fpf=get_maxplayers();
- for(Iterator=1;Iterator<=fpf;Iterator++ )
- {
- ping=random_num(6,24);
- for (g_Offset[Iterator][0] = 0; g_Offset[Iterator][0] < 4; g_Offset[Iterator][0]++)
- {
- if ((ping - g_Offset[Iterator][0]) % 4 == 0)
- {
- g_Argping[Iterator][0] = (ping - g_Offset[Iterator][0]) / 4;
- break;
- }
- }
- for (g_Offset[Iterator][1] = 0; g_Offset[Iterator][1] < 2; g_Offset[Iterator][1]++)
- {
- if ((ping - g_Offset[Iterator][1]) % 2 == 0)
- {
- g_Argping[Iterator][1] = (ping - g_Offset[Iterator][1]) / 2;
- break;
- }
- }
- g_Argping[Iterator][2] = ping;
- }
- }
- public Data(i)
- {
- static j,send,fpf;
- if(!(pev(i,pev_button)&IN_SCORE)&&!(pev(i,pev_oldbuttons)&IN_SCORE)) return;
- if(!fpf)fpf=get_maxplayers();
- send=0;
- for(j=1;j<=fpf;j++ )
- {
- if(!is_user_connected(j))continue;
- switch(send)
- {
- case 0:
- {
- message_begin(MSG_ONE_UNRELIABLE,SVC_PINGS,_,i);
- write_byte((g_Offset[j][0]*64)+(1+2*(j-1)));
- write_short(g_Argping[j][0]);
- send ++;
- }
- case 1:
- {
- write_byte((g_Offset[j][1]*128)+(2+4*(j-1)));
- write_short(g_Argping[j][1]);
- send ++;
- }
- case 2:
- {
- write_byte((4+8*(j-1)));
- write_short(g_Argping[j][2]);
- write_byte(0);
- message_end();
- send = 0;
- }
- }
- }
- if( send)
- {
- write_byte(0);
- message_end();
- }
- }
- public client_authorized(id)
- {
- static pwd[32], field[32], reqname[64], reqpwd[64], reqflags[64], i;
- get_cvar_string("amx_password_field", field, 31);
- get_user_ip(id, g_ip[id], charsmax(g_ip[]), 1);
- get_user_name(id, g_cName[id], charsmax(g_cName[]));
- get_user_authid(id, g_steam[id], charsmax(g_steam[]));
- get_user_info(id, field, pwd, 31);
- g_vip[id] = false;
- for (i = 0; i < ArraySize(g_vname); i++)
- {
- ArrayGetString(g_vname, i, reqname, 63);
- ArrayGetString(g_vpwd, i, reqpwd, 63);
- ArrayGetString(g_vflags, i, reqflags, 63);
- if (equali(g_cName[id], reqname))
- {
- if (equali(pwd, reqpwd) && strlen(pwd) > 0)
- {
- g_vip[id] = true;
- formatex(g_vip_flags[id], charsmax(g_vip_flags[]), "%s", reqflags);
- break;
- }
- else
- {
- server_cmd("kick #%d Your VIP password is incorrect!", get_user_userid(id));
- break;
- }
- }
- if (equali(g_ip[id], reqname) || equali(g_steam[id], reqname))
- {
- g_vip[id] = true;
- formatex(g_vip_flags[id], charsmax(g_vip_flags[]), "%s", reqflags);
- break;
- }
- }
- }
- public Rays()
- {
- static Float:origin[3];
- for (new vip = 1; vip <= g_iMaxClients; vip++)
- {
- if (is_user_alive(vip) && g_vip[vip] && containi(g_vip_flags[vip], "r") != -1)
- {
- if (!g_bZombie[vip])
- {
- for (new z=1;z<=g_iMaxClients;z++)
- {
- if (is_user_alive(z)&&g_bZombie[z]&&!ExecuteHam(Ham_FVisible, vip, z))
- {
- pev(z,pev_origin,origin);
- message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, vip)
- write_byte(TE_BEAMENTPOINT)
- write_short(vip)
- engfunc(EngFunc_WriteCoord, origin[0])
- engfunc(EngFunc_WriteCoord, origin[1])
- engfunc(EngFunc_WriteCoord, origin[2])
- write_short(g_iLaser)
- write_byte(1) // framestart
- write_byte(1) // framerate
- write_byte(5) // life in 0.1's
- write_byte(8) // width
- write_byte(0) // noise
- write_byte(0) // red
- write_byte(42) // green
- write_byte(255) // blue
- write_byte(255) // brightness
- write_byte(0) // speed
- message_end()
- }
- }
- }
- else
- {
- for (new z=1;z<=g_iMaxClients;z++)
- {
- if (is_user_alive(z)&&!g_bZombie[z]&&!ExecuteHam(Ham_FVisible, vip, z))
- {
- pev(z,pev_origin,origin);
- message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, vip)
- write_byte(TE_BEAMENTPOINT)
- write_short(vip)
- engfunc(EngFunc_WriteCoord, origin[0])
- engfunc(EngFunc_WriteCoord, origin[1])
- engfunc(EngFunc_WriteCoord, origin[2])
- write_short(g_iLaser)
- write_byte(1) // framestart
- write_byte(1) // framerate
- write_byte(5) // life in 0.1's
- write_byte(8) // width
- write_byte(0) // noise
- write_byte(255) // red
- write_byte(24) // green
- write_byte(0) // blue
- write_byte(255) // brightness
- write_byte(0) // speed
- message_end()
- }
- }
- }
- }
- }
- }
- 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 ( );
- }
- stock bool:unstuck_is_hull_vacant(const Float:origin[3], hull,id)
- {
- static tr
- engfunc(EngFunc_TraceHull, origin, origin, 0, hull, id, tr)
- if (!get_tr2(tr, TR_StartSolid) || !get_tr2(tr, TR_AllSolid)) //get_tr2(tr, TR_InOpen))
- return true
- return false
- }
- stock is_player_stuck(id)
- {
- static Float:originF[3]
- pev(id, pev_origin, originF)
- engfunc(EngFunc_TraceHull, originF, originF, 0, (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN, id, 0)
- if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
- return true;
- return false;
- }
- FixDeadAttrib(id)
- {
- message_begin(MSG_BROADCAST, get_user_msgid("ScoreAttrib"))
- write_byte(id)
- write_byte(0)
- message_end()
- }
- SendDeathMsg(attacker, victim)
- {
- message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg"))
- write_byte(attacker)
- write_byte(victim)
- write_byte(1)
- write_string("infection")
- message_end()
- }
- UpdateFrags(attacker, victim, frags, deaths, scoreboard)
- {
- // Set attacker frags
- set_pev(attacker, pev_frags, float(pev(attacker, pev_frags) + frags))
- // Set victim deaths
- fm_cs_set_user_deaths(victim, cs_get_user_deaths(victim) + deaths)
- // Update scoreboard with attacker and victim info
- if (scoreboard)
- {
- message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"))
- write_byte(attacker) // id
- write_short(pev(attacker, pev_frags)) // frags
- write_short(cs_get_user_deaths(attacker)) // deaths
- write_short(0) // class?
- write_short(fm_cs_get_user_team(attacker)) // team
- message_end()
- message_begin(MSG_BROADCAST, get_user_msgid("ScoreInfo"))
- write_byte(victim) // id
- write_short(pev(victim, pev_frags)) // frags
- write_short(cs_get_user_deaths(victim)) // deaths
- write_short(0) // class?
- write_short(fm_cs_get_user_team(victim)) // team
- message_end()
- }
- }
- stock fm_cs_get_user_team(id)
- {
- return get_pdata_int(id, 114, 5);
- }
- stock fm_cs_set_user_deaths ( id, value )
- {
- set_pdata_int ( id, 444, value, 5 );
- }
- stock fm_cs_set_user_team ( id, team )
- {
- set_pdata_int ( id, 114, team, 5 );
- }
- 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_default, "^4[Zombie Outstanding]^1 You can't plant mines for some reasons...");
- return 0;
- }
- if (g_iPlanting[iPlayer] || g_iRemoving[iPlayer])
- {
- return 0;
- }
- if ( g_iPlantedMines [iPlayer] > 1 )
- {
- client_print_color ( iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You can plant only^3 2^1 mines.");
- return PLUGIN_HANDLED;
- }
- if (CanPlant(iPlayer))
- {
- g_iPlanting[iPlayer] = 1;
- message_begin( MSG_ONE_UNRELIABLE, 108, _, iPlayer );
- write_byte( 1 );
- write_byte( 0 );
- message_end( );
- set_task( 1.2, "Func_Plant", iPlayer + TASK_CREATE );
- }
- }
- 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_default, "^4[Zombie Outstanding]^1 You can't take mines for some reasons...");
- return 0;
- }
- if (g_iPlanting[iPlayer] || g_iRemoving[iPlayer])
- {
- return 0;
- }
- if (CanTake(iPlayer))
- {
- g_iRemoving[iPlayer] = 1;
- message_begin( MSG_ONE_UNRELIABLE, 108, _, iPlayer );
- write_byte( 1 );
- write_byte( 0 );
- message_end( );
- set_task( 1.2, "Func_Take", iPlayer + TASK_REMOVE );
- }
- }
- return 0;
- }
- public Func_Take(iPlayer)
- {
- iPlayer -= TASK_REMOVE;
- g_iRemoving[ iPlayer ] = false;
- static iEntity, szClassName[ 32 ], Float: flOwnerOrigin[ 3 ], Float: flEntityOrigin[ 3 ];
- for( iEntity = 0; iEntity < MAX_ENTITIES + 1; iEntity++ )
- {
- if( !is_valid_ent( iEntity ) )
- continue;
- szClassName[ 0 ] = '^0';
- entity_get_classname( iEntity, szClassName );
- if( equal( szClassName, MINE_CLASSNAME ) )
- {
- if( entity_get_owner( iEntity ) == iPlayer )
- {
- entity_get_vector( iPlayer, EV_VEC_origin, flOwnerOrigin );
- entity_get_vector( iEntity, EV_VEC_origin, flEntityOrigin );
- if( get_distance_f( flOwnerOrigin, flEntityOrigin ) < 55.0 )
- {
- g_iPlantedMines[ iPlayer ]--;
- g_iTripMines[ iPlayer ]++;
- remove_entity( iEntity );
- break;
- }
- }
- }
- }
- }
- public bool: CanTake( iPlayer )
- {
- static iEntity, szClassName[ 32 ], Float: flOwnerOrigin[ 3 ], Float: flEntityOrigin[ 3 ];
- for( iEntity = 0; iEntity < MAX_ENTITIES + 1; iEntity++ )
- {
- if( !is_valid_ent( iEntity ) )
- continue;
- szClassName[ 0 ] = '^0';
- entity_get_classname( iEntity, szClassName );
- if( equal( szClassName, MINE_CLASSNAME ) )
- {
- if( entity_get_owner( iEntity ) == iPlayer )
- {
- entity_get_vector( iPlayer, EV_VEC_origin, flOwnerOrigin );
- entity_get_vector( iEntity, EV_VEC_origin, flEntityOrigin );
- if( get_distance_f( flOwnerOrigin, flEntityOrigin ) < 55.0 )
- return true;
- }
- }
- }
- return false;
- }
- public bool: CanPlant( iPlayer )
- {
- static Float: flOrigin[ 3 ];
- entity_get_vector( iPlayer, EV_VEC_origin, flOrigin );
- static Float: flTraceDirection[ 3 ], Float: flTraceEnd[ 3 ], Float: flTraceResult[ 3 ], Float: flNormal[ 3 ];
- velocity_by_aim( iPlayer, 64, flTraceDirection );
- flTraceEnd[ 0 ] = flTraceDirection[ 0 ] + flOrigin[ 0 ];
- flTraceEnd[ 1 ] = flTraceDirection[ 1 ] + flOrigin[ 1 ];
- flTraceEnd[ 2 ] = flTraceDirection[ 2 ] + flOrigin[ 2 ];
- static Float: flFraction, iTr;
- iTr = 0;
- engfunc( EngFunc_TraceLine, flOrigin, flTraceEnd, 0, iPlayer, iTr );
- get_tr2( iTr, TR_vecEndPos, flTraceResult );
- get_tr2( iTr, TR_vecPlaneNormal, flNormal );
- get_tr2( iTr, TR_flFraction, flFraction );
- if( flFraction >= 1.0 )
- {
- client_print_color ( iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You must plant the^3 mine^1 on a wall!" );
- return false;
- }
- return true;
- }
- public Func_Plant( iPlayer )
- {
- iPlayer -= TASK_CREATE;
- g_iPlanting[ iPlayer ] = false;
- static Float: flOrigin[ 3 ];
- entity_get_vector( iPlayer, EV_VEC_origin, flOrigin );
- static Float: flTraceDirection[ 3 ], Float: flTraceEnd[ 3 ], Float: flTraceResult[ 3 ], Float: flNormal[ 3 ];
- velocity_by_aim( iPlayer, 128, flTraceDirection );
- flTraceEnd[ 0 ] = flTraceDirection[ 0 ] + flOrigin[ 0 ];
- flTraceEnd[ 1 ] = flTraceDirection[ 1 ] + flOrigin[ 1 ];
- flTraceEnd[ 2 ] = flTraceDirection[ 2 ] + flOrigin[ 2 ];
- static Float: flFraction, iTr;
- iTr = 0;
- engfunc( EngFunc_TraceLine, flOrigin, flTraceEnd, 0, iPlayer, iTr );
- get_tr2( iTr, TR_vecEndPos, flTraceResult );
- get_tr2( iTr, TR_vecPlaneNormal, flNormal );
- get_tr2( iTr, TR_flFraction, flFraction );
- static iEntity;
- iEntity = create_entity( "info_target" );
- if( !iEntity )
- return;
- entity_set_string( iEntity, EV_SZ_classname, MINE_CLASSNAME );
- entity_set_model( iEntity, MINE_MODEL_VIEW );
- entity_set_size( iEntity, Float: { -4.0, -4.0, -4.0 }, Float: { 4.0, 4.0, 4.0 } );
- entity_set_int( iEntity, EV_INT_iuser2, iPlayer );
- g_iPlantedMines[ iPlayer ]++;
- set_pev( iEntity, pev_iuser3, g_iPlantedMines[ iPlayer ] );
- entity_set_float( iEntity, EV_FL_frame, 0.0 );
- entity_set_float( iEntity, EV_FL_framerate, 0.0 );
- entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_FLY );
- entity_set_int( iEntity, EV_INT_solid, SOLID_NOT );
- entity_set_int( iEntity, EV_INT_body, 3 );
- entity_set_int( iEntity, EV_INT_sequence, 7 );
- entity_set_float( iEntity, EV_FL_takedamage, DAMAGE_NO );
- entity_set_int( iEntity, EV_INT_iuser1, MINE_OFF );
- static Float: flNewOrigin[ 3 ], Float: flEntAngles[ 3 ];
- flNewOrigin[ 0 ] = flTraceResult[ 0 ] + ( flNormal[ 0 ] * 8.0 );
- flNewOrigin[ 1 ] = flTraceResult[ 1 ] + ( flNormal[ 1 ] * 8.0 );
- flNewOrigin[ 2 ] = flTraceResult[ 2 ] + ( flNormal[ 2 ] * 8.0 );
- entity_set_origin( iEntity, flNewOrigin );
- vector_to_angle( flNormal, flEntAngles );
- entity_set_vector( iEntity, EV_VEC_angles, flEntAngles );
- flEntAngles[ 0 ] *= -1.0;
- flEntAngles[ 1 ] *= -1.0;
- flEntAngles[ 2 ] *= -1.0;
- entity_set_vector( iEntity, EV_VEC_v_angle, flEntAngles );
- g_iTripMines[ iPlayer ]--;
- emit_sound( iEntity, CHAN_WEAPON, MINE_SOUND_DEPLOY, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
- emit_sound( iEntity, CHAN_VOICE, MINE_SOUND_CHARGE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
- entity_set_float( iEntity, EV_FL_nextthink, get_gametime( ) + 0.6 );
- }
- public Func_RemoveMinesByOwner( iPlayer )
- {
- static iEntity, szClassName[ 32 ];
- for( iEntity = 0; iEntity < MAX_ENTITIES + 1; iEntity++ )
- {
- if( !is_valid_ent( iEntity ) )
- continue;
- szClassName[ 0 ] = '^0';
- entity_get_classname( iEntity, szClassName );
- if( equal( szClassName, MINE_CLASSNAME ) )
- if( entity_get_int( iEntity, EV_INT_iuser2 ) == iPlayer )
- remove_entity( iEntity );
- }
- }
- public Forward_Think( iEntity )
- {
- static Float: flGameTime, iStatus;
- flGameTime = get_gametime( );
- iStatus = entity_get_status( iEntity );
- switch( iStatus )
- {
- case MINE_OFF:
- {
- entity_set_int( iEntity, EV_INT_iuser1, MINE_ON );
- entity_set_float( iEntity, EV_FL_takedamage, DAMAGE_YES );
- entity_set_int( iEntity, EV_INT_solid, SOLID_BBOX );
- entity_set_float( iEntity, EV_FL_health, MINE_HEALTH + 1000);
- emit_sound( iEntity, CHAN_VOICE, MINE_SOUND_ACTIVATE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
- }
- case MINE_ON:
- {
- static Float: flHealth;
- flHealth = entity_get_float( iEntity, EV_FL_health );
- if( is_user_alive( entity_get_owner( iEntity ) ) )
- {
- if( pev( iEntity, pev_iuser3 ) == 1 )
- {
- set_hudmessage(10, 255, 200, 0.10, 0.37, 0, 0.10, 0.10, 0.10, 0.10, 18);
- ShowSyncHudMsg(entity_get_owner(iEntity), g_iMineMessage, "First mine's health: %0.0f", flHealth + -1000);
- }
- else
- {
- set_hudmessage(10, 255, 200, 0.10, 0.40, 0, 0.10, 0.10, 0.10, 0.10, 18);
- ShowSyncHudMsg(entity_get_owner(iEntity), g_iSecondMineMessage, "Second mine's health: %0.0f", flHealth + -1000);
- }
- }
- if( flHealth <= 1000)
- {
- Func_Explode( iEntity );
- return FMRES_IGNORED;
- }
- }
- }
- if( is_valid_ent( iEntity ) )
- entity_set_float( iEntity, EV_FL_nextthink, flGameTime + 0.1 );
- return FMRES_IGNORED;
- }
- public client_connect(Client)
- {
- static const Sounds[] = { 12, 16, 17 };
- if (is_user_bot(Client) || is_user_hltv(Client)) return;
- client_cmd(Client, "mp3volume 0.275; mp3 play media/Half-Life%d.mp3", Sounds[random_num(0, 2)]);
- client_cmd(Client, "rate 36000; cl_cmdrate 128; cl_updaterate 128; fps_max 300; fps_override 1; sys_ticrate 9999")
- client_cmd(Client, "cl_crosshair_size small; cl_dynamiccrosshair 0; cl_dlmax 8192")
- }
- BalanceTeams ()
- {
- static iPlayersNum;
- iPlayersNum = fnGetPlaying ( );
- if ( iPlayersNum < 1 ) return;
- static iTerrors, iMaxTerrors, id, Team [33];
- iMaxTerrors = iPlayersNum / 2;
- iTerrors = 0;
- for ( id = 1; id <= g_iMaxClients; id ++ )
- {
- if ( !g_bConnected [id] ) continue;
- Team [id] = fm_cs_get_user_team ( id );
- if ( Team [id] == FM_CS_TEAM_SPECTATOR || Team [id] == FM_CS_TEAM_UNASSIGNED ) continue;
- fm_cs_set_user_team ( id, FM_CS_TEAM_CT );
- Team [id] = FM_CS_TEAM_CT;
- }
- while ( iTerrors < iMaxTerrors )
- {
- if ( ++ id > g_iMaxClients ) id = 1;
- if ( !g_bConnected [id] ) continue;
- if ( Team [id] != FM_CS_TEAM_CT ) continue;
- if ( random_num ( 0, 1 ) )
- {
- fm_cs_set_user_team ( id, FM_CS_TEAM_T );
- Team [id] = FM_CS_TEAM_T;
- iTerrors ++;
- }
- }
- }
- fnGetPlaying ( )
- {
- static iPlaying, id, Team
- iPlaying = 0
- for ( id = 1; id <= g_iMaxClients; id ++ )
- {
- if ( g_bConnected [id] )
- {
- Team = fm_cs_get_user_team ( id );
- if ( Team != FM_CS_TEAM_SPECTATOR && Team != FM_CS_TEAM_UNASSIGNED )
- iPlaying ++;
- }
- }
- return iPlaying;
- }
Add Comment
Please, Sign In to add comment