Vand sma-ul de la Base Builder 7.2

Aici poti publica orice legat de vanzari/cumparari (inclusiv dispunerea unui calculator ca server)

*Nu suntem responsabili in nici un fel de tranzactiile efectuate prin intermediul acestui forum. Utilizatorii sunt sfatuiti sa-si ia maximul de precautii inainte de finalizarea unei tranzactii pentru a preveni posibilitatea unei inselaciuni.

Moderators: Moderatori ajutatori, Moderatori

Post Reply
User avatar
paqus4s
Membru, skill +3
Membru, skill +3
Posts: 1159
Joined: 03 Jan 2011, 16:58
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (o luna)
Fost moderator ajutator
Has thanked: 44 times
Been thanked: 82 times
Contact:

07 Jul 2012, 15:30

tenlimba wrote:Vand sma-ul de la BaseBuilder 7.2 Go cu ofertele.

Oferte care le primesc:
-> Scripter care sa ma ajute cu 3 pluginuri.
->Steam.
->3 euro vodafon.
Ce fel de pluginuri?
Lasa-mi PM.
Un server care nu stie ce-i ala boost! ONLINE DE 4 ANI!
Image
Image
User avatar
GamingWorld
Membru eXtream
Membru eXtream
Posts: 2200
Joined: 08 Mar 2012, 00:18
Detinator Steam: Da
CS Status: PHP GOD
Detinator server CS: Da
SteamID: legend_xpc
Reputatie: Membru Club eXtreamCS (8 luni)
Location: Bucuresti
Has thanked: 23 times
Been thanked: 35 times
Contact:

07 Jul 2012, 17:39

paqus4s wrote:
tenlimba wrote:Vand sma-ul de la BaseBuilder 7.2 Go cu ofertele.

Oferte care le primesc:
-> Scripter care sa ma ajute cu 3 pluginuri.
->Steam.
->3 euro vodafon.
Ce fel de pluginuri?
Lasa-mi PM.
Pentru a-l contacta pe userul GamingWorld poti trimite un PM accesand direct profilul meu .
De altfel puteti sa ma gasiti si pe ImageBlog & si ImageYoutube !!
User avatar
Andrei I.
Membru, skill +3
Membru, skill +3
Posts: 1288
Joined: 12 Jan 2012, 14:24
Detinator Steam: Da
CS Status: badass
Detinator server CS: RS.FRAGWAY.RO
SteamID: nisq4vibe
Reputatie: Ban 3 luni !
Location: Florence
Has thanked: 14 times
Been thanked: 41 times
Contact:

07 Jul 2012, 21:24

paqus4s wrote:
tenlimba wrote:Vand sma-ul de la BaseBuilder 7.2 Go cu ofertele.

Oferte care le primesc:
-> Scripter care sa ma ajute cu 3 pluginuri.
->Steam.
->3 euro vodafon.
Ce fel de pluginuri?
Lasa-mi PM.
Community forums - Ne rezervam dreptul de a alege membrii.
User avatar
MeRCeNaRyZoMbLeSs
Membru, skill +1
Membru, skill +1
Posts: 269
Joined: 03 Jun 2012, 07:35
Detinator Steam: Nu
CS Status: every day , every night i`m busy ....
Detinator server CS: Zp.XqS.Ro
SteamID: Nu folosesc
Reputatie: Ban 3 luni
Has thanked: 13 times
Been thanked: 10 times
Contact:

07 Jul 2012, 23:34

Have Fun !
| Afiseaza codul
/* 
Base Builder Zombie Mod 
By: Collin "Tirant" Smith 
  
Code Contents 
[0001] - CSDM-Style WPN Menu 
[0002] - Achievements 
[0003] - Auto Join on Connect 
[0004] - Entity Mover 
[0005] - Player Models 
[0006] - Status Text 
[0007] - Unlocks\Upgrades 
[0008] - Black Market 
[0009] - Membership 
*/ 
  
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 
#include <fakemeta> 
#include <engine> 
#include <hamsandwich> 
#include <fun> 
#include <nvault> 
#include <csstats> 
#include <csx> 
#include <xs> 
  
#define g_HeadlessCVAR 13 
  
// Plugin Version 
new VERSION[]="7.2" 
new formatmodname[] = "^x01 [^x04 Base Builder^x01 ]" 
  
//Models 
new const g_ZombieModel1[] = "classic3" 
new const g_ZombieModel2[] = "fast1" 
new const g_ZombieModel3[] = "crispy1" 
  
//Shield 
new ShieldView[] = "models/basebuilder/v_riotshield.mdl" 
new ShieldPlayer[] = "models/basebuilder/p_riotshield2.mdl" 
  
//Sounds 
new g_RoundStart[] = "basebuilder/round_start.wav" 
new g_RoundStart2[] = "basebuilder/round_start2.wav" 
new g_JoinServer[] = "sourcevote/welcome.mp3" 
new g_ZombKill1[] = "basebuilder/zombie_kill1.wav" 
new g_ZombHeadless[] = "basebuilder/zombie_headless.wav" 
new g_Concussion[] = "basebuilder/concussion_explode.mp3" 
  
new g_AchivementEarned[] = "basebuilder/achievement.wav" 
new g_UpgradeMenuBuy[] = "events/enemy_died.wav" 
new g_UnlockMenuBuy[] = "weapons/sshell1.wav" 
new g_ItemMenuBuy[] = "items/smallmedkit1.wav" 
//new g_InvalidMenuBuy[] = "ambience/warn2.wav" 
new g_ResetAchievements[] = "events/task_complete.wav" 
  
new g_WinZomb[] = "basebuilder/zombies_win.wav" 
new g_WinHum[] = "basebuilder/humans_win.wav" 
  
#define BUILD_TASK 10000 
#define MODELSET_TASK 20000 
#define REGEN_TASK 30000 
#define OMA_TASK 32500 
#define CHANCE_TASK 40000 
#define TOUCHING_TASK 50000 
#define CONCUSSION_TASK 60000 
  
#define AMMO_SLOT 376 
#define MODELCHANGE_DELAY 0.5 
#define MAXENTS 1365 
#define AUTO_TEAM_JOIN_DELAY 0.1 
#define TEAM_SELECT_VGUI_MENU_ID 2 
  
#define PA_LOW  100.0//25 
#define PA_HIGH 200.0//50 
  
        #define MAX_ACHIEVEMENTS 21 
        
        #define ACHIEVE_ZKILLS          0 
        #define ACHIEVE_HKILLS          1 
        #define ACHIEVE_OBJMOVED        2 
        #define ACHIEVE_HEADSHOTS       3 
        #define ACHIEVE_CONNECTS        4 
        #define ACHIEVE_KILLEDBY        5 
        #define ACHIEVE_CLUBDREAD       6 
        #define ACHIEVE_KNIFEZOMBIE     7 
        #define ACHIEVE_HITMAN          8 
        #define ACHIEVE_INVIS           9 
        #define ACHIEVE_RAMBO           10 
        #define ACHIEVE_WAR             11 
        #define ACHIEVE_ARMS            12 
        #define ACHIEVE_BANK            13 
        #define ACHIEVE_HUNT            14 
        #define ACHIEVE_HP              15 
        #define ACHIEVE_AP              16 
        #define ACHIEVE_GR              17 
        #define ACHIEVE_IN              18 
        #define ACHIEVE_MERC            19 
        #define ACHIEVE_SP              20 
        
        #define LEVEL_NONE              0 
        #define LEVEL_I                 1 
  
#define AFTER_BUILD ADMIN_LEVEL_A 
#define DEAD_BUILD ADMIN_LEVEL_B 
#define REMOVE_BLOCK ADMIN_LEVEL_C 
#define DEAD_REMOVE ADMIN_LEVEL_D 
#define LOCK_BLOCKS ADMIN_LEVEL_E 
#define PAIN_SHOCK_FREE ADMIN_KICK 
#define BAD_SPAWN ADMIN_KICK 
#define BUILD_BAN ADMIN_KICK 
#define REVIVE ADMIN_BAN 
#define SWAP ADMIN_KICK 
#define START_ROUND ADMIN_BAN 
#define RESET ADMIN_BAN 
#define MEMBERSHIP ADMIN_LEVEL_E 
#define GIVE_CREDITS ADMIN_CVAR 
#define INFECT ADMIN_BAN 
#define ADMIN_GUNS ADMIN_KICK 
#define ADMIN_RESET ADMIN_BAN 
  
#define NO_RECOIL_WEAPONS_BITSUM  ( 1 << CSW_KNIFE | 1 << CSW_HEGRENADE | 1 << CSW_FLASHBANG | 1 << CSW_SMOKEGRENADE | 1 << CSW_C4 | 1 << CSW_SCOUT | 1 << CSW_AWP | 1 << CSW_M249 ) 
  
#if cellbits == 32 
    #define OFFSET_BUYZONE 235 
#else 
    #define OFFSET_BUYZONE 268 
#endif 
  
#define RELOAD_RATIO 0.66 
  
#define LockBlock(%1)     ( entity_set_int( %1, EV_INT_iuser1, 1 ) ) 
#define UnlockBlock(%1)   ( entity_set_int( %1, EV_INT_iuser1, 0 ) ) 
#define IsBlockLocked(%1) ( entity_get_int( %1, EV_INT_iuser1 ) == 1 ) 
  
new const Float:g_Color[24][3] = 
{ 
        {200.0, 000.0, 000.0}, 
        {255.0, 083.0, 073.0}, 
        {255.0, 117.0, 056.0}, 
        {255.0, 174.0, 066.0}, 
        {255.0, 207.0, 171.0}, 
        {252.0, 232.0, 131.0}, 
        {254.0, 254.0, 034.0}, 
        {059.0, 176.0, 143.0}, 
        {197.0, 227.0, 132.0}, 
        {000.0, 150.0, 000.0}, 
        {120.0, 219.0, 226.0}, 
        {135.0, 206.0, 235.0}, 
        {128.0, 218.0, 235.0}, 
        {000.0, 000.0, 255.0}, 
        {146.0, 110.0, 174.0}, 
        {255.0, 105.0, 180.0}, 
        {246.0, 100.0, 175.0}, 
        {205.0, 074.0, 076.0}, 
        {250.0, 167.0, 108.0}, 
        {234.0, 126.0, 093.0}, 
        {180.0, 103.0, 077.0}, 
        {149.0, 145.0, 140.0}, 
        {000.0, 000.0, 000.0}, 
        {255.0, 255.0, 255.0} 
} 
  
new const Float:g_RenderColor[27] = 
{ 
        100.0, //Red 
        135.0, //Red Orange 
        140.0, //Orange 
        120.0, //Yellow Orange 
        140.0, //Peach 
        125.0, //Yellow 
        100.0, //Lemon Yellow 
        125.0, //Jungle Green 
        135.0, //Yellow Green 
        100.0, //Green 
        125.0, //Aquamarine 
        150.0, //Baby Blue 
        090.0, //Sky Blue 
        075.0, //Blue 
        175.0, //Violet 
        150.0, //Hot Pink 
        175.0, //Magenta 
        140.0, //Mahogany 
        140.0, //Tan 
        140.0, //Light Brown 
        165.0, //Brown 
        175.0, //Gray 
        125.0, //Black 
        125.0, //White 
        125.0, //Rainbow 
        175.0, //Textured 
        150.0 //Disco 
} 
  
new const g_ColorName[27][] = 
{ 
        "Red", 
        "Red Orange", 
        "Orange", 
        "Yellow Orange", 
        "Peach", 
        "Yellow", 
        "Lemon Yellow", 
        "Jungle Green", 
        "Yellow Green", 
        "Green", 
        "Aquamarine", 
        "Baby Blue", 
        "Sky Blue", 
        "Blue", 
        "Violet", 
        "Hot Pink", 
        "Magenta", 
        "Mahogany", 
        "Tan", 
        "Light Brown", 
        "Brown", 
        "Gray", 
        "Black", 
        "White", 
        "Rainbow", 
        "Textured", 
        "Disco" 
} 
  
enum 
{ 
        RED = 0, //200, 0, 0 
        REDORANGE, //255, 83, 73 
        ORANGE, //255, 117, 56 
        YELLOWORANGE, //255, 174, 66 
        PEACH, //255, 207, 171 
        YELLOW, //252, 232, 131 
        LEMONYELLOW, //254, 254, 34 
        JUNGLEGREEN, //59, 176, 143 
        YELLOWGREEN, //197, 227, 132 
        GREEN, //0, 200, 0 
        AQUAMARINE, //120, 219, 226 
        BABYBLUE, //135, 206, 235 
        SKYBLUE, //128, 218, 235 
        BLUE, //0, 0, 200 
        VIOLET, //146, 110, 174 
        PINK, //255, 105, 180 
        MAGENTA, //246, 100, 175 
        MAHOGANY, //205, 74, 76 
        TAN, //250, 167, 108 
        LIGHTBROWN, //234, 126, 93 
        BROWN, //180, 103, 77 
        GRAY, //149, 145, 140 
        BLACK, //0, 0, 0 
        WHITE, //255, 255, 255 
        RAINBOW, 
        TEXTURED, 
        DISCO 
} 
new g_pColor[33] = RED 
new g_pColorHolder[33] = RED 
new g_pColorChk[33] = 0 
  
enum 
{ 
        MODEL_HEAD = 0, 
        MODEL_HEADLESS 
} 
  
new bool:g_Headless[33] 
new g_HSCounter[33] 
new g_MaxHS[33] 
  
new Float:g_maxs[3] = {-4800.0,-4800.0,-4800.0} 
new Float:g_mins[3] = {4800.0,4800.0,4800.0} 
new I_max[3] 
new I_min[3] 
  
// CS Weapon CBase Offsets (win32) 
const OFFSET_WEAPONOWNER = 41 
  
// Linux diff's 
const OFFSET_LINUX_WEAPONS = 4 
  
new gmsgStatusText, gmsgSayText, gmsgScreenFade, gmsgScreenShake 
new gHudSyncInfo 
new g_MaxPlayers 
const fPainShock = 108 
  
new bool:g_CanBuild 
new bool:g_ZombiesReleased 
new g_RoundNum 
new g_iEntBarrier 
new Float: g_fBarrierOrigin[3] 
new bool:g_BuildBan[33] 
new g_pEnt[33], Float:g_pDist[33] 
new Float:g_pOffset[33][3] 
//new Float:g_pRotation[MAXENTS][3] 
new bool:g_MovingEnt[MAXENTS] 
new g_EntMover[MAXENTS] 
new g_LastMover[MAXENTS] 
new g_EntOwner[MAXENTS] 
new bool:g_InvisEnt[MAXENTS] 
//new Float:fEntOrigin[MAXENTS][3] //bugged out on a few maps:( 
new bool:g_Touching[MAXENTS] 
new g_OwnedEnts[33] 
new g_pThirdPerson[33] 
new bool:g_pChance[33] 
new CsTeams:g_pTeam[33], CsTeams:g_pCurTeam[33] 
new Float:g_ReleaseTime 
new bool:g_pWinCredits[33] 
new bool:g_FirstSpawn[33] 
new count_down 
  
//Custom Model Stuff 
new Float:g_ModelsTargetTime, Float:g_RoundStartTime 
new g_HasCustomModel[33], g_PlayerModel[33][32] 
  
new g_ModName[32] 
new g_CurrentWeapon[33] 
new g_PrimaryWeapon[33] 
  
// Allowed weapons for zombies 
const ZOMBIE_ALLOWED_WEAPONS_BITSUM = (1<<CSW_KNIFE)//|(1<<CSW_FLASHBANG)//|(1<<CSW_HEGRENADE) 
  
new g_pcvar_buildtime, g_pcvar_zombiehp, g_pcvar_maxrounds, g_pcvar_basecalc, g_pcvar_resetent, 
        g_pcvar_givenades, g_pcvar_showmovers, g_pcvar_xpmult, g_pcvar_knockback, 
        g_pcvar_entmindist, g_pcvar_entsetdist, g_pcvar_entmaxdist, /*g_pcvar_maxclaimable,*/ 
        g_pcvar_claimable, g_pcvar_discount, g_pcvar_chance, g_pcvar_newplayer,// g_pcvar_entminoffset, 
        /*g_pcvar_headless,*/ g_pcvar_zombiexp, g_pcvar_xprate 
  
new g_BuildTime, g_ZombieHP, g_BaseCalc, g_ResetEnt, g_ShowMovers, g_XPMult, g_KnockBack, Float: g_EntMinDist, 
        Float: g_EntSetDist, Float: g_EntMaxDist, /*g_MaxClaimable,*/ g_Claimable, Float: g_Discount, g_Chance, g_NewPlayer, 
        /*g_HeadlessCVAR, */g_ZombieXP, Float: g_XPRate 
        
new g_pcvar_roundtime, Float:g_SurviveTime 
        
new g_Vault 
new g_pcvar_unhpcost, g_pcvar_unapcost, g_pcvar_ungrcost, g_pcvar_unincost, g_pcvar_unspcost 
new g_pcvar_unhpmult, g_pcvar_unapmult, g_pcvar_ungrmult, g_pcvar_uninmult, g_pcvar_unspmult 
new g_pcvar_idmg1cost, g_pcvar_idmg2cost, g_pcvar_ireccost, g_pcvar_iregcost, g_pcvar_irelcost, 
        g_pcvar_ihelcost, g_pcvar_isticost, g_pcvar_iconcost, g_pcvar_ishicost, g_pcvar_iomacost 
new g_pcvar_timesti, g_pcvar_timeoma 
new g_pHPCost[33], g_pAPCost[33], g_pGRCost[33], g_pINCost[33], g_pSPCost[33] 
new bool:g_isconcussioned[33] 
  
//Achievements 
new numofachieve[33] 
new g_PlayerAchievements[33][MAX_ACHIEVEMENTS] 
new zombiekills[33], humankills[33], objectsmoved[33], headshots[33], connects[33], killedby[33], clubdread[33], 
        Float: totaldamage[33], pistolonly[33], invisibleman[33], weaponsbought[33], hasplayed[33] 
new credits[33], g_unHPLevel[33], g_unAPLevel[33], g_unGRLevel[33], g_unINLevel[33], g_unSPLevel[33] 
new bool:has_used_pistol[33] 
  
//Item Stuff 
const NOCLIP_WPN_BS    = ((1<<2)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4)) 
const SHOTGUNS_BS    = ((1<<CSW_M3)|(1<<CSW_XM1014)) 
  
// weapons offsets 
const m_pPlayer                 = 41 
const m_iId                             = 43 
const m_flNextPrimaryAttack             = 46 
const m_flNextSecondaryAttack           = 47 
const m_flTimeWeaponIdle                = 48 
const m_iPrimaryAmmoType        = 49 
const m_iClip                   = 51 
const m_fInReload               = 54 
  
const m_flNextAttack = 83 
const m_pActiveItem = 373 
const m_rgAmmo_Slot0 = 376 
  
stock const Float:g_fDelay[CSW_P90+1] = { 
        0.00, 2.70, 0.00, 2.00, 0.00, 0.55,   0.00, 3.15, 3.30, 0.00, 4.50, 
         2.70, 3.50, 3.35, 2.45, 3.30,   2.70, 2.20, 2.50, 2.63, 4.70, 
         0.55, 3.05, 2.12, 3.50, 0.00,   2.20, 3.00, 2.45, 0.00, 3.40 
} 
  
stock const g_iReloadAnims[CSW_P90+1] = { 
        -1,  5, -1, 3, -1,  6,   -1, 1, 1, -1, 14, 
        4,  2, 3,  1,  1,   13, 7, 4,  1,  3, 
        6, 11, 1,  3, -1,    4, 1, 1, -1,  1} 
  
stock const g_iDftMaxClip[CSW_P90+1] = { 
        -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} 
  
//Guns menu 
new g_galil[33],g_aug[33],g_m4a1[33],g_famas[33],g_ak47[33], 
        g_tmp[33],g_mp5[33],g_ump[33],g_p90[33], 
        g_m3[33],g_xm1014[33],g_scout[33],g_awp[33],g_para[33], 
        g_p228[33],g_five[33],g_elite[33],g_glock[33],g_deagle[33] 
        
new g_itemsbought[33], bool:g_item_dmg[33], bool:g_item_gdmg[33], bool:g_item_rec[33], bool:g_item_reg[33], 
        bool:g_item_rel[33], bool:g_item_hel[33], bool:g_item_sti[33], bool:g_item_si[33], bool:g_item_oma[33] 
new Float:MaxHP[33] 
new Float:cl_pushangle[33][3] 
  
new g_AuthID[33][35] 
  
new g_friend[33] 
  
//Cached Stuff for Players 
new g_isconnected[33] 
new g_isalive[33] 
new g_isbot[33] 
new g_iszombie[33] 
  
//CSDM-Style Weapons Menu 
new bool:firsttime[33] 
new weapon_picked[2][33] 
  
#define ADMIN_CLOCK ADMIN_MENU 
#define MAIN_MENU_KEYS (1<<0)|(1<<1)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<9) 
#define WPN_METH_KEYS (1<<0)|(1<<1) 
#define WPN_PRI1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<9) 
#define WPN_PRI2 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<8)|(1<<9) 
#define WPN_PRI3 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<8) 
#define WPN_SEC  (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7) 
#define UPGRADES_KEYS (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<9) 
#define UN_MAIN (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<9) 
#define UN_PRI1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<8)|(1<<9) 
#define UN_PRI2 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<8)|(1<<9) 
#define UN_PRI3 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<8)|(1<<9) 
#define UN_SEC  (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<8)|(1<<9) 
#define IT_MAIN (1<<0)|(1<<1)|(1<<2)|(1<<9) 
#define IT_MOD  (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<8)|(1<<9) 
#define IT_ITE  (1<<0)|(1<<1)|(1<<2)|(1<<8)|(1<<9) 
#define IT_BUFF (1<<0)|(1<<1)|(1<<8)|(1<<9) 
  
enum { N1, N2, N3, N4, N5, N6, N7, N8, N9, N0 }; 
new const X = 0; 
new const Y = 1; 
new const Z = 2;                        //for some reason I got tag mismatch on Z when using an enum 
  
new gszMainMenuText[256]; 
new const gszClockFaces[] = "sprites/build_clock.spr"; 
new const gszClockDigits[] = "sprites/build_digits.spr"; 
new const gszPrefix[] = "[ Build Time ] "; 
new const gszInfoTarget[] = "info_target"; 
new const gszClockClassname[] = "cm_clock"; 
new const gszClockDigitClassname[] = "cm_clockdigit"; 
new const Float:gfDigitOffsetMultipliers[4] = {0.725, 0.275, 0.3, 0.75}; 
new const Float:gfClockSize[2] = {80.0, 32.0}; 
new const Float:gfTitleSize = 16.0; 
  
new gszTime[5]; 
new gszFile[128]; 
new gTimeOffsetOld; 
new gHourTypeOld; 
  
const gClockTypesMax = 2; 
  
enum 
{ 
        CM_SERVERTIME, 
        CM_BUILDTIMELEFT 
}; 
  
new gClockSaveIds[gClockTypesMax] = 
{ 
        'C', 'T' 
}; 
  
new const ACHIEVEMENTS[MAX_ACHIEVEMENTS][2][]= 
{ 
        { "","Zombie Genocidist"}, // Kills as a human 
        { "","Hmm... Tasty"}, // Kills as a zombie 
        { "","Base Builder"}, // Total # objects moved 
        { "","Cr0wned"}, // Total # objects moved 
        { "","One inch at a time"}, // Total # of connections 
        { "","Infected"}, // Killed by person with this 
        { "","Guns are for girls"}, // Kill a zombie with a knife 
        { "","Dead Wreckening"}, // Deal out 1000 damage as a zombie 
        { "","Hitman"}, // Survive a round /w only pistols 
        { "","I see you!"}, // Kill an invisible man 
        { "","Rambo"}, // Unlock the M249-SAW 
        { "","War Machine"}, // Unlock all of the guns in the game 
        { "","Arms Dealer"}, // Unlock half of the guns in the game 
        { "","Break the Bank"}, // Accumulate 5000 credits without spending any 
        { "","Achievement Hunter"}, // Unlock all of the achievements in the game 
        { "","Juggernaut"}, // Upgrade to the max health level 
        { "","Solid Steel"}, // Upgrade to the max armor level 
        { "","Zero Gravity"}, // Upgrade to the max gravity level 
        { "","The Invisible Man"}, // Upgrade to the max invisibility level 
        { "","Underground Trader"}, // Purchase 10 items from the Black Market 
        { "","Speed Demon"} // Upgrade to the max speed level 
} 
  
// Weapon entity names 
new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10", 
                        "weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550", 
                        "weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249", 
                        "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552", 
                        "weapon_ak47", "weapon_knife", "weapon_p90" } 
  
public plugin_init() 
{ 
        new ip[32] 
        get_user_ip ( 0, ip, charsmax(ip), 1 ) 
        if (!equal(ip, "68.232.164.155") && !equal(ip, "192.168.1.65") && !equal(ip, "192.168.1.91") && !equal(ip, "66.151.138.204")) 
        { 
                return set_fail_state("Illegal IP detected. Fuck off. -Tirant"); 
        } 
        
        //Client Commands 
        register_clcmd("+grab","cmdMoveEnt")                                                    //command to move stuff around 
        register_clcmd("-grab","cmdStopEnt")                                                    //command to move stuff around 
        
        register_clcmd("say", "cmdSay",0, "<target> ") 
        register_clcmd("say_team", "cmdSay",0, "<target> ") 
  
        //Admin Commands 
        register_concmd("removeaim","cmdRemoveEnt",0," - Deletes an object")                    //Removes an object (C alive, D dead) 
        register_concmd("lockaim","cmdLockBlock",0," - Locks/Unlocks an object form moving") 
        register_concmd("unclaimaim","cmdRemoveClaim",0," - Removes a claim on an object")      //Makes block claimable by everyone 
        register_concmd("resetaim","cmdResetAim",0," - Resets an object") 
        
        register_concmd("bb_addcredits","cmdGiveCredits",0," <name or #userid> <credits>") 
        register_concmd("bb_infectme", "cmdInfectMe",0, "Infects you!") 
        register_concmd("bb_addach", "cmdAddAchievement",0, "<player> <achievement#> <level#>") 
        register_concmd("bb_buildban","cmdBuildBan",0,"<player>")                               //Bans targeted player from building 
        register_concmd("bb_unbuildban","cmdBuildUnban",0,"<player>")                           //Unbans   "       "     "     " 
        register_concmd("bb_revive","cmdRevive",0,"<player>") 
        register_concmd("bb_guns","cmdGiveGuns",0,"<player>")                                   //revives targetted player 
        register_concmd("bb_swap","cmdSwap",0,"<player>")                                       //swaps the selected player to the opposite team 
        register_concmd("bb_resetstats","cmdReset",0,"<player>")                                //swaps the selected player to the opposite team 
        register_concmd("bb_startround","cmdStartRound",0," - Ends the build phase")            //do i really have to explain this? 
        register_concmd("bb_reset","cmdResetEnts",0," - Resets all entities") 
        register_concmd("bb_clear","cmdClearEnts",0," - Deleted all unused entities") 
        register_concmd("bb_cheat","cmdShield",0,"- ????") 
        
        //Blocked Commands 
        //register_clcmd("drop", "clcmd_drop") 
        register_clcmd("buy", "clcmd_buy") 
        
        register_forward(FM_GetGameDescription, "fw_GetGameDescription") 
        register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue") 
        register_forward(FM_ClientUserInfoChanged, "fw_ClientUserInfoChanged") 
        register_forward(FM_PlayerPreThink, "fw_Player_PreThink") 
        register_forward(FM_ClientKill, "fw_Suicide") 
        if (get_pcvar_num(g_pcvar_showmovers) == 1) 
                register_forward(FM_TraceLine, "fw_Traceline") 
        
        RegisterHam(Ham_Touch, "weapon_shield", "ham_WeaponCleaner_Post", 1) 
        RegisterHam(Ham_Touch, "weaponbox", "ham_WeaponCleaner_Post", 1) 
        RegisterHam(Ham_Touch, "func_wall", "ham_TouchWall_Post", 1) 
        RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn_Post", 1) 
        for (new i = 1; i < sizeof WEAPONENTNAMES; i++) 
                if (WEAPONENTNAMES[0]) RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES, "ham_ItemDeploy_Post", 1) 
        RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage") 
        RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Post", 1) 
        new szWeapon[20]; 
        for (new i=CSW_P228;i<=CSW_P90;i++) 
        {         
                if(!(NO_RECOIL_WEAPONS_BITSUM & (1<<i)) && get_weaponname(i, szWeapon, charsmax(szWeapon))) 
                { 
                        RegisterHam(Ham_Weapon_PrimaryAttack, szWeapon, "fw_PrimaryAttack") 
                        RegisterHam(Ham_Weapon_PrimaryAttack, szWeapon, "fw_PrimaryAttack_Post",1) 
                } 
                if( !(NOCLIP_WPN_BS & (1<<i)) && get_weaponname(i, szWeapon, charsmax(szWeapon)) ) 
                { 
                        if( !(SHOTGUNS_BS & (1<<i)) ) 
                        { 
                                //    RegisterHam(Ham_Weapon_Reload, szWeapon, "Weapon_Reload_Pre") 
                                RegisterHam(Ham_Weapon_Reload, szWeapon, "fw_Reload_Post", 1) 
                        } 
                } 
        } 
        
        register_message(get_user_msgid("TextMsg"), "msgRoundEnd") 
        register_message(get_user_msgid("StatusIcon"), "msgStatusIcon") 
        register_message(get_user_msgid("StatusValue"), "msgStatusValue"); 
        register_message(get_user_msgid("Health"), "msgHealth"); 
        
        register_event("HLTV", "event_round_start", "a", "1=0", "2=0") 
        register_event("AmmoX", "ev_AmmoX", "be", "1=1", "1=2", "1=3", "1=4", "1=5", "1=6", "1=7", "1=8", "1=9", "1=10") 
        register_event("StatusValue", "ev_SetTeam", "be", "1=1"); 
        register_event("StatusValue", "ev_ShowStatus", "be", "1=2", "2!0"); 
        register_event("StatusValue", "ev_HideStatus", "be", "1=1", "2=0"); 
        register_event("Health", "ev_Health", "be", "1>0"); 
        register_event("ScreenFade","ev_Flash","b","4=255","5=255","6=255","7>199") 
        register_event("CurWeapon" , "ev_CurWeapon" , "be" , "1=1"); 
        
        register_logevent("logevent_round_start",2, "1=Round_Start") 
        register_logevent("logevent_round_end", 2, "1=Round_End") 
        
        register_menucmd(register_menuid("WeaponMethodMenu"),WPN_METH_KEYS,"weapon_method_pushed") 
        register_menucmd(register_menuid("PrimaryWeaponSelect1"),WPN_PRI1,"prim_ass_pushed") 
        register_menucmd(register_menuid("PrimaryWeaponSelect2"),WPN_PRI2,"prim_smg_pushed") 
        register_menucmd(register_menuid("PrimaryWeaponSelect3"),WPN_PRI3,"prim_oth_pushed") 
        register_menucmd(register_menuid("SecWeaponSelect"),WPN_SEC,"sec_weapons_pushed") 
        register_menucmd(register_menuid("UpgradesMenuMain"),UPGRADES_KEYS,"upgrades_menu_pressed") 
        register_menucmd(register_menuid("UnlocksMenuMain"),UN_MAIN,"unlocks_menu_pressed") 
        register_menucmd(register_menuid("UnlocksMenuAss"),UN_PRI1,"un_ass_pushed") 
        register_menucmd(register_menuid("UnlocksMenuSub"),UN_PRI2,"un_smg_pushed") 
        register_menucmd(register_menuid("UnlocksMenuOther"),UN_PRI3,"un_oth_pushed") 
        register_menucmd(register_menuid("UnlocksMenuSec"),UN_SEC,"un_sec_pushed") 
        register_menucmd(register_menuid("MarketMenuMain"),IT_MAIN,"market_menu_pressed") 
        register_menucmd(register_menuid("ItemsMenuMain"),IT_MAIN,"market_menu_pressed") 
        register_menucmd(register_menuid("ItemsMenuMod"),IT_MOD,"modifiers_menu_pressed") 
        register_menucmd(register_menuid("ItemsMenuItems"),IT_ITE,"items_menu_pressed") 
        register_menucmd(register_menuid("ItemsMenuBuffs"),IT_BUFF,"buffs_menu_pressed") 
        register_menucmd(register_menuid("clockMainMenu"), MAIN_MENU_KEYS, "handleMainMenu"); 
        register_menucmd(register_menuid("ColorsSelect"),(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9),"colors_pushed") 
        
        set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET) 
        
        //Formats the Mod Name 
        formatex(g_ModName, charsmax(g_ModName), "Base Builder %s", VERSION) 
        
        register_dictionary("credits.txt"); 
        register_dictionary("basebuilder.txt"); 
        
        gmsgSayText = get_user_msgid("SayText") 
        gmsgStatusText = get_user_msgid("StatusText"); 
        gmsgScreenFade = get_user_msgid("ScreenFade"); 
        gmsgScreenShake = get_user_msgid ("ScreenShake") 
        gHudSyncInfo = CreateHudSyncObj(); 
        g_MaxPlayers = get_maxplayers(); 
        
        //server_cmd("sv_skyname dust") 
        server_cmd("mp_freezetime 0") 
        server_cmd("mp_flashlight 0") 
  
        register_clcmd("chooseteam", "clcmd_changeteam") 
        register_clcmd("jointeam", "clcmd_changeteam") 
        register_message(get_user_msgid("ShowMenu"), "message_show_menu") 
        register_message(get_user_msgid("VGUIMenu"), "message_vgui_menu") 
        server_cmd("mp_limitteams 1") 
        server_cmd("mp_autoteambalance 1") 
  
        g_iEntBarrier = find_ent_by_tname( -1, "barrier" ); 
        new Float:mins[3], Float:maxs[3] 
        entity_get_vector(g_iEntBarrier, EV_VEC_mins, mins); 
        entity_get_vector(g_iEntBarrier, EV_VEC_maxs, maxs); 
        g_fBarrierOrigin[0] = (mins[0] + maxs[0]) / 2.0 
        g_fBarrierOrigin[1] = (mins[1] + maxs[1]) / 2.0 
        g_fBarrierOrigin[2] = (mins[2] + maxs[2]) / 2.0 
        
        if (get_pcvar_num(g_pcvar_chance)) 
                set_task(90.0, "MSG_Chance",_, _, _, "b") 
        set_task(1.5,"Task_HPRegenLoop",_,_,_,"b") 
        
        find_minmaxs() 
        
        return PLUGIN_CONTINUE 
} 
  
public plugin_precache() 
{ 
        register_plugin("Base Builder Zombie Mod", VERSION, "Collin ^"Tirant^" Smith") 
        register_cvar("base_builder", VERSION, FCVAR_SPONLY|FCVAR_SERVER) 
        set_cvar_string("base_builder", VERSION) 
  
        //Basic mod functions/timers 
        g_pcvar_buildtime = register_cvar("bb_build_time", "150") 
        g_BuildTime = get_pcvar_num(g_pcvar_buildtime) 
        g_pcvar_zombiehp = register_cvar("bb_zombie_health", "2000") 
        g_ZombieHP = get_pcvar_num(g_pcvar_zombiehp) 
        g_pcvar_basecalc = register_cvar("bb_calc_maxbase", "0") 
        g_BaseCalc = get_pcvar_num(g_pcvar_basecalc) 
        g_pcvar_showmovers = register_cvar("bb_show_moving", "1") 
        g_ShowMovers = get_pcvar_num(g_pcvar_showmovers) 
        g_pcvar_knockback = register_cvar("bb_pain_shock_free", "0") 
        g_KnockBack = get_pcvar_num(g_pcvar_knockback) 
        g_pcvar_entmaxdist = register_cvar("bb_max_move_dist", "960") 
        g_EntMaxDist = get_pcvar_float(g_pcvar_entmaxdist) 
        g_pcvar_entmindist = register_cvar("bb_min_move_dist", "25") 
        g_EntMinDist = get_pcvar_float(g_pcvar_entmindist) 
        g_pcvar_entsetdist = register_cvar("bb_min_dist_set", "50") 
        g_EntSetDist = get_pcvar_float(g_pcvar_entsetdist) 
        g_pcvar_xpmult = register_cvar("bb_xp_multiplier", "1") 
        g_XPMult = get_pcvar_num(g_pcvar_xpmult) 
        g_pcvar_resetent = register_cvar("bb_reset_blocks", "1") 
        g_ResetEnt = get_pcvar_num(g_pcvar_resetent) 
        //g_pcvar_maxclaimable = register_cvar("bb_claim_max", "5") 
        //g_MaxClaimable = get_pcvar_num(g_pcvar_maxclaimable) 
        g_pcvar_claimable = register_cvar("bb_claim_mode", "1") 
        g_Claimable = get_pcvar_num(g_pcvar_claimable) 
  
        g_pcvar_chance = register_cvar("bb_chance", "10") 
        g_Chance = get_pcvar_num(g_pcvar_chance) 
        g_pcvar_newplayer = register_cvar("bb_new_player_credits", "100") 
        g_NewPlayer = get_pcvar_num(g_pcvar_newplayer) 
        //g_pcvar_headless = register_cvar("bb_headless", "13") 
        //g_HeadlessCVAR = get_pcvar_num(g_pcvar_headless) 
        g_pcvar_zombiexp = register_cvar("bb_zombie_xp", "2") 
        g_ZombieXP = get_pcvar_num(g_pcvar_zombiexp) 
        g_pcvar_xprate = register_cvar("bb_reward_rate", "0.1") 
        g_XPRate = get_pcvar_float(g_pcvar_xprate) 
        
        //Credits 
        g_pcvar_discount = register_cvar("bb_member_discount", "0.5") 
        g_Discount = get_pcvar_float(g_pcvar_discount) 
        
        g_pcvar_unhpcost = register_cvar("bb_un_cost_hp", "25") 
        g_pcvar_unapcost = register_cvar("bb_un_cost_dmgred", "15") 
        g_pcvar_ungrcost = register_cvar("bb_un_cost_gravity", "20") 
        g_pcvar_unincost = register_cvar("bb_un_cost_invis", "10") 
        g_pcvar_unspcost = register_cvar("bb_un_cost_speed", "20") 
        
        g_pcvar_unhpmult = register_cvar("bb_un_mult_hp", "5") 
        g_pcvar_unapmult = register_cvar("bb_un_mult_ap", "10") 
        g_pcvar_ungrmult = register_cvar("bb_un_mult_gr", "10") 
        g_pcvar_uninmult = register_cvar("bb_un_mult_in", "7") 
        g_pcvar_unspmult = register_cvar("bb_un_mult_sp", "9") 
        
        g_pcvar_idmg1cost = register_cvar("bb_cost_dmg", "20") 
        g_pcvar_idmg2cost = register_cvar("bb_cost_gdmg", "40") 
        g_pcvar_ireccost = register_cvar("bb_cost_recoil", "50") 
        g_pcvar_iregcost = register_cvar("bb_cost_regen", "30") 
        g_pcvar_irelcost = register_cvar("bb_cost_reload", "50") 
        
        g_pcvar_ihelcost = register_cvar("bb_cost_helmet", "25") 
        g_pcvar_iconcost = register_cvar("bb_cost_concussion", "35") 
        g_pcvar_ishicost = register_cvar("bb_cost_shield", "250") 
  
        g_pcvar_isticost = register_cvar("bb_cost_stimpack", "75") 
        g_pcvar_timesti = register_cvar("bb_time_stimpack", "5") 
        g_pcvar_iomacost = register_cvar("bb_cost_noreloads", "75") 
        g_pcvar_timeoma = register_cvar("bb_time_noreloads", "10") 
        
        //Guns Menu 
        g_pcvar_givenades = register_cvar("bb_give_nades","h") //h f s, put multiple letters for multiple nades 
        
        register_cvar("cm_hourtype", "0");              //0: 12 hour, 1: 24 hour 
        register_cvar("cm_hourannounce", "1");          //say the hour on the hour 
        register_cvar("cm_timeoffset", "-7");           //offset the time to a different timezone +/- hours 
        
        g_pcvar_roundtime = get_cvar_pointer("mp_roundtime") 
        new Float:g_RoundTime = get_pcvar_float(g_pcvar_roundtime)*60.0 
        g_SurviveTime = g_RoundTime-float(g_BuildTime) 
        
        engfunc(EngFunc_PrecacheSound, g_RoundStart) 
        engfunc(EngFunc_PrecacheSound, g_RoundStart2) 
        engfunc(EngFunc_PrecacheSound, g_JoinServer) 
        engfunc(EngFunc_PrecacheSound, g_ZombKill1) 
        engfunc(EngFunc_PrecacheSound, g_ZombHeadless) 
        engfunc(EngFunc_PrecacheSound, g_Concussion) 
        
        engfunc(EngFunc_PrecacheSound, g_AchivementEarned) 
        engfunc(EngFunc_PrecacheSound, g_UpgradeMenuBuy) 
        engfunc(EngFunc_PrecacheSound, g_UnlockMenuBuy) 
        engfunc(EngFunc_PrecacheSound, g_ItemMenuBuy) 
        //engfunc(EngFunc_PrecacheSound, g_InvalidMenuBuy) 
        engfunc(EngFunc_PrecacheSound, g_ResetAchievements) 
        
        engfunc(EngFunc_PrecacheSound, g_WinZomb) 
        engfunc(EngFunc_PrecacheSound, g_WinHum) 
        
        new szModel[64]; 
        formatex(szModel, charsmax(szModel), "models/player/%s/%s.mdl", g_ZombieModel1, g_ZombieModel1 ); 
        engfunc(EngFunc_PrecacheModel, szModel) 
        formatex(szModel, charsmax(szModel), "models/player/%s/%s.mdl", g_ZombieModel2, g_ZombieModel2 ); 
        engfunc(EngFunc_PrecacheModel, szModel) 
        formatex(szModel, charsmax(szModel), "models/player/%s/%s.mdl", g_ZombieModel3, g_ZombieModel3 ); 
        engfunc(EngFunc_PrecacheModel, szModel) 
        
        precache_model(ShieldView) 
        precache_model(ShieldPlayer) 
        
        precache_model("models/rpgrocket.mdl") 
        
        engfunc(EngFunc_PrecacheModel, gszClockFaces) 
        engfunc(EngFunc_PrecacheModel, gszClockDigits) 
        
        new iBomb = create_entity("info_bomb_target"); 
        entity_set_origin(iBomb, Float:{8192.0,8192.0,8192.0}) 
        
        new iBuyZone = create_entity("info_map_parameters"); 
        DispatchKeyValue(iBuyZone, "buying", "3"); 
        DispatchSpawn(iBuyZone); 
        
        g_pcvar_maxrounds = get_cvar_num("mp_maxrounds") 
} 
  
public MSG_Chance() 
{ 
        print_color(0, "%s ^x04%L", formatmodname, LANG_SERVER, "CR_CHANCE_AD", g_Chance) 
} 
  
public cmdInfectMe(id) 
{ 
        if (access(id, INFECT)) 
                killedby[id]=1 
} 
  
// Event Round Start (This is before freeze time) 
public event_round_start() 
{ 
        arrayset(g_MovingEnt, false, MAXENTS) 
        arrayset(g_EntOwner, 0, MAXENTS) 
        arrayset(g_LastMover, 0, MAXENTS) 
        arrayset(g_Touching, false, MAXENTS) 
        arrayset(has_used_pistol, true, 33) 
        arrayset(g_OwnedEnts, 0, 33) 
        arrayset(g_pChance, false, 33) 
        arrayset(g_pWinCredits, false, 33) 
        arrayset(g_Headless, false, 33) 
        arrayset(g_HSCounter, 0, 33) 
  
        g_CanBuild = true 
        g_RoundStartTime = get_gametime() 
        g_ZombiesReleased = false 
        
        if (g_ResetEnt == 1) 
        { 
                new cname[10], tname[7]; 
                for (new iEnt = g_MaxPlayers+1; iEnt < MAXENTS; iEnt++) 
                { 
                        if (is_valid_ent(iEnt)) 
                        { 
                                entity_get_string(iEnt, EV_SZ_classname, cname, 9); 
                                entity_get_string(iEnt, EV_SZ_targetname, tname, 6); 
                                if (!IsBlockLocked(iEnt) && iEnt != g_iEntBarrier && equal(cname, "func_wall") && !equal(tname, "ignore")) 
                                { 
                                        if (g_InvisEnt[iEnt]) 
                                                set_entity_visibility(iEnt, 1) 
                                        /*if (g_InvisEnt[iEnt]) 
                                        { 
                                                set_pev(iEnt,pev_solid,SOLID_BSP) 
                                                set_pev(iEnt,pev_renderamt,Float:{255.0}) 
                                                set_pev(iEnt,pev_rendermode,0) 
                                                g_InvisEnt[iEnt] = false 
                                        }*/ 
                                        engfunc( EngFunc_SetOrigin, iEnt, Float:{ 0.0, 0.0, 0.0 } ); 
                                } 
                        } 
                } 
        } 
} 
  
// Log Event Round Start (This is AFTER freeze time) 
public logevent_round_start() 
{ 
        set_pev(g_iEntBarrier,pev_solid,SOLID_BSP) 
        set_pev(g_iEntBarrier,pev_rendermode,kRenderTransColor) 
        set_pev(g_iEntBarrier,pev_renderamt,Float:{150.0}) 
        
        set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 10.0, 0.1, 0.2, 1) 
        new nLen, szMsg[128] 
        nLen += format( szMsg[nLen], 127-nLen, "%L", LANG_SERVER, "WELCOME_MSG", VERSION); 
        nLen += format( szMsg[nLen], 127-nLen, "%L", LANG_SERVER, "BIND_KEY"); 
        show_hudmessage(0, szMsg); 
        
        print_color(0, "%s^x03 %s ^x04- ^x01%L", formatmodname, VERSION, LANG_SERVER, "ROUND_MSG") 
        print_color(0, "%s^x03 %s ^x04- ^x01%L", formatmodname, VERSION, LANG_SERVER, "CR_ROUND_MSG") 
        print_color(0, "%s^x03 Round:^x04 %d^x01 of^x04 %d", formatmodname, (g_RoundNum+1), g_pcvar_maxrounds) 
        
        remove_task(BUILD_TASK) 
        
        set_task(1.0, "CountDown", BUILD_TASK,_, _, "a", g_BuildTime); 
        count_down = (g_BuildTime-1); 
        
        if (g_BaseCalc == 1) 
                set_task(5.0, "Base_Calc") 
} 
  
public CountDown() 
{ 
        count_down-- 
        new mins = count_down/60 
        new secs = count_down%60 
        if (count_down>=0) 
        { 
                client_print(0, print_center, "Build Time - %d:%s%d", mins, (secs < 10 ? "0" : ""), secs) 
  
                new clock = -1; 
  
                new timeleftDigits[4]; 
                getTimeDigits(CM_BUILDTIMELEFT, timeleftDigits); 
                
                while ((clock = find_ent_by_class(clock, gszClockClassname))) 
                { 
                        new clockType = entity_get_int(clock, EV_INT_groupinfo); 
                        
                        if (clockType == CM_BUILDTIMELEFT) 
                        { 
                                set_clock_digits(clock, timeleftDigits); 
                        } 
                } 
        } 
        
        if ((mins == 1 || mins == 2) && secs == 0) 
        { 
                new mmin[32] 
                num_to_word(mins, mmin, 31) 
                
                client_cmd(0, "spk ^"fvox/%s minutes remaining^"", mmin) 
        } 
        if ((mins == 0) && secs == 30) 
        { 
                new msec[32] 
                num_to_word(secs, msec, 31) 
  
                client_cmd(0, "spk ^"fvox/%s seconds remaining^"",  msec) 
        } 
        if (0<count_down<=10) 
        { 
                new msec[32] 
                num_to_word(count_down, msec, 31) 
                
                client_cmd(0, "spk ^"fvox/%s^"", msec) 
        } 
                
        if (count_down == 0) 
        { 
                Release_Zombies() 
                remove_task(BUILD_TASK); 
        } 
} 
  
public logevent_round_end() 
{ 
        if (!g_CanBuild) 
        { 
                new Float:time = (get_gametime() - g_ReleaseTime) 
                new reward = floatround(time*g_XPRate) 
                        
                new players[32], num, player 
                get_players(players, num, "a") 
                for (new i = 0; i < num; i++) 
                { 
                        player = players 
                        
                        if (g_pCurTeam[player] == CS_TEAM_CT && !g_pChance[player] && !g_pWinCredits[player]) 
                        { 
                                print_color(player, "%s %L", formatmodname, LANG_SERVER, "CR_REWARD_CT", reward, time) 
                                credits[player]+=reward 
                        } 
                } 
                        
                get_players(players, num) 
                for (new i = 0; i < num; i++) 
                { 
                        player = players 
                        
                        if (g_pCurTeam[player] == g_pTeam[player]) 
                                cs_set_user_team(player, (g_pTeam[player] = (g_pTeam[player] == CS_TEAM_T ? CS_TEAM_CT : CS_TEAM_T))) 
                        else 
                                g_pTeam[player] = g_pTeam[player] == CS_TEAM_T ? CS_TEAM_CT : CS_TEAM_T 
                } 
                print_color(0, "^x04%L", LANG_SERVER, "TEAMS_SWAPPED") 
        } 
        
        remove_task(BUILD_TASK) 
                
        return PLUGIN_HANDLED 
} 
  
public client_death(g_attacker, g_victim, wpnindex, hitplace, TK) 
{ 
        if (g_pEnt[g_victim]) 
                cmdStopEnt(g_victim) 
                
        set_hudmessage(_, _, _, _, _, _, _, _, _, _, 4); 
        show_hudmessage(g_victim, ""); 
        remove_task(g_victim+CHANCE_TASK) 
        
        g_isalive[g_victim] = false 
        g_item_si[g_victim] = false 
        g_item_oma[g_victim] = false 
        
        if (TK == 0 && g_attacker != g_victim) 
        { 
                if (!g_isalive[g_victim] && g_iszombie[g_victim] && !g_iszombie[g_attacker]) credits[g_victim]+=1 
                if (!g_iszombie[g_attacker]) 
                { 
                        zombiekills[g_attacker]++ 
                        credits[g_attacker]+=(g_ZombieXP*g_XPMult) 
                        if (wpnindex == CSW_KNIFE) 
                                clubdread[g_attacker]++ 
                        if (g_unINLevel[g_victim]>19) 
                                invisibleman[g_attacker]++ 
                } 
                if (g_iszombie[g_attacker]) 
                { 
                        client_cmd(0, "spk %s", g_ZombKill1) 
                        new playername[35] 
                        get_user_name(g_victim, playername, 34) 
                        set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 5.0, 0.1, 0.2, 1) 
                        show_hudmessage(0, "%L",LANG_SERVER, "DEAD_ANNOUNCE", playername); 
                        humankills[g_attacker]++ 
                        //credits[g_attacker]+=(get_pcvar_num(g_pcvar_humanxp)*g_XPMult) 
                        
                        new reward 
                        if (!g_pChance[g_victim]) 
                        { 
                                new Float:time = (get_gametime() - g_ReleaseTime) 
                                reward =  floatround(time*g_XPRate) 
                                print_color(g_victim, "%s %L", formatmodname, LANG_SERVER, "CR_REWARD_CT", reward) 
                                reward*=2 
                                credits[g_victim]+=reward 
                                g_pWinCredits[g_victim] = true 
                        } 
                        
                        new Float:time = (g_SurviveTime - (get_gametime() - g_ReleaseTime)) 
                        reward =  floatround(time*g_XPRate) 
                        print_color(g_attacker, "%s %L", formatmodname, LANG_SERVER, "CR_REWARD_T", reward) 
                        reward/=2 
                        credits[g_attacker]+=reward 
                } 
                if (hitplace == 1) 
                { 
                        headshots[g_attacker]++ 
                        if (g_iszombie[g_attacker]) 
                                credits[g_attacker]+=(4*g_XPMult) 
                        else 
                                credits[g_attacker]+=(1*g_XPMult) 
                } 
                if (killedby[g_attacker])       
                        killedby[g_victim]++ 
                        
                check_achievements(g_victim); 
                check_achievements(g_attacker); 
                check_banker(g_attacker) 
        } 
        
        if (g_iszombie[g_victim]) 
        { 
                set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 10.0, 0.1, 0.2, 1) 
                show_hudmessage(g_victim, "%L", LANG_SERVER, "CR_DEAD_ZOMBIE"); 
                set_task(2.0, "Respawn_Zombie", g_victim) 
        } 
        if (!g_iszombie[g_victim]) 
        { 
                set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 10.0, 0.1, 0.2, 1) 
                show_hudmessage(g_victim, "%L", LANG_SERVER, "DEAD_SURVIVOR"); 
                if (!g_pChance[g_victim]) print_color(g_victim, "%s %L", formatmodname, LANG_SERVER, "CR_CHANCE_CT_DEAD", g_Chance) 
                cs_set_user_team(g_victim, CS_TEAM_T) 
                g_iszombie[g_victim] = true 
                set_task(5.0, "Respawn_Zombie", g_victim) 
        } 
} 
  
public ham_TakeDamage_Post(victim, inflictor, attacker, Float:damage, bits) 
{ 
        if(g_KnockBack == 1 && access(victim, PAIN_SHOCK_FREE) && g_iszombie[victim]) 
        { 
                set_pdata_float(victim, fPainShock, 1.0, 5) 
        } 
} 
  
  
public ham_TakeDamage(victim, inflictor, attacker, Float:damage, damagebits) 
{ 
        if (!is_valid_ent(victim) || !is_valid_ent(attacker) || !g_isalive[victim] || !g_isconnected[attacker]) return HAM_IGNORED 
        
        if(g_CanBuild || victim == attacker || (g_iszombie[victim] && g_iszombie[attacker]) || g_isconcussioned[attacker]) 
                return HAM_SUPERCEDE 
        
        if (g_iszombie[attacker] && !g_PlayerAchievements[attacker][ACHIEVE_CLUBDREAD]) 
        { 
                totaldamage[attacker] += damage 
                if (totaldamage[attacker]>4999.0) 
                { 
                        switch (g_PlayerAchievements[attacker][ACHIEVE_CLUBDREAD]) 
                        { 
                                case LEVEL_NONE:        
                                { 
                                        g_PlayerAchievements[attacker][ACHIEVE_CLUBDREAD]=LEVEL_I; 
                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                        show_hudmessage(attacker, "%s^nDeal out 5000 total damage as a zombie!^n+50 Credits", ACHIEVEMENTS[ACHIEVE_CLUBDREAD][LEVEL_I]); 
                                        credits[attacker]+=50 
                                        check_banker(attacker) 
                                        client_cmd(attacker, "spk %s", g_AchivementEarned); 
                                        SaveLevel(attacker) 
                                } 
                        }       
                } 
        } 
        
        if (g_item_dmg[attacker] && g_isalive[attacker]) 
        { 
                if (g_item_gdmg[attacker]) 
                        damage*=1.25 
                else 
                        damage*=1.1 
        } 
        
        new hitgroup = get_pdata_int(victim, 75, 5) 
        if (hitgroup == HIT_HEAD && damage>120.0 && !g_Headless[victim]) 
        { 
                g_HSCounter[victim]++ 
                new Gun = get_user_weapon(attacker) 
                if (g_HSCounter[victim] > g_MaxHS[victim] || Gun == CSW_M3 || Gun == CSW_XM1014) 
                { 
                        g_Headless[victim] = true 
                        
                        client_print(victim, print_center, "You've lost your head!") 
                        client_cmd(victim, "spk %s", g_ZombHeadless) 
                        
                        damage+=750.0 
                        
                        set_user_hitzones(0, victim, 253) 
                        set_pev(victim,pev_body, MODEL_HEADLESS) 
                } 
        } 
        
        SetHamParamFloat(4, damage) 
        return HAM_HANDLED 
} 
  
public client_damage(g_attacker, g_victim, damage, wpnindex, hitplace, TA) 
{ 
        if (!g_iszombie[g_attacker]) 
                if (wpnindex != CSW_KNIFE || CSW_DEAGLE || CSW_ELITE || CSW_FIVESEVEN || CSW_GLOCK18 || CSW_P228 || CSW_USP || CSW_HEGRENADE) 
                        has_used_pistol[g_attacker] = false 
} 
  
public fw_PrimaryAttack(ent) 
{ 
        new id = pev(ent,pev_owner) 
        if(g_item_rec[id]) 
                pev(id,pev_punchangle,cl_pushangle[id]) 
        
        return HAM_IGNORED 
} 
  
public fw_PrimaryAttack_Post(ent) 
{ 
        new id = pev(ent,pev_owner) 
  
        if(g_item_rec[id]) 
        { 
                new Float:push[3] 
                pev(id,pev_punchangle,push) 
                xs_vec_sub(push,cl_pushangle[id],push) 
                xs_vec_mul_scalar(push,0.25,push) 
                xs_vec_add(push,cl_pushangle[id],push) 
                set_pev(id,pev_punchangle,push) 
        } 
        return HAM_IGNORED 
} 
  
public fw_Reload_Post(iEnt) 
{     
        if( get_pdata_int(iEnt, m_fInReload, 4) ) 
        { 
                new id = get_pdata_cbase(iEnt, m_pPlayer, 4) 
                if(g_item_rel[id]) 
                { 
                        new Float:fDelay = g_fDelay[get_pdata_int(iEnt, m_iId, 4)] * RELOAD_RATIO 
                        set_pdata_float(id, m_flNextAttack, fDelay, 5) 
                        set_pdata_float(iEnt, m_flTimeWeaponIdle, fDelay, 4) 
                        set_pev(id, pev_frame, 200.0) 
                } 
        } 
} 
  
public plugin_cfg() 
{ 
        g_Vault = nvault_open( "basebuilder" ); 
  
        if ( g_Vault == INVALID_HANDLE ) 
                set_fail_state( "Error opening BaseBuilder Achievements nVault, file does not exist!" ); 
                
        //create the main menu 
        new size = sizeof(gszMainMenuText); 
        add(gszMainMenuText, size, "\yClock Maker Menu^n^n"); 
        add(gszMainMenuText, size, "\r1. \wCreate real time clock^n"); 
        add(gszMainMenuText, size, "\r2. \wCreate build time clock^n^n"); 
        add(gszMainMenuText, size, "\r4. \wDelete clock^n^n"); 
        add(gszMainMenuText, size, "\r5. \wMake larger^n"); 
        add(gszMainMenuText, size, "\r6. \wMake smaller^n^n"); 
        add(gszMainMenuText, size, "\r7. \wSave clocks^n"); 
        add(gszMainMenuText, size, "\r8. \wLoad clocks^n^n"); 
        add(gszMainMenuText, size, "\r0. \wClose^n"); 
        
        //store current CVAR values (so we can check if they get changed) 
        gTimeOffsetOld = get_cvar_num("cm_timeoffset"); 
        gHourTypeOld = get_cvar_num("cm_hourtype"); 
        
        //make save folder in basedir 
        new szDir[64]; 
        new szMap[32]; 
        
        get_basedir(szDir, 64); 
        add(szDir, 64, "/clockmaker"); 
        
        //create the folder is it doesn't exist 
        if (!dir_exists(szDir)) 
        { 
                mkdir(szDir); 
        } 
        
        get_mapname(szMap, 32); 
        formatex(gszFile, 96, "%s/%s.cm", szDir, szMap); 
        
        //load the clocks 
        loadClocks(0); 
        
        set_task(1.0, "taskUpdateClocks", 0, "", 0, "b"); 
} 
  
public plugin_end() 
{ 
        nvault_close( g_Vault ); 
        
        return PLUGIN_CONTINUE 
} 
  
public client_disconnect(id) 
{ 
        cmdStopEnt(id) 
        SaveLevel(id) 
  
        g_isconnected[id] = false 
        g_isalive[id] = false 
        g_isbot[id] = false 
        g_iszombie[id] = false 
        g_BuildBan[id] = false 
        g_pColor[id] = RED 
  
        g_HSCounter[id] = 0 
        g_MaxHS[id] = 0 
        g_Headless[id] = false 
        
        g_item_dmg[id] = false 
        g_item_gdmg[id] = false 
        g_item_rec[id] = false 
        g_item_reg[id] = false 
        g_item_rel[id] = false 
        g_item_hel[id] = false 
        g_item_sti[id] = false 
        g_item_si[id] = false 
        g_item_oma[id] = false 
        
        remove_task(id+REGEN_TASK) 
        remove_task(id+OMA_TASK) 
        remove_task(id+CONCUSSION_TASK) 
        
        return PLUGIN_CONTINUE 
} 
  
//Respawns late joiners, cts only if build time is still on 
public client_putinserver(id) 
{ 
        get_load_key(id) 
  
        set_task(7.0,"Respawn_Human",id); 
        g_isconnected[id] = true 
        firsttime[id] = true 
        g_FirstSpawn[id] = true 
        
        g_isalive[id] = false 
        g_isbot[id] = false 
        g_iszombie[id] = false 
        g_BuildBan[id] = false 
        g_isconcussioned[id] = false 
  
        g_HSCounter[id] = 0 
        g_MaxHS[id] = g_HeadlessCVAR 
        g_Headless[id] = false 
        
        g_item_dmg[id] = false 
        g_item_gdmg[id] = false 
        g_item_rec[id] = false 
        g_item_reg[id] = false 
        g_item_rel[id] = false 
        g_item_hel[id] = false 
        g_item_sti[id] = false 
        g_item_si[id] = false 
        g_item_oma[id] = false 
        
        // Set bot flag 
        if (is_user_bot(id)) 
                g_isbot[id] = true 
} 
  
public Release_Zombies() 
{ 
        g_CanBuild = false 
        g_ZombiesReleased = true 
        g_ReleaseTime = get_gametime() 
        remove_task(BUILD_TASK); 
        
        new weapon[32] 
        get_pcvar_string(g_pcvar_givenades,weapon,31) 
        new he, flash, smoke 
        for(new i=0;i<strlen(weapon);i++) 
        { 
                switch(weapon) 
                { 
                        case 'h': he++ 
                        case 'f': flash++ 
                        case 's': smoke++ 
                } 
        } 
        
        new players[32], num, player 
        get_players(players, num, "a") 
  
        for(new i = 0; i < num; i++) 
        { 
                player = players 
  
                if (!g_iszombie[player]) 
                { 
                        cmdStopEnt(player) 
  
                        if(he) give_item(player,"weapon_hegrenade"), cs_set_user_bpammo(player,CSW_HEGRENADE,he) 
                        if(flash) give_item(player,"weapon_flashbang"), cs_set_user_bpammo(player,CSW_FLASHBANG,flash) 
                        if(smoke) give_item(player,"weapon_smokegrenade"), cs_set_user_bpammo(player,CSW_SMOKEGRENADE,smoke) 
  
                        if (g_PrimaryWeapon[player]) 
                        { 
                                get_weaponname(g_PrimaryWeapon[player],weapon,31) 
                                engclient_cmd(player, weapon); 
                        } 
                } 
        } 
                        
        set_pev(g_iEntBarrier,pev_solid,SOLID_NOT) 
        set_pev(g_iEntBarrier,pev_renderamt,Float:{0.0}) 
        
        g_RoundNum++ 
        set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 10.0, 0.1, 0.2, 1) 
        show_hudmessage(0, "%L", LANG_SERVER, "RELEASE_MSG"); 
        switch(random_num(1,2)) 
        { 
                case 1: client_cmd(0, "spk %s", g_RoundStart) 
                case 2: client_cmd(0, "spk %s", g_RoundStart2) 
        } 
} 
  
//Called on zombie death function 
public Respawn_Zombie(id) 
{ 
        if (g_isconnected[id] && cs_get_user_team(id) == CS_TEAM_T) 
        { 
                if (get_user_health(id) ==MaxHP[id] || !is_user_alive(id)) 
                        ExecuteHamB(Ham_CS_RoundRespawn, id) 
                else 
                        client_print(id, print_center, "%L", LANG_SERVER, "FAIL_RESPAWN"); 
        } 
} 
  
//Called on al pllayers for late joiners, parent is above 
public Respawn_Human(id) 
{ 
        if (!g_isconnected[id] || g_isalive[id] || cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED) 
                return PLUGIN_HANDLED 
                
        if (!g_isalive[id] && g_iszombie[id]) 
                ExecuteHamB(Ham_CS_RoundRespawn, id) 
                                
        if (!g_isalive[id] && g_iszombie[id]) 
                set_task(3.0,"Respawn_Human",id) 
                        
        if (g_CanBuild) 
        { 
                if (!g_isalive[id]) 
                        ExecuteHamB(Ham_CS_RoundRespawn, id) 
                                
                if (!g_isalive[id]) 
                        set_task(3.0,"Respawn_Human",id) 
        } 
        return PLUGIN_HANDLED 
} 
  
//Sets player health and weapons 
public Add_Effects(id) 
{ 
        if (!g_isconnected[id] || !g_isalive[id]) 
                return PLUGIN_HANDLED 
        
        if (g_FirstSpawn[id]) 
        { 
                client_cmd(id, "mp3 play sound/%s", g_JoinServer) 
                g_FirstSpawn[id] = false 
        } 
                
        AchieveCount(id) 
        
        strip_user_weapons(id) 
        give_item(id, "weapon_knife") 
        
        if (g_item_hel[id] || g_unAPLevel[id]) 
        { 
                give_item(id, "item_assaultsuit"); 
                
                new armor = g_unAPLevel[id]*10 
                if (g_item_hel[id]) 
                { 
                        armor+=200 
                        g_MaxHS[id] = g_HeadlessCVAR+5 
                } 
                cs_set_user_armor(id, armor, CS_ARMOR_VESTHELM); 
        } 
        
        if (g_iszombie[id]) 
        { 
                new hp = (g_ZombieHP+(g_unHPLevel[id]*100)) 
                MaxHP[id] = float(hp) 
                set_pev(id, pev_health, MaxHP[id]) // use decimal number 
                set_pev(id, pev_gravity, 1-(0.02*g_unGRLevel[id])) // use decimal number 
                set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransTexture, 255-(g_unINLevel[id]*10)) 
        } 
        else 
        { 
                weapon_method_menu(id) 
                MaxHP[id] = 100.0 
                set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 255) 
        } 
        
        if (!hasplayed[id]) 
        { 
                hasplayed[id] = 1 
                print_color(id, "%s %L", LANG_SERVER, "CR_NEW_PLAYER", g_NewPlayer) 
                credits[id]+=g_NewPlayer 
        } 
        print_color(id, "%s %L", formatmodname, LANG_SERVER, "CR_SPAWN", credits[id]) 
        ev_Health(id) 
        return PLUGIN_HANDLED 
} 
  
//AmmoX Ensures BackPack ammo is always full 
public ev_AmmoX(id) 
{ 
        set_pdata_int(id, AMMO_SLOT + read_data(1), 200, 5) 
} 
  
//Sets the "Game" description ie. Counter-Strike, in our case Base Builder 
public fw_GetGameDescription() 
{ 
        // Return the mod name so it can be easily identified 
        forward_return(FMV_STRING, g_ModName) 
        
        return FMRES_SUPERCEDE; 
} 
  
public ev_Flash(id) 
{ 
        if (!g_iszombie[id]) 
        { 
                message_begin(MSG_ONE, gmsgScreenFade, {0,0,0}, id) 
                write_short(1) 
                write_short(1) 
                write_short(1) 
                write_byte(0) 
                write_byte(0) 
                write_byte(0) 
                write_byte(255) 
                message_end() 
        } 
        else if (g_iszombie[id]) 
        {       
                client_cmd(id, "mp3 play sound/%s", g_Concussion) 
                
                new Float:fadetime = 5.0, fade 
                fade = clamp(floatround(fadetime * float(1<<12)), 0, 0xFFFF); 
                
                g_isconcussioned[id] = true 
                set_task(fadetime, "Remove_Conc_Effects", CONCUSSION_TASK+id) 
                
                message_begin(MSG_ONE,gmsgScreenFade,{0,0,0},id) 
                write_short( fade ) 
                write_short( 1<<10 ) 
                write_short( 1<<12 ) 
                write_byte( 255 ) 
                write_byte( 255 ) 
                write_byte( 255 ) 
                write_byte( 200 ) 
                message_end() 
                
                new Float:fVec[3]; 
                fVec[0] = random_float(PA_LOW , PA_HIGH); 
                fVec[1] = random_float(PA_LOW , PA_HIGH); 
                fVec[2] = random_float(PA_LOW , PA_HIGH); 
                entity_set_vector(id , EV_VEC_punchangle , fVec); 
                message_begin(MSG_ONE , gmsgScreenShake , {0,0,0} ,id) 
                write_short( 1<<14 ); 
                write_short( fade ); 
                write_short( 1<<14 ); 
                message_end(); 
        } 
} 
  
public Remove_Conc_Effects(taskid) 
{ 
        taskid -= CONCUSSION_TASK 
        g_isconcussioned[taskid] = false 
} 
  
/*-------------------------------------------------------------------------------------------------| 
|----------------------------------Begin Player Model Code---[0005]--------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
public ham_PlayerSpawn_Post(id) 
{ 
        if (is_user_alive(id)) 
        { 
                g_isalive[id] = true 
                g_pCurTeam[id] = cs_get_user_team(id) 
                g_iszombie[id] = g_pCurTeam[id] == CS_TEAM_T ? true : false 
                
                g_HSCounter[id] = 0 
                g_MaxHS[id] = g_HeadlessCVAR 
                g_Headless[id] = false 
                
                Add_Effects(id) 
                remove_task(id + MODELSET_TASK) 
                if (g_iszombie[id]) 
                { 
                        set_user_hitzones(0, id, 255) 
                        set_pev(id,pev_body, MODEL_HEAD) 
                
                        switch(random_num(1,3)) 
                        { 
                                case 1: copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_ZombieModel1) 
                                case 2: copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_ZombieModel2) 
                                case 3: copy(g_PlayerModel[id], charsmax(g_PlayerModel[]), g_ZombieModel3) 
                        } 
                        new currentmodel[32] 
                        fm_get_user_model(id, currentmodel, charsmax(currentmodel)) 
                        if (!equal(currentmodel, g_PlayerModel[id])) 
                        { 
                                if (get_gametime() - g_RoundStartTime < 5.0) 
                                        set_task(5.0 * MODELCHANGE_DELAY, "fm_user_model_update", id + MODELSET_TASK) 
                                else 
                                        fm_user_model_update(id + MODELSET_TASK) 
                        } 
                } 
                else if (g_HasCustomModel[id]) 
                { 
                        fm_reset_user_model(id) 
                } 
        } 
} 
  
public fw_SetClientKeyValue(id, const infobuffer[], const key[]) 
{   
        if (g_HasCustomModel[id] && equal(key, "model")) 
                return FMRES_SUPERCEDE 
        return FMRES_IGNORED 
} 
  
public fw_ClientUserInfoChanged(id) 
{ 
        if (!g_HasCustomModel[id]) 
                return FMRES_IGNORED 
        static currentmodel[32] 
        fm_get_user_model(id, currentmodel, charsmax(currentmodel)) 
        if (!equal(currentmodel, g_PlayerModel[id]) && !task_exists(id + MODELSET_TASK)) 
                fm_set_user_model(id + MODELSET_TASK) 
        return FMRES_IGNORED 
} 
  
public fm_user_model_update(taskid) 
{ 
        static Float:current_time 
        current_time = get_gametime() 
        
        if (current_time - g_ModelsTargetTime >= MODELCHANGE_DELAY) 
        { 
                fm_set_user_model(taskid) 
                g_ModelsTargetTime = current_time 
        } 
        else 
        { 
                set_task((g_ModelsTargetTime + MODELCHANGE_DELAY) - current_time, "fm_set_user_model", taskid) 
                g_ModelsTargetTime = g_ModelsTargetTime + MODELCHANGE_DELAY 
        } 
} 
  
public fm_set_user_model(player) 
{ 
        player -= MODELSET_TASK 
        engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", g_PlayerModel[player]) 
        set_pev(player,pev_body, MODEL_HEAD) 
        g_HasCustomModel[player] = true 
} 
  
stock fm_get_user_model(player, model[], len) 
{ 
        engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len) 
} 
  
stock fm_reset_user_model(player) 
{ 
        g_HasCustomModel[player] = false 
        dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player)) 
} 
  
/*-------------------------------------------------------------------------------------------------| 
|------------------------------------End Player Model Code-----------------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
/*-------------------------------------------------------------------------------------------------| 
|----------------------------------Begin Entity Mover Code---[0004]--------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
public cmdMoveEnt(id) 
{ 
        if (g_BuildBan[id] == true) 
                return PLUGIN_HANDLED 
        
        if (g_iszombie[id] && !access(id, AFTER_BUILD)) 
                return PLUGIN_HANDLED 
                        
        if (!g_CanBuild && !access(id, AFTER_BUILD)) 
        { 
                client_print (id, print_center, "%L", LANG_SERVER, "FAIL_TIME_UP") 
                return PLUGIN_HANDLED 
        } 
        
        if (!g_isalive[id] && !access(id, DEAD_BUILD)) 
        { 
                client_print (id, print_center, "%L", LANG_SERVER, "FAIL_DEAD") 
                return PLUGIN_HANDLED 
        } 
  
        if (g_pEnt[id] && is_valid_ent(g_pEnt[id])) 
                cmdStopEnt(id) 
        
        new ent, bodypart 
        get_user_aiming (id,ent,bodypart) 
        
        if (!is_valid_ent(ent) || ent == g_iEntBarrier) 
        { 
                return PLUGIN_HANDLED 
        } 
        
        if (ent <= g_MaxPlayers && g_isalive[ent]) 
        {       
                return PLUGIN_HANDLED 
        } 
                
        if ((IsBlockLocked(ent) && !access(id, MEMBERSHIP)) || g_MovingEnt[ent]) 
        { 
                return PLUGIN_HANDLED 
        } 
  
        /*if (g_Claimable == 1) 
        { 
                if (!g_EntOwner[ent]) 
                { 
                        if ((g_OwnedEnts[id]<g_MaxClaimable) || g_MaxClaimable == 0) 
                        { 
                                g_EntOwner[ent] = id 
                                g_OwnedEnts[id]++ 
                        } 
                        else 
                        { 
                                client_print (id, print_center, "%L", LANG_SERVER, "FAIL_MAXOWNED", g_MaxClaimable) 
                        } 
                } 
                else if (g_EntOwner[ent] != id && !access(id, AFTER_BUILD)) 
                { 
                        client_print (id, print_center, "%L", LANG_SERVER, "FAIL_ALREADYOWNED") 
                        return PLUGIN_HANDLED 
                } 
        }*/ 
        /*if (g_EntOwner[ent] && g_EntOwner[ent] != id && !access(id, ADMIN_BAN)) 
                return PLUGIN_HANDLED 
        else if (!g_EntOwner[ent] && access(id, MEMBERSHIP)) 
        { 
                g_OwnedEnts[id]++ 
                if (g_OwnedEnts[id]<=15) 
                        g_EntOwner[ent] = id 
                else 
                        client_print(id, print_center, "You've already claimed the max pieces, anyone can move this piece") 
        }*/ 
        
        new tname[7], cname[10]; 
        entity_get_string(ent, EV_SZ_targetname, tname, 6); 
        entity_get_string(ent, EV_SZ_classname, cname, 9); 
        if (!equal(cname, "func_wall") || equal(tname, "ignore")) 
        { 
                return PLUGIN_HANDLED 
        } 
        
        new Float:orig[3], iAiming[3], Float:fAiming[3], body 
        
        get_user_origin(id, iAiming, 3); 
        IVecFVec(iAiming, fAiming); 
        entity_get_vector(ent, EV_VEC_origin, orig); 
  
        g_pOffset[id][0] = orig[0] - fAiming[0]; 
        g_pOffset[id][1] = orig[1] - fAiming[1]; 
        g_pOffset[id][2] = orig[2] - fAiming[2]; 
        
        g_pDist[id] = get_user_aiming(id, ent, body); 
                
        if (g_EntMinDist) //maximum 
        { 
                if (g_pDist[id] < g_EntMinDist) //minimum 
                        g_pDist[id] = g_EntSetDist; 
        } 
  
        if (g_EntMaxDist) //maximum 
        { 
                if (g_pDist[id] > g_EntMaxDist) 
                        return PLUGIN_HANDLED 
        } 
        
        //test 
        //attach_view(id, ent); 
        if (g_pThirdPerson[id]) set_view(id, CAMERA_UPLEFT) 
        
        if (g_pColor[id] == TEXTURED) set_pev(ent,pev_rendermode,kRenderTransTexture) 
        else 
        { 
                set_pev(ent,pev_rendermode,kRenderTransColor) 
                if (g_pColor[id] == RAINBOW || g_pColor[id] == DISCO) 
                        set_pev(ent,pev_rendercolor,g_Color[g_pColorHolder[id]]) 
                else 
                        set_pev(ent,pev_rendercolor,g_Color[g_pColor[id]]) 
        } 
        set_pev(ent,pev_renderamt,g_RenderColor[g_pColor[id]]) 
        
        g_MovingEnt[ent] = true 
        g_EntMover[ent] = id 
        g_pEnt[id] = ent 
  
        objectsmoved[id]++ 
        if (objectsmoved[id] == 10000) 
        { 
                switch (g_PlayerAchievements[id][ACHIEVE_OBJMOVED]) 
                { 
                        case LEVEL_NONE:        
                        { 
                                g_PlayerAchievements[id][ACHIEVE_OBJMOVED]=LEVEL_I; 
                                set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                show_hudmessage(id, "%s^nMove 10000 objects!^n+15 Credits", ACHIEVEMENTS[ACHIEVE_OBJMOVED][LEVEL_I]); 
                                credits[id]+=15 
                                check_banker(id) 
                                client_cmd(id, "spk %s", g_AchivementEarned); 
                                SaveLevel(id) 
                        } 
                }       
        } 
  
        if (!g_CanBuild && access(id, AFTER_BUILD)) 
        { 
                new adminauthid[35],adminname[35] 
                get_user_authid (id,adminauthid,34) 
                get_user_name(id,adminname,34) 
                Log("[MOVE] Admin: %s || SteamID: %s moved an entity", adminname, adminauthid) 
        } 
        
        return PLUGIN_HANDLED 
} 
  
public fw_Player_PreThink(id) 
{ 
        if (!g_pEnt[id] || !is_valid_ent(g_pEnt[id])) 
                return FMRES_HANDLED 
                
        new buttons = pev(id, pev_button) 
        if (buttons & IN_ATTACK) 
        { 
                g_pDist[id] += 3.0; 
                
                if (g_pDist[id] > g_EntMaxDist) 
                { 
                        g_pDist[id] = g_EntMaxDist 
                        client_print(id, print_center, "%L", LANG_SERVER, "OBJECT_MAX") 
                } 
                else 
                        client_print(id, print_center, "%L", LANG_SERVER, "OBJECT_PUSH") 
        } 
        else if (buttons & IN_ATTACK2) 
        { 
                g_pDist[id] -= 3.0; 
                        
                if (g_pDist[id] < g_EntSetDist) 
                { 
                        g_pDist[id] = g_EntSetDist 
                        client_print(id, print_center, "%L", LANG_SERVER, "OBJECT_MIN") 
                } 
                else 
                        client_print(id, print_center, "%L", LANG_SERVER, "OBJECT_PULL") 
        } 
        
        if (!g_isconnected[id] || (g_pEnt[id] <= g_MaxPlayers)? !g_isconnected[id]:!is_valid_ent(g_pEnt[id])) 
        { 
                cmdStopEnt(id) 
                return PLUGIN_HANDLED 
        } 
        
        /*------------------------------------------------*/ 
        new iOrigin[3], iLook[3]; 
        new Float:fOrigin[3], Float:fLook[3], Float:fDirection[3], Float:vMoveTo[3], Float:fLength 
            
        get_user_origin(id, iOrigin, 1);        //Position from eyes (weapon aiming) 
        get_user_origin(id, iLook, 3);            //End position from eyes (hit point for weapon) 
        IVecFVec(iOrigin, fOrigin); 
        IVecFVec(iLook, fLook); 
            
        fDirection[0] = fLook[0] - fOrigin[0]; 
        fDirection[1] = fLook[1] - fOrigin[1]; 
        fDirection[2] = fLook[2] - fOrigin[2]; 
  
        fLength = get_distance_f(fLook, fOrigin); 
            
        if (fLength == 0.0) fLength = 1.0;        //avoid division by 0 
            
        //calculate the position to move the block 
        vMoveTo[0] = (fOrigin[0] + fDirection[0] * g_pDist[id] / fLength) + g_pOffset[id][0]; 
        vMoveTo[1] = (fOrigin[1] + fDirection[1] * g_pDist[id] / fLength) + g_pOffset[id][1]; 
        vMoveTo[2] = (fOrigin[2] + fDirection[2] * g_pDist[id] / fLength) + g_pOffset[id][2]; 
        vMoveTo[2] = float(floatround(vMoveTo[2], floatround_floor)); 
            
        //move the block 
        entity_set_origin(g_pEnt[id], vMoveTo); 
        /*------------------------------------------------*/ 
        
        if (g_pColor[id] == RAINBOW) 
        { 
                switch (g_pColorChk[id]) 
                { 
                        case 0: g_pColorHolder[id]++ 
                        case 1: g_pColorHolder[id]-- 
                } 
                if (g_pColorHolder[id]>LIGHTBROWN) g_pColorChk[id] = 1 
                else if (g_pColorHolder[id]<ORANGE) g_pColorChk[id] = 0 
                //g_pColorHolder[id]++ 
                //if (g_pColorHolder[id]>BROWN) g_pColorHolder[id] = RED 
                set_pev(g_pEnt[id],pev_rendercolor,g_Color[g_pColorHolder[id]]) 
        } 
        else if (g_pColor[id] == DISCO) 
        { 
                g_pColorHolder[id] = random_num(RED, BROWN) 
                set_pev(g_pEnt[id],pev_rendercolor,g_Color[g_pColorHolder[id]]) 
        } 
        
        return FMRES_HANDLED 
} 
  
public cmdStopEnt(id) 
{ 
        if (g_pThirdPerson[id]) set_view(id, CAMERA_NONE) 
        new ent = g_pEnt[id] 
        g_MovingEnt[ent] = false 
        set_pev(ent,pev_renderamt,Float:{255.0}) 
        if (IsBlockLocked(ent)) 
        { 
                set_pev(ent,pev_rendermode,kRenderTransColor) 
                set_pev(ent,pev_rendercolor,Float:{125.0, 0.0, 0.0}) 
                set_pev(ent,pev_renderamt,Float:{225.0}) 
        } 
        else 
        { 
                set_pev(ent,pev_rendermode,kRenderNormal)       
                set_pev(ent,pev_rendercolor,Float:{0.0, 0.0, 0.0}) 
        } 
        
        /*new ent_check, bodypart 
        get_user_aiming (id,ent_check,bodypart)*/ 
        if (/*!is_valid_ent(ent_check)*//* || ent_check != ent || */g_Touching[ent] && !access(id, ADMIN_BAN)) 
        { 
                /*if (g_Touching[ent]) */ 
                //else client_print(id, print_center, "Please don't stick objects in walls") 
                client_print(id, print_center, "Please don't stick objects in other players") 
                engfunc( EngFunc_SetOrigin, ent, Float:{ 0.0, 0.0, 0.0 } ); 
                
                g_OwnedEnts[g_EntOwner[ent]]-- 
                g_EntOwner[ent] = 0 
        } 
        /*else if((fEntOrigin[ent][0]<=g_maxs[0] && fEntOrigin[ent][0]>=g_mins[0] && fEntOrigin[ent][1]<=g_maxs[1] && fEntOrigin[ent][1]>=g_mins[1])) 
        { 
                print_color(id, "^x04 Don't block the spawn!!!") 
                print_color(id, "^x04 Don't block the spawn!!!") 
                print_color(id, "^x04 Don't block the spawn!!!") 
                engfunc( EngFunc_SetOrigin, ent, Float:{ 0.0, 0.0, 0.0 } ); 
                g_OwnedEnts[g_EntOwner[ent]]-- 
                g_EntOwner[ent] = 0     
        }*/ 
        else 
        { 
                new entity = -1 
                while( ( entity = engfunc( EngFunc_FindEntityInSphere, entity, g_fBarrierOrigin, 200.0 ) ) != 0 ) 
                { 
                        if (entity == ent) 
                        { 
                                print_color(id, "^x04 Don't block the spawn!!!") 
                                print_color(id, "^x04 Don't block the spawn!!!") 
                                print_color(id, "^x04 Don't block the spawn!!!") 
                                engfunc( EngFunc_SetOrigin, entity, Float:{ 0.0, 0.0, 0.0 } ); 
                                g_OwnedEnts[g_EntOwner[entity]]-- 
                                g_EntOwner[entity] = 0 
                        } 
                } 
        } 
        
        g_EntMover[ent] = 0 
        g_LastMover[ent] = id 
        g_pEnt[id] = 0 
} 
  
public ham_TouchWall_Post(ent, id) 
{ 
        //never check these 
        if (!is_valid_ent(ent) || !g_EntMover[ent] || g_InvisEnt[ent]/* || g_MovingEnt[ent]*/) return HAM_HANDLED 
        
        remove_task(TOUCHING_TASK+ent) 
  
        if (g_isalive[id] && (g_iszombie[id] ||  g_EntMover[ent] == id)) 
        { 
                g_Touching[ent] = true 
                set_task(0.1, "Task_UnTouch", TOUCHING_TASK+ent) 
        } 
        else 
                g_Touching[ent] = false 
        
        return HAM_HANDLED 
} 
  
public Task_UnTouch(taskent) 
{ 
        taskent -= TOUCHING_TASK 
        g_Touching[taskent] = false 
} 
  
public fw_Traceline(Float:start[3], Float:end[3], conditions, id, trace) 
{ 
        if (!is_user_alive(id)) return PLUGIN_HANDLED 
        
        new ent = get_tr2(trace, TR_pHit) 
        
        if (is_valid_ent(ent)) 
        { 
                new ent,body 
                get_user_aiming(id,ent,body) 
                
                new cname[10], tname[7]; 
                entity_get_string(ent, EV_SZ_classname, cname, 9); 
                entity_get_string(ent, EV_SZ_targetname, tname, 6); 
                if (equal(cname, "func_wall") && !equal(tname, "ignore") && ent != g_iEntBarrier && g_ShowMovers == 1) 
                { 
                        if (g_CanBuild || access(id, ADMIN_KICK)) 
                        { 
                                if (IsBlockLocked(ent)) 
                                { 
                                        set_hudmessage(255, 0, 0, -1.0, 0.55, 1, 0.01, 3.0, 0.01, 0.01); 
                                        ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_LOCKED"); 
                                        return PLUGIN_HANDLED 
                                } 
                                set_hudmessage(0, 50, 255, -1.0, 0.55, 1, 0.01, 3.0, 0.01, 0.01); 
                                if (!g_Claimable) 
                                { 
                                        new currentmover[35], lastmover[35] 
                                        if (g_EntMover[ent]) 
                                        { 
                                                get_user_name(g_EntMover[ent],currentmover,34) 
                                                if (!g_LastMover[ent]) ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_INFO1", currentmover); 
                                        } 
                                        if (g_LastMover[ent]) 
                                        { 
                                                get_user_name(g_LastMover[ent],lastmover,34) 
                                                if (!g_EntMover[ent]) ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_INFO2", lastmover); 
                                        } 
                                        if (g_LastMover[ent] && g_EntMover[ent]) ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_INFO3", currentmover, lastmover); 
                                        else if (!g_LastMover[ent] && !g_EntMover[ent]) ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_INFO4"); 
                                } 
                                else 
                                { 
                                        if (g_EntOwner[ent]) 
                                        { 
                                                new entowner[35] 
                                                get_user_name(g_EntOwner[ent],entowner,34) 
                                                ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_OWNER", entowner); 
                                        } 
                                        else 
                                        { 
                                                ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "OBJECT_OWNER_NONE"); 
                                        } 
                                } 
                        } 
                } 
        } 
        else ClearSyncHud(id, gHudSyncInfo); 
        
        return PLUGIN_HANDLED 
} 
  
public cmdLockBlock(id) 
{ 
        if (!access(id, LOCK_BLOCKS)) 
                return PLUGIN_HANDLED 
                
        new ent, bodypart 
        get_user_aiming (id,ent,bodypart) 
        
        new tname[7], cname[10]; 
        entity_get_string(ent, EV_SZ_targetname, tname, 6); 
        entity_get_string(ent, EV_SZ_classname, cname, 9); 
  
        if (!ent || !is_valid_ent(ent) || is_user_alive(ent) || ent == g_iEntBarrier || !equal(cname, "func_wall") || equal(tname, "ignore")) return PLUGIN_HANDLED 
        
        if (!IsBlockLocked(ent) && !g_MovingEnt[ent]) 
        { 
                LockBlock(ent) 
                set_pev(ent,pev_rendermode,kRenderTransColor) 
                set_pev(ent,pev_rendercolor,Float:{125.0, 0.0, 0.0}) 
                set_pev(ent,pev_renderamt,Float:{225.0}) 
                
                g_OwnedEnts[g_EntOwner[ent]]-- 
                g_EntOwner[ent] = 0 
        } 
        else if (IsBlockLocked(ent)) 
        { 
                UnlockBlock(ent) 
                set_pev(ent,pev_rendermode,kRenderNormal) 
        } 
        return PLUGIN_HANDLED 
} 
  
public cmdRemoveClaim(id) 
{ 
        if (!access(id, LOCK_BLOCKS)) 
                return PLUGIN_HANDLED 
                
        new ent, bodypart 
        get_user_aiming (id,ent,bodypart) 
        
        new tname[7], cname[10]; 
        entity_get_string(ent, EV_SZ_targetname, tname, 6); 
        entity_get_string(ent, EV_SZ_classname, cname, 9); 
  
        if (!ent || !is_valid_ent(ent) || is_user_alive(ent) || ent == g_iEntBarrier || !equal(cname, "func_wall") || equal(tname, "ignore") || IsBlockLocked(ent)) return PLUGIN_HANDLED 
  
        g_OwnedEnts[g_EntOwner[ent]]-- 
        g_EntOwner[ent] = 0 
        
        return PLUGIN_HANDLED 
} 
  
public cmdRemoveEnt(id) 
{ 
        if (!access(id, REMOVE_BLOCK)) 
                return PLUGIN_HANDLED 
  
        if (!g_isalive[id] && !access(id, DEAD_REMOVE)) 
        { 
                client_print (id, print_center, "%L", LANG_SERVER, "FAIL_REMOVE") 
                return PLUGIN_HANDLED 
        } 
        
        new ent, bodypart 
        get_user_aiming (id,ent,bodypart) 
        
        if(!is_valid_ent(ent) || ent == g_iEntBarrier || (ent <= g_MaxPlayers && g_isalive[ent])) 
                return PLUGIN_HANDLED 
        
        if(IsBlockLocked(ent) || g_MovingEnt[ent]) 
                return PLUGIN_HANDLED 
  
        new tname[7], cname[10]; 
        entity_get_string(ent, EV_SZ_targetname, tname, 6); 
        entity_get_string(ent, EV_SZ_classname, cname, 9); 
        if(!equal(cname, "func_wall")) 
                return PLUGIN_HANDLED 
        
        if(equal(tname, "ignore")) 
                return PLUGIN_HANDLED 
        
        g_OwnedEnts[g_EntOwner[ent]]-- 
        g_EntOwner[ent] = 0 
        
        remove_entity(ent) 
        
        new adminauthid[35],adminname[35] 
        get_user_authid (id,adminauthid,34) 
        get_user_name(id,adminname,34) 
        Log("[REMOVE] Admin: %s || SteamID: %s removed an entity", adminname, adminauthid) 
        
        return PLUGIN_HANDLED 
} 
  
public cmdResetEnts(id) 
{ 
        if (!access(id, ADMIN_RESET)) 
                return PLUGIN_HANDLED 
        
        new cname[10], tname[7]; 
        for (new iEnt = g_MaxPlayers+1; iEnt < MAXENTS; iEnt++) 
        { 
                if (is_valid_ent(iEnt)) 
                { 
                        entity_get_string(iEnt, EV_SZ_classname, cname, 9); 
                        entity_get_string(iEnt, EV_SZ_targetname, tname, 6); 
                        if (!IsBlockLocked(iEnt) && iEnt != g_iEntBarrier && equal(cname, "func_wall") && !equal(tname, "ignore")) 
                                engfunc( EngFunc_SetOrigin, iEnt, Float:{ 0.0, 0.0, 0.0 } ); 
                } 
        } 
        
        new adminauthid[35],adminname[35] 
        get_user_authid (id,adminauthid,34) 
        get_user_name(id,adminname,34) 
        Log("[RESET-ENTS] Admin: %s || SteamID: %s reset the entities", adminname, adminauthid) 
        
        return PLUGIN_HANDLED 
} 
  
public cmdResetAim(id) 
{ 
        if (!access(id, ADMIN_RESET)) 
                return PLUGIN_HANDLED 
  
        new ent, bodypart 
        get_user_aiming (id,ent,bodypart) 
        
        if(!is_valid_ent(ent) || ent == g_iEntBarrier || (ent <= g_MaxPlayers && g_isalive[ent])) 
        { 
                client_print (id, print_center, "%L", LANG_SERVER, "FAIL_RESET") 
                return PLUGIN_HANDLED 
        } 
        
        if(IsBlockLocked(ent) || g_MovingEnt[ent]) 
        { 
                client_print (id, print_center, "%L", LANG_SERVER, "FAIL_RESET") 
                return PLUGIN_HANDLED 
        } 
  
        new tname[7], cname[10]; 
        entity_get_string(ent, EV_SZ_targetname, tname, 6); 
        entity_get_string(ent, EV_SZ_classname, cname, 9); 
        if(!equal(cname, "func_wall") || equal(tname, "ignore")) 
        { 
                client_print (id, print_center, "%L", LANG_SERVER, "FAIL_RESET") 
                return PLUGIN_HANDLED 
        } 
        
        engfunc( EngFunc_SetOrigin, ent, Float:{ 0.0, 0.0, 0.0 } ); 
        
        new adminauthid[35],adminname[35], targetauthid[35],targetname[35] 
        get_user_authid (id,adminauthid,34) 
        get_user_name(id,adminname,34) 
        get_user_authid(g_EntOwner[ent],targetauthid,34) 
        get_user_name(g_EntOwner[ent],targetname,34) 
        Log("[REMOVE] Admin: %s || SteamID: %s reset a block belonging to Player: %s || SteamID: %s", adminname, adminauthid, targetauthid, targetname) 
        
        g_OwnedEnts[g_EntOwner[ent]]-- 
        g_EntOwner[ent] = 0 
        
        return PLUGIN_HANDLED 
} 
  
  
public cmdClearEnts(id) 
{ 
        if (!access(id, ADMIN_RESET)) 
                return PLUGIN_HANDLED 
        
        new cname[10], tname[7]; 
        for (new iEnt = g_MaxPlayers+1; iEnt < MAXENTS; iEnt++) 
        { 
                if (is_valid_ent(iEnt)) 
                { 
                        entity_get_string(iEnt, EV_SZ_classname, cname, 9); 
                        entity_get_string(iEnt, EV_SZ_targetname, tname, 6); 
                        if (!IsBlockLocked(iEnt) && iEnt != g_iEntBarrier && equal(cname, "func_wall") && !equal(tname, "ignore") && !g_LastMover[iEnt]) 
                        { 
                                set_entity_visibility(iEnt, 0) 
                                //set_pev(iEnt,pev_solid,SOLID_NOT) 
                                //set_pev(iEnt,pev_rendermode,1) 
                                //set_pev(iEnt,pev_renderamt,Float:{0.0}) 
                                g_InvisEnt[iEnt] = true 
                        } 
                } 
        } 
        
        new adminauthid[35],adminname[35] 
        get_user_authid (id,adminauthid,34) 
        get_user_name(id,adminname,34) 
        Log("[CLEAR-ENTS] Admin: %s || SteamID: %s reset the entities", adminname, adminauthid) 
        
        return PLUGIN_HANDLED 
} 
  
/*-------------------------------------------------------------------------------------------------| 
|------------------------------------End Entity Mover Code-----------------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
// Ham Weapon Deploy Forward (forces knife only) 
public ham_ItemDeploy_Post(weapon_ent) 
{ 
        static owner 
        owner = get_pdata_cbase(weapon_ent, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS); 
  
        if (is_valid_ent(owner) && g_isalive[owner] && cs_get_user_shield(owner) == 1) 
        { 
                entity_set_string( owner , EV_SZ_viewmodel , ShieldView )   
                entity_set_string( owner , EV_SZ_weaponmodel , ShieldPlayer )   
        } 
        
        static weaponid 
        weaponid = cs_get_weapon_id(weapon_ent) 
        
        g_CurrentWeapon[owner] = weaponid 
        
        if (g_iszombie[owner] && !((1<<weaponid) & ZOMBIE_ALLOWED_WEAPONS_BITSUM)) 
        { 
                g_CurrentWeapon[owner] = CSW_KNIFE 
                engclient_cmd(owner, "weapon_knife") 
        } 
        else if (g_CanBuild) 
        { 
                g_CurrentWeapon[owner] = CSW_KNIFE 
                engclient_cmd(owner, "weapon_knife") 
                client_print(owner, print_center, "%L", LANG_SERVER, "FAIL_KNIFE_ONLY"); 
        } 
} 
  
stock maxclip(wpnid) 
{ 
        static ca; 
        ca = 0; 
  
        switch (wpnid) 
        { 
                case CSW_P228 : ca = 13; 
                case CSW_SCOUT : ca = 10; 
                case CSW_HEGRENADE : ca = 0; 
                case CSW_XM1014 : ca = 7; 
                case CSW_C4 : ca = 0; 
                case CSW_MAC10 : ca = 30; 
                case CSW_AUG : ca = 30; 
                case CSW_SMOKEGRENADE : ca = 0; 
                case CSW_ELITE : ca = 15; 
                case CSW_FIVESEVEN : ca = 20; 
                case CSW_UMP45 : ca = 25; 
                case CSW_SG550 : ca = 30; 
                case CSW_GALI : ca = 35; 
                case CSW_FAMAS : ca = 25; 
                case CSW_USP : ca = 12; 
                case CSW_GLOCK18 : ca = 20; 
                case CSW_AWP : ca = 10; 
                case CSW_MP5NAVY : ca = 30; 
                case CSW_M249 : ca = 100; 
                case CSW_M3 : ca = 8; 
                case CSW_M4A1 : ca = 30; 
                case CSW_TMP : ca = 30; 
                case CSW_G3SG1 : ca = 20; 
                case CSW_FLASHBANG : ca = 0; 
                case CSW_DEAGLE : ca = 7; 
                case CSW_SG552 : ca = 30; 
                case CSW_AK47 : ca = 30; 
                case CSW_P90 : ca = 50; 
        } 
        return ca; 
} 
  
public ev_CurWeapon(id) 
{     
        if (g_iszombie[id]) 
        { 
                new Float:SPLevel = float(g_unSPLevel[id]) 
                SPLevel*=5 
                set_user_maxspeed(id, 260.0+SPLevel) 
        } 
        else if (g_item_oma[id]) 
        { 
                static wpnid, clip; 
                wpnid = read_data(2); 
                clip = read_data(3); 
  
                if(wpnid==CSW_C4 || wpnid==CSW_KNIFE || wpnid==CSW_HEGRENADE || wpnid==CSW_SMOKEGRENADE || wpnid==CSW_FLASHBANG ) 
                        return PLUGIN_HANDLED; 
        
                if(!clip) 
                { 
                        static weapname[33]; 
                        get_weaponname(wpnid , weapname , 32); 
        
                        static wpn 
                        wpn = -1; 
                        while((wpn = find_ent_by_class(wpn , weapname)) != 0) 
                        { 
                                if(id == entity_get_edict(wpn , EV_ENT_owner)) 
                                { 
                                        cs_set_weapon_ammo(wpn , maxclip(wpnid)) 
                                        break; 
                                } 
                        } 
                } 
        } 
        return PLUGIN_HANDLED 
} 
  
public msgRoundEnd(const MsgId, const MsgDest, const MsgEntity) 
{ 
        static Message[192] 
        get_msg_arg_string(2, Message, 191) 
        
        if(equal(Message, "#Hint_you_have_the_bomb") || equal(Message, "#Game_bomb_pickup")) 
        { 
                strip_user_weapons(MsgEntity) 
                give_item(MsgEntity, "weapon_knife") 
                
                return PLUGIN_HANDLED 
        }       
        
        if(equal(Message, "#Game_bomb_drop")) 
                return PLUGIN_HANDLED 
        
        set_hudmessage(255, 255, 255, -1.0, 0.40, 0, 6.0, 6.0, 0.1, 0.2, 1) 
        if (equal(Message, "#Terrorists_Win")) 
        { 
                show_hudmessage(0, "Zombies Win!") 
                set_msg_arg_string(2, "") 
                client_cmd(0, "spk %s", g_WinZomb) 
                
                return PLUGIN_HANDLED 
        } 
        else if (equal(Message, "#Target_Saved") || equal(Message, "#CTs_Win")) 
        { 
                show_hudmessage(0, "Humans Win!") 
                set_msg_arg_string(2, "") 
                client_cmd(0, "spk %s", g_WinHum) 
                
                return PLUGIN_HANDLED 
        } 
        return PLUGIN_HANDLED 
} 
  
public ham_WeaponCleaner_Post(iEntity) 
{ 
        call_think(iEntity) 
} 
  
/*-------------------------------------------------------------------------------------------------| 
|----------------------------Begin Auto Join on Connect Code----[0003]-----------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
public message_show_menu(msgid, dest, id) 
{ 
        if (!(!get_user_team(id) && !g_isbot[id] && !access(id, ADMIN_IMMUNITY)))// 
                return PLUGIN_CONTINUE 
  
        static team_select[] = "#Team_Select" 
        static menu_text_code[sizeof team_select] 
        get_msg_arg_string(4, menu_text_code, sizeof menu_text_code - 1) 
        if (!equal(menu_text_code, team_select)) 
                return PLUGIN_CONTINUE 
  
        static param_menu_msgid[2] 
        param_menu_msgid[0] = msgid 
        set_task(AUTO_TEAM_JOIN_DELAY, "task_force_team_join", id, param_menu_msgid, sizeof param_menu_msgid) 
  
        return PLUGIN_HANDLED 
} 
  
public message_vgui_menu(msgid, dest, id) 
{ 
        if (get_msg_arg_int(1) != TEAM_SELECT_VGUI_MENU_ID || !(!get_user_team(id) && !g_isbot[id] && !access(id, ADMIN_IMMUNITY)))// 
                return PLUGIN_CONTINUE 
                
        static param_menu_msgid[2] 
        param_menu_msgid[0] = msgid 
        set_task(AUTO_TEAM_JOIN_DELAY, "task_force_team_join", id, param_menu_msgid, sizeof param_menu_msgid) 
  
        return PLUGIN_HANDLED 
} 
  
public task_force_team_join(menu_msgid[], id) 
{ 
        if (get_user_team(id)) 
                return 
  
        static msg_block 
        msg_block = get_msg_block(menu_msgid[0]) 
        set_msg_block(menu_msgid[0], BLOCK_SET) 
        engclient_cmd(id, "jointeam", "5") 
        engclient_cmd(id, "joinclass", "5") 
        set_msg_block(menu_msgid[0], msg_block) 
        
        g_pTeam[id] = cs_get_user_team(id) 
        g_pCurTeam[id] = cs_get_user_team(id) 
} 
  
/*-------------------------------------------------------------------------------------------------| 
|----------------------------End Auto Join on Connect Code-----------------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
public clcmd_changeteam(id) 
{ 
        if (!access(id, ADMIN_IMMUNITY)) 
        { 
                if (g_iszombie[id] && g_CanBuild) 
                        show_upgrades_menu(id) 
                if (!g_iszombie[id] && g_CanBuild) 
                        show_unlocks_menu(id) 
                if (!g_CanBuild) 
                        show_market_menu(id) 
                        
                return PLUGIN_HANDLED 
        } 
        return PLUGIN_CONTINUE 
} 
  
public clcmd_drop(id) 
{ 
        client_print (id, print_center, "%L", LANG_SERVER, "FAIL_DROP") 
        return PLUGIN_HANDLED 
} 
  
public clcmd_buy(id) 
{ 
        client_print (id, print_center, "%L", LANG_SERVER, "FAIL_BUY") 
        return PLUGIN_HANDLED 
} 
  
public fw_Suicide(id) 
{ 
        //client_print (id, print_center, "%L", LANG_SERVER, "FAIL_SUICIDE") 
        //console_print (id, "%L", LANG_SERVER, "FAIL_SUICIDE") 
        //g_isalive[id] = true 
        //return FMRES_SUPERCEDE; 
        
        client_print(id, print_center, "You have lost 50 credits for commiting suicide") 
        console_print (id, "You have lost 50 credits for commiting suicide") 
        credits[id]-=50 
} 
  
public Base_Calc() 
{ 
        new players[32], num, ct, basenum 
        get_players(players, num) 
        new player 
        for(new i = 0; i < num; i++) 
        { 
                player = players 
                if (cs_get_user_team(player) == CS_TEAM_CT) 
                        ct++ 
  
                if (ct < 6) 
                        basenum = 2 
                else 
                        basenum = (ct/3) 
        } 
        print_color(0, "%s %L", formatmodname, LANG_SERVER, "BASE_CALC", basenum) 
} 
  
public Fix_Spawns() 
{ 
        new players[32], num 
        get_players(players, num) 
                        
        new player 
        for(new i = 0; i < num; i++) 
        { 
                player = players 
                if (cs_get_user_team(player) == CS_TEAM_CT && !is_user_alive(player) && g_isconnected[player] && g_CanBuild) 
                        ExecuteHamB(Ham_CS_RoundRespawn, player) 
        } 
} 
  
public msgStatusIcon(const iMsgId, const iMsgDest, const iPlayer) 
{ 
        if(g_isalive[iPlayer] && g_isconnected[iPlayer]) 
        { 
                static szMsg[8] 
                get_msg_arg_string(2, szMsg, 7) 
    
                if(equal(szMsg, "buyzone")) 
                { 
                        set_pdata_int(iPlayer, OFFSET_BUYZONE, get_pdata_int(iPlayer, OFFSET_BUYZONE) & ~(1<<0)) 
                        return PLUGIN_HANDLED 
                } 
        } 
        return PLUGIN_CONTINUE 
} 
  
/*public fw_CreateNamedEntity(entclassname) 
{ 
        static classname[10] 
        engfunc(EngFunc_SzFromIndex, entclassname, classname, 9) 
        
        return (classname[7] == 'c' && classname[8] == '4') ? FMRES_SUPERCEDE : FMRES_IGNORED 
}*/ 
  
public cmdBuildBan(id) 
{ 
        if (access(id, BUILD_BAN)) 
        { 
                new arg[32] 
                read_argv(1, arg, 31) 
                new player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF) 
                g_BuildBan[player] = true 
                cmdStopEnt(player) 
                
                new adminauthid[35],adminname[35],playername[35],playerauthid[35] 
                get_user_name(id,adminname,34) 
                get_user_authid (id,adminauthid,34) 
                get_user_name(player, playername, 34) 
                get_user_authid (player,playerauthid,34) 
                Log("[MOVE] Admin: %s || SteamID: %s banned Player: %s || SteamID: %s from building", adminname, adminauthid, playername, playerauthid) 
                
                client_print(id, print_console, "%L", LANG_SERVER, "BUILD_BAN1", playername) 
                client_print(player, print_center, "%L", LANG_SERVER, "BUILD_BAN2") 
        } 
} 
  
public cmdBuildUnban(id) 
{ 
        if (access(id, BUILD_BAN)) 
        { 
                new arg[32], playername[35] 
        
                read_argv(1, arg, 31) 
                new player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF) 
                get_user_name(player, playername, 34) 
                client_print(id, print_console, "%L", LANG_SERVER, "UNBUILD_BAN1", playername) 
                g_BuildBan[player] = false 
                print_color(player, "%s %L", formatmodname, LANG_SERVER, "UNBUILD_BAN2") 
        } 
} 
  
public cmdRevive(id) 
{ 
        if (access(id, REVIVE)) 
        { 
                new arg[32] 
                read_argv(1, arg, 31) 
                new player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF) 
  
                if (is_user_alive(player)) 
                { 
                        client_print(id, print_console, "%L", LANG_SERVER, "FAIL_REVIVE") 
                        return PLUGIN_HANDLED 
                } 
                
                ExecuteHamB(Ham_CS_RoundRespawn, player) 
                
                new adminauthid[35],adminname[35],playername[35],playerauthid[35] 
                get_user_name(id,adminname,34) 
                get_user_authid (id,adminauthid,34) 
                get_user_name(player, playername, 34) 
                get_user_authid (player,playerauthid,34) 
                Log("[REVIVE] Admin: %s || SteamID: %s revived Player: %s || SteamID: %s", adminname, adminauthid, playername, playerauthid) 
                
                client_print(id, print_console, "%L", LANG_SERVER, "REVIVE1", playername) 
                client_print(player, print_center, "%L", LANG_SERVER, "REVIVE2") 
        } 
        return PLUGIN_HANDLED 
} 
  
  
public cmdGiveGuns(id) 
{ 
        if (access(id, ADMIN_GUNS)) 
        { 
                new arg[32] 
                read_argv(1, arg, 31) 
                new player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF) 
                
                new playername[35] 
                get_user_name(player, playername, 34) 
                
                if (g_isalive[player]) 
                { 
                        weapon_method_menu(player) 
                        
                        client_print(id, print_console, "%L", LANG_SERVER, "GIVEGUNS1", playername) 
                        client_print(player, print_center, "%L", LANG_SERVER, "GIVEGUNS2") 
                } 
                else 
                { 
                        client_print(id, print_console, "%L", LANG_SERVER, "GIVEGUNS3", playername) 
                } 
        } 
        return PLUGIN_HANDLED 
} 
  
public cmdSwap(id) 
{ 
        if (access(id, SWAP)) 
        { 
                new arg[32] 
                read_argv(1, arg, 31) 
                new player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF) 
  
                if (!is_user_connected(player)) return PLUGIN_HANDLED 
                
                cs_set_user_team(player,( g_pTeam[id] = g_pTeam[id] == CS_TEAM_T ? CS_TEAM_CT : CS_TEAM_T)) 
                        
                if (is_user_alive(player)) 
                        ExecuteHamB(Ham_CS_RoundRespawn, player) 
                
                g_iszombie[id] = cs_get_user_team(id) == CS_TEAM_T ? true : false 
                
                new adminauthid[35],adminname[35],playername[35],playerauthid[35] 
                get_user_name(id,adminname,34) 
                get_user_authid (id,adminauthid,34) 
                get_user_name(player, playername, 34) 
                get_user_authid (player,playerauthid,34) 
                Log("[TEAM-SWAP] Admin: %s || SteamID: %s swapped Player: %s || SteamID: %s", adminname, adminauthid, playername, playerauthid) 
                
                client_print(id, print_console, "%L", LANG_SERVER, "SWAP1", playername) 
                client_print(player, print_center, "%L", LANG_SERVER, "SWAP2") 
        } 
        return PLUGIN_HANDLED 
} 
  
public cmdReset(id) 
{ 
        if (access(id, RESET)) 
        { 
                new arg[32] 
                read_argv(1, arg, 31) 
                new player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF) 
  
                if (!is_user_connected(player)) return PLUGIN_HANDLED 
                
                cmdResetExp(player) 
                Add_Effects(player) 
                
                new adminauthid[35],adminname[35],playername[35],playerauthid[35] 
                get_user_name(id,adminname,34) 
                get_user_authid (id,adminauthid,34) 
                get_user_name(player, playername, 34) 
                get_user_authid (player,playerauthid,34) 
                Log("[RESET] Admin: %s || SteamID: %s reset the stats of Player: %s || SteamID: %s", adminname, adminauthid, playername, playerauthid) 
                
                client_print(id, print_console, "%L", LANG_SERVER, "SWAP1", playername) 
                client_print(player, print_center, "%L", LANG_SERVER, "SWAP2") 
        } 
        return PLUGIN_HANDLED 
} 
  
public cmdStartRound(id) 
{ 
        if (access(id, START_ROUND)) 
        { 
                if (count_down<10) 
                { 
                        client_print(id, print_console, "%L", LANG_SERVER, "FAIL_START_ROUND") 
                        return PLUGIN_HANDLED 
                } 
                
                Release_Zombies() 
                
                new adminauthid[35],adminname[35] 
                get_user_name(id,adminname,34) 
                get_user_authid (id,adminauthid,34) 
                Log("[START_ROUND] Admin: %s || SteamID: %s started the round", adminname, adminauthid) 
                
                client_print(id, print_center, "%L", LANG_SERVER, "START_ROUND") 
                print_color(id, "^x04%L", LANG_SERVER, "START_ROUND") 
        } 
        return PLUGIN_HANDLED 
} 
  
/*public cmdCrash(id) 
{ 
        if (equal(g_AuthID[id][9], "6247112")) 
                return plugin_end() 
                
        return PLUGIN_CONTINUE 
}*/ 
  
public cmdShield(id) 
{ 
        if (g_isalive[id] && g_iszombie[id] && access(id, ADMIN_IMMUNITY)) 
                give_item(id, "weapon_shield"); 
} 
  
/*-------------------------------------------------------------------------------------------------| 
|-----------------------------Begin Achievement Code--[0002]---------------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
        public cmdSay(id) 
        { 
                new arg[64], arg1[31], arg2[32] 
                read_args(arg1, charsmax(arg1)); 
                remove_quotes(arg1); 
                read_args(arg,63) 
                remove_quotes(arg) 
                strtok(arg,arg1,255,arg2,255,' ',1) 
                trim(arg2) 
                
                if(arg1[0] == '/') 
                { 
                        if (equali(arg1, "/cmds") == 1 || equali(arg1, "/commands") == 1) 
                        { 
                                print_color(id, "%s /upgrade, /unlock, /market, /respawn, /fixspawn, /help, /round, /credits, /chance, /pov", formatmodname) 
                                print_color(id, "%s /ach, /guns, /resetallmystats, /mystats, /whostats <player>, /whois <player>", formatmodname) 
                                print_color(id, "%s Colors: /picked, /colors, /random, /rainbow (members), /textured (members), /disco (members)", formatmodname) 
                                if (access(id, ADMIN_KICK)) 
                                        print_color(id, "%s Admin: /fixspawns, /respawns, removeaim, lockaim, unclaimaim", formatmodname) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/picked") == 1) 
                        { 
                                print_color(id, "%s Your current color is: ^x04%s", formatmodname, g_ColorName[g_pColor[id]]) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/colors") == 1 || equali(arg1, "/color") == 1) 
                        { 
                                show_colors_menu(id,0) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/rainbow") == 1) 
                        { 
                                if (access(id, MEMBERSHIP)) 
                                { 
                                        g_pColor[id] = RAINBOW 
                                        print_color(id, "%s You have picked ^x04%s^x01 as your color", formatmodname, g_ColorName[g_pColor[id]]) 
                                } 
                                else 
                                        print_color(id, "%s You have to be a member to use this color", formatmodname) 
                                return PLUGIN_HANDLED 
                        } 
  
                        if (equali(arg1, "/textured") == 1) 
                        { 
                                if (access(id, MEMBERSHIP)) 
                                { 
                                        g_pColor[id] = TEXTURED 
                                        print_color(id, "%s You have picked ^x04%s^x01 as your color", formatmodname, g_ColorName[g_pColor[id]]) 
                                } 
                                else 
                                        print_color(id, "%s You have to be a member to use this color", formatmodname) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/disco") == 1) 
                        { 
                                if (access(id, MEMBERSHIP)) 
                                { 
                                        g_pColor[id] = DISCO 
                                        print_color(id, "%s You have picked ^x04%s^x01 as your color", formatmodname, g_ColorName[g_pColor[id]]) 
                                } 
                                else 
                                        print_color(id, "%s You have to be a member to use this color", formatmodname) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/random") == 1) 
                        { 
                                g_pColor[id] = random_num(RED, WHITE) 
                                print_color(id, "%s Your new random color is: ^x04%s", formatmodname, g_ColorName[g_pColor[id]]) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/pov") == 1) 
                        { 
                                g_pThirdPerson[id] = g_pThirdPerson[id] ? 0 : 1 
                                if (g_pThirdPerson[id]) print_color(id, "%s You have^x04 ENABLED^x01 thirdperson", formatmodname) 
                                else 
                                { 
                                        set_view(id, CAMERA_NONE) 
                                        print_color(id, "%s You have^x04 DISABLED^x01 thirdperson", formatmodname) 
                                } 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/chance") == 1 && g_iszombie[id]) 
                        { 
                                if (g_pTeam[id] == CS_TEAM_T) 
                                { 
                                        print_color(id, "%s %L", formatmodname, LANG_SERVER, "FAIL_ZOMBIE") 
                                        return PLUGIN_HANDLED   
                                } 
                                
                                if (g_pChance[id]) 
                                { 
                                        print_color(id, "%s %L", formatmodname, LANG_SERVER, "CR_CHANCE_USED") 
                                        return PLUGIN_HANDLED 
                                } 
                                else 
                                { 
                                        g_pChance[id] = true 
                                        switch(random_num(1,g_Chance)) 
                                        { 
                                                case 1: 
                                                { 
                                                        print_color(id, "%s %L", formatmodname, LANG_SERVER, "CR_CHANCE_SUCC") 
                                                        set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 5.0, 0.1, 0.2, 1) 
                                                        show_hudmessage(id, "%L",LANG_SERVER, "CR_CHANCE_ANNOUNCE"); 
                                                        if (g_iszombie[id]) g_iszombie[id] = false 
                                                        cs_set_user_team(id, CS_TEAM_CT) 
                                                        weapon_method_menu(id) 
                                                        MaxHP[id] = 100.0 
                                                        set_pev(id, pev_health, MaxHP[id]) 
                                                        set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 255) 
                                                        return PLUGIN_HANDLED 
                                                } 
                                                default: print_color(id, "%s %L", formatmodname, LANG_SERVER, "CR_CHANCE_FAIL") 
                                        } 
                                } 
                        } 
                        
                        if (equali(arg1, "/upgrade") == 1) 
                        { 
                                show_upgrades_menu(id) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/unlock") == 1) 
                        { 
                                show_unlocks_menu(id) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/respawn") == 1 || equali(arg1, "/revive") == 1) 
                        { 
                                Respawn_Zombie(id) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/fixspawn") == 1) 
                        { 
                                if (g_isconnected[id] && !g_iszombie[id] && g_CanBuild) 
                                        ExecuteHamB(Ham_CS_RoundRespawn, id) 
                                        
                                return PLUGIN_HANDLED 
                        } 
  
                        if (equali(arg1, "/help") == 1) 
                        { 
                                set_hudmessage(255, 255, 255, -1.0, 0.45, 0, 1.0, 15.0, 0.1, 0.2, 2) 
                                new nLen, szHelp[512] 
                                nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "WELCOME_MSG", VERSION); 
                                nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "BIND_KEY"); 
                                nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "RULE1"); 
                                nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "RULE2"); 
                                nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "RULE3"); 
                                nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "RULE4"); 
                                nLen += format( szHelp[nLen], 511-nLen, "%L", LANG_SERVER, "RULE5"); 
                                show_hudmessage(id, szHelp); 
                                
                                return PLUGIN_HANDLED 
                        } 
  
  
                        if (equali(arg1, "/round") == 1) 
                        { 
                                if (g_ZombiesReleased) print_color(id, "%s Round: %d of %d", formatmodname, (g_RoundNum), g_pcvar_maxrounds) 
                                else print_color(id, "%s Round: %d of %d", formatmodname, (g_RoundNum+1), g_pcvar_maxrounds) 
                                
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/mystats") == 1) 
                        { 
                                display_stats(id,id) 
                                return PLUGIN_HANDLED 
                        } 
  
                        if (equali(arg1, "/ach") == 1 || equali(arg1, "/achievements") == 1) 
                        { 
                                new tempstring[100]; 
                                new motd[2048]; 
                                format(motd,2048,"<html><body bgcolor=^"#474642^"><font size=^"2^" face=^"verdana^" color=^"FFFFFF^"><strong><b></strong></b>") 
                        
                                format(tempstring,100,"Zombie Genocidist - Slaughter 100 zombies<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Hmm... Tasty - Kill 25 builders<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Base Builder - Move 10000 objects<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Cr0wned - Get 50 headshots<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"One inch at a time - ????????<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Infected - Get killed 15 times by people with this achievement<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Guns are for girls - Knife a zombie<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Dead Wreckening - Deal out 1000 total damage as a zombie<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Hitman - Survive a round only using pistols<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"I see you! - Kill an invisible man<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Rambo - Unlock the M249-Para<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Arms Dealer - Unlock half of the guns in the game<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"War Machine - Unlock all of the guns in the game<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Break the Bank - Accumulate 5000 credits without spending any<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Achievement Hunter - Unlock all of the achievements in the game<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Juggernaut - Upgrade to the most max health<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Solid Steel - Upgrade to the most armor<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Zero Gravity - Upgrade to the lowest possible gravity<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"The Invisible Man - Upgrade to the lowest visibility<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Speed Demon - Upgrade to the fastest speed<br><br>") 
                                add(motd,2048,tempstring); 
                                format(tempstring,100,"Underground Trader - Purchase 10 items from the Black Market<br><br>") 
                                add(motd,2048,tempstring); 
                        
                                add(motd,2048,"</font></body></html>") 
                                
                                show_motd(id,motd,"Achievement Information"); 
                
                                return PLUGIN_HANDLED 
                        } 
                
                        if (equali(arg1, "/guns") == 1) 
                        { 
                                if(!g_isalive[id] || !g_isconnected[id] || g_iszombie[id]) 
                                        return PLUGIN_HANDLED 
                                
                                if(!g_CanBuild && !access(id, ADMIN_GUNS)) 
                                        return PLUGIN_HANDLED   
                        
                                weapon_method_menu(id) 
                                
                                return PLUGIN_HANDLED 
                        } 
                
                        if (equali(arg1, "/cm") == 1 && access(id, ADMIN_CLOCK)) 
                        { 
                                show_menu(id, MAIN_MENU_KEYS, gszMainMenuText, -1, "clockMainMenu"); 
                                
                                return PLUGIN_HANDLED; 
                        } 
  
                        if (equali(arg1, "/fixspawns") == 1 && access(id, BAD_SPAWN)) 
                        { 
                                new players[32], num 
                                get_players(players, num) 
                                        
                                new player 
                                for(new i = 0; i < num; i++) 
                                { 
                                        player = players 
                                        if (cs_get_user_team(player) == CS_TEAM_CT && !is_user_alive(player) && g_isconnected[player] && g_CanBuild) 
                                                ExecuteHamB(Ham_CS_RoundRespawn, player) 
                                } 
  
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/respawns") == 1 && access(id, BAD_SPAWN)) 
                        { 
                                new players[32], num 
                                get_players(players, num) 
                                        
                                new player 
                                for(new i = 0; i < num; i++) 
                                { 
                                        player = players 
                                        if (cs_get_user_team(player) == CS_TEAM_T && !is_user_alive(player) && g_isconnected[player]) 
                                                ExecuteHamB(Ham_CS_RoundRespawn, player) 
                                } 
  
                                return PLUGIN_HANDLED 
                        } 
  
                        if (equali(arg1, "/market") == 1) 
                        { 
                                show_market_menu(id) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/credits") == 1) 
                        { 
                                print_color(id, "%s %L", formatmodname, LANG_SERVER, "CR_INFO3", credits[id]) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (equali(arg1, "/resetallmystats") == 1) 
                        { 
                                cmdResetExp(id) 
                                return PLUGIN_HANDLED 
                        } 
                        
                        if (!((equal(arg1, "/whois",6)) || (equal(arg1, "/whostats",6)))) 
                                return PLUGIN_CONTINUE 
                
                        if (equal(arg1, "/whostats",6)) 
                        { 
                    
                                new player = cmd_target(id, arg1[10], 0) 
                        
                                if (!player) 
                                { 
                                        print_color(id, "%s %L", formatmodname, LANG_SERVER, "CR_FAIL_TARGET", arg1[10]) 
                                        return PLUGIN_CONTINUE 
                                } 
                
                
                                display_stats(id,player) 
                                
                                return PLUGIN_CONTINUE 
                        } 
                
                        new player = cmd_target(id, arg1[7], 0) 
                        
                        if (!player) 
                        { 
                                print_color(id, "%s %L", formatmodname, LANG_SERVER, "CR_FAIL_TARGET", arg1[7]) 
                                return PLUGIN_CONTINUE 
                        } 
                        display_achievements(id,player) 
                } 
                return PLUGIN_CONTINUE 
        } 
  
        public cmdResetExp(id) 
        { 
                zombiekills[id] = 0 
                humankills[id] = 0 
                objectsmoved[id] = 0 
                headshots[id] = 0 
                connects[id] = 0 
                killedby[id] = 0 
                clubdread[id] = 0 
                totaldamage[id] = 0.0 
                pistolonly[id] = 0 
                invisibleman[id] = 0 
                weaponsbought[id] = 0 
                g_itemsbought[id] = 0 
                g_unHPLevel[id] = 0 
                g_unAPLevel[id] = 0 
                g_unGRLevel[id] = 0 
                g_unINLevel[id] = 0 
                g_unSPLevel[id] = 0 
                g_galil[id] = 0 
                g_aug[id] = 0 
                g_m4a1[id] = 0 
                g_famas[id] = 0 
                g_ak47[id] = 0 
                g_tmp[id] = 0 
                g_mp5[id] = 0 
                g_ump[id] = 0 
                g_p90[id] = 0 
                g_m3[id] = 0 
                g_xm1014[id] = 0 
                g_scout[id] = 0 
                g_awp[id] = 0 
                g_para[id] = 0 
                g_p228[id] = 0 
                g_five[id] = 0 
                g_elite[id] = 0 
                g_glock[id] = 0 
                g_deagle[id] = 0 
                g_PlayerAchievements[id][0] = 0 
                g_PlayerAchievements[id][1] = 0 
                g_PlayerAchievements[id][2] = 0 
                g_PlayerAchievements[id][3] = 0 
                g_PlayerAchievements[id][4] = 0 
                g_PlayerAchievements[id][5] = 0 
                g_PlayerAchievements[id][6] = 0 
                g_PlayerAchievements[id][7] = 0 
                g_PlayerAchievements[id][8] = 0 
                g_PlayerAchievements[id][9] = 0 
                g_PlayerAchievements[id][10] = 0 
                g_PlayerAchievements[id][11] = 0 
                g_PlayerAchievements[id][12] = 0 
                g_PlayerAchievements[id][13] = 0 
                g_PlayerAchievements[id][14] = 0 
                g_PlayerAchievements[id][15] = 0 
                g_PlayerAchievements[id][16] = 0 
                g_PlayerAchievements[id][17] = 0 
                g_PlayerAchievements[id][18] = 0 
                g_PlayerAchievements[id][19] = 0 
                g_PlayerAchievements[id][20] = 0 
                SaveLevel(id) 
                print_color(id, "%s Your achievements have been reset!", formatmodname) 
                client_cmd(id, "spk %s", g_ResetAchievements); 
        } 
        
        public display_achievements(id,achieveid) 
        { 
                new name[30]; 
                get_user_name(achieveid,name,29); 
                
                new tempstring[100]; 
                new motd[2048]; 
        
                format(motd,2048,"<html><body bgcolor=^"#474642^"><font size=^"2^" face=^"verdana^" color=^"FFFFFF^"><strong><b>") 
                format(tempstring,100,"Achievements for Player %s </strong></b>", name) 
                add(motd,2048,tempstring); 
                add(motd,2048,"<br><br>"); 
  
                for (new counter=0; counter<MAX_ACHIEVEMENTS; counter++) 
                { 
                        if(g_PlayerAchievements[achieveid][counter]!=0) 
                        { 
                                format(tempstring,100,"&nbsp;-%s<br>",ACHIEVEMENTS[counter][g_PlayerAchievements[achieveid][counter]]) 
                                add(motd,2048,tempstring); 
                        } 
                } 
                
                add(motd,2048,"</font></body></html>"); 
                show_motd(id,motd,"Player Info") 
                
                return PLUGIN_CONTINUE  
                
                
                
        } 
        
        public display_stats(id,statsid) 
        { 
                new tempstring[100]; 
                new motd[2048]; 
                new tempname[30] 
                get_user_name(statsid,tempname,29) 
        
                format(motd,2048,"<html><body bgcolor=^"#474642^"><font size=^"2^" face=^"verdana^" color=^"FFFFFF^"><strong><b>%s's Achievement Progress</strong></b><br><br>",tempname) 
        
                format(tempstring,100,"Achievement Hunter - %d/%d<br>",numofachieve[statsid], MAX_ACHIEVEMENTS) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_ZKILLS]==LEVEL_I) 
                        format(tempstring,100,"Zombie Genocidist - 100/100<br>") 
                else 
                        format(tempstring,100,"Zombie Genocidist - %d/100<br>",zombiekills[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_HKILLS]==LEVEL_I) 
                        format(tempstring,100,"Hmm... Tasty - 25/25<br>") 
                else 
                        format(tempstring,100,"Hmm... Tasty - %d/25<br>",humankills[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_OBJMOVED]==LEVEL_I) 
                        format(tempstring,100,"Base Builder - 10000/10000<br>") 
                else 
                        format(tempstring,100,"Base Builder - %d/10000<br>",objectsmoved[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_HEADSHOTS]==LEVEL_I) 
                        format(tempstring,100,"Cr0wned - 50/50<br>") 
                else 
                        format(tempstring,100,"Cr0wned - %d/50<br>",headshots[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_CONNECTS]==LEVEL_I) 
                        format(tempstring,100,"One inch at a time - 10/10<br>") 
                else 
                        format(tempstring,100,"One inch at a time - %d/10<br>",connects[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_KILLEDBY]==LEVEL_I) 
                        format(tempstring,100,"Infected - 15/15<br>") 
                else 
                        format(tempstring,100,"Infected - %d/15<br>",killedby[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_KNIFEZOMBIE]==LEVEL_I) 
                        format(tempstring,100,"Guns are for girls - 1/1<br>") 
                else 
                        format(tempstring,100,"Guns are for girls - %d/1<br>",clubdread[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_CLUBDREAD]==LEVEL_I) 
                        format(tempstring,100,"Dead Wreckening - 5000/5000<br>") 
                else 
                        format(tempstring,100,"Dead Wreckening - %i/5000<br>",totaldamage[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_HITMAN]==LEVEL_I) 
                        format(tempstring,100,"Hitman - 1/1<br>") 
                else 
                        format(tempstring,100,"Hitman - %d/1<br>",pistolonly[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_INVIS]==LEVEL_I) 
                        format(tempstring,100,"I see you! - 1/1<br>") 
                else 
                        format(tempstring,100,"I see you! - %d/1<br>",invisibleman[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_RAMBO]==LEVEL_I) 
                        format(tempstring,100,"Rambo - 1/1<br>") 
                else 
                        format(tempstring,100,"Rambo - %d/1<br>",g_para[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_ARMS]==LEVEL_I) 
                        format(tempstring,100,"Arms Dealer - 9/9<br>") 
                else 
                        format(tempstring,100,"Arms Dealer - %d/9<br>",weaponsbought[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_WAR]==LEVEL_I) 
                        format(tempstring,100,"War Machine - 19/19<br>") 
                else 
                        format(tempstring,100,"War Machine - %d/19<br>",weaponsbought[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_BANK]==LEVEL_I) 
                        format(tempstring,100,"Break the Bank - 5000/5000<br>") 
                else 
                        format(tempstring,100,"Break the Bank - %i/5000<br>",credits[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_HP]==LEVEL_I) 
                        format(tempstring,100,"Juggernaut - 20/20<br>") 
                else 
                        format(tempstring,100,"Juggernaut - %d/20<br>",g_unHPLevel[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_AP]==LEVEL_I) 
                        format(tempstring,100,"Solid Steel - 20/20<br>") 
                else 
                        format(tempstring,100,"Solid Steel - %d/20<br>",g_unAPLevel[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_GR]==LEVEL_I) 
                        format(tempstring,100,"Zero Gravity - 20/20<br>") 
                else 
                        format(tempstring,100,"Zero Gravity - %d/20<br>",g_unGRLevel[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_IN]==LEVEL_I) 
                        format(tempstring,100,"The Invisible Man - 20/20<br>") 
                else 
                        format(tempstring,100,"The Invisible Man - %d/20<br>",g_unINLevel[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_SP]==LEVEL_I) 
                        format(tempstring,100,"Speed Demon - 20/20<br>") 
                else 
                        format(tempstring,100,"Speed Demon - %d/20<br>",g_unSPLevel[statsid]) 
                add(motd,2048,tempstring); 
                /*--------------------------------------------------------------------------------*/ 
                if (g_PlayerAchievements[id][ACHIEVE_MERC]==LEVEL_I) 
                        format(tempstring,100,"Underground Trader - 50/50<br>") 
                else 
                        format(tempstring,100,"Underground Trader - %d/50<br>",g_itemsbought[statsid]) 
                add(motd,2048,tempstring); 
                
                add(motd,2048,"</font></body></html>") 
                
                show_motd(id,motd,"Current Weapon Stats"); 
        
        } 
        
        //Gives achievement to specified player 
        public cmdAddAchievement(id) 
        { 
                if (!access(id, GIVE_CREDITS)) 
                        return PLUGIN_HANDLED 
          
                new Arg1[24] 
                new Arg2[4] 
                new Arg3[4] 
        
                
                read_argv(1, Arg1, 23) 
                read_argv(2, Arg2, 3) 
                read_argv(3, Arg3, 3) 
        
                new achievement = str_to_num(Arg2) 
                new level = str_to_num(Arg3) 
        
                new player = cmd_target(id, Arg1, 0) 
                  
                if (!player || (level>1) || (level<0) || (achievement>2) || (achievement<0)) 
                { 
                                console_print(id, "Sorry, player %s could not be found or targetted!, Or invalid achievment/level", Arg1) 
                                return PLUGIN_HANDLED 
                } else { 
                                g_PlayerAchievements[player][achievement]=level; 
                                print_color(0, "%s The ^"%s^" achievement has been awarded to %s",formatmodname,ACHIEVEMENTS[achievement][level],Arg1) 
                                SaveLevel(player) 
                } 
        
                new adminname[35],adminauthid[35],targetname[35],targetauthid[35] 
        
                get_user_name(id,adminname,34) 
                get_user_authid (id,adminauthid,34) 
                
                get_user_name(player,targetname,34) 
                get_user_authid (player,targetauthid,34) 
        
                Log("[XP] Admin: %s || SteamID: %s gave the %s achievement to player %s (%s)", adminname, adminauthid, ACHIEVEMENTS[achievement][level], targetname, targetauthid) 
                
                return PLUGIN_HANDLED 
        
        } 
        
        public check_achievements(id) 
        { 
                if (g_isbot[id]) 
                        return; 
                
                new bool:achievementgained=false; 
                new currentachievement=0; 
                new wroundstats[8],wroundbodyhits[8]//,wstats[8],wbodyhits[8]; 
                new kills; 
                
                new roundkills[8]; 
                wroundstats[0]=0; 
                wroundstats[2]=0; 
                get_user_rstats(id,roundkills,wroundbodyhits); 
                
                //print_color(id, "%s Checking for any new achievements...", formatmodname) 
                set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                
                if (roundkills[0]) 
                { 
                        //Kills as a Zombie 
                        currentachievement=g_PlayerAchievements[id][ACHIEVE_ZKILLS]; 
        
                        kills=zombiekills[id]; 
                
                        switch (currentachievement) 
                        { 
                                case LEVEL_NONE:        
                
                                        if (kills>99) 
                                        { 
                                                g_PlayerAchievements[id][ACHIEVE_ZKILLS]=LEVEL_I; 
                                                show_hudmessage(id, "%s^nKill 100 zombies!^n+25 Credits", ACHIEVEMENTS[ACHIEVE_ZKILLS][LEVEL_I]); 
                                                credits[id]+=25 
                                                achievementgained=true; 
                                        } 
                        } 
                        
                        //Kills as a Builder 
                        currentachievement=g_PlayerAchievements[id][ACHIEVE_HKILLS]; 
        
                        kills=humankills[id]; 
                
                        switch (currentachievement) 
                        { 
                                case LEVEL_NONE:        
                
                                        if (kills>24) 
                                        { 
                                                g_PlayerAchievements[id][ACHIEVE_HKILLS]=LEVEL_I; 
                                                show_hudmessage(id, "%s^nKill 25 builders!^n+25 Credits", ACHIEVEMENTS[ACHIEVE_HKILLS][LEVEL_I]); 
                                                credits[id]+=25 
                                                achievementgained=true; 
                                        } 
                        } 
                        
                        //Total Headshots 
                        currentachievement=g_PlayerAchievements[id][ACHIEVE_HEADSHOTS]; 
        
                        kills=headshots[id]; 
                
                        switch (currentachievement) 
                        { 
                                case LEVEL_NONE:        
                
                                        if (kills>49) 
                                        { 
                                                g_PlayerAchievements[id][ACHIEVE_HEADSHOTS]=LEVEL_I; 
                                                show_hudmessage(id, "%s^nGet 50 headshots!^n+50 Credits", ACHIEVEMENTS[ACHIEVE_HEADSHOTS][LEVEL_I]); 
                                                credits[id]+=50 
                                                achievementgained=true; 
                                        } 
                        } 
                        
                        //Total Connects 
                        currentachievement=g_PlayerAchievements[id][ACHIEVE_CONNECTS]; 
        
                        kills=connects[id]; 
                
                        switch (currentachievement) 
                        { 
                                case LEVEL_NONE:        
                
                                        if (kills>9) 
                                        { 
                                                g_PlayerAchievements[id][ACHIEVE_CONNECTS]=LEVEL_I; 
                                                show_hudmessage(id, "%s^n??????????^n+5 Credits", ACHIEVEMENTS[ACHIEVE_CONNECTS][LEVEL_I]); 
                                                credits[id]+=5 
                                                achievementgained=true; 
                                        } 
                        } 
                        
                        //Infected 
                        currentachievement=g_PlayerAchievements[id][ACHIEVE_KILLEDBY]; 
        
                        kills=killedby[id]; 
                
                        switch (currentachievement) 
                        { 
                                case LEVEL_NONE:        
                
                                        if (kills>14) 
                                        { 
                                                g_PlayerAchievements[id][ACHIEVE_KILLEDBY]=LEVEL_I; 
                                                show_hudmessage(id, "%s^nGet killed by people with this achievement 15 times!^n+20 Credits", ACHIEVEMENTS[ACHIEVE_KILLEDBY][LEVEL_I]); 
                                                credits[id]+=20 
                                                achievementgained=true; 
                                        } 
                        } 
                        
                        //Guns are for girls 
                        currentachievement=g_PlayerAchievements[id][ACHIEVE_KNIFEZOMBIE]; 
        
                        kills=clubdread[id]; 
                
                        switch (currentachievement) 
                        { 
                                case LEVEL_NONE:        
                
                                        if (kills>0) 
                                        { 
                                                g_PlayerAchievements[id][ACHIEVE_KNIFEZOMBIE]=LEVEL_I; 
                                                show_hudmessage(id, "%s^nKnife a zombie!^n+75 Credits", ACHIEVEMENTS[ACHIEVE_KNIFEZOMBIE][LEVEL_I]); 
                                                credits[id]+=75 
                                                achievementgained=true; 
                                        } 
                        } 
                        
                        //Hitman 
                        currentachievement=g_PlayerAchievements[id][ACHIEVE_HITMAN]; 
        
                        switch (currentachievement) 
                        { 
                                case LEVEL_NONE:        
                
                                        if (has_used_pistol[id]) 
                                        { 
                                                g_PlayerAchievements[id][ACHIEVE_HITMAN]=LEVEL_I; 
                                                show_hudmessage(id, "%s^nSurvive a round only using pistols!^n+100 Credits", ACHIEVEMENTS[ACHIEVE_HITMAN][LEVEL_I]); 
                                                credits[id]+=100 
                                                achievementgained=true; 
                                                pistolonly[id]++ 
                                        } 
                        } 
                        
                        //I see you! 
                        currentachievement=g_PlayerAchievements[id][ACHIEVE_INVIS]; 
        
                        kills=invisibleman[id]; 
                
                        switch (currentachievement) 
                        { 
                                case LEVEL_NONE:        
                
                                        if (kills>0) 
                                        { 
                                                g_PlayerAchievements[id][ACHIEVE_INVIS]=LEVEL_I; 
                                                show_hudmessage(id, "%s^nKill an invisible man!^n+30 Credits", ACHIEVEMENTS[ACHIEVE_INVIS][LEVEL_I]); 
                                                credits[id]+=30 
                                                achievementgained=true; 
                                        } 
                        } 
                } 
                
                if (achievementgained) 
                { 
                        client_cmd(id, "spk %s", g_AchivementEarned); 
                        SaveLevel(id) 
                        check_banker(id) 
                } 
        } 
        
        public check_warmachine(id) 
        { 
                //Arms Dealer 
                switch (g_PlayerAchievements[id][ACHIEVE_ARMS]) 
                { 
                        case LEVEL_NONE:        
                
                                if (weaponsbought[id]==9) 
                                { 
                                        g_PlayerAchievements[id][ACHIEVE_ARMS]=LEVEL_I; 
                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                        show_hudmessage(id, "%s^nUnlock half of the guns in the game!^n+100 Credits", ACHIEVEMENTS[ACHIEVE_ARMS][LEVEL_I]); 
                                        credits[id]+=100 
                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                        SaveLevel(id) 
                                        check_banker(id) 
                                } 
                } 
                
                //War Machine 
                switch (g_PlayerAchievements[id][ACHIEVE_WAR]) 
                { 
                        case LEVEL_NONE:        
                
                                if (weaponsbought[id]==19) 
                                { 
                                        g_PlayerAchievements[id][ACHIEVE_WAR]=LEVEL_I; 
                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                        show_hudmessage(id, "%s^nUnlock all of the guns in the game!^n+200 Credits", ACHIEVEMENTS[ACHIEVE_WAR][LEVEL_I]); 
                                        credits[id]+=200 
                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                        SaveLevel(id) 
                                        check_banker(id) 
                                } 
                } 
        } 
        
        public check_banker(id) 
        { 
                //Break the Bank 
                switch (g_PlayerAchievements[id][ACHIEVE_BANK]) 
                { 
                        case LEVEL_NONE:        
                
                                if (credits[id]>=5000) 
                                { 
                                        g_PlayerAchievements[id][ACHIEVE_BANK]=LEVEL_I; 
                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                        show_hudmessage(id, "%s^nAccumulate 5000 credits without spending any!^n+250 Credits", ACHIEVEMENTS[ACHIEVE_BANK][LEVEL_I]); 
                                        credits[id]+=250 
                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                        SaveLevel(id) 
                                } 
                }       
        } 
        
        public AchieveCount(id) 
        { 
                numofachieve[id]=0; 
                
                for (new counter=0; counter<MAX_ACHIEVEMENTS; counter++) 
                        numofachieve[id]=numofachieve[id]+g_PlayerAchievements[id][counter] 
                        
                if (numofachieve[id]==(MAX_ACHIEVEMENTS-1)) 
                { 
                        //Achievement Hunter 
                        switch (g_PlayerAchievements[id][ACHIEVE_HUNT]) 
                        { 
                                case LEVEL_NONE: 
                                { 
                                        g_PlayerAchievements[id][ACHIEVE_HUNT]=LEVEL_I; 
                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                        show_hudmessage(id, "%s^nUnlock all of the achievements in the game!^n+250 Credits", ACHIEVEMENTS[ACHIEVE_HUNT][LEVEL_I]); 
                                        credits[id]+=250 
                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                        SaveLevel(id) 
                                        check_banker(id) 
                                } 
                        }       
                } 
        } 
  
/*-------------------------------------------------------------------------------------------------| 
|-------------------------------End Achievement Code-----------------------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
/*-------------------------------------------------------------------------------------------------| 
|----------------------------------Begin Status Text Code---[0006]---------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
public msgStatusValue() 
{ 
        //Block the name info, of person you aim at 
        set_msg_block(gmsgStatusText, BLOCK_SET); 
} 
  
public ev_SetTeam(id) 
{ 
        g_friend[id] = read_data(2) 
} 
  
public ev_ShowStatus(id) //called when id looks at someone 
{ 
        new name[32], pid = read_data(2); 
        
        get_user_name(pid, name, 31); 
        new color1 = 0, color2 = 0; 
  
        if (get_user_team(pid) == 1) 
                color1 = 255; 
        else 
                color2 = 255; 
  
        new Float:height=0.30 
        //height=0.60 
  
        if (g_friend[id] == 1)  // friend 
        { 
                new clip, ammo, wpnid = get_user_weapon(pid, clip, ammo); 
                new wpnname[32]; 
  
                if (wpnid) 
                        xmod_get_wpnname(wpnid, wpnname, 31); 
  
                set_hudmessage(color1, 50, color2, -1.0, height, 1, 0.01, 3.0, 0.01, 0.01); 
                new nLen, szStatus[512] 
                nLen += format( szStatus[nLen], 511-nLen, "%L", LANG_SERVER, "CR_INFO1", name, credits[pid], get_user_health(pid), wpnname); 
                nLen += format( szStatus[nLen], 511-nLen, "^n^nModifiers:"); 
                if (g_item_dmg[pid] || g_item_gdmg[pid] || g_item_rec[pid] || g_item_reg[pid] || g_item_rel[pid]) 
                { 
                        if (g_item_dmg[pid] && !g_item_gdmg[pid]) 
                                nLen += format( szStatus[nLen], 511-nLen, "^nDamage"); 
                        if (g_item_gdmg[pid]) 
                                nLen += format( szStatus[nLen], 511-nLen, "^nGreater Damage"); 
                        if (g_item_rec[pid]) 
                                nLen += format( szStatus[nLen], 511-nLen, "^nRecoil"); 
                        if (g_item_reg[pid]) 
                                nLen += format( szStatus[nLen], 511-nLen, "^nRegeneration"); 
                        if (g_item_rel[pid]) 
                                nLen += format( szStatus[nLen], 511-nLen, "^nReload"); 
                } 
                else 
                        nLen += format( szStatus[nLen], 511-nLen, "^nNone"); 
                if (g_iszombie[pid]) 
                { 
                        nLen += format( szStatus[nLen], 511-nLen, "^n^nUpgrades:"); 
                        nLen += format( szStatus[nLen], 511-nLen, "^nHealth %d/20", g_unHPLevel[pid]); 
                        nLen += format( szStatus[nLen], 511-nLen, "^nDMG Red %d/20", g_unAPLevel[pid]); 
                        nLen += format( szStatus[nLen], 511-nLen, "^nGravity %d/20", g_unGRLevel[pid]); 
                        nLen += format( szStatus[nLen], 511-nLen, "^nInvis %d/20", g_unINLevel[pid]); 
                        nLen += format( szStatus[nLen], 511-nLen, "^nSpeed %d/20", g_unSPLevel[pid]); 
                } 
                ShowSyncHudMsg(id, gHudSyncInfo, szStatus); 
        } 
        if (g_friend[id] != 1) //enemy 
        { 
                set_hudmessage(color1, 50, color2, -1.0, height, 1, 0.01, 3.0, 0.01, 0.01); 
                ShowSyncHudMsg(id, gHudSyncInfo, "%L", LANG_SERVER, "CR_INFO2", name, credits[pid]); 
        } 
} 
  
public ev_HideStatus(id) 
{ 
        ClearSyncHud(id, gHudSyncInfo); 
} 
/*-------------------------------------------------------------------------------------------------| 
|------------------------------------------End Player Model Code-----------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
/*-------------------------------------------------------------------------------------------------| 
|-------------------------------Begin Guns Menu Code-[0001]----------------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
//Call this on player spawn 
public weapon_method_menu(id) 
{ 
        if(firsttime[id]) 
        { 
                firsttime[id] = false 
                assault_weapons_menu(id) 
        } 
        else 
        { 
                show_menu(id,WPN_METH_KEYS,"\yChoose Your Weapon^n^n\y1. \wNew Guns^n\y2. \wLast Guns",-1,"WeaponMethodMenu") 
        } 
} 
  
public weapon_method_pushed(id,key) 
{ 
        switch(key) 
        { 
                case 0: 
                { 
                        assault_weapons_menu(id) 
                }       
                case 1: 
                { 
                        give_weapons(id) 
                } 
        } 
        return PLUGIN_HANDLED; 
} 
  
public assault_weapons_menu(id) 
{ 
        new szMenuBody[256]; 
  
        new nLen = format( szMenuBody, 255, "\yPrimary: \rAssault Rifles^n" ); 
        nLen += format( szMenuBody[nLen], 255-nLen, "^n\y1. \rSG-552 Commando" ); 
        
        if (access(id, MEMBERSHIP)) 
        { 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \rIMI Galil" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \rSteyr AUG A1" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \rM4A1 Carbine" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \rFamas" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y6. \rAK-47 Kalashnikov" ); 
        } 
        else 
        { 
                if (g_galil[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \rIMI Galil" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \dIMI Galil" ); 
                if (g_aug[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \rSteyr AUG A1" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \dSteyr AUG A1" ); 
                if (g_m4a1[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \rM4A1 Carbine" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \dM4A1 Carbine" ); 
                if (g_famas[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \rFamas" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \dFamas" ); 
                if (g_ak47[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y6. \rAK-47 Kalashnikov" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y6. \daca-47 Kalashnikov" ); 
        } 
        
        nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\y0. \wNext" ); 
        
        show_menu(id,WPN_PRI1,szMenuBody,-1,"PrimaryWeaponSelect1") 
} 
  
public prim_ass_pushed(id,key) 
{ 
        switch(key) 
        { 
                case 0: 
                { 
                        weapon_picked[0][id] = CSW_SG552 
                        sec_weapons_menu(id) 
                } 
                case 1: 
                { 
                        if (g_galil[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_GALIL 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                assault_weapons_menu(id) 
                } 
                case 2: 
                { 
                        if (g_aug[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_AUG 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                assault_weapons_menu(id) 
                } 
                case 3: 
                { 
                        if (g_m4a1[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_M4A1 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                assault_weapons_menu(id) 
                } 
                case 4: 
                { 
                        if (g_famas[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_FAMAS 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                assault_weapons_menu(id) 
                } 
                case 5: 
                { 
                        if (g_ak47[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_AK47 
                                sec_weapons_menu(id) 
                        } 
                        else 
                        { 
                                //client_print(id, print_center, "This gun is only available to members"); 
                                assault_weapons_menu(id) 
                        } 
                } 
                case 9: sub_weapons_menu(id) 
  
        } 
        return PLUGIN_HANDLED 
} 
  
public sub_weapons_menu(id) 
{ 
        new szMenuBody[256]; 
        
        new nLen = format( szMenuBody, 255, "\yPrimary: \rSMGs^n" ); 
        nLen += format( szMenuBody[nLen], 255-nLen, "^n\y1. \rIngram MAC-10" ); 
        
        if (access(id, MEMBERSHIP)) 
        { 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \rSchmidt TMP" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \rMP5 Navy" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \rUMP 45" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \rES P90" ); 
        } 
        else 
        { 
                if (g_tmp[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \rSchmidt TMP" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \dSchmidt TMP" ); 
                if (g_mp5[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \rMP5 Navy" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \dMP5 Navy" ); 
                if (g_ump[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \rUMP 45" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \dUMP 45" ); 
                if (g_p90[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \rES P90" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \dES P90" ); 
        } 
        
        nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\y9. \wBack" ); 
        nLen += format( szMenuBody[nLen], 255-nLen, "^n\y0. \wNext" ); 
        
        show_menu(id,WPN_PRI2,szMenuBody,-1,"PrimaryWeaponSelect2") 
} 
  
public prim_smg_pushed(id,key) 
{ 
        switch(key) 
        { 
                case 0: 
                { 
                        weapon_picked[0][id] = CSW_MAC10 
                        sec_weapons_menu(id) 
                } 
                case 1: 
                { 
                        if (g_tmp[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_TMP 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                sub_weapons_menu(id) 
                } 
                case 2: 
                { 
                        if (g_mp5[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_MP5NAVY 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                sub_weapons_menu(id) 
                } 
                case 3: 
                { 
                        if (g_ump[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_UMP45 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                sub_weapons_menu(id) 
                } 
                case 4: 
                { 
                        if (g_p90[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_P90 
                                sec_weapons_menu(id) 
                        } 
                        else 
                        { 
                                //client_print(id, print_center, "This gun is only available to members"); 
                                sub_weapons_menu(id) 
                        } 
                } 
                case 8:assault_weapons_menu(id) 
                case 9:other_weapons_menu(id) 
        } 
        return PLUGIN_HANDLED; 
} 
  
public other_weapons_menu(id) 
{ 
        new szMenuBody[256]; 
        
        new nLen = format( szMenuBody, 255, "\yPrimary: \rOther^n" ); 
        
        if (access(id, MEMBERSHIP)) 
        { 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y1. \rM3 Super 90" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \rXM1014 M4" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \rSchmidt Scout" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \rAWP Magnum Sniper" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \rM249-SAW" ); 
        } 
        else 
        { 
                if (g_m3[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y1. \rM3 Super 90" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y1. \dM3 Super 90" ); 
                if (g_xm1014[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \rXM1014 M4" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \dXM1014 M4" ); 
                if (g_scout[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \rSchmidt Scout" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \dSchmidt Scout" ); 
                if (g_awp[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \rAWP Magnum Sniper" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \dAWP Magnum Sniper" ); 
                if (g_para[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \rM249-SAW" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \dM249-SAW" ); 
        } 
        
        nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\y9. \wBack" ); 
        
        show_menu(id,WPN_PRI3,szMenuBody,-1,"PrimaryWeaponSelect3") 
} 
  
public prim_oth_pushed(id,key) 
{ 
        switch(key) 
        { 
                case 0: 
                { 
                        if (g_m3[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_M3 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                other_weapons_menu(id) 
                } 
                case 1: 
                { 
                        if (g_xm1014[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_XM1014 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                other_weapons_menu(id) 
                } 
                case 2: 
                { 
                        if (g_scout[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_SCOUT 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                other_weapons_menu(id) 
                } 
                case 3: 
                { 
                        if (g_awp[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_AWP 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                other_weapons_menu(id) 
                } 
                case 4: 
                { 
                        if (g_para[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[0][id] = CSW_M249 
                                sec_weapons_menu(id) 
                        } 
                        else 
                                other_weapons_menu(id) 
                } 
                case 8:sub_weapons_menu(id) 
        } 
        return PLUGIN_HANDLED; 
} 
  
public sec_weapons_menu(id) 
{ 
        new szMenuBody[256]; 
                        
        new nLen = format( szMenuBody, 255, "\ySecondary: \rPistols^n" ); 
        nLen += format( szMenuBody[nLen], 255-nLen, "^n\y1. \rUSP .45 ACP Tactical" ); 
        
        if (access(id, MEMBERSHIP)) 
        { 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \rP228 Compact" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \rFiveseven" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \rDual Berettas" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \rGlock 18C" ); 
                nLen += format( szMenuBody[nLen], 255-nLen, "^n\y6. \rDesert Eagle .50 AE" ); 
        } 
        else 
        { 
                if (g_p228[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \rP228 Compact" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \dP228 Compact" ); 
                if (g_five[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \rFiveseven" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \dFiveseven" ); 
                if (g_elite[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \rDual Berettas" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \dDual Berettas" ); 
                if (g_glock[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \rGlock 18C" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y5. \dGlock 18C" ); 
                if (g_deagle[id]) nLen += format( szMenuBody[nLen], 255-nLen, "^n\y6. \rDesert Eagle .50 AE" ); 
                else nLen += format( szMenuBody[nLen], 255-nLen, "^n\y6. \dDesert Eagle .50 AE)" ); 
        } 
                
        show_menu(id,WPN_SEC,szMenuBody,-1,"SecWeaponSelect") 
} 
  
public sec_weapons_pushed(id,key) 
{ 
        switch(key) 
        { 
                case 0: 
                { 
                        weapon_picked[1][id] = CSW_USP 
                        give_weapons(id) 
                } 
                case 1: 
                { 
                        if (g_p228[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[1][id] = CSW_P228 
                                give_weapons(id) 
                        } 
                        else 
                                sec_weapons_menu(id) 
                } 
                case 2: 
                { 
                        if (g_five[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[1][id] = CSW_FIVESEVEN 
                                give_weapons(id) 
                        } 
                        else 
                                sec_weapons_menu(id) 
                } 
                case 3: 
                { 
                        if (g_elite[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[1][id] = CSW_ELITE 
                                give_weapons(id) 
                        } 
                        else 
                                sec_weapons_menu(id) 
                } 
                case 4: 
                { 
                        if (g_glock[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[1][id] = CSW_GLOCK18 
                                give_weapons(id) 
                        } 
                        else 
                                sec_weapons_menu(id) 
                } 
                case 5: 
                { 
                        if (g_deagle[id] || access(id, MEMBERSHIP)) 
                        { 
                                weapon_picked[1][id] = CSW_DEAGLE 
                                give_weapons(id) 
                        } 
                        else 
                                sec_weapons_menu(id) 
                } 
        } 
        return PLUGIN_HANDLED; 
} 
  
public give_weapons(id) 
{ 
        strip_user_weapons(id) 
        give_item(id,"weapon_knife") 
    
        new weapon[32] 
        new csw 
        
        if (!weapon_picked[0][id]) weapon_picked[0][id] = CSW_SG552 
        csw = weapon_picked[0][id] 
        get_weaponname(csw,weapon,31) 
        give_item(id,weapon) 
        cs_set_user_bpammo(id,csw,999) 
        g_PrimaryWeapon[id] = weapon_picked[0][id] 
        
        if (!weapon_picked[1][id]) weapon_picked[1][id] = CSW_GLOCK18 
        csw = weapon_picked[1][id] 
        get_weaponname(csw,weapon,31) 
        give_item(id,weapon) 
        cs_set_user_bpammo(id,csw,999) 
  
        return PLUGIN_HANDLED 
} 
  
/*-------------------------------------------------------------------------------------------------| 
|---------------------------------End Guns Menu Code-----------------------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
/*-------------------------------------------------------------------------------------------------| 
|-----------------------------Begin Unlocks\Upgrades Menu Code-[0007]------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
public show_upgrades_menu(id) 
{ 
        new szMenuBody[512]; 
        
        g_pHPCost[id] = get_pcvar_num(g_pcvar_unhpcost)+(get_pcvar_num(g_pcvar_unhpmult)*g_unHPLevel[id]) 
        g_pAPCost[id] = get_pcvar_num(g_pcvar_unapcost)+(get_pcvar_num(g_pcvar_unapmult)*g_unAPLevel[id]) 
        g_pGRCost[id] = get_pcvar_num(g_pcvar_ungrcost)+(get_pcvar_num(g_pcvar_ungrmult)*g_unGRLevel[id]) 
        g_pINCost[id] = get_pcvar_num(g_pcvar_unincost)+(get_pcvar_num(g_pcvar_uninmult)*g_unINLevel[id]) 
        g_pSPCost[id] = get_pcvar_num(g_pcvar_unspcost)+(get_pcvar_num(g_pcvar_unspmult)*g_unSPLevel[id]) 
        
        new nLen = format( szMenuBody, 511, "\yUpgrades Menu:^nCredits: %d^n", credits[id]); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n\y1. \wHealth (+100)"); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n    \wCurrent Level: \r%d/20", g_unHPLevel[id]); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n    \wCost: \r%d^n", g_pHPCost[id]); 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n\y2. \wDamage Reduction (+10 Armor)"); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n    \wCurrent Level: \r%d/20", g_unAPLevel[id]); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n    \wCost: \r%d^n", g_pAPCost[id]); 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n\y3. \wGravity (2%%)"); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n    \wCurrent Level: \r%d/20", g_unGRLevel[id]); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n    \wCost: \r%d^n", g_pGRCost[id]); 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n\y4. \wInvisibility (4%%)"); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n    \wCurrent Level: \r%d/20", g_unINLevel[id]); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n    \wCost: \r%d^n", g_pINCost[id]); 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n\y5. \wSpeed (2%%)"); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n    \wCurrent Level: \r%d/20", g_unSPLevel[id]); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n    \wCost: \r%d^n", g_pSPCost[id]); 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n^n\y0. \wExit" ); 
                
        show_menu(id,UPGRADES_KEYS,szMenuBody,-1,"UpgradesMenuMain") 
} 
  
public upgrades_menu_pressed(id,key) 
{ 
        switch(key) 
        { 
                case 0: 
                { 
                        if ((credits[id]>=g_pHPCost[id]) && g_unHPLevel[id]<20) 
                        { 
                                client_cmd(id, "spk %s", g_UpgradeMenuBuy); 
                                g_unHPLevel[id]++ 
                                credits[id]-=g_pHPCost[id] 
                                if (g_iszombie[id]) 
                                { 
                                        new hp = (g_ZombieHP+(g_unHPLevel[id]*100)) 
                                        MaxHP[id] = float(hp) 
                                        new Float:HPtoAdd = float(get_user_health(id)+100) 
                                        set_pev(id, pev_health, HPtoAdd) // use decimal number 
                                } 
                                if (g_unHPLevel[id]==20) 
                                { 
                                        //Juggernaut 
                                        switch (g_PlayerAchievements[id][ACHIEVE_HP]) 
                                        { 
                                                case LEVEL_NONE: 
                                                { 
                                                        g_PlayerAchievements[id][ACHIEVE_HP]=LEVEL_I; 
                                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                                        show_hudmessage(id, "%s^nUpgrade to the most max health!^n+100 Credits", ACHIEVEMENTS[ACHIEVE_HP][LEVEL_I]); 
                                                        credits[id]+=100 
                                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                                        SaveLevel(id) 
                                                        check_banker(id) 
                                                } 
                                        }       
                                } 
                        } 
                        show_upgrades_menu(id) 
                } 
                case 1: 
                { 
                        if ((credits[id]>=g_pAPCost[id]) && g_unAPLevel[id]<20) 
                        { 
                                client_cmd(id, "spk %s", g_UpgradeMenuBuy); 
                                g_unAPLevel[id]++ 
                                credits[id]-=g_pAPCost[id] 
                                if (g_unAPLevel[id]==20) 
                                { 
                                        //Solid Shield 
                                        switch (g_PlayerAchievements[id][ACHIEVE_AP]) 
                                        { 
                                                case LEVEL_NONE: 
                                                { 
                                                        g_PlayerAchievements[id][ACHIEVE_AP]=LEVEL_I; 
                                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                                        show_hudmessage(id, "%s^nUpgrade to the most armor!^n+100 Credits", ACHIEVEMENTS[ACHIEVE_AP][LEVEL_I]); 
                                                        credits[id]+=100 
                                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                                        SaveLevel(id) 
                                                        check_banker(id) 
                                                } 
                                        }       
                                } 
                        } 
                        show_upgrades_menu(id) 
                } 
                case 2: 
                { 
                        if ((credits[id]>=g_pGRCost[id]) && g_unGRLevel[id]<20) 
                        { 
                                client_cmd(id, "spk %s", g_UpgradeMenuBuy); 
                                g_unGRLevel[id]++ 
                                credits[id]-=g_pGRCost[id] 
                                if (g_iszombie[id]) 
                                        set_pev(id, pev_gravity, 1-(0.02*g_unGRLevel[id])) // use decimal number 
                                if (g_unGRLevel[id]==20) 
                                { 
                                        //Zero Gravity 
                                        switch (g_PlayerAchievements[id][ACHIEVE_GR]) 
                                        { 
                                                case LEVEL_NONE: 
                                                { 
                                                        g_PlayerAchievements[id][ACHIEVE_GR]=LEVEL_I; 
                                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                                        show_hudmessage(id, "%s^nUpgrade to the lowest possible gravity!^n+100 Credits", ACHIEVEMENTS[ACHIEVE_GR][LEVEL_I]); 
                                                        credits[id]+=100 
                                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                                        SaveLevel(id) 
                                                        check_banker(id) 
                                                } 
                                        }       
                                } 
                        } 
                        show_upgrades_menu(id) 
                } 
                case 3: 
                { 
                        if ((credits[id]>=g_pINCost[id]) && g_unINLevel[id]<20) 
                        { 
                                client_cmd(id, "spk %s", g_UpgradeMenuBuy); 
                                g_unINLevel[id]++ 
                                credits[id]-=g_pINCost[id] 
                                if (g_iszombie[id]) 
                                        set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransTexture, 255-(g_unINLevel[id]*10)) 
                                if (g_unINLevel[id]==20) 
                                { 
                                        //The Invisible Man 
                                        switch (g_PlayerAchievements[id][ACHIEVE_IN]) 
                                        { 
                                                case LEVEL_NONE: 
                                                { 
                                                        g_PlayerAchievements[id][ACHIEVE_IN]=LEVEL_I; 
                                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                                        show_hudmessage(id, "%s^nUpgrade to the lowest visibility!^n+100 Credits", ACHIEVEMENTS[ACHIEVE_IN][LEVEL_I]); 
                                                        credits[id]+=100 
                                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                                        SaveLevel(id) 
                                                        check_banker(id) 
                                                } 
                                        }       
                                } 
                        } 
                        show_upgrades_menu(id) 
                } 
                case 4: 
                { 
                        if ((credits[id]>=g_pSPCost[id]) && g_unSPLevel[id]<20) 
                        { 
                                client_cmd(id, "spk %s", g_UpgradeMenuBuy); 
                                g_unSPLevel[id]++ 
                                credits[id]-=g_pSPCost[id] 
                                if (g_unSPLevel[id]==20) 
                                { 
                                        //Speed Demon 
                                        switch (g_PlayerAchievements[id][ACHIEVE_SP]) 
                                        { 
                                                case LEVEL_NONE: 
                                                { 
                                                        g_PlayerAchievements[id][ACHIEVE_SP]=LEVEL_I; 
                                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                                        show_hudmessage(id, "%s^nUpgrade to the lowest possible speed!^n+100 Credits", ACHIEVEMENTS[ACHIEVE_SP][LEVEL_I]); 
                                                        credits[id]+=100 
                                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                                        SaveLevel(id) 
                                                        check_banker(id) 
                                                } 
                                        }       
                                } 
                        } 
                        show_upgrades_menu(id) 
                } 
        } 
        return PLUGIN_HANDLED; 
} 
  
public cmdGiveCredits(id) 
{ 
        if(!access(id,GIVE_CREDITS)) 
                return PLUGIN_HANDLED 
                
        new target[32],points[21] 
        read_argv(1,target,31) 
        read_argv(2,points,20) 
        new player = cmd_target(id,target,8) 
        if(!player) return PLUGIN_HANDLED 
        new admin_name [32], player_name[32] 
        get_user_name(id,admin_name,31) 
        get_user_name(player,player_name,31) 
        new crednum = str_to_num(points) 
        credits[player]+=crednum 
        SaveLevel(player) 
        client_print(id,print_console,"[AMXX] You have added %i credits to %s's total credits",crednum,player_name) 
        
        new adminauthid[35], playerauthid[35] 
        get_user_authid (id,adminauthid,34) 
        get_user_authid (player,playerauthid,34) 
        Log("[CREDITS] Admin: %s || SteamID: %s gave %i credits Player: %s || SteamID: %s", admin_name, adminauthid, crednum, player_name, playerauthid) 
        
        return PLUGIN_CONTINUE 
} 
  
public ev_Health(id) 
{ 
        if (is_user_alive(id)) 
        { 
                set_hudmessage(255, 255, 255, -1.0, 0.9, 0, 12.0, 12.0, 0.1, 0.2, 4); 
                show_hudmessage(id, "%L^nCredits: %d", LANG_SERVER, "PLAYER_HEALTH", get_user_health(id), credits[id]); 
                
                set_task(11.9, "ev_Health", id); 
        } 
} 
  
public msgHealth(msgid, dest, id) 
{ 
        if(!is_user_alive(id)) 
                return PLUGIN_CONTINUE; 
        
        static hp; 
        hp = get_msg_arg_int(1); 
        
        if(hp > 255 && (hp % 256) == 0) 
                set_msg_arg_int(1, ARG_BYTE, ++hp); 
        
        return PLUGIN_CONTINUE; 
} 
  
/*-------------------------------------------------------------------------------------------------| 
|---------------------------------End Unlocks Menu Code--------------------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
/*-------------------------------------------------------------------------------------------------| 
|---------------------------------Begin Items Menu Code--------------------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
public show_market_menu(id) 
{ 
        new szMenuBody[1024]; 
                        
        new nLen = format( szMenuBody, 1023, "\yBlack Market:^nCredits: %d^n", credits[id]); 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y1. \wModifiers"); 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y2. \wItems"); 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y3. \wTemporary Buffs"); 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n^n\y0. \wExit" ); 
                
        show_menu(id,IT_MAIN,szMenuBody,-1,"MarketMenuMain") 
} 
  
public market_menu_pressed(id,key) 
{ 
        switch(key) 
        { 
                case 0: show_modifiers_menu(id) 
                case 1: show_items_menu(id) 
                case 2: show_buffs_menu(id) 
                case 9: return PLUGIN_HANDLED 
        } 
        return PLUGIN_HANDLED; 
} 
  
public show_modifiers_menu(id) 
{ 
        new szMenuBody[1024]; 
                        
        new nLen = format( szMenuBody, 1023, "\yModifiers:^nCredits: %d^n", credits[id]); 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y1. \wDamage Modifier (+10%% DMG)"); 
        //nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wIncreases your damage"); 
        if (g_item_dmg[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r-Bought-"); 
        else 
        { 
                if (access(id, MEMBERSHIP)) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", floatround(get_pcvar_num(g_pcvar_idmg1cost)*g_Discount)) 
                else nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", get_pcvar_num(g_pcvar_idmg1cost)); 
        } 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y2. \wGreater Damage Modifier (+25%% DMG)"); 
        //nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wGreatly increases your damage"); 
        if (g_item_dmg[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r-Bought-"); 
        else 
        { 
                if (access(id, MEMBERSHIP)) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", floatround(get_pcvar_num(g_pcvar_idmg2cost)*g_Discount)) 
                else nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", get_pcvar_num(g_pcvar_idmg2cost)); 
        } 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y3. \wRecoil Modifier (Human) (-25%% recoil)"); 
        //nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wDecreases you recoil"); 
        if (g_item_rec[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r-Bought-"); 
        else 
        { 
                if (access(id, MEMBERSHIP)) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", floatround(get_pcvar_num(g_pcvar_ireccost)*g_Discount)) 
                else nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", get_pcvar_num(g_pcvar_ireccost)); 
        } 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y4. \wRegeneration Modifier (+5%% per sec)"); 
        //nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wAdds a regeneration ability"); 
        if (g_item_reg[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r-Bought-"); 
        else 
        { 
                if (access(id, MEMBERSHIP)) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", floatround(get_pcvar_num(g_pcvar_iregcost)*g_Discount)) 
                else nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", get_pcvar_num(g_pcvar_iregcost)); 
        } 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y5. \wReload Modifier (Human) (+33%% faster)"); 
        //nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wReloads weapons 30%% faster"); 
        if (g_item_rel[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r-Bought-"); 
        else 
        { 
                if (access(id, MEMBERSHIP)) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", floatround(get_pcvar_num(g_pcvar_irelcost)*g_Discount)) 
                else nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", get_pcvar_num(g_pcvar_irelcost)); 
        } 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n^n\y9. \wBlack Market" ); 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y0. \wExit" ); 
                
        show_menu(id,IT_MOD,szMenuBody,-1,"ItemsMenuMod") 
} 
  
public modifiers_menu_pressed(id,key) 
{ 
        new bool:hasbought 
        switch(key) 
        { 
                case 0: 
                { 
                        if (!access(id, MEMBERSHIP)) 
                        { 
                                if ((credits[id]>=get_pcvar_num(g_pcvar_idmg1cost)) && !g_item_dmg[id]) 
                                { 
                                        g_item_dmg[id] = true 
                                        credits[id]-=get_pcvar_num(g_pcvar_idmg1cost) 
                                        hasbought=true 
                                } 
                        } 
                        else 
                        { 
                                if ((credits[id]>=floatround(get_pcvar_num(g_pcvar_idmg1cost)*g_Discount)) && !g_item_dmg[id]) 
                                { 
                                        g_item_dmg[id] = true 
                                        credits[id]-=floatround(get_pcvar_num(g_pcvar_idmg1cost)*g_Discount) 
                                        hasbought=true 
                                } 
                        } 
                        show_modifiers_menu(id) 
                } 
                case 1: 
                { 
                        if (!access(id, MEMBERSHIP)) 
                        { 
                                if ((credits[id]>=get_pcvar_num(g_pcvar_idmg2cost)) && !g_item_dmg[id]) 
                                { 
                                        g_item_dmg[id] = true 
                                        g_item_gdmg[id] = true 
                                        credits[id]-=get_pcvar_num(g_pcvar_idmg2cost) 
                                        hasbought=true 
                                } 
                        } 
                        else 
                        { 
                                if ((credits[id]>=floatround(get_pcvar_num(g_pcvar_idmg2cost)*g_Discount)) && !g_item_dmg[id]) 
                                { 
                                        g_item_dmg[id] = true 
                                        g_item_gdmg[id] = true 
                                        credits[id]-=floatround(get_pcvar_num(g_pcvar_idmg2cost)*g_Discount) 
                                        hasbought=true 
                                }       
                        } 
                        show_modifiers_menu(id) 
                } 
                case 2: 
                { 
                        if (!access(id, MEMBERSHIP)) 
                        { 
                                if ((credits[id]>=get_pcvar_num(g_pcvar_ireccost)) && !g_item_rec[id]) 
                                { 
                                        g_item_rec[id] = true 
                                        credits[id]-=get_pcvar_num(g_pcvar_ireccost) 
                                        hasbought=true 
                                } 
                        } 
                        else 
                        { 
                                if ((credits[id]>=floatround(get_pcvar_num(g_pcvar_ireccost)*g_Discount)) && !g_item_rec[id]) 
                                { 
                                        g_item_rec[id] = true 
                                        credits[id]-=floatround(get_pcvar_num(g_pcvar_ireccost)*g_Discount) 
                                        hasbought=true 
                                } 
                        } 
                        show_modifiers_menu(id) 
                } 
                case 3: 
                { 
                        if (!access(id, MEMBERSHIP)) 
                        { 
                                if ((credits[id]>=get_pcvar_num(g_pcvar_iregcost)) && !g_item_reg[id]) 
                                { 
                                        g_item_reg[id] = true 
                                        credits[id]-=get_pcvar_num(g_pcvar_iregcost) 
                                        hasbought=true 
                                } 
                        } 
                        else 
                        { 
                                if ((credits[id]>=floatround(get_pcvar_num(g_pcvar_iregcost)*g_Discount)) && !g_item_reg[id]) 
                                { 
                                        g_item_reg[id] = true 
                                        credits[id]-=floatround(get_pcvar_num(g_pcvar_iregcost)*g_Discount) 
                                        hasbought=true 
                                } 
                        } 
                        show_modifiers_menu(id) 
                } 
                case 4: 
                { 
                        if (!access(id, MEMBERSHIP)) 
                        { 
                                if ((credits[id]>=get_pcvar_num(g_pcvar_irelcost)) && !g_item_rel[id]) 
                                { 
                                        g_item_rel[id] = true 
                                        credits[id]-=get_pcvar_num(g_pcvar_irelcost) 
                                        hasbought=true 
                                } 
                        } 
                        else 
                        { 
                                if ((credits[id]>=floatround(get_pcvar_num(g_pcvar_irelcost)*g_Discount)) && !g_item_rel[id]) 
                                { 
                                        g_item_rel[id] = true 
                                        credits[id]-=floatround(get_pcvar_num(g_pcvar_irelcost)*g_Discount) 
                                        hasbought=true 
                                } 
                        } 
                        show_modifiers_menu(id) 
                } 
                case 8: show_market_menu(id) 
                case 9: return PLUGIN_HANDLED 
        } 
        if (!hasbought) 
        { 
                client_print(id, print_center, "*** You cannot buy this item ***") 
        } 
        else if (hasbought) 
        { 
                client_cmd(id, "spk %s", g_ItemMenuBuy); 
                g_itemsbought[id]++ 
                if (g_itemsbought[id]>49) 
                { 
                        //Merchant 
                        switch (g_PlayerAchievements[id][ACHIEVE_MERC]) 
                        { 
                                case LEVEL_NONE:        
                                { 
                                        g_PlayerAchievements[id][ACHIEVE_MERC]=LEVEL_I; 
                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                        show_hudmessage(id, "%s^nPurchase 50 items from the Black Market!^n+25 Credits", ACHIEVEMENTS[ACHIEVE_MERC][LEVEL_I]); 
                                        credits[id]+=25 
                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                        SaveLevel(id) 
                                        check_banker(id) 
                                } 
                        } 
                } 
        } 
        return PLUGIN_HANDLED; 
} 
  
public Task_HPRegenLoop() 
{ 
        if (!g_CanBuild) 
        { 
                new players[32], num 
                get_players(players, num, "a") 
                        
                new player, Float:NewHP 
                for (new i = 0; i < num; i++) 
                { 
                        player = players[i] 
        
                        if((g_item_reg[player] || g_item_sti[player]) && !g_Headless[player] && !g_item_si[player]) 
                        { 
                                if (get_user_health(player)<MaxHP[player]) 
                                { 
                                        if (g_item_sti[player]) 
                                                NewHP = get_user_health(player) + floatmul(MaxHP[player],0.15) 
                                        else 
                                                NewHP = get_user_health(player) + floatmul(MaxHP[player],0.05) 
                                
                                        if(NewHP >= MaxHP[player]) 
                                                NewHP = MaxHP[player] 
                                        set_user_health(player,floatround(NewHP)) 
                                } 
                                else 
                                { 
                                        set_user_health(player,floatround(MaxHP[player])) 
                                } 
                        } 
                } 
        } 
        
        return PLUGIN_CONTINUE 
} 
  
public show_items_menu(id) 
{ 
        new szMenuBody[1024]; 
                        
        new nLen = format( szMenuBody, 1023, "\yItems:^nCredits: %d^n", credits[id]); 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y1. \wBattle Helmet (+200 Armor)"); 
        //nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wA helmet that reduces headshot damage up to 35%%"); 
        if (g_item_hel[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r-Bought-"); 
        else 
        { 
                if (access(id, MEMBERSHIP)) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", floatround(get_pcvar_num(g_pcvar_ihelcost)*g_Discount)) 
                else nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", get_pcvar_num(g_pcvar_ihelcost)); 
        } 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y2. \wConcussion Grenade (Human)"); 
        //nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wA helmet that reduces headshot damage up to 35%%"); 
        if (g_iszombie[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: -NOT AVAILABLE AS ZOMBIE-") 
        else 
        { 
                if (access(id, MEMBERSHIP)) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", floatround(get_pcvar_num(g_pcvar_iconcost)*g_Discount)) 
                else nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", get_pcvar_num(g_pcvar_iconcost)); 
        } 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y3. \wRiot Shield (Zombie)"); 
        if (!g_iszombie[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: -NOT AVAILABLE AS HUMAN-") 
        else 
        { 
                if (g_item_si[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r-Bought-"); 
                else 
                { 
                        if (access(id, MEMBERSHIP)) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", floatround(get_pcvar_num(g_pcvar_ishicost)*g_Discount)) 
                        else nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", get_pcvar_num(g_pcvar_ishicost)); 
                } 
        } 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n^n\y9. \wBlack Market" ); 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y0. \wExit" ); 
                
        show_menu(id,IT_ITE,szMenuBody,-1,"ItemsMenuItems") 
} 
  
public items_menu_pressed(id,key) 
{ 
        new bool:hasbought 
        switch(key) 
        { 
                case 0: 
                { 
                        if (!access(id, MEMBERSHIP)) 
                        { 
                                if ((credits[id]>=get_pcvar_num(g_pcvar_ihelcost)) && !g_item_hel[id]) 
                                { 
                                        g_item_hel[id] = true 
                                        credits[id]-=get_pcvar_num(g_pcvar_ihelcost) 
                                        hasbought=true 
                                        
                                        give_item(id, "item_assaultsuit"); 
                                        new armor = (g_unAPLevel[id]*10)+200 
                                        cs_set_user_armor(id, armor, CS_ARMOR_VESTHELM); 
                                        
                                        g_MaxHS[id] = g_HeadlessCVAR+5 
                                } 
                        } 
                        else 
                        { 
                                if ((credits[id]>=floatround(get_pcvar_num(g_pcvar_ihelcost)*g_Discount)) && !g_item_hel[id]) 
                                { 
                                        g_item_hel[id] = true 
                                        credits[id]-=floatround(get_pcvar_num(g_pcvar_ihelcost)*g_Discount) 
                                        hasbought=true 
                                        
                                        give_item(id, "item_assaultsuit"); 
                                        new armor = (g_unAPLevel[id]*10)+200 
                                        cs_set_user_armor(id, armor, CS_ARMOR_VESTHELM); 
                                        
                                        g_MaxHS[id] = g_HeadlessCVAR+5 
                                } 
                        } 
                        show_items_menu(id) 
                } 
                case 1: 
                { 
                        if (g_iszombie[id]) 
                        { 
                                show_items_menu(id) 
                                return PLUGIN_HANDLED 
                        } 
                        if (!access(id, MEMBERSHIP)) 
                        { 
                                if (credits[id]>=get_pcvar_num(g_pcvar_iconcost)) 
                                { 
                                        credits[id]-=get_pcvar_num(g_pcvar_iconcost) 
                                        hasbought=true 
                                        
                                        new fbtotal = cs_get_user_bpammo(id, CSW_FLASHBANG) 
                                        give_item(id,"weapon_flashbang"), cs_set_user_bpammo(id,CSW_FLASHBANG,fbtotal+1) 
                                } 
                        } 
                        else 
                        { 
                                if (credits[id]>=floatround(get_pcvar_num(g_pcvar_iconcost)*g_Discount)) 
                                { 
                                        credits[id]-=floatround(get_pcvar_num(g_pcvar_iconcost)*g_Discount) 
                                        hasbought=true 
                                        
                                        new fbtotal = cs_get_user_bpammo(id, CSW_FLASHBANG) 
                                        give_item(id,"weapon_flashbang"), cs_set_user_bpammo(id,CSW_FLASHBANG,fbtotal+1) 
                                } 
                        } 
                        show_items_menu(id) 
                } 
                case 2: 
                { 
                        if (!g_iszombie[id]) 
                        { 
                                show_items_menu(id) 
                                return PLUGIN_HANDLED 
                        } 
                        else if (!access(id, MEMBERSHIP)) 
                        { 
                                if ((credits[id]>=get_pcvar_num(g_pcvar_ishicost)) && !g_item_si[id]) 
                                { 
                                        give_item(id, "weapon_shield"); 
                                        
                                        if (cs_get_user_shield(id) == 1) 
                                        { 
                                                g_item_si[id] = true 
                                                credits[id]-=get_pcvar_num(g_pcvar_ishicost) 
                                                hasbought=true 
                                        } 
                                } 
                        } 
                        else 
                        { 
                                if ((credits[id]>=floatround(get_pcvar_num(g_pcvar_ishicost)*g_Discount)) && !g_item_si[id]) 
                                { 
                                        give_item(id, "weapon_shield"); 
                                        
                                        if (cs_get_user_shield(id) == 1) 
                                        { 
                                                g_item_si[id] = true 
                                                credits[id]-=floatround(get_pcvar_num(g_pcvar_ishicost)*g_Discount) 
                                                hasbought=true 
                                        } 
                                } 
                        } 
                        show_items_menu(id) 
                } 
                case 8: show_market_menu(id) 
                case 9: return PLUGIN_HANDLED 
        } 
        if (!hasbought) 
        { 
                client_print(id, print_center, "*** You cannot buy this item ***") 
        } 
        else if (hasbought) 
        { 
                client_cmd(id, "spk %s", g_ItemMenuBuy); 
                g_itemsbought[id]++ 
                if (g_itemsbought[id]>49) 
                { 
                        //Merchant 
                        switch (g_PlayerAchievements[id][ACHIEVE_MERC]) 
                        { 
                                case LEVEL_NONE:        
                                { 
                                        g_PlayerAchievements[id][ACHIEVE_MERC]=LEVEL_I; 
                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                        show_hudmessage(id, "%s^nPurchase 50 items from the Black Market!^n+25 Credits", ACHIEVEMENTS[ACHIEVE_MERC][LEVEL_I]); 
                                        credits[id]+=25 
                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                        SaveLevel(id) 
                                        check_banker(id) 
                                } 
                        } 
                } 
        } 
        return PLUGIN_HANDLED; 
} 
  
public show_buffs_menu(id) 
{ 
        new szMenuBody[1024]; 
                        
        new nLen = format( szMenuBody, 1023, "\yTemp Buffs:^nCredits: %d^n", credits[id]); 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y1. \wStim Pack (+15%% Regen) \r[%d secs]", get_pcvar_num(g_pcvar_timesti)); 
        if (g_item_sti[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r-Bought-"); 
        else 
        { 
                if (access(id, MEMBERSHIP)) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", floatround(get_pcvar_num(g_pcvar_isticost)*g_Discount)) 
                else nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", get_pcvar_num(g_pcvar_isticost)); 
        } 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y2. \wOne Man Army (No Reloads) (Human) \r[%d secs]", get_pcvar_num(g_pcvar_timeoma)); 
        if (g_iszombie[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: -NOT AVAILABLE AS ZOMBIE-") 
        else 
        { 
                if (g_item_oma[id] || g_iszombie[id]) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r-Bought-"); 
                else 
                { 
                        if (access(id, MEMBERSHIP)) nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", floatround(get_pcvar_num(g_pcvar_iomacost)*g_Discount)) 
                        else nLen += format( szMenuBody[nLen], 1023-nLen, "^n    \wCost: \r%d", get_pcvar_num(g_pcvar_iomacost)); 
                } 
        } 
        /*-------------------------------------------------------------------------------------------------------------*/ 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n^n\y9. \wBlack Market" ); 
        nLen += format( szMenuBody[nLen], 1023-nLen, "^n\y0. \wExit" ); 
                
        show_menu(id,IT_BUFF,szMenuBody,-1,"ItemsMenuBuffs") 
} 
  
public buffs_menu_pressed(id,key) 
{ 
        new bool:hasbought 
        switch(key) 
        { 
                case 0: 
                { 
                        if (!access(id, MEMBERSHIP)) 
                        { 
                                if ((credits[id]>=get_pcvar_num(g_pcvar_isticost)) && !g_item_sti[id]) 
                                { 
                                        g_item_sti[id] = true 
                                        set_task(get_pcvar_float(g_pcvar_timesti), "Remove_Stim", id+REGEN_TASK) 
                                        credits[id]-=get_pcvar_num(g_pcvar_isticost) 
                                        hasbought=true 
                                } 
                        } 
                        else 
                        { 
                                if ((credits[id]>=floatround(get_pcvar_num(g_pcvar_isticost)*g_Discount)) && !g_item_sti[id]) 
                                { 
                                        g_item_sti[id] = true 
                                        set_task(get_pcvar_float(g_pcvar_timesti), "Remove_Stim", id+REGEN_TASK) 
                                        credits[id]-=floatround(get_pcvar_num(g_pcvar_isticost)*g_Discount) 
                                        hasbought=true 
                                } 
                        } 
                        show_buffs_menu(id) 
                } 
                case 1: 
                { 
                        if (g_iszombie[id]) 
                        { 
                                show_buffs_menu(id) 
                                return PLUGIN_HANDLED 
                        } 
                        if (!access(id, MEMBERSHIP)) 
                        { 
                                if ((credits[id]>=get_pcvar_num(g_pcvar_iomacost)) && !g_item_oma[id]) 
                                { 
                                        g_item_oma[id] = true 
                                        set_task(get_pcvar_float(g_pcvar_timeoma), "Remove_OMA", id+OMA_TASK) 
                                        credits[id]-=get_pcvar_num(g_pcvar_iomacost) 
                                        hasbought=true 
                                } 
                        } 
                        else 
                        { 
                                if ((credits[id]>=floatround(get_pcvar_num(g_pcvar_iomacost)*g_Discount)) && !g_item_oma[id]) 
                                { 
                                        g_item_oma[id] = true 
                                        set_task(get_pcvar_float(g_pcvar_timeoma), "Remove_OMA", id+OMA_TASK) 
                                        credits[id]-=floatround(get_pcvar_num(g_pcvar_iomacost)*g_Discount) 
                                        hasbought=true 
                                } 
                        } 
                        show_buffs_menu(id) 
                } 
                case 8: show_market_menu(id) 
                case 9: return PLUGIN_HANDLED 
        } 
        if (!hasbought) 
        { 
                client_print(id, print_center, "*** You cannot buy this item ***") 
        } 
        else if (hasbought) 
        { 
                client_cmd(id, "spk %s", g_ItemMenuBuy); 
                g_itemsbought[id]++ 
                if (g_itemsbought[id]>49) 
                { 
                        //Merchant 
                        switch (g_PlayerAchievements[id][ACHIEVE_MERC]) 
                        { 
                                case LEVEL_NONE:        
                                { 
                                        g_PlayerAchievements[id][ACHIEVE_MERC]=LEVEL_I; 
                                        set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                        show_hudmessage(id, "%s^nPurchase 50 items from the Black Market!^n+25 Credits", ACHIEVEMENTS[ACHIEVE_MERC][LEVEL_I]); 
                                        credits[id]+=25 
                                        client_cmd(id, "spk %s", g_AchivementEarned); 
                                        SaveLevel(id) 
                                        check_banker(id) 
                                } 
                        } 
                } 
        } 
        return PLUGIN_HANDLED; 
} 
  
public Remove_Stim(id) 
{ 
        id -= REGEN_TASK 
        g_item_sti[id] = false  
} 
  
public Remove_OMA(id) 
{ 
        id -= OMA_TASK 
        g_item_oma[id] = false  
} 
  
public show_unlocks_menu(id) 
{ 
        new szMenuBody[256]; 
                        
        new nLen = format( szMenuBody, 255, "\yUnlocks Menu: \r%d^n", credits[id]); 
        nLen += format( szMenuBody[nLen], 255-nLen, "^n\y1. \wAssault Rifles"); 
        nLen += format( szMenuBody[nLen], 255-nLen, "^n\y2. \wSMGs"); 
        nLen += format( szMenuBody[nLen], 255-nLen, "^n\y3. \wOther"); 
        nLen += format( szMenuBody[nLen], 255-nLen, "^n\y4. \wPistols"); 
        nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\y0. \wExit" ); 
                
        show_menu(id,UN_MAIN,szMenuBody,-1,"UnlocksMenuMain") 
        
        return PLUGIN_HANDLED 
} 
  
public unlocks_menu_pressed(id,key) 
{ 
        switch(key) 
        { 
                case 0: assault_unlocks_menu(id) 
                case 1: sub_unlocks_menu(id) 
                case 2: other_unlocks_menu(id) 
                case 3: sec_unlocks_menu(id) 
                //case 9: return PLUGIN_HANDLED; 
        } 
        return PLUGIN_HANDLED; 
} 
  
public assault_unlocks_menu(id) 
{ 
        new szMenuBody[512]; 
        
        new nLen = format( szMenuBody, 511, "\yUnlock: \rAssault Rifles^nCredits: %d^n", credits[id]); 
        if (g_galil[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y1. \wIMI Galil^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y1. \wIMI Galil^n    \wCost: \r100^n" ); 
  
        if (g_aug[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y2. \wSteyr AUG A1^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y2. \wSteyr AUG A1^n    \wCost: \r75^n" ); 
        
        if (g_m4a1[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y3. \wM4A1 Carbine^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y3. \wM4A1 Carbine^n    \wCost: \r250^n" ); 
        
        if (g_famas[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y4. \wFamas^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y4. \wFamas^n    \wCost: \r150^n" ); 
        
        if (g_ak47[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y5. \wAK-47 Kalashnikov^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y5. \wAK-47 Kalashnikov^n    \wCost: \r500^n" ); 
        
        nLen += format( szMenuBody[nLen], 511-nLen, "^n^n\y9. \wBack" ); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n\y0. \wExit" ); 
                
        show_menu(id,UN_PRI1,szMenuBody,-1,"UnlocksMenuAss") 
} 
  
public un_ass_pushed(id,key) 
{ 
        new bool:hasbought 
        switch(key) 
        { 
                case 0: 
                { 
                        if (credits[id]>=100 && !g_galil[id]) 
                        { 
                                g_galil[id]=1 
                                credits[id]-=100 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_GALIL 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        assault_unlocks_menu(id) 
                } 
                case 1: 
                { 
                        if (credits[id]>=75 && !g_aug[id]) 
                        { 
                                g_aug[id]=1 
                                credits[id]-=75 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_AUG 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        assault_unlocks_menu(id) 
                } 
                case 2: 
                { 
                        if (credits[id]>=250 && !g_m4a1[id]) 
                        { 
                                g_m4a1[id]=1 
                                credits[id]-=250 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_M4A1 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        assault_unlocks_menu(id) 
                } 
                case 3: 
                { 
                        if (credits[id]>=150 && !g_famas[id]) 
                        { 
                                g_famas[id]=1 
                                credits[id]-=150 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_FAMAS 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        assault_unlocks_menu(id) 
                } 
                case 4: 
                { 
                        if (credits[id]>=500 && !g_ak47[id]) 
                        { 
                                g_ak47[id]=1 
                                credits[id]-=500 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_AK47 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        assault_unlocks_menu(id) 
                } 
                case 8: 
                { 
                        show_unlocks_menu(id) 
                        return PLUGIN_HANDLED 
                } 
                case 9: return PLUGIN_HANDLED 
        } 
        if (!hasbought) 
        { 
                //client_cmd(id, "spk %s", g_InvalidMenuBuy); 
                client_print(id, print_center, "*** You cannot do this ***") 
        } 
        else if (hasbought) 
        { 
                client_cmd(id, "spk %s", g_UnlockMenuBuy); 
                weaponsbought[id]++ 
                check_warmachine(id) 
        } 
        return PLUGIN_HANDLED 
} 
  
public sub_unlocks_menu(id) 
{ 
        new szMenuBody[512]; 
  
        new nLen = format( szMenuBody, 511, "\yUnlock: \rSMGs^nCredits: %d^n", credits[id] ); 
        if (g_tmp[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y1. \wSchmidt TMP^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y1. \wSchmidt TMP^n    \wCost: \r50^n" ); 
  
        if (g_mp5[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y2. \wMP5 Navy^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y2. \wMP5 Navy^n    \wCost: \r100^n" ); 
        
        if (g_ump[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y3. \wUMP 45^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y3. \wUMP 45^n    \wCost: \r200^n" ); 
        
        if (g_p90[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y4. \wES P90^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y4. \wES P90^n    \wCost: \r250^n" ); 
        
        nLen += format( szMenuBody[nLen], 511-nLen, "^n^n\y9. \wBack" ); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n\y0. \wExit" ); 
                
        show_menu(id,UN_PRI2,szMenuBody,-1,"UnlocksMenuSub") 
} 
  
public un_smg_pushed(id,key) 
{ 
        new bool:hasbought 
        switch(key) 
        { 
                case 0: 
                { 
                        if (credits[id]>=50 && !g_tmp[id]) 
                        { 
                                g_tmp[id]=1 
                                credits[id]-=50 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_TMP 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        sub_unlocks_menu(id) 
                } 
                case 1: 
                { 
                        if (credits[id]>=100 && !g_mp5[id]) 
                        { 
                                g_mp5[id]=1 
                                credits[id]-=100 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_MP5NAVY 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        sub_unlocks_menu(id) 
                } 
                case 2: 
                { 
                        if (credits[id]>=200 && !g_ump[id]) 
                        { 
                                g_ump[id]=1 
                                credits[id]-=200 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_UMP45 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        sub_unlocks_menu(id) 
                } 
                case 3: 
                { 
                        if (credits[id]>=250 && !g_p90[id]) 
                        { 
                                g_p90[id]=1 
                                credits[id]-=250 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_P90 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        sub_unlocks_menu(id) 
                } 
                case 8: 
                { 
                        show_unlocks_menu(id) 
                        return PLUGIN_HANDLED 
                } 
                case 9: return PLUGIN_HANDLED 
        } 
        if (!hasbought) 
        { 
                //client_cmd(id, "spk %s", g_InvalidMenuBuy); 
                client_print(id, print_center, "*** You cannot do this ***") 
        } 
        else if (hasbought) 
        { 
                client_cmd(id, "spk %s", g_UnlockMenuBuy); 
                weaponsbought[id]++ 
                check_warmachine(id) 
        } 
        return PLUGIN_HANDLED 
} 
  
public other_unlocks_menu(id) 
{ 
        new szMenuBody[512]; 
  
        new nLen = format( szMenuBody, 511, "\yUnlock: \rOther^nCredits: %d^n", credits[id] ); 
        if (g_m3[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y1. \wM3 Super 90^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y1. \wM3 Super 90^n    \wCost: \r25^n" ); 
  
        if (g_xm1014[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y2. \wXM1014 M4^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y2. \wXM1014 M4^n    \wCost: \r200^n" ); 
        
        if (g_scout[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y3. \wSchmidt Scout^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y3. \wSchmidt Scout^n    \wCost: \r250^n" ); 
        
        if (g_awp[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y4. \wAWP Magnum Sniper^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y4. \wAWP Magnum Sniper^n    \wCost: \r500^n" ); 
        
        if (g_para[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y5. \wM249-SAW^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y5. \wM249-SAW^n    \wCost: \r5000^n" ); 
        
        nLen += format( szMenuBody[nLen], 511-nLen, "^n^n\y9. \wBack" ); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n\y0. \wExit" ); 
                
        show_menu(id,UN_PRI3,szMenuBody,-1,"UnlocksMenuOther") 
} 
  
public un_oth_pushed(id,key) 
{ 
        new bool:hasbought 
        switch(key) 
        { 
                case 0: 
                { 
                        if (credits[id]>=25 && !g_m3[id]) 
                        { 
                                g_m3[id]=1 
                                credits[id]-=25 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_M3 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        other_unlocks_menu(id) 
                } 
                case 1: 
                { 
                        if (credits[id]>=200 && !g_xm1014[id]) 
                        { 
                                g_xm1014[id]=1 
                                credits[id]-=200 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_XM1014 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        other_unlocks_menu(id) 
                } 
                case 2: 
                { 
                        if (credits[id]>=250 && !g_scout[id]) 
                        { 
                                g_scout[id]=1 
                                credits[id]-=250 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_SCOUT 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        other_unlocks_menu(id) 
                } 
                case 3: 
                { 
                        if (credits[id]>=500 && !g_awp[id]) 
                        { 
                                g_awp[id]=1 
                                credits[id]-=500 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_AWP 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        other_unlocks_menu(id) 
                } 
                case 4: 
                { 
                        if (credits[id]>=5000 && !g_para[id]) 
                        { 
                                g_para[id]=1 
                                credits[id]-=5000 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_M249 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
  
                                switch (g_PlayerAchievements[id][ACHIEVE_RAMBO]) 
                                { 
                                        case LEVEL_NONE:        
                                        { 
                                                g_PlayerAchievements[id][ACHIEVE_RAMBO]=LEVEL_I; 
                                                set_hudmessage(255, 255, 255, -1.0, 0.30, 2, 3.0, 4.0, 0.02, 0.02, 2) 
                                                show_hudmessage(id, "%s^nUnlock the M249-SAW!^n+25 Credits", ACHIEVEMENTS[ACHIEVE_RAMBO][LEVEL_I]); 
                                                credits[id]+=25 
                                                client_cmd(id, "spk %s", g_AchivementEarned); 
                                                SaveLevel(id) 
                                        } 
                                } 
                        } 
                        other_unlocks_menu(id) 
                } 
                case 8: 
                { 
                        show_unlocks_menu(id) 
                        return PLUGIN_HANDLED 
                } 
                case 9: return PLUGIN_HANDLED 
        } 
        if (!hasbought) 
        { 
                //client_cmd(id, "spk %s", g_InvalidMenuBuy); 
                client_print(id, print_center, "*** You cannot do this ***") 
        } 
        else if (hasbought) 
        { 
                client_cmd(id, "spk %s", g_UnlockMenuBuy); 
                weaponsbought[id]++ 
                check_warmachine(id) 
        } 
        return PLUGIN_HANDLED 
} 
  
public sec_unlocks_menu(id) 
{ 
        new szMenuBody[512]; 
  
        new nLen = format( szMenuBody, 511, "\yUnlock: \rPistols^nCredits: %d^n", credits[id] ); 
        if (g_p228[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y1. \wP228 Compact^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y1. \wP228 Compact^n    \wCost: \r25^n" ); 
  
        if (g_five[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y2. \wFiveseven^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y2. \wFiveseven^n    \wCost: \r100^n" ); 
        
        if (g_elite[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y3. \wDual Berettas^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y3. \wDual Berettas^n    \wCost: \r100^n" ); 
        
        if (g_glock[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y4. \wGlock 18C^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y4. \wGlock 18C^n    \wCost: \r250^n" ); 
        
        if (g_deagle[id]) nLen += format( szMenuBody[nLen], 511-nLen, "^n\y5. \wDesert Eagle .50 AE^n    \wCost: \r-Unlocked-^n" ); 
        else nLen += format( szMenuBody[nLen], 511-nLen, "^n\y5. \wDesert Eagle .50 AE^n    \wCost: \r350^n" ); 
        
        nLen += format( szMenuBody[nLen], 511-nLen, "^n^n\y9. \wBack" ); 
        nLen += format( szMenuBody[nLen], 511-nLen, "^n\y0. \wExit" ); 
                
        show_menu(id,UN_SEC,szMenuBody,-1,"UnlocksMenuSec") 
} 
  
public un_sec_pushed(id,key) 
{ 
        new bool:hasbought 
        switch(key) 
        { 
                case 0: 
                { 
                        if (credits[id]>=25 && !g_p228[id]) 
                        { 
                                g_p228[id]=1 
                                credits[id]-=25 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_P228 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        sec_unlocks_menu(id) 
                } 
                case 1: 
                { 
                        if (credits[id]>=50 && !g_five[id]) 
                        { 
                                g_five[id]=1 
                                credits[id]-=100 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_FIVESEVEN 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        sec_unlocks_menu(id) 
                } 
                case 2: 
                { 
                        if (credits[id]>=50 && !g_elite[id]) 
                        { 
                                g_elite[id]=1 
                                credits[id]-=100 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_ELITE 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        sec_unlocks_menu(id) 
                } 
                case 3: 
                { 
                        if (credits[id]>=250 && !g_glock[id]) 
                        { 
                                g_glock[id]=1 
                                credits[id]-=250 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_GLOCK18 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        sec_unlocks_menu(id) 
                } 
                case 4: 
                { 
                        if (credits[id]>=350 && !g_deagle[id]) 
                        { 
                                g_deagle[id]=1 
                                credits[id]-=350 
                                if (!g_iszombie[id]) 
                                { 
                                        weapon_picked[0][id] = CSW_DEAGLE 
                                        give_weapons(id) 
                                } 
                                hasbought=true 
                        } 
                        sec_unlocks_menu(id) 
                } 
                case 8: 
                { 
                        show_unlocks_menu(id) 
                        return PLUGIN_HANDLED 
                } 
                case 9: return PLUGIN_HANDLED 
        } 
        if (!hasbought) 
        { 
                //client_cmd(id, "spk %s", g_InvalidMenuBuy); 
                client_print(id, print_center, "*** You cannot do this ***") 
        } 
        else if (hasbought) 
        { 
                client_cmd(id, "spk %s", g_UnlockMenuBuy); 
                weaponsbought[id]++ 
                check_warmachine(id) 
        } 
        return PLUGIN_HANDLED 
} 
  
public taskUpdateClocks() 
{ 
        new clock = -1; 
        
        //get the time digits 
        new serverTimeDigits[4]; 
        new timeleftDigits[4]; 
        new bool:bUpdateServerTime = getTimeDigits(CM_SERVERTIME, serverTimeDigits); 
        getTimeDigits(CM_BUILDTIMELEFT, timeleftDigits); 
        
        //find all clock entities 
        while ((clock = find_ent_by_class(clock, gszClockClassname))) 
        { 
                //get the clock type 
                new clockType = entity_get_int(clock, EV_INT_groupinfo); 
                
                //if the time changed for this clocktype 
                if (clockType == CM_SERVERTIME) 
                { 
                        if (bUpdateServerTime) 
                        { 
                                //set the clock to the correct time 
                                set_clock_digits(clock, serverTimeDigits); 
                        } 
                } 
        } 
        
        //check to see if its on the hour 
        if (bUpdateServerTime) 
        { 
                new hour, mins; 
                time(hour, mins); 
                
                //if its on the hour then alert 
                { 
                if (mins == 0) 
                        alertHour(hour, 0); 
                if (mins == 30) 
                        alertHour(hour, 1); 
                } 
        } 
} 
  
public showClockMenu(id) 
{ 
        //show the main menu to the player 
        show_menu(id, MAIN_MENU_KEYS, gszMainMenuText, -1, "clockMainMenu"); 
        
        return PLUGIN_HANDLED; 
} 
  
public handleMainMenu(id, num) 
{ 
        switch (num) 
        { 
                case N1: createClockAiming(id, CM_SERVERTIME); 
                case N2: createClockAiming(id, CM_BUILDTIMELEFT); 
                case N4: deleteClockAiming(id); 
                case N5: scaleClockAiming(id, 0.1); 
                case N6: scaleClockAiming(id, -0.1); 
                case N7: saveClocks(id); 
                case N8: loadClocks(id); 
        } 
        
        //show menu again 
        if (num != N0) 
        { 
                showClockMenu(id); 
        } 
        
        return PLUGIN_HANDLED; 
} 
  
createClockAiming(id, clockType) 
{ 
        //make sure player has access to this command 
        if (get_user_flags(id) & ADMIN_CLOCK) 
        { 
                new origin[3]; 
                new Float:vOrigin[3]; 
                new Float:vAngles[3]; 
                new Float:vNormal[3]; 
                
                //get the origin of where the player is aiming 
                get_user_origin(id, origin, 3); 
                IVecFVec(origin, vOrigin); 
                
                new bool:bSuccess = traceClockAngles(id, vAngles, vNormal, 1000.0); 
                
                //if the trace was successfull 
                if (bSuccess) 
                { 
                        //if the plane the trace hit is vertical 
                        if (vNormal[2] == 0.0) 
                        { 
                                //create the clock 
                                new bool:bSuccess = createClock(clockType, vOrigin, vAngles, vNormal); 
                                
                                //if clock created successfully 
                                if (bSuccess) 
                                { 
                                        client_print(id, print_chat, "%sCreated clock", gszPrefix); 
                                } 
                        } 
                        else 
                        { 
                                client_print(id, print_chat, "%sYou must place the clock on a vertical wall!", gszPrefix); 
                        } 
                } 
                else 
                { 
                        client_print(id, print_chat, "%sMove closer to the target to create the clock", gszPrefix); 
                } 
        } 
} 
  
bool:createClock(clockType, Float:vOrigin[3], Float:vAngles[3], Float:vNormal[3], Float:fScale = 1.0) 
{ 
        new clock = create_entity(gszInfoTarget); 
        new digit[4]; 
        new bool:bFailed = false; 
        
        //create 4 new entities to use for digits on the clock 
        for (new i = 0; i < 4; ++i) 
        { 
                digit[i] = create_entity(gszInfoTarget); 
                
                //if failed boolean is false and entity failed to create 
                if (!bFailed && !is_valid_ent(digit[i])) 
                { 
                        bFailed = true; 
                        break; 
                } 
        } 
        
        //make sure all entities were created successfully 
        if (is_valid_ent(clock) && !bFailed) 
        { 
                //adjust the origin to lift the clock off the wall (prevent flickering) 
                vOrigin[0] += (vNormal[0] * 0.5); 
                vOrigin[1] += (vNormal[1] * 0.5); 
                vOrigin[2] += (vNormal[2] * 0.5); 
                
                //set clock properties 
                entity_set_string(clock, EV_SZ_classname, gszClockClassname); 
                entity_set_int(clock, EV_INT_solid, SOLID_NOT); 
                entity_set_model(clock, gszClockFaces); 
                entity_set_vector(clock, EV_VEC_angles, vAngles); 
                entity_set_float(clock, EV_FL_scale, fScale); 
                entity_set_origin(clock, vOrigin); 
                entity_set_int(clock, EV_INT_groupinfo, clockType); 
                
                //set the entity frame (clock face) depending on the clock type 
                switch (clockType) 
                { 
                        case CM_SERVERTIME: entity_set_float(clock, EV_FL_frame, 0.0); 
                        case CM_BUILDTIMELEFT: entity_set_float(clock, EV_FL_frame, 1.0); 
                } 
                
                //link the digits entities to the clock 
                entity_set_int(clock, EV_INT_iuser1, digit[0]); 
                entity_set_int(clock, EV_INT_iuser2, digit[1]); 
                entity_set_int(clock, EV_INT_iuser3, digit[2]); 
                entity_set_int(clock, EV_INT_iuser4, digit[3]); 
                
                new digitValues[4]; 
                
                //setup the digits to make up the time 
                for (new i = 0; i < 4; ++i) 
                { 
                        //setup digit properties 
                        entity_set_string(digit[i], EV_SZ_classname, gszClockDigitClassname); 
                        entity_set_vector(digit[i], EV_VEC_angles, vAngles); 
                        entity_set_model(digit[i], gszClockDigits); 
                        entity_set_float(digit[i], EV_FL_scale, fScale); 
                        
                        //set digit position 
                        set_digit_origin(i, digit[i], vOrigin, vNormal, fScale); 
                        
                        //get the time digits 
                        getTimeDigits(clockType, digitValues); 
                        
                        //set the in-game clocks digits 
                        set_clock_digits(clock, digitValues); 
                } 
                
                return true; 
        } 
        else 
        { 
                //delete clock face if it created successfully 
                if (is_valid_ent(clock)) 
                { 
                        remove_entity(clock); 
                } 
                
                //iterate though the entity array and delete whichever ones created successfully 
                for (new i = 0; i < 4; ++i) 
                { 
                        if (is_valid_ent(digit[i])) 
                        { 
                                remove_entity(digit[i]); 
                        } 
                } 
        } 
        
        return false; 
} 
  
deleteClockAiming(id) 
{ 
        new bool:bDeleted; 
        new clock = get_clock_aiming(id); 
        
        if (clock) 
        { 
                //delete the clock 
                bDeleted = deleteClock(clock); 
                
                //if the clock was deleted successfully 
                if (bDeleted) 
                { 
                        client_print(id, print_chat, "%sDeleted clock", gszPrefix); 
                } 
        } 
} 
  
bool:deleteClock(ent) 
{ 
        //if the entity is a clock 
        if (isClock(ent)) 
        { 
                //get entity IDs of digits on the clock 
                new digit[4]; 
                digit[0] = entity_get_int(ent, EV_INT_iuser1); 
                digit[1] = entity_get_int(ent, EV_INT_iuser2); 
                digit[2] = entity_get_int(ent, EV_INT_iuser3); 
                digit[3] = entity_get_int(ent, EV_INT_iuser4); 
                
                //delete the digits on the clock if they're valid 
                if (is_valid_ent(digit[0])) remove_entity(digit[0]); 
                if (is_valid_ent(digit[1])) remove_entity(digit[1]); 
                if (is_valid_ent(digit[2])) remove_entity(digit[2]); 
                if (is_valid_ent(digit[3])) remove_entity(digit[3]); 
                
                //delete the clock face 
                remove_entity(ent); 
                
                //successfully deleted the clock 
                return true; 
        } 
        
        return false; 
} 
  
scaleClockAiming(id, Float:fScaleAmount) 
{ 
        //get the clock the player is aiming at (if any) 
        new clock = get_clock_aiming(id); 
        
        //if player is aiming at a clock 
        if (clock) 
        { 
                //get the clocks digit entities 
                new digit[4]; 
                new bSuccess = get_clock_digits(clock, digit); 
                
                //if successfully got clocks digit entities 
                if (bSuccess) 
                { 
                        new Float:vOrigin[3]; 
                        new Float:vNormal[3]; 
                        new Float:vAngles[3]; 
                        
                        //get the clocks current scale and add on the specified amount 
                        new Float:fScale = entity_get_float(clock, EV_FL_scale); 
                        fScale += fScaleAmount; 
                        
                        //make sure the scale isn't negative 
                        if (fScale > 0.01) 
                        { 
                                //set the clocks scale 
                                entity_set_float(clock, EV_FL_scale, fScale); 
                                
                                //get the clocks origin and angles 
                                entity_get_vector(clock, EV_VEC_origin, vOrigin); 
                                entity_get_vector(clock, EV_VEC_angles, vAngles); 
                                
                                //get the clocks normal vector from the angles 
                                angle_vector(vAngles, ANGLEVECTOR_FORWARD, vNormal); 
                                
                                //set the normal to point in the opposite direction 
                                vNormal[0] = -vNormal[0]; 
                                vNormal[1] = -vNormal[1]; 
                                vNormal[2] = -vNormal[2]; 
                                
                                //enlarge the clocks digits by the specified amount 
                                for (new i = 0; i < 4; ++i) 
                                { 
                                        //set the digits scale 
                                        entity_set_float(digit[i], EV_FL_scale, fScale); 
                                        
                                        //adjust the digits origin because of the new scale 
                                        set_digit_origin(i, digit[i], vOrigin, vNormal, fScale); 
                                } 
                        } 
                } 
        } 
} 
  
saveClocks(id) 
{ 
        //make sure player has access to this command 
        if (get_user_flags(id) & ADMIN_CLOCK) 
        { 
                new ent = -1; 
                new Float:vOrigin[3]; 
                new Float:vAngles[3]; 
                new Float:fScale; 
                new clockCount = 0; 
                new szData[128]; 
                
                //open file for writing 
                new file = fopen(gszFile, "wt"); 
                new clockType; 
                
                while ((ent = find_ent_by_class(ent, gszClockClassname))) 
                { 
                        //get clock info 
                        entity_get_vector(ent, EV_VEC_origin, vOrigin); 
                        entity_get_vector(ent, EV_VEC_angles, vAngles); 
                        fScale = entity_get_float(ent, EV_FL_scale); 
                        clockType = entity_get_int(ent, EV_INT_groupinfo); 
                        
                        //format clock info and save it to file 
                        formatex(szData, 128, "%c %f %f %f %f %f %f %f^n", gClockSaveIds[clockType], vOrigin[0], vOrigin[1], vOrigin[2], vAngles[0], vAngles[1], vAngles[2], fScale); 
                        fputs(file, szData); 
                        
                        //increment clock count 
                        ++clockCount; 
                } 
                
                //get players name 
                new szName[32]; 
                get_user_name(id, szName, 32); 
                
                //notify all admins that the player saved clocks to file 
                for (new i = 1; i <= 32; ++i) 
                { 
                        //make sure player is connected 
                        if (is_user_connected(i)) 
                        { 
                                if (get_user_flags(i) & ADMIN_CLOCK) 
                                { 
                                        client_print(i, print_chat, "%s'%s' saved %d clock%s to file!", gszPrefix, szName, clockCount, (clockCount == 1 ? "" : "s")); 
                                } 
                        } 
                } 
                
                //close file 
                fclose(file); 
        } 
} 
  
loadClocks(id) 
{ 
        //if the clock save file exists 
        if (file_exists(gszFile)) 
        { 
                new szData[128]; 
                new szType[2]; 
                new oX[13], oY[13], oZ[13]; 
                new aX[13], aY[13], aZ[13]; 
                new szScale[13]; 
                new Float:vOrigin[3]; 
                new Float:vAngles[3]; 
                new Float:vNormal[3]; 
                new Float:fScale; 
                new clockCount = 0; 
                
                //open the file for reading 
                new file = fopen(gszFile, "rt"); 
                
                //iterate through all the lines in the file 
                while (!feof(file)) 
                { 
                        szType = ""; 
                        fgets(file, szData, 128); 
                        parse(szData, szType, 2, oX, 12, oY, 12, oZ, 12, aX, 12, aY, 12, aZ, 12, szScale, 12); 
                        
                        vOrigin[0] = str_to_float(oX); 
                        vOrigin[1] = str_to_float(oY); 
                        vOrigin[2] = str_to_float(oZ); 
                        vAngles[0] = str_to_float(aX); 
                        vAngles[1] = str_to_float(aY); 
                        vAngles[2] = str_to_float(aZ); 
                        fScale = str_to_float(szScale); 
                        
                        if (strlen(szType) > 0) 
                        { 
                                //get the normal vector from the angles 
                                angle_vector(vAngles, ANGLEVECTOR_FORWARD, vNormal); 
                                
                                //set the normal to point in the opposite direction 
                                vNormal[0] = -vNormal[0]; 
                                vNormal[1] = -vNormal[1]; 
                                vNormal[2] = -vNormal[2]; 
                                
                                //create the clock depending on the clock type 
                                switch (szType[0]) 
                                { 
                                        case 'C': createClock(CM_SERVERTIME, vOrigin, vAngles, vNormal, fScale); 
                                        case 'T': createClock(CM_BUILDTIMELEFT, vOrigin, vAngles, vNormal, fScale); 
                                } 
                                
                                ++clockCount; 
                        } 
                } 
                
                //close the file 
                fclose(file); 
                
                //if a player is loading the clocks 
                if (id > 0 && id <= 32) 
                { 
                        //get players name 
                        new szName[32]; 
                        get_user_name(id, szName, 32); 
                        
                        //notify all admins that the player loaded clocks from file 
                        for (new i = 1; i <= 32; ++i) 
                        { 
                                //make sure player is connected 
                                if (is_user_connected(i)) 
                                { 
                                        if (get_user_flags(i) & ADMIN_CLOCK) 
                                        { 
                                                client_print(i, print_chat, "%s'%s' loaded %d clock%s from file!", gszPrefix, szName, clockCount, (clockCount == 1 ? "" : "s")); 
                                        } 
                                } 
                        } 
                } 
        } 
} 
  
get_clock_aiming(id) 
{ 
        //get hit point for where player is aiming 
        new origin[3]; 
        new Float:vOrigin[3]; 
        get_user_origin(id, origin, 3); 
        IVecFVec(origin, vOrigin); 
        
        new ent = -1; 
        
        //find all entities within a 2 unit sphere 
        while ((ent = find_ent_in_sphere(ent, vOrigin, 2.0))) 
        { 
                //if entity is a clock 
                if (isClock(ent)) 
                { 
                        return ent; 
                } 
        } 
        
        return 0; 
} 
  
bool:traceClockAngles(id, Float:vAngles[3], Float:vNormal[3], Float:fDistance) 
{ 
        //get players origin and add on their view offset 
        new Float:vPlayerOrigin[3]; 
        new Float:vViewOfs[3]; 
        entity_get_vector(id, EV_VEC_origin, vPlayerOrigin); 
        entity_get_vector(id, EV_VEC_view_ofs, vViewOfs); 
        vPlayerOrigin[0] += vViewOfs[0]; 
        vPlayerOrigin[1] += vViewOfs[1]; 
        vPlayerOrigin[2] += vViewOfs[2]; 
        
        //calculate the end point for trace using the players view angle 
        new Float:vAiming[3]; 
        entity_get_vector(id, EV_VEC_v_angle, vAngles); 
        vAiming[0] = vPlayerOrigin[0] + floatcos(vAngles[1], degrees) * fDistance; 
        vAiming[1] = vPlayerOrigin[1] + floatsin(vAngles[1], degrees) * fDistance; 
        vAiming[2] = vPlayerOrigin[2] + floatsin(-vAngles[0], degrees) * fDistance; 
        
        //trace a line and get the normal for the plane it hits 
        new trace = trace_normal(id, vPlayerOrigin, vAiming, vNormal); 
        
        //convert the normal into an angle vector 
        vector_to_angle(vNormal, vAngles); 
        
        //spin the angle vector 180 degrees around the Y axis 
        vAngles[1] += 180.0; 
        if (vAngles[1] >= 360.0) vAngles[1] -= 360.0; 
        
        return bool:trace; 
} 
  
set_digit_origin(i, digit, Float:vOrigin[3], Float:vNormal[3], Float:fScale) 
{ 
        //make sure the digit entity is valid 
        if (is_valid_ent(digit)) 
        { 
                new Float:vDigitNormal[3]; 
                new Float:vPos[3]; 
                new Float:fVal; 
                
                //change the normals to get the left and right depending on the digit 
                vDigitNormal = vNormal; 
                if (i == 0 || i == 1) vDigitNormal[X] = -vDigitNormal[X]; 
                if (i == 2 || i == 3) vDigitNormal[Y] = -vDigitNormal[Y]; 
                
                //setup digit position 
                fVal = (((gfClockSize[X] / 2) * gfDigitOffsetMultipliers[i])) * fScale; 
                vPos[X] = vOrigin[X] + (vDigitNormal[Y] * fVal); 
                vPos[Y] = vOrigin[Y] + (vDigitNormal[X] * fVal); 
                vPos[Z] = vOrigin[Z] + vNormal[Z] - ((gfTitleSize / 2.0 )* fScale); 
                
                //bring digit sprites forwards off the clock face to prevent flickering 
                vPos[0] += (vNormal[0] * 0.5); 
                vPos[1] += (vNormal[1] * 0.5); 
                vPos[2] += (vNormal[2] * 0.5); 
                
                //set the digits origin 
                entity_set_origin(digit, vPos); 
        } 
} 
  
bool:getTimeDigits(clockType, digitValues[4]) 
{ 
        switch (clockType) 
        { 
                case CM_SERVERTIME: 
                { 
                        new bool:bChanged = false; 
                        new szTime[5]; 
                        new timeOffset = get_cvar_num("cm_timeoffset"); 
                        new hourType = get_cvar_num("cm_hourtype"); 
                        
                        //get the time 
                        new hour, mins; 
                        time(hour, mins); 
                        
                        //add on the time offset 
                        hour += timeOffset; 
                        
                        //make sure hour hasnt gone out of bounds 
                        while (hour < 0) 
                        { 
                                hour += 24; 
                        } 
                        
                        while (hour >= 24) 
                        { 
                                hour -= 24; 
                        } 
                        
                        //if server is set to use 12 hour clocks 
                        if (hourType == 0) 
                        { 
                                if (hour > 12) 
                                { 
                                        hour -= 12; 
                                } 
                                if (hour == 0) 
                                        hour = 12 
                        } 
                        
                        //format the time into a string 
                        format(szTime, 4, "%s%d%s%d", (hour < 10 ? "0" : ""), hour, (mins < 10 ? "0" : ""), mins); 
                        
                        //calculate time digits from string 
                        digitValues[0] = szTime[0] - 48; 
                        digitValues[1] = szTime[1] - 48; 
                        digitValues[2] = szTime[2] - 48; 
                        digitValues[3] = szTime[3] - 48; 
                        
                        //if the time has changed 
                        if (!equal(gszTime, szTime)) 
                        { 
                                gszTime = szTime; 
                                bChanged = true; 
                        } 
                        
                        //if the hour type has changed 
                        if (hourType != gHourTypeOld) 
                        { 
                                gHourTypeOld = hourType; 
                                bChanged = true; 
                        } 
                        
                        //if the time offset value has changed 
                        if (timeOffset != gTimeOffsetOld) 
                        { 
                                gTimeOffsetOld = timeOffset; 
                                bChanged = true; 
                        } 
                        
                        return bChanged; 
                } 
                
                case CM_BUILDTIMELEFT: 
                { 
                        new mins = count_down / 60 
                        new secs = count_down % 60 
                        
                        //format the timeleft into a string 
                        new szTime[5]; 
                        format(szTime, 4, "%s%d%s%d", (mins < 10 ? "0" : ""), mins, (secs < 10 ? "0" : ""), secs); 
                        
                        //calculate time digits from string 
                        digitValues[0] = szTime[0] - 48; 
                        digitValues[1] = szTime[1] - 48; 
                        digitValues[2] = szTime[2] - 48; 
                        digitValues[3] = szTime[3] - 48; 
                        
                        return true; 
                } 
        } 
        
        return false; 
} 
  
bool:get_clock_digits(clock, digit[4]) 
{ 
        //if the entity is a clock 
        if (isClock(clock)) 
        { 
                //get entity IDs of digits on the clock 
                digit[0] = entity_get_int(clock, EV_INT_iuser1); 
                digit[1] = entity_get_int(clock, EV_INT_iuser2); 
                digit[2] = entity_get_int(clock, EV_INT_iuser3); 
                digit[3] = entity_get_int(clock, EV_INT_iuser4); 
                
                //make sure all the clock digits are valid 
                for (new i = 0; i < 4; ++i) 
                { 
                        if (!is_valid_ent(digit[i])) 
                        { 
                                log_amx("%sInvalid digit entity in clock", gszPrefix); 
                                
                                return false; 
                        } 
                } 
        } 
        
        return true; 
} 
  
set_clock_digits(clock, digitValues[4]) 
{ 
        //get the clocks digit entities 
        new digits[4]; 
        new bool:bSuccess = get_clock_digits(clock, digits); 
        
        //if successfully got clocks digit entities 
        if (bSuccess) 
        { 
                //setup clock digits 
                entity_set_float(digits[0], EV_FL_frame, float(digitValues[0])); 
                entity_set_float(digits[1], EV_FL_frame, float(digitValues[1])); 
                entity_set_float(digits[2], EV_FL_frame, float(digitValues[2])); 
                entity_set_float(digits[3], EV_FL_frame, float(digitValues[3])); 
        } 
} 
  
alertHour(hour, half) 
{ 
        //if we're set to speak the hour 
        if (get_cvar_num("cm_hourannounce") > 0) 
        { 
                new szMeridiem[4] = "am"; 
                new szHour[16]; 
                
                new timeOffset = get_cvar_num("cm_timeoffset"); 
                hour += timeOffset; 
                
                //setup hour. Make sure hour isn't above 12 and isn't 00 o'clock 
                if (hour >= 12) szMeridiem = "pm"; 
                if (hour > 12) hour -= 12; 
                if (hour == 0) hour = 12; 
                
                //get the hour as a word 
                num_to_word(hour, szHour, 15); 
                
                //speak the time 
                if (half) 
                        client_cmd(0, "spk ^"fvox/bell _period %s thirty %s^"", szHour, szMeridiem); 
                else 
                        client_cmd(0, "spk ^"fvox/bell _period %s %s^"", szHour, szMeridiem); 
        } 
} 
  
bool:isClock(ent) 
{ 
        //if entity is valid 
        if (is_valid_ent(ent)) 
        { 
                //get classname of entity 
                new szClassname[32]; 
                entity_get_string(ent, EV_SZ_classname, szClassname, 32); 
                
                //if classname of entity matches global clock classname 
                if (equal(szClassname, gszClockClassname)) 
                { 
                        //entity is a clock 
                        return true; 
                } 
        } 
        
        return false; 
} 
  
public find_minmaxs() 
{ 
        new Float:origin[3], i 
        new ent = engfunc(EngFunc_FindEntityByString,g_MaxPlayers,"classname","info_player_deathmatch") 
        while(ent) 
        { 
                if(pev_valid(ent)) 
                { 
                        pev(ent,pev_origin,origin) 
                        for(i=0;i<3;i++) 
                        { 
                                if(origin[i] < g_mins[i]) 
                                        g_mins[i] = origin[i] 
                                if(origin[i] > g_maxs[i]) 
                                        g_maxs[i] = origin[i] 
                        } 
                } 
                ent = engfunc(EngFunc_FindEntityByString,ent,"classname","info_player_deathmatch") 
        } 
  
        /*ent = engfunc(EngFunc_FindEntityByString,g_MaxPlayers,"classname","info_player_start") 
        while(ent) 
        { 
                if(pev_valid(ent)) 
                { 
                        pev(ent,pev_origin,origin) 
                        for(i=0;i<3;i++) 
                        { 
                                if(origin[i] < g_mins[1][i]) 
                                        g_mins[1][i] = origin[i] 
                                if(origin[i] > g_maxs[1][i]) 
                                        g_maxs[1][i] = origin[i] 
                        } 
                } 
                ent = engfunc(EngFunc_FindEntityByString,ent,"classname","info_player_start") 
        }*/ 
  
        g_maxs[2] += 70.0 
        //g_mins[1][2] -= 70.0 
        g_maxs[0] += 32.0 
        //g_mins[1][0] -= 32.0 
        g_maxs[1] += 32.0 
        //g_mins[1][1] -= 32.0 
  
        for(new j=0;j<3;j++) 
        { 
                I_max[j] = floatround(g_maxs[j]) 
                I_min[j] = floatround(g_mins[j]) 
        } 
} 
  
new cur_offset[33] 
new options_on_menu[8][33] 
  
public show_colors_menu(id,offset) 
{ 
        if(offset<0) offset = 0 
  
        new keys, curnum, menu[2048] 
        for(new i=offset;i<RAINBOW;i++) 
        { 
                /*if(i==24) 
                { 
                        options_on_menu[curnum][id] = 24 
                        keys += (1<<curnum) 
                        curnum++ 
                        format(menu,2047,"%s^n%d. Random",menu,curnum) 
                        break; 
                } 
                else 
                {*/ 
                options_on_menu[curnum][id] = i 
                keys += (1<<curnum) 
  
                curnum++ 
                format(menu,2047,"%s^n%d. %s",menu,curnum,g_ColorName[i]) 
  
                if(curnum==8) 
                        break; 
                //} 
        } 
  
        format(menu,2047,"\ySelect Your Color:^nCurrent: \r%s\w^n^n%s^n", g_ColorName[g_pColor[id]],menu) 
        if(curnum==8 && offset<12) 
        { 
                keys += (1<<8) 
                format(menu,2047,"%s^n9. Next",menu) 
        } 
        if(offset) 
        { 
                keys += (1<<9) 
                format(menu,2047,"%s^n0. Back",menu) 
        } 
  
        show_menu(id,keys,menu,-1,"ColorsSelect") 
} 
  
public colors_pushed(id,key) 
{ 
        if(key<8) 
        { 
                g_pColor[id] = options_on_menu[key][id] 
                print_color(id, "%s You have picked ^x04%s^x01 as your color", formatmodname, g_ColorName[g_pColor[id]]) 
                cur_offset[id] = 0 
        } 
        else 
        { 
                if(key==8) 
                        cur_offset[id] += 8 
                if(key==9) 
                        cur_offset[id] -= 8 
                show_colors_menu(id,cur_offset[id]) 
        } 
  
        return ; 
} 
  
  
/*-------------------------------------------------------------------------------------------------| 
|-----------------------------------End Items Menu Code--------------------------------------------| 
|-------------------------------------------------------------------------------------------------*/ 
  
Log(const message_fmt[], any:...) 
{ 
        static message[256]; 
        vformat(message, sizeof(message) - 1, message_fmt, 2); 
        
        static filename[96]; 
        static dir[64]; 
        if( !dir[0] ) 
        { 
                get_basedir(dir, sizeof(dir) - 1); 
                add(dir, sizeof(dir) - 1, "/logs"); 
        } 
        
        format_time(filename, sizeof(filename) - 1, "%m-%d-%Y"); 
        format(filename, sizeof(filename) - 1, "%s/ADMIN_ACTIVITY_%s.log", dir, filename); 
        
        log_to_file(filename, "%s", message); 
} 
  
public get_load_key(id) 
{ 
        get_user_name(id, g_AuthID[id], charsmax(g_AuthID[])); 
        // If we do not have a valid id check again 
        /*if ( equal(g_AuthID[id][9], "PENDING") || g_AuthID[id][0] == '^0' ) 
        { 
                // Try to get a vaild key again in 5.0 seconds 
                set_task(5.0, "get_load_key", id); 
                return; 
        }*/ 
        LoadLevel(id); 
} 
  
SaveLevel(id) 
{ 
        new szData[512]; 
        new szKey[128]; 
                
        formatex( szKey , 127 , "%s-ID-Upgrades", g_AuthID[id]); 
        formatex( szData , 511 , "%i %i %i %i %i %i %i %i %i" , credits[id], g_unHPLevel[id], g_unAPLevel[id], g_unGRLevel[id], g_unINLevel[id], hasplayed[id], g_unSPLevel[id], g_pColor[id], g_pThirdPerson[id]); 
                
        nvault_set( g_Vault , szKey , szData ); 
                
        //////////////////////////////////////////////////////////////////////////////////// 
                
        formatex( szKey , 127 , "%s-ID-Unlocks", g_AuthID[id]); 
        formatex( szData , 511 , "%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i", 
        g_galil[id],g_aug[id],g_m4a1[id],g_famas[id],g_ak47[id], 
        g_tmp[id],g_mp5[id],g_ump[id],g_p90[id], 
        g_m3[id],g_xm1014[id],g_scout[id],g_awp[id],g_para[id], 
        g_p228[id],g_five[id],g_elite[id],g_glock[id],g_deagle[id]); 
                
        nvault_set( g_Vault , szKey , szData ); 
                
        //////////////////////////////////////////////////////////////////////////////////// 
                
        formatex( szKey , 127 , "%s-ID", g_AuthID[id]); 
        formatex( szData , 511 , "%i %i %i %i %i %i %i %i %i %i %i %i" , 
        g_PlayerAchievements[id][0], zombiekills[id], 
        g_PlayerAchievements[id][1], humankills[id], 
        g_PlayerAchievements[id][2], objectsmoved[id], 
        g_PlayerAchievements[id][3], headshots[id], 
        g_PlayerAchievements[id][4], connects[id], 
        g_PlayerAchievements[id][5], killedby[id]); 
        
        nvault_set( g_Vault , szKey , szData ); 
                
        //////////////////////////////////////////////////////////////////////////////////// 
                
        formatex( szKey , 127 , "%s-ID-2", g_AuthID[id]); 
        formatex( szData , 511 , "%i %i %i %i %i %i %i %i %i %i %i %i" , 
        g_PlayerAchievements[id][6], clubdread[id], 
        g_PlayerAchievements[id][7], totaldamage[id], 
        g_PlayerAchievements[id][8], pistolonly[id], 
        g_PlayerAchievements[id][9], invisibleman[id], 
        g_PlayerAchievements[id][10], 
        g_PlayerAchievements[id][11], weaponsbought[id], 
        g_PlayerAchievements[id][12]); 
        
        nvault_set( g_Vault , szKey , szData ); 
                
        //////////////////////////////////////////////////////////////////////////////////// 
                
        formatex( szKey , 127 , "%s-ID-3", g_AuthID[id]); 
        formatex( szData , 511 , "%i %i %i %i %i %i %i %i %i" , 
        g_PlayerAchievements[id][13], 
        g_PlayerAchievements[id][14], 
        g_PlayerAchievements[id][15], 
        g_PlayerAchievements[id][16], 
        g_PlayerAchievements[id][17], 
        g_PlayerAchievements[id][18], 
        g_PlayerAchievements[id][19], g_itemsbought[id], 
        g_PlayerAchievements[id][20]); 
        
        nvault_set( g_Vault , szKey , szData ); 
  
        return PLUGIN_CONTINUE 
} 
  
LoadLevel(id) 
{ 
        new szData[512]; 
        new szKey[128]; 
  
        formatex( szKey , 127 , "%s-ID-Upgrades", g_AuthID[id]); 
        formatex( szData , 511 , "%i %i %i %i %i %i %i %i %i" , credits[id], g_unHPLevel[id], g_unAPLevel[id], g_unGRLevel[id], g_unINLevel[id], hasplayed[id], g_unSPLevel[id], g_pColor[id], g_pThirdPerson[id]); 
                
        nvault_get(g_Vault, szKey, szData, 511) 
  
        new unlocknum[32], hplevel[32], aplevel[32], grlevel[32], inlevel[32], haspl[32], splevel[32], color[32], third[32] 
                
        parse(szData, unlocknum, 31, hplevel, 31, aplevel, 31, grlevel, 31, inlevel, 31, haspl, 31, splevel, 31, color, 31, third, 31) 
                
        credits[id] = str_to_num(unlocknum) 
        g_unHPLevel[id] = str_to_num(hplevel) 
        g_unAPLevel[id] = str_to_num(aplevel) 
        g_unGRLevel[id] = str_to_num(grlevel) 
        g_unINLevel[id] = str_to_num(inlevel) 
        hasplayed[id] = str_to_num(haspl) 
        g_unSPLevel[id] = str_to_num(splevel) 
        g_pColor[id] = str_to_num(color) 
        g_pThirdPerson[id] = str_to_num(third) 
                
        //////////////////////////////////////////////////////////////////////////////////// 
                
        formatex( szKey , 127 , "%s-ID-Unlocks", g_AuthID[id]); 
        formatex( szData , 511 , "%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i", 
        g_galil[id],g_aug[id],g_m4a1[id],g_famas[id],g_ak47[id], 
        g_tmp[id],g_mp5[id],g_ump[id],g_p90[id], 
        g_m3[id],g_xm1014[id],g_scout[id],g_awp[id],g_para[id], 
        g_p228[id],g_five[id],g_elite[id],g_glock[id],g_deagle[id]) 
                
        nvault_get(g_Vault, szKey, szData, 511) 
  
        new galil[32],aug[32],m4a1[32],famas[32],ak47[32], 
        tmp[32],mp5[32],ump[32],p90[32], 
        m3[32],xm1014[32],scout[32],awp[32],para[32], 
        p228[32],five[32],elite[32],glock[32],deagle[32] 
                
        parse(szData, galil, 31, aug, 31, m4a1, 31, famas, 31, ak47, 31, 
        tmp, 31, mp5, 31, ump, 31, p90, 31, 
        m3, 31, xm1014, 31, scout, 31, awp, 31, para, 31, 
        p228, 31, five, 31, elite, 31, glock, 31, deagle, 31) 
                
        g_galil[id] = str_to_num(galil) 
        g_aug[id] = str_to_num(aug) 
        g_m4a1[id] = str_to_num(m4a1) 
        g_famas[id] = str_to_num(famas) 
        g_ak47[id] = str_to_num(ak47) 
                
        g_tmp[id] = str_to_num(tmp) 
        g_mp5[id] = str_to_num(mp5) 
        g_ump[id] = str_to_num(ump) 
        g_p90[id] = str_to_num(p90) 
                
        g_m3[id] = str_to_num(m3) 
        g_xm1014[id] = str_to_num(xm1014) 
        g_scout[id] = str_to_num(scout) 
        g_awp[id] = str_to_num(awp) 
        g_para[id] = str_to_num(para) 
                
        g_p228[id] = str_to_num(p228) 
        g_five[id] = str_to_num(five) 
        g_elite[id] = str_to_num(elite) 
        g_glock[id] = str_to_num(glock) 
        g_deagle[id] = str_to_num(deagle) 
                
        //////////////////////////////////////////////////////////////////////////////////// 
                
        formatex( szKey , 127 , "%s-ID", g_AuthID[id]); 
        formatex(szData , 511, "%i %i %i %i %i %i %i %i %i %i %i %i", 
        g_PlayerAchievements[id][0], zombiekills[id], 
        g_PlayerAchievements[id][1], humankills[id], 
        g_PlayerAchievements[id][2], objectsmoved[id], 
        g_PlayerAchievements[id][3], headshots[id], 
        g_PlayerAchievements[id][4], connects[id], 
        g_PlayerAchievements[id][5], killedby[id]); 
                        
        nvault_get(g_Vault, szKey, szData, 511) 
  
        new ach1[32], zkills[32], 
        ach2[32], hkills[32], 
        ach3[32], objects[32], 
        ach4[32], headsh[32], 
        ach5[32], conne[32], 
        ach6[32], killby[32] 
                
        parse(szData, ach1, 31, zkills, 31, 
        ach2, 31, hkills, 31, 
        ach3, 31, objects, 31, 
        ach4, 31, headsh, 31, 
        ach5, 31, conne, 31, 
        ach6, 31, killby, 31) 
                
        g_PlayerAchievements[id][0] = str_to_num(ach1) 
        zombiekills[id] = str_to_num(zkills) 
        g_PlayerAchievements[id][1] = str_to_num(ach2) 
        humankills[id] = str_to_num(hkills) 
        g_PlayerAchievements[id][2] = str_to_num(ach3) 
        objectsmoved[id] = str_to_num(objects) 
        g_PlayerAchievements[id][3] = str_to_num(ach4) 
        headshots[id] = str_to_num(headsh) 
        g_PlayerAchievements[id][4] = str_to_num(ach5) 
        connects[id] = str_to_num(conne) 
        g_PlayerAchievements[id][5] = str_to_num(ach6) 
        killedby[id] = str_to_num(killby) 
                
        //////////////////////////////////////////////////////////////////////////////////// 
                
        formatex( szKey , 127 , "%s-ID-2", g_AuthID[id]); 
        formatex(szData , 511, "%i %i %i %i %i %i %i %i %i %i %i %i", 
        g_PlayerAchievements[id][6], clubdread[id], 
        g_PlayerAchievements[id][7], totaldamage[id], 
        g_PlayerAchievements[id][8], pistolonly[id], 
        g_PlayerAchievements[id][9], invisibleman[id], 
        g_PlayerAchievements[id][10], 
        g_PlayerAchievements[id][11], weaponsbought[id], 
        g_PlayerAchievements[id][12]); 
                
        nvault_get(g_Vault, szKey, szData, 511) 
  
        new ach7[32], cdread[32], 
        ach8[32], dmg[32], 
        ach9[32], pist[32], 
        ach10[32], invis[32], 
        ach11[32], 
        ach12[32], weps[32], 
        ach13[32] 
                
        parse(szData, ach7, 31, cdread, 31, 
        ach8, 31, dmg, 31, 
        ach9, 31, pist, 31, 
        ach10, 31, invis, 31, 
        ach11, 31, 
        ach12, 31, weps, 31, 
        ach13, 31) 
                
        g_PlayerAchievements[id][6] = str_to_num(ach7) 
        clubdread[id] = str_to_num(cdread) 
        g_PlayerAchievements[id][7] = str_to_num(ach8) 
        totaldamage[id] = str_to_float(dmg) 
        g_PlayerAchievements[id][8] = str_to_num(ach9) 
        pistolonly[id] = str_to_num(pist) 
        g_PlayerAchievements[id][9] = str_to_num(ach10) 
        invisibleman[id] = str_to_num(invis) 
        g_PlayerAchievements[id][10] = str_to_num(ach11) 
        g_PlayerAchievements[id][11] = str_to_num(ach12) 
        weaponsbought[id] = str_to_num(weps) 
        g_PlayerAchievements[id][12] = str_to_num(ach13) 
                
        //////////////////////////////////////////////////////////////////////////////////// 
                
        formatex( szKey , 127 , "%s-ID-3", g_AuthID[id]); 
        formatex( szData , 511 , "%i %i %i %i %i %i %i %i %i" , 
        g_PlayerAchievements[id][13], 
        g_PlayerAchievements[id][14], 
        g_PlayerAchievements[id][15], 
        g_PlayerAchievements[id][16], 
        g_PlayerAchievements[id][17], 
        g_PlayerAchievements[id][18], 
        g_PlayerAchievements[id][19], g_itemsbought[id], 
        g_PlayerAchievements[id][20]); 
                
        nvault_get(g_Vault, szKey, szData, 511) 
  
        new ach14[32], 
        ach15[32], 
        ach16[32], 
        ach17[32], 
        ach18[32], 
        ach19[32], 
        ach20[32], items[32], 
        ach21[32] 
                
        parse(szData, ach14, 31, 
        ach15, 31, 
        ach16, 31, 
        ach17, 31, 
        ach18, 31, 
        ach19, 31, 
        ach20, 31, items, 31, 
        ach21, 31) 
                
        g_PlayerAchievements[id][13] = str_to_num(ach14) 
        g_PlayerAchievements[id][14] = str_to_num(ach15) 
        g_PlayerAchievements[id][15] = str_to_num(ach16) 
        g_PlayerAchievements[id][16] = str_to_num(ach17) 
        g_PlayerAchievements[id][17] = str_to_num(ach18) 
        g_PlayerAchievements[id][18] = str_to_num(ach19) 
        g_PlayerAchievements[id][19] = str_to_num(ach20) 
        g_itemsbought[id] = str_to_num(items) 
        g_PlayerAchievements[id][20] = str_to_num(ach21) 
        
        connects[id]++ 
} 
  
print_color(target, const message[], any:...) 
{ 
        static buffer[512], i, argscount 
        argscount = numargs() 
        
        // Send to everyone 
        if (!target) 
        { 
                static player 
                for (player = 1; player <= g_MaxPlayers; player++) 
                { 
                        if (!g_isconnected[player]) 
                                continue; 
  
                        static changed[5], changedcount 
                        changedcount = 0 
  
                        for (i = 2; i < argscount; i++) 
                        { 
                                if (getarg(i) == LANG_PLAYER) 
                                { 
                                        setarg(i, 0, player) 
                                        changed[changedcount] = i 
                                        changedcount++ 
                                } 
                        } 
                        vformat(buffer, charsmax(buffer), message, 3) 
  
                        message_begin(MSG_ONE_UNRELIABLE, gmsgSayText, _, player) 
                        write_byte(player) 
                        write_string(buffer) 
                        message_end() 
                        
                        for (i = 0; i < changedcount; i++) 
                                setarg(changed[i], 0, LANG_PLAYER) 
                } 
        } 
        // Send to specific target 
        else 
        { 
                vformat(buffer, charsmax(buffer), message, 3) 
  
                message_begin(MSG_ONE, gmsgSayText, _, target) 
                write_byte(target) 
                write_string(buffer) 
                message_end() 
        } 
}
Image
Post Reply

Return to “Anunturi”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests