Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Www.nextwas.com gamemode creata da armando (dangerous)
- #include <a_samp>
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 100 // Modificare secondo le slot !
- #include <dini>
- #include <dudb>
- #include <gl_common>
- #include <foreach>
- #include <a_zones>
- #define ASSAULT 0
- #define DEMOLITION 1
- #define SNIPER 2
- #define PILOT 3
- #define MEDIC 4
- #define ENGINEER 5
- #define PYRO 6
- #define Esploratore 7
- #define ADMIN 8
- #define GENERAL 9
- #define SPAM 6
- #define COMMAND_SPAM 7
- new Text:Textdraw0;
- forward SpamUpdate();
- new Text:vehiclehpbar[12];
- forward VHPBarUpdate();
- #define COLOR_VHPGOOD 0x0AFF0AAA
- #define COLOR_VHPWARNING 0xFFFF00AA
- #define COLOR_VHPDANGER 0xFF0000AA
- //new FALSE = false;
- #define SendFormattedMessage(%0,%1,%2,%3) do{new _string[128]; format(_string,sizeof(_string),%2,%3); SendClientMessage(%0,%1,_string);} while(FALSE)
- #define SendFormattedMessageToAll(%0,%1,%2) do{new _string[128]; format(_string,sizeof(_string),%1,%2); SendClientMessageToAll(%0,_string);} while(FALSE)
- forward MutePlayer(playerid,time,reason[]);
- new Messages[MAX_PLAYERS];
- new Commands[MAX_PLAYERS];
- new Muted[MAX_PLAYERS];
- new Planes[]=
- {
- 413,417,425,447,460,469,476,487,488,497,511,512,513,519,520,548,553,563,577,592,593
- };
- new VehicleName[][] =
- {
- "Landstalker",
- "Bravura",
- "Buffalo",
- "Linerunner",
- "Pereniel",
- "Sentinel",
- "Dumper",
- "Firetruck",
- "Trashmaster",
- "Stretch",
- "Manana",
- "Infernus",
- "Voodoo",
- "Pony",
- "Mule",
- "Cheetah",
- "Ambulance",
- "Leviathan",
- "Moonbeam",
- "Esperanto",
- "Taxi",
- "Washington",
- "Bobcat",
- "Mr Whoopee",
- "BF Injection",
- "Hunter",
- "Premier",
- "Enforcer",
- "Securicar",
- "Banshee",
- "Predator",
- "Bus",
- "Rhino",
- "Barracks",
- "Hotknife",
- "Trailer",
- "Previon",
- "Coach",
- "Cabbie",
- "Stallion",
- "Rumpo",
- "RC Bandit",
- "Romero",
- "Packer",
- "Monster Truck",
- "Admiral",
- "Squalo",
- "Seasparrow",
- "Pizzaboy",
- "Tram",
- "Trailer",
- "Turismo",
- "Speeder",
- "Reefer",
- "Tropic",
- "Flatbed",
- "Yankee",
- "Caddy",
- "Solair",
- "Berkley's RC Van",
- "Skimmer",
- "PCJ-600",
- "Faggio",
- "Freeway",
- "RC Baron",
- "RC Raider",
- "Glendale",
- "Oceanic",
- "Sanchez",
- "Sparrow",
- "Patriot",
- "Quad",
- "Coastguard",
- "Dinghy",
- "Hermes",
- "Sabre",
- "Rustler",
- "ZR-350",
- "Walton",
- "Regina",
- "Comet",
- "BMX",
- "Burrito",
- "Camper",
- "Marquis",
- "Baggage",
- "Dozer",
- "Maverick",
- "News Chopper",
- "Rancher",
- "FBI Rancher",
- "Virgo",
- "Greenwood",
- "Jetmax",
- "Hotring",
- "Sandking",
- "Blista Compact",
- "Police Maverick",
- "Boxville",
- "Benson",
- "Mesa",
- "RC Goblin",
- "Hotring Racer",
- "Hotring Racer",
- "Bloodring Banger",
- "Rancher",
- "Super GT",
- "Elegant",
- "Journey",
- "Bike",
- "Mountain Bike",
- "Beagle",
- "Cropdust",
- "Stunt",
- "Tanker",
- "RoadTrain",
- "Nebula",
- "Majestic",
- "Buccaneer",
- "Shamal",
- "Hydra",
- "FCR-900",
- "NRG-500",
- "HPV1000",
- "Cement Truck",
- "Tow Truck",
- "Fortune",
- "Cadrona",
- "FBI Truck",
- "Willard",
- "Forklift",
- "Tractor",
- "Combine",
- "Feltzer",
- "Remington",
- "Slamvan",
- "Blade",
- "Freight",
- "Streak",
- "Vortex",
- "Vincent",
- "Bullet",
- "Clover",
- "Sadler",
- "Firetruck",
- "Hustler",
- "Intruder",
- "Primo",
- "Cargobob",
- "Tampa",
- "Sunrise",
- "Merit",
- "Utility",
- "Nevada",
- "Yosemite",
- "Windsor",
- "Monster Truck",
- "Monster Truck",
- "Uranus",
- "Jester",
- "Sultan",
- "Stratum",
- "Elegy",
- "Raindance",
- "RC Tiger",
- "Flash",
- "Tahoma",
- "Savanna",
- "Bandito",
- "Freight",
- "Trailer",
- "Kart",
- "Mower",
- "Duneride",
- "Sweeper",
- "Broadway",
- "Tornado",
- "AT-400",
- "DFT-30",
- "Huntley",
- "Stafford",
- "BF-400",
- "Newsvan",
- "Tug",
- "Trailer",
- "Emperor",
- "Wayfarer",
- "Euros",
- "Hotdog",
- "Club",
- "Trailer",
- "Trailer",
- "Andromada",
- "Dodo",
- "RC Cam",
- "Launch",
- "Police Car (LSPD)",
- "Police Car (SFPD)",
- "Police Car (LVPD)",
- "Police Ranger",
- "Picador",
- "S.W.A.T. Van",
- "Alpha",
- "Phoenix",
- "Glendale",
- "Sadler",
- "Luggage Trailer",
- "Luggage Trailer",
- "Stair Trailer",
- "Boxville",
- "Farm Plow",
- "Utility Trailer"
- };
- #define RED 0xFF0000FF
- #define GREEN 0x00FF00FF
- #define GetVehicleName(%0) VehicleName[GetVehicleModel(%0)-400]
- #define MAX_SPEED 19
- #define MAX_TEAMS 20
- #define MAX_TEAM_NAME 16
- #define MAX_TEAM_MEMBERS 4
- #define MAX_MEMBERS 4
- #define MAX_CHECKS 5
- #define MAX_VARIABLES 24
- new JB_Warnings[MAX_PLAYERS];
- // === [Color Defines] ===
- #define COLOR_LIGHTGREEN 0x9ACD32AA
- #define COLOR_YELLOW2 0xF5DEB3AA
- #define COLOR_DBLUE 0x2641FEAA
- #define COLOR_SYSTEM 0xEFEFF7AA
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_BLUE 0x0000FF96
- #define COLOR_DIS_RED 0xFF0000FF
- #define COLOR_CON_GREEN 0x00FF00FF
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_BRIGHTRED 0xFF0000AA
- #define COLOR_ORANGE 0xFFA500AA
- #define GCOLOR_GREEN 0x33AA3355
- #define YELLOW 0xFFFF00FF
- #define COLOR_OOC 0xFF8080FF
- #define COLOR_LIGHTRED 0xFF8080FF
- #define COLOR_LIGHTBLUE 0x00BFFFAA
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_RED 0xFF0000AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_GREEN 0x00FF00AA
- #define ADMIN_RED 0xFB0000FF
- #define YELLOW 0xFFFF00FF
- #define ORANGE 0xF97804FF
- #define LIGHTRED 0xFF8080FF
- #define LIGHTBLUE 0x00C2ECFF
- #define PURPLE 0xB360FDFF
- #define BLUE 0x1229FAFF
- #define LIGHTGREEN 0x38FF06FF
- #define DARKPINK 0xE100E1FF
- #define DARKGREEN 0x008040FF
- #define AQUAGREEN 0x00CACAFB
- #define NICESKY 0x99FFFFAA
- #define GREY 0xCECECEFF
- #define WHITE 0xFFFFFFFF
- #define COLOR_TAN 0xE39216FF
- //Admin
- // === [Some configuring] ===
- #define JOIN_MESSAGES false
- #define Leavemessages false
- #define leavemessagecolor COLOR_RED
- #define joinmessagecolor COLOR_RED
- #define MEASURE_TIME 1000
- #define Livello1Comandi1 ">> /clearchat, /slap [id], /kick [id] [reason], /goto [id], /get [id], /akill [id], /warn [id] [reason]"
- #define Livello1Comandi2 ">> /(un)freeze [id], /playerinfo [id], /asay [msg], /ip [id], /mute [id], /ajail [id] [time], /force [id]"
- #define Livello2Comandi1 ">> /telep [teleportee id] [dest. id], /(un)mute [id] /(un)jail [id] [time], /ann [text] [time]"
- #define Livello2Comandi2 ">> /eject [id], /sethealth [id] [amt], /setarmour [id] [amt] /healall, /armourall"
- #define Livello3Comandi1 ">> /disarm [id], /disarmall, /explode [id], /time [0-23], /weather [weatherid]"
- #define Livello3Comandi2 ">> /setmoney [id] [amount], /ban [id] [reason], /say [text]"
- #define Livello4Comandi1 ">> /disarmall, /reloadbans, /reloadlogs, /crash [id]"
- #define TEAM_USA 0
- #define TEAM_GERMANY 1
- #define TEAM_MERC 2
- #define TEAM_RUSSIA 3
- #define TEAM_JAPAN 4
- //new mailsubject[128];
- new SpeedHacking[MAX_PLAYERS];
- new Speed[MAX_PLAYERS][MAX_CHECKS];
- enum pWarns
- {
- TeamJack
- }
- new Warns[MAX_PLAYERS][pWarns];
- enum enums
- {
- is,
- intspc,
- Float:Xspc,
- Float:Yspc,
- Float:Zspc
- };
- new admgod[MAX_PLAYERS];
- new freeze[MAX_PLAYERS];
- new WarnedTimes[MAX_PLAYERS];
- new PlayerSpec[MAX_PLAYERS][enums];
- new Dispenser[MAX_PLAYERS];
- new EngineerI[MAX_PLAYERS];
- new dispout[MAX_PLAYERS];
- new Driver[MAX_VEHICLES];
- new logged[MAX_PLAYERS];
- new adminlevel[MAX_PLAYERS];
- new money[MAX_PLAYERS];
- new playername[MAX_PLAYER_NAME];
- new bool:IsInCargoB[MAX_PLAYERS];
- new PlayerCargoB[MAX_PLAYERS];
- new bool:IsInBarracks[MAX_PLAYERS];
- new PlayerBarracks[MAX_PLAYERS];
- new ammoo[MAX_PLAYERS];
- new piolet[MAX_PLAYERS];
- new deaths[MAX_PLAYERS];
- new kills[MAX_PLAYERS];
- new rank[MAX_PLAYERS];
- new pscore[MAX_PLAYERS];
- new mute[MAX_PLAYERS];
- new jail[MAX_PLAYERS];
- forward BanLog(string[]);
- forward SendClientMessageToAdmins(color,string[],alevel);
- forward Message();
- new IfCapture[16];
- new BarracksUser[MAX_PLAYERS][MAX_VEHICLES];
- new CargoBobUser[MAX_PLAYERS][MAX_VEHICLES];
- forward IsPlayerAdminCall(playerid);
- public IsPlayerAdminCall(playerid)
- return (adminlevel[playerid] >= 1);
- new LastVehicle[MAX_PLAYERS];
- new adminduty[MAX_PLAYERS];
- #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1]
- #define isnull(%1) ((%1[0] == 0) || (%1[0] == 1 && %1[1] == 0))
- AntiDEAmx()
- {
- new gunz[][] =
- {
- "Unarmed (Fist)",
- "Brass K"
- };
- #pragma unused gunz
- }
- //TOP KILLERS
- new Players;
- forward RankRefresh();
- new Text:Classt[MAX_PLAYERS];
- new Text:Spree;
- new Text:Teams[MAX_PLAYERS];
- //------------------------
- new ExplosionRadius = 15; //raggio esplosione
- forward Explode(playerid);
- new buyweapon;
- new IsInGunShop[MAX_PLAYERS];
- new GunShopID[MAX_PLAYERS];
- new hashit[MAX_PLAYERS];
- new C4[MAX_PLAYERS];
- new Bomb[MAX_PLAYERS];
- new Planted[MAX_PLAYERS];
- new Float:bx[MAX_PLAYERS], Float:by[MAX_PLAYERS], Float:bz[MAX_PLAYERS];
- new pSpawned[MAX_PLAYERS];
- new gunshop[8];
- new PickedClass[MAX_PLAYERS] = 0;
- new usingcomp[MAX_PLAYERS];
- new hasbombs[MAX_PLAYERS];
- new hasrepair[MAX_PLAYERS];
- new healedrec[MAX_PLAYERS];
- new repair[MAX_PLAYERS];
- new SpawnP[MAX_PLAYERS];
- forward GetClosestPlayer(p1);
- forward Float:GetDistanceBetweenPlayers(p1,p2);
- forward Txtreset();
- public Txtreset()
- {
- TextDrawHideForAll(Spree);
- return 1;
- }
- forward SettingPlayerTeam();
- new nuke;
- new AbleToSpawn[MAX_PLAYERS];
- //NEW------------------------------------------------------------------------------------
- static gTeam[MAX_PLAYERS];
- new gPlayerClass[MAX_PLAYERS];
- new EnteredArea[MAX_PLAYERS];
- new CapturedBy; // 0 ( none ) 1 ( USA ) 2 ( Germany )
- new EnteredArea2[MAX_PLAYERS];
- new CapturedBy2; // 0 ( none ) 1 ( USA ) 2 ( Germany )
- new EnteredArea3[MAX_PLAYERS];
- new CapturedBy3; // 0 ( none ) 1 ( USA ) 2 ( Germany )
- new EnteredArea4[MAX_PLAYERS];
- new CapturedBy4; // 0 ( none ) 1 ( USA ) 2 ( Germany )
- new EnteredArea5[MAX_PLAYERS];
- new CapturedBy5; // 0 ( none ) 1 ( USA ) 2 ( Germany )
- new EnteredArea6[MAX_PLAYERS];
- new CapturedBy6; // 0 ( none ) 1 ( USA ) 2 ( Germany )
- new EnteredArea7[MAX_PLAYERS];
- new CapturedBy7; // 0 ( none ) 1 ( USA ) 2 ( Germany )
- new EnteredArea8[MAX_PLAYERS];
- new CapturedBy8; // 0 ( none ) 1 ( USA ) 2 ( Germany )
- new EnteredArea9[MAX_PLAYERS];
- new CapturedBy9; // 0 ( none ) 1 ( USA ) 2 ( Germany )
- new EnteredArea10[MAX_PLAYERS];
- new CapturedBy10; // 0 ( none ) 1 ( USA ) 2 ( Germany )
- new EnteredArea11[MAX_PLAYERS];
- new CapturedBy11;
- new EnteredArea12[MAX_PLAYERS];
- new CapturedBy12;
- new EnteredArea13[MAX_PLAYERS];
- new CapturedBy13;
- new EnteredArea14[MAX_PLAYERS];
- new CapturedBy14;
- new EnteredArea15[MAX_PLAYERS];
- new CapturedBy15;
- new GeneralClass[MAX_PLAYERS][5];
- new gscore;
- new uscore;
- new T1[MAX_PLAYERS];
- new T2[MAX_PLAYERS];
- new T3[MAX_PLAYERS];
- new T4[MAX_PLAYERS];
- new T5[MAX_PLAYERS];
- new T6[MAX_PLAYERS];
- new T7[MAX_PLAYERS];
- new T8[MAX_PLAYERS];
- new T9[MAX_PLAYERS];
- new T10[MAX_PLAYERS];
- new T11[MAX_PLAYERS];
- new T12[MAX_PLAYERS];
- new T13[MAX_PLAYERS];
- new T14[MAX_PLAYERS];
- new T15[MAX_PLAYERS];
- new spree[MAX_PLAYERS];
- new randperson[MAX_PLAYERS];
- new hitman[MAX_PLAYERS];
- new gmini;
- new umini;
- new uhit;
- new ghit;
- new USA;
- new GERMANY;
- new Ear;
- new EarU;
- new EarG;
- new Town1;
- new Town2;
- new Resturant;
- new ResturantU;
- new ResturantG;
- new Airfield;
- new AirfieldU;
- new AirfieldG;
- new Diner;
- new DinerU;
- new DinerG;
- new Cluck;
- new CluckU;
- new CluckG;
- new OilPump;
- new OilPumpU;
- new OilPumpG;
- new Oil;
- new OilU;
- new OilG;
- new Beach;
- new BeachU;
- new BeachG;
- new A;
- new AU;
- new AG;
- new University;
- new UniversityU;
- new UniversityG;
- new Gas;
- new GasU;
- new GasG;
- new OS;
- new OSU;
- new OSG;
- new T;
- new TU;
- new TG;
- new D;
- new DU;
- new DG;
- new OT;
- new OTU;
- new OTG;
- enum cbinf { seats };
- new CargoBob[MAX_VEHICLES][cbinf];
- new Barracks[MAX_VEHICLES][cbinf];
- new nameee[20];
- new IsInHunter[MAX_PLAYERS];
- new IsInRhino[MAX_PLAYERS];
- new nuked = 0;
- //DEFINES--------------------------------------------------------------------------------
- //FORWARDS-------------------------------------------------------------------------------
- forward ZonesPay();
- public ZonesPay()
- {
- new monys[2];
- new mstr[100];
- monys[0] = 0;
- monys[1] = 0;//i kno money, not moneys, not mony
- foreach(Player, i)
- {
- if( gTeam[i] == TEAM_USA )
- {
- if( CapturedBy == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy2 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy3 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy4 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy5 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy6 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy7 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy8 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy9 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy10 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy11 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy12 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy13 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy14 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- if( CapturedBy15 == 1 ){ GivePlayerMoney(i, 100); monys[0]++; }
- format(mstr, 100, "You recieved %i money from captured areas.", monys[0]*100);
- SendClientMessage(i, COLOR_GREEN, mstr);
- }
- if( gTeam[i] == TEAM_GERMANY )
- {
- if( CapturedBy == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy2 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy3 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy4 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy5 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy6 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy7 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy8 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy9 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy10 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy11 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy12 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy13 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy14 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- if( CapturedBy15 == 2 ){ GivePlayerMoney(i, 100); monys[1]++; }
- format(mstr, 100, "You recieved %i money from captured areas.", monys[1]*100);
- SendClientMessage(i, COLOR_GREEN, mstr);
- }
- }
- return 1;
- }
- forward AreaCheck();
- forward TakeOver();
- forward NoArea(playerid);
- forward NoArea2(playerid);
- forward Secs(playerid);
- forward Spawn(playerid);
- forward SendPlayerFormattedText(playerid, const string[], define);
- forward ClassShow(playerid);
- public ClassShow(playerid)
- {
- if( gPlayerClass[playerid] == ENGINEER )
- {
- EngineerI[playerid] = 1;
- }
- if( gPlayerClass[playerid] == ADMIN ) admgod[playerid] = SetTimerEx("AdminGOD", 250, 1, "i", playerid);
- if( GetPlayerMoney(playerid) < 0 ) ResetPlayerMoney(playerid);
- new cstr[100];
- format(cstr, 100, " ");
- new classs[50];
- if( gPlayerClass[playerid] == GENERAL ) format(classs, 50, "general");
- if( gPlayerClass[playerid] == ADMIN ) format(classs, 50, "~r~Admin");
- if( gPlayerClass[playerid] == Esploratore ) format(classs, 50, "Esploratore");
- if( gPlayerClass[playerid] == PYRO ) format(classs, 50, "Pyroman");
- if( gPlayerClass[playerid] == MEDIC ) format(classs,50, "Medic");
- if( gPlayerClass[playerid] == ENGINEER ) format(classs,50,"Engineer");
- if( gPlayerClass[playerid] == PILOT ) format(classs,50,"Pilot");
- if( gPlayerClass[playerid] == DEMOLITION ) format(classs,50,"Demolition");
- if( gPlayerClass[playerid] == ASSAULT ) format(classs,50,"Assault");
- if( gPlayerClass[playerid] == SNIPER ) format(classs,50,"Sniper");
- format(cstr, 100, "~y~%s", classs);
- TextDrawHideForPlayer(playerid,Classt[playerid]);
- TextDrawSetString(Classt[playerid], cstr);
- TextDrawShowForPlayer(playerid,Classt[playerid]);
- return 1;
- }
- new Float:cbx[MAX_PLAYERS], Float:cby[MAX_PLAYERS], Float:cbz[MAX_PLAYERS], Float:cba[MAX_PLAYERS];
- forward ParaExit(playerid);
- public ParaExit(playerid)
- {
- RemovePlayerFromVehicle(playerid);
- GivePlayerWeapon(playerid, 46, 1);
- return 1;
- }
- forward ExitCB(playerid);
- public ExitCB(playerid)
- {
- SetPlayerPos(playerid, cbx[playerid], cby[playerid], cbz[playerid]);
- SetPlayerFacingAngle(playerid, cba[playerid]);
- new vehicleid = LastVehicle[playerid];
- if( BarracksUser[playerid][vehicleid] == 1 )
- {
- BarracksUser[playerid][vehicleid] = 0;
- }
- if( CargoBobUser[playerid][vehicleid] == 1 )
- {
- GivePlayerWeapon(playerid, 46, 1);
- CargoBobUser[playerid][vehicleid] =0;
- print("got out of bob");
- }
- return 1;
- }
- forward DispeClean(playerid);
- public DispeClean(playerid)
- {
- DestroyPickup(Dispenser[playerid]);
- return 1;
- }
- new RandomWeather[2][1] = {
- {5},
- {10}
- };
- stock SetRandomWeather()
- {
- new rand = random(sizeof(RandomWeather));
- SetWeather(RandomWeather[rand][0]);
- return 1;
- }
- forward WeatherRefresh();
- public WeatherRefresh()
- {
- SendClientMessageToAll(WHITE, "If you want your stats, including deaths and kills to be saved type /register [password]");
- SetRandomWeather();
- return 1;
- }
- //http://codwwserver.co.cc/
- forward AdminGOD(playerid);
- public AdminGOD(playerid)
- {
- if( adminlevel[playerid] > 0 )
- {
- if( gPlayerClass[playerid] == ADMIN )
- {
- if( GetPlayerSkin(playerid) == 217)
- SetPlayerArmour(playerid, 999999.0);
- if( IsPlayerInAnyVehicle(playerid))
- {
- RepairVehicle(GetPlayerVehicleID(playerid));
- }else
- if( !IsPlayerInAnyVehicle(playerid))
- {
- SetPlayerHealth(playerid, 999999.0);
- }
- }
- }
- return 1;
- }
- new Float:RandomUSACoords[13][3] = {
- {-244.2003, 2602.5547, 63.7031},
- {-291.127594, 2608.788574, 63.799774},
- {-155.354614, 2659.233398, 64.549774},
- {-193.562515, 2731.505615, 63.749756},
- {-218.214340, 2759.695313, 63.749756},
- {-239.894196, 2727.762939, 63.749756},
- {-323.737000, 2652.677490, 64.249756},
- {-175.897125, 2612.831787, 62.749756},
- {-263.895935, 2586.644043, 64.249756},
- {-334.114258, 2727.419434, 63.799774},
- {-244.2003, 2602.5547, 63.7031},
- {-225.250168, 2786.327393, 63.799774},
- {-153.849152, 2760.387695, 65.749756}
- };
- new Float:RandomGERCoords[7][3] = {
- {-148.932114, 1069.882690, 20.310356},
- {-233.991333, 1178.141357, 20.235357},
- {-320.718079, 1057.609863, 20.235357},
- {-130.159241, 973.272156, 23.485357},
- {-161.434662, 1205.636963, 20.085356},
- {-144.539536, 1132.992188, 19.985357},
- {-147.705017, 1111.523804, 19.785360}
- };
- stock IsPlayerInFlying(playerid,vehicleid)
- {
- if(IsPlayerInVehicle(playerid,vehicleid))
- {
- switch(GetVehicleModel(vehicleid))
- {
- case 487, 488, 497, 460, 476, 511, 512, 513, 519, 520,548,553,577,592,593:
- {
- return true;
- }
- }
- }
- return false;
- }
- stock SetRandomUSAPos(playerid)
- {
- if( gTeam[playerid] == TEAM_USA )
- {
- new rand = random(sizeof(RandomUSACoords));
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, RandomUSACoords[rand][0],RandomUSACoords[rand][1],RandomUSACoords[rand][2]);
- }
- return 1;
- }
- stock SetRandomGERPos(playerid)
- {
- if( gTeam[playerid]==TEAM_GERMANY )
- {
- new rand = random(sizeof(RandomGERCoords));
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, RandomGERCoords[rand][0], RandomGERCoords[rand][1], RandomGERCoords[rand][2]);
- }
- return 1;
- }
- new Text:txtTimeDisp;
- new hourx, minutex, secx;
- new timestr[32];
- forward UpdateTime();
- public UpdateTime()
- {
- foreach(Player, i)
- {
- if(IsPlayerInAnyVehicle(i))
- {
- new mphspeed[128];
- format(mphspeed, sizeof(mphspeed), "%d mph", GetPlayerSpeedSpeedo(i, false));
- TextDrawHideForPlayer(i, Text:Textdraw0);
- TextDrawSetString(Text:Textdraw0, mphspeed);
- TextDrawShowForPlayer(i, Text:Textdraw0);
- }
- else
- {
- TextDrawHideForPlayer(i, Text:Textdraw0);
- }
- if(GetPlayerState(i)==PLAYER_STATE_DRIVER && !IsPlayerInPlane(i))
- {
- if(GetPlayerSpeedSpeedo(i, true) > 400)
- {
- new BadSpeed = GetPlayerSpeedSpeedo(i, true);
- new speedo[128];
- new HackerName[MAX_PLAYER_NAME];
- GetPlayerName(i, HackerName, sizeof(HackerName));
- format(speedo, sizeof(speedo), "Banning: %s [Reason: Speedhacks | %dKMH; MAX: 400KMH]", HackerName, BadSpeed);
- SendClientMessageToAll(RED, speedo);
- BanEx(i, "Speedhacks");
- }
- }
- if(adminlevel[i] < 1)
- {
- /*
- switch(GetPlayerWeapon(i))
- {
- case 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 26, 35, 38, 42, 44, 45:
- {
- new HackerName[MAX_PLAYER_NAME];
- GetPlayerName(i, HackerName, sizeof(HackerName));
- new string[128];
- format(string, sizeof(string), "Banning: %s [Reason: Weapon Hacks]", HackerName);
- SendClientMessageToAll(COLOR_RED, string);
- BanEx(i, "Invalid Weapon - Weapon Hacks");
- }
- }
- */
- new weapon;
- new gunammo;
- for(new w = 0; w <13; w++)
- {
- GetPlayerWeaponData(i, w, weapon, gunammo);
- if((weapon == 2 || weapon == 3 || weapon == 5 || weapon == 6 || weapon == 7 || weapon == 8 || weapon == 9 || weapon == 10 || weapon == 11 || weapon == 12 || weapon == 13 || weapon == 14 || weapon == 15 || weapon == 17 || weapon == 18 || weapon == 26 || weapon == 35 || weapon == 38 || weapon == 42 || weapon == 44 || weapon == 45) && gunammo > 0)
- {
- new HackerName[MAX_PLAYER_NAME];
- GetPlayerName(i, HackerName, sizeof(HackerName));
- new string[128];
- format(string, sizeof(string), "Banning: %s [Reason: Weapon Hacks]", HackerName);
- SendClientMessageToAll(COLOR_RED, string);
- BanEx(i, "Invalid Weapon - Weapon Hacks");
- return 1;
- }
- }
- if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK)
- {
- new HackerName[MAX_PLAYER_NAME];
- GetPlayerName(i, HackerName, sizeof(HackerName));
- new string[128];
- format(string, sizeof(string), "Banning: %s [Reason: Jetpack]", HackerName);
- SendClientMessageToAll(COLOR_RED, string);
- BanEx(i, "Invalid Weapon - Jetpack");
- }
- if(GetPlayerPing(i) > 800 && pSpawned[i] == 1)
- {
- new HackerName[MAX_PLAYER_NAME];
- GetPlayerName(i, HackerName, sizeof(HackerName));
- new string[128];
- format(string, sizeof(string), "Kicking: %s [Reason: High Ping | %d/800]", HackerName, GetPlayerPing(i));
- SendClientMessageToAll(COLOR_RED, string);
- Kick(i);
- }
- if(GetPlayerState(i)==PLAYER_STATE_DRIVER)
- {
- new weaponid=GetPlayerSpeed(i);
- if(weaponid>260 && !IsPlayerInPlane(i))
- {
- SpeedHacking[i]++;
- if(SpeedHacking[i]==2)
- {
- JB_Warnings[i]++;
- TogglePlayerControllable(i,false);
- if(JB_Warnings[i]<2)
- {
- new reason[128];
- format(reason,sizeof(reason),"%d KM/H with %s",weaponid,GetVehicleName(GetPlayerVehicleID(i)));
- SendClientMessageToAdmins(RED, reason, 1);
- }
- else
- {
- new HackerName[MAX_PLAYER_NAME];
- GetPlayerName(i, HackerName, sizeof(HackerName));
- new string[128];
- format(string, sizeof(string), "Banning: %s [Reason: Speedhacks]", HackerName);
- SendClientMessageToAll(RED, string);
- BanEx(i,"Speedhack");
- continue;
- }
- }
- }
- else
- {
- SpeedHacking[i]=0;
- }
- }
- }
- }
- new reason[64];
- foreach(Player, i)
- {
- if(Messages[i])
- {
- if(!Muted[i])
- {
- if(Messages[i]>15)
- {
- format(reason,sizeof(reason),"Extreme spam [%d messages/second]",Messages[i]);
- SendClientMessageToAll(RED, reason);
- Kick(i);
- continue;
- }
- else if(Messages[i]>10)
- {
- format(reason,sizeof(reason),"Massive spam [%d messages/second]",Messages[i]);
- SendClientMessageToAll(RED, reason);
- Kick(i);
- continue;
- }
- else if(Messages[i]>4)
- {
- format(reason,sizeof(reason),"Spam [%d messages/second]",Messages[i]);
- SendClientMessageToAll(RED, reason);
- MutePlayer(i,2*60,reason);
- }
- Messages[i]--;
- }
- if(Commands[i])
- {
- if(Commands[i]>15)
- {
- format(reason,sizeof(reason),"Extreme command spam [%d commands/second]",Commands[i]);
- SendClientMessageToAll(RED, reason);
- Kick(i);
- continue;
- }
- else if(Commands[i]>5)
- {
- format(reason,sizeof(reason),"Massive command spam [%d commands/second]",Commands[i]);
- SendClientMessageToAll(RED, reason);
- Kick(i);
- continue;
- }
- }
- Commands[i]--;
- }
- }
- foreach(Player, i)
- {
- if( GetPlayerWantedLevel(i) != rank[i] ) SetPlayerWantedLevel(i, rank[i]);
- }
- secx++;
- if( secx == 5 ) minutex++;
- if( minutex == 60 ) hourx++;
- if( hourx == 24 ) hourx = 0;
- if( minutex > 59 ) minutex = 0;
- format(timestr,32,"%02d:%02d",hourx,minutex);
- TextDrawHideForAll(txtTimeDisp);
- TextDrawSetString(txtTimeDisp,timestr);
- TextDrawShowForAll(txtTimeDisp);
- SetWorldTime(hourx);
- foreach(Player, i)
- {
- SetPlayerTime(i, hourx, minutex);
- }
- if( hourx >= 22 || hourx <= 4 && hourx >= 0)
- {
- foreach(Player, j)
- {
- foreach(Player, i)
- {
- if( gTeam[i] != gTeam[j] )
- {
- if( gTeam[j]== TEAM_USA ) SetPlayerMarkerForPlayer(i, j, 0x0000FF00);
- if( gTeam[j]== TEAM_GERMANY ) SetPlayerMarkerForPlayer(i, j, 0xFF000000);
- if( gTeam[j]== TEAM_JAPAN ) SetPlayerMarkerForPlayer(i, j, 0xFFFFFF00);
- if( gTeam[j]== TEAM_RUSSIA ) SetPlayerMarkerForPlayer(i, j, 0xF9780400);
- if( gTeam[j]== TEAM_MERC ) SetPlayerMarkerForPlayer(i, j, 0xFFFF0000);
- if( gTeam[i] == gTeam[j] && gPlayerClass[j] == GENERAL) SetPlayerMarkerForPlayer(j, i, 0xF50FCBFF);
- }
- }
- }
- }else
- if( hourx > 4 && hourx < 22 )
- {
- new tcolor;
- foreach(Player, j)
- {
- foreach(Player, i)
- {
- if( gTeam[i] == TEAM_USA ) tcolor = COLOR_BLUE;
- if( gTeam[i] == TEAM_GERMANY ) tcolor = COLOR_RED;
- if( gTeam[i] == TEAM_JAPAN ) tcolor = COLOR_WHITE;
- if( gTeam[i] == TEAM_RUSSIA ) tcolor = COLOR_ORANGE;
- if( gTeam[i] == TEAM_MERC ) tcolor = COLOR_YELLOW;
- if( gTeam[i] != gTeam[j] ) SetPlayerMarkerForPlayer(j, i, tcolor);
- if( gPlayerClass[i] == GENERAL) SetPlayerMarkerForPlayer(j, i, 0xF50FCBFF);
- }
- }
- }
- return 1;
- }
- new playerColors[MAX_PLAYERS];
- forward PlayerLeaveGang(playerid);
- new teamNames[MAX_TEAMS][MAX_TEAM_NAME];
- new teamInfo[MAX_TEAMS][3]; //0-created,1-members,2-color
- new playerTeam[MAX_PLAYERS];
- new teamMembers[MAX_TEAMS][MAX_TEAM_MEMBERS];
- new teamInvite[MAX_PLAYERS];
- PlayerLeaveGang(playerid) {
- new string[100];
- new teamnum = playerTeam[playerid];
- if(teamnum > 0) {
- for(new i = 0; i < teamInfo[teamnum][1]; i++) {
- if(teamMembers[teamnum][i]==playerid) {
- //One less team member
- teamInfo[teamnum][1]--;
- for(new j = i; j < teamInfo[teamnum][1]; j++) {
- //Shift team members
- teamMembers[teamnum][j]=teamMembers[teamnum][j+1];
- }
- //Disband team if no more members
- if(teamInfo[teamnum][1]<1) {
- teamInfo[teamnum][0]=0;
- teamInfo[teamnum][1]=0;
- }
- //Notify other members
- for(new j = 0; j < teamInfo[teamnum][1]; j++) {
- GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
- format(string, sizeof(string),"%s has quit your team.", playername);
- SendClientMessage(teamMembers[teamnum][j], COLOR_ORANGE, string);
- }
- format(string, sizeof(string),"You have quit the team '%s' (id: %d)", teamNames[teamnum], teamnum);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- playerTeam[playerid]=0;
- return;
- }
- }
- } else {
- SendClientMessage(playerid, COLOR_RED, "You are not in a team.");
- }
- }
- forward DispenserOut(playerid);
- public DispenserOut(playerid)
- {
- dispout[playerid] = 0;
- return 1;
- }
- //-=====VEHICLES====
- new total_vehicles_from_files=0;
- main()
- {
- print("__________GAMEMODE LOADING!_________");
- print("\n----------------------------------");
- print(" Call Of Duty 5 Gamemode" );
- print("----------------------------------\n");
- print("__________GAMEMODE LOADED!__________");
- }
- public OnGameModeInit()
- {
- vehiclehpbar[0] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[0], true);
- TextDrawBoxColor(vehiclehpbar[0], COLOR_VHPDANGER);
- TextDrawSetShadow(vehiclehpbar[0],0);
- TextDrawTextSize(vehiclehpbar[0], 602, 0);
- TextDrawSetOutline(vehiclehpbar[0],1);
- vehiclehpbar[1] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[1], true);
- TextDrawBoxColor(vehiclehpbar[1], COLOR_VHPDANGER);
- TextDrawSetShadow(vehiclehpbar[1],0);
- TextDrawTextSize(vehiclehpbar[1], 551, 0);
- TextDrawSetOutline(vehiclehpbar[1],1);
- vehiclehpbar[2] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[2], true);
- TextDrawBoxColor(vehiclehpbar[2], COLOR_VHPDANGER);
- TextDrawSetShadow(vehiclehpbar[2],0);
- TextDrawTextSize(vehiclehpbar[2], 556, 0);
- TextDrawSetOutline(vehiclehpbar[2],1);
- vehiclehpbar[3] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[3], true);
- TextDrawBoxColor(vehiclehpbar[3], COLOR_VHPDANGER);
- TextDrawSetShadow(vehiclehpbar[3],0);
- TextDrawTextSize(vehiclehpbar[3], 561, 0);
- TextDrawSetOutline(vehiclehpbar[3],1);
- vehiclehpbar[4] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[4], true);
- TextDrawBoxColor(vehiclehpbar[4], COLOR_VHPWARNING);
- TextDrawSetShadow(vehiclehpbar[4],0);
- TextDrawTextSize(vehiclehpbar[4], 566, 0);
- TextDrawSetOutline(vehiclehpbar[4],1);
- vehiclehpbar[5] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[5], true);
- TextDrawBoxColor(vehiclehpbar[5], COLOR_VHPWARNING);
- TextDrawSetShadow(vehiclehpbar[5],0);
- TextDrawTextSize(vehiclehpbar[5], 571, 0);
- TextDrawSetOutline(vehiclehpbar[5],1);
- vehiclehpbar[6] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[6], true);
- TextDrawBoxColor(vehiclehpbar[6], COLOR_VHPWARNING);
- TextDrawSetShadow(vehiclehpbar[6],0);
- TextDrawTextSize(vehiclehpbar[6], 576, 0);
- TextDrawSetOutline(vehiclehpbar[6],1);
- vehiclehpbar[7] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[7], true);
- TextDrawBoxColor(vehiclehpbar[7], COLOR_VHPWARNING);
- TextDrawSetShadow(vehiclehpbar[7],0);
- TextDrawTextSize(vehiclehpbar[7], 581, 0);
- TextDrawSetOutline(vehiclehpbar[7],1);
- vehiclehpbar[8] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[8], true);
- TextDrawBoxColor(vehiclehpbar[8], COLOR_VHPGOOD);
- TextDrawSetShadow(vehiclehpbar[8],0);
- TextDrawTextSize(vehiclehpbar[8], 586, 0);
- TextDrawSetOutline(vehiclehpbar[8],1);
- vehiclehpbar[9] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[9], true);
- TextDrawBoxColor(vehiclehpbar[9], COLOR_VHPGOOD);
- TextDrawSetShadow(vehiclehpbar[9],0);
- TextDrawTextSize(vehiclehpbar[9], 591, 0);
- TextDrawSetOutline(vehiclehpbar[9],1);
- vehiclehpbar[10] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[10], true);
- TextDrawBoxColor(vehiclehpbar[10], COLOR_VHPGOOD);
- TextDrawSetShadow(vehiclehpbar[10],0);
- TextDrawTextSize(vehiclehpbar[10], 596, 0);
- TextDrawSetOutline(vehiclehpbar[10],1);
- vehiclehpbar[11] = TextDrawCreate(551.0, 59.0, " ");
- TextDrawUseBox(vehiclehpbar[11], true);
- TextDrawBoxColor(vehiclehpbar[11], COLOR_VHPGOOD);
- TextDrawSetShadow(vehiclehpbar[11],0);
- TextDrawTextSize(vehiclehpbar[11], 602, 0);
- TextDrawSetOutline(vehiclehpbar[11],1);
- SetTimer("VHPBarUpdate",250,1);
- Textdraw0 = TextDrawCreate(502.000000,134.000000," mph");
- TextDrawUseBox(Textdraw0,1);
- TextDrawBoxColor(Textdraw0,0x00000066);
- TextDrawTextSize(Textdraw0,602.000000,0.000000);
- TextDrawAlignment(Textdraw0,0);
- TextDrawBackgroundColor(Textdraw0,0x000000ff);
- TextDrawFont(Textdraw0,1);
- TextDrawLetterSize(Textdraw0,0.599999,0.899999);
- TextDrawColor(Textdraw0,0xffffffff);
- TextDrawSetOutline(Textdraw0,1);
- TextDrawSetProportional(Textdraw0,1);
- TextDrawSetShadow(Textdraw0,1);
- txtTimeDisp = TextDrawCreate(605.0,25.0,"00:00");
- TextDrawUseBox(txtTimeDisp, 0);
- TextDrawFont(txtTimeDisp, 3);
- TextDrawSetShadow(txtTimeDisp,0); // no shadow
- TextDrawSetOutline(txtTimeDisp,2); // thickness 1
- TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
- TextDrawColor(txtTimeDisp,0xFFFFFFFF);
- TextDrawAlignment(txtTimeDisp,3);
- TextDrawLetterSize(txtTimeDisp,0.5,1.5);
- UpdateTime();
- SetTimer("UpdateTime", 1000, 1); //rank refresh, time, anti weapon hack
- SetWeather(10);
- SetTimer("WeatherRefresh", 300000 , 1);
- SetTimer("ZonesPay", 600000 , 1);
- Spree = TextDrawCreate(9.000000,310.000000,"s is on a killing spree of i kills.");
- TextDrawAlignment(Spree,0);
- TextDrawBackgroundColor(Spree,0x000000ff);
- TextDrawFont(Spree,3);
- TextDrawLetterSize(Spree,0.299999,0.799999);
- TextDrawColor(Spree,0xffffffff);
- TextDrawSetOutline(Spree,1);
- TextDrawSetProportional(Spree,1);
- TextDrawSetShadow(Spree,1);
- TextDrawHideForAll(Spree);
- AntiDEAmx();
- DisableInteriorEnterExits();
- foreach(Player, i) IsInBarracks[i] = false;
- foreach(Player, i) IsInCargoB[i] = false;
- GangZoneShowForAll(Ear ,GCOLOR_GREEN);
- GangZoneShowForAll(Airfield ,GCOLOR_GREEN);
- GangZoneShowForAll(Resturant ,GCOLOR_GREEN);
- GangZoneShowForAll(Oil ,GCOLOR_GREEN);
- GangZoneShowForAll(A ,GCOLOR_GREEN);
- GangZoneShowForAll(Gas ,GCOLOR_GREEN);
- GangZoneShowForAll(OS ,GCOLOR_GREEN);
- GangZoneShowForAll(T ,GCOLOR_GREEN);
- GangZoneShowForAll(D ,GCOLOR_GREEN);
- GangZoneShowForAll(OT ,GCOLOR_GREEN);
- //---NRGs added in MTA for USA and GER
- AddStaticVehicle(522,-231.327087, 2671.195068, 62.358879,0.0,-1,-1);
- AddStaticVehicle(522,-232.865707, 2671.293213, 62.358879,0.0,-1,-1);
- AddStaticVehicle(522,-234.415634, 2671.292236, 62.358879,0.0,-1,-1);
- AddStaticVehicle(522,-236.240616, 2671.293213, 62.358879,0.0,-1,-1);
- AddStaticVehicle(522,-237.990616, 2671.293213, 62.358879,0.0,-1,-1);
- AddStaticVehicle(522,-239.715805, 2671.218506, 62.358879,0.0,-1,-1);
- AddStaticVehicle(522,-177.418762, 1154.855347, 19.510365,0.0,-1,-1);
- AddStaticVehicle(522,-176.104294, 1154.993408, 19.510365,0.0,-1,-1);
- AddStaticVehicle(522,-174.654770, 1155.088135, 19.510365,0.0,-1,-1);
- AddStaticVehicle(522,-173.154892, 1155.038818, 19.510365,0.0,-1,-1);
- AddStaticVehicle(522,-171.754623, 1155.163452, 19.510365,0.0,-1,-1);
- AddStaticVehicle(522,-170.479691, 1155.187744, 19.510365,0.0,-1,-1);
- AddStaticVehicle(522,-169.254623, 1155.188965, 19.510365,0.0,-1,-1);
- //infernuses
- AddStaticVehicle(411,967.2693,2546.0071,10.4964,8.3137,-1,-1); //
- AddStaticVehicle(411,962.8986,2548.3208,10.5105,6.7354,-1,-1); //
- AddStaticVehicle(411,958.4675,2551.7644,10.5237,5.1051,-1,-1); //
- AddStaticVehicle(411,950.3170,2557.6938,10.5427,17.1943,-1,-1); //
- //germs vehs
- AddStaticVehicle(507,-169.7802,1193.7305,19.4832,272.1584,53,53); //
- AddStaticVehicle(507,-151.3201,1193.4274,19.4921,270.2192,53,53); //
- AddStaticVehicle(432,-132.8332,1214.5040,19.7549,359.7852,-1,-1); //
- AddStaticVehicle(432,-143.8001,1213.6923,19.7513,1.2314,-1,-1); //
- AddStaticVehicle(432,-163.7118,1227.4756,19.7552,92.3068,-1,-1); //
- AddStaticVehicle(432,-162.9769,1215.4075,19.7552,92.4037,-1,-1); //
- AddStaticVehicle(432,-148.0277,1183.0833,19.7562,269.6900,-1,-1); //
- AddStaticVehicle(432,-80.7883,1053.4082,19.7529,90.7146,-1,-1); //
- AddStaticVehicle(432,-80.8473,1045.3708,19.7413,91.6475,-1,-1); //
- AddStaticVehicle(432,-243.6082,1081.1266,19.7272,178.3251,-1,-1); //
- AddStaticVehicle(432,-259.8210,1218.5247,19.7549,358.7866,-1,-1); //
- AddStaticVehicle(432,-250.5950,1216.1040,19.7551,2.0934,-1,-1); //
- AddStaticVehicle(432,-236.8259,1214.0068,19.7550,1.2626,-1,-1); //
- AddStaticVehicle(433,-228.7815,1217.0042,20.1753,181.5212,-1,-1); //
- AddStaticVehicle(433,-218.9273,1216.7688,20.1735,178.4961,-1,-1); //
- AddStaticVehicle(433,-197.2750,1214.2571,20.1787,182.0692,-1,-1); //
- AddStaticVehicle(433,-200.4926,1171.9255,20.1027,179.7394,-1,-1); //
- AddStaticVehicle(433,-153.7065,1084.7604,20.1406,266.1849,-1,-1); //
- AddStaticVehicle(470,-158.6108,1167.2167,19.7354,178.3675,-1,-1); //
- AddStaticVehicle(470,-145.2791,1153.0159,19.6592,272.3667,-1,-1); //
- AddStaticVehicle(470,-82.8678,1158.0170,19.7345,271.8048,-1,-1); //
- AddStaticVehicle(470,-32.2315,1184.7002,19.3484,359.4193,-1,-1); //
- AddStaticVehicle(470,-10.5601,1220.7673,19.3413,4.1551,-1,-1); //
- AddStaticVehicle(470,-2.0027,1221.7136,19.3442,1.9967,-1,-1); //
- AddStaticVehicle(470,5.4184,1218.5588,19.3461,357.7910,-1,-1); //
- AddStaticVehicle(470,-80.4464,1222.3505,19.7347,91.6395,-1,-1); //
- AddStaticVehicle(563,331.4599,1886.1169,18.3770,84.4659,-1,-1); //
- AddStaticVehicle(563,331.2554,1909.8429,18.3464,78.5222,-1,-1); //
- AddStaticVehicle(563,331.7949,1938.8259,18.5398,77.9602,-1,-1); //
- AddStaticVehicle(563,330.3231,1983.9952,18.3442,81.1244,-1,-1); //
- AddStaticVehicle(563,122.7671,1842.8962,18.3292,2.5195,-1,-1); //
- AddStaticVehicle(512,528.9547,2367.5115,30.6920,137.7069,-1,-1); //
- AddStaticVehicle(512,514.9328,2378.3474,30.5232,150.2689,-1,-1); //
- AddStaticVehicle(593,-1361.7849,2037.5492,52.8914,57.9189,-1,-1); //
- AddStaticVehicle(476,286.9427,1955.4691,18.3671,277.5993,0,0); //
- AddStaticVehicle(476,288.6657,1989.6289,18.3534,270.2627,0,0); //
- AddStaticVehicle(476,287.8248,2023.4749,18.3601,273.9962,0,0); //
- AddStaticVehicle(593,318.0988,2053.4099,18.1017,182.6097,-1,-1); //
- AddStaticVehicle(593,297.5963,2052.5305,18.0996,184.7778,-1,-1); //
- AddStaticVehicle(432,277.6725,1933.4904,17.6535,258.1084,-1,-1); //
- AddStaticVehicle(432,650.9734,1720.9785,7.0048,314.1348,-1,-1); //
- AddStaticVehicle(522,645.8229,1703.7096,6.5479,271.0890,-1,-1); //
- AddStaticVehicle(522,646.0932,1705.3629,6.5526,248.8787,-1,-1); //
- AddStaticVehicle(522,645.7590,1701.5352,6.5439,296.7048,-1,-1); //
- AddStaticVehicle(548,665.9,1713.4247,12.5887,130.9149,-1,-1); //
- AddStaticVehicle(463,637.9642,1676.7590,6.5403,42.7471,-1,-1); //
- AddStaticVehicle(463,636.8578,1674.5835,6.5324,41.8462,-1,-1); //
- AddStaticVehicle(463,634.3597,1673.4452,6.5328,40.7716,-1,-1); //
- AddStaticVehicle(548,-194.1559,1099.2136,22.1135,91.4867,-1,-1); //
- AddStaticVehicle(470,-104.4889,1338.6318,10.1483,8.6644,-1,-1); //
- AddStaticVehicle(470,-91.5219,1339.2817,10.5482,8.5679,-1,-1); //
- AddStaticVehicle(433,-79.0923,1341.5598,11.4249,184.2915,-1,-1); //
- AddStaticVehicle(548,-123.5095,1363.0320,10.0150,280.9174,-1,-1); //
- AddStaticVehicle(548,-121.2912,1342.0988,10.2959,270.8427,-1,-1); //
- AddStaticVehicle(495,-359.1719,2198.1541,42.7821,98.7701,-1,-1); //
- AddStaticVehicle(495,-356.5640,2192.8105,42.7588,100.7477,-1,-1); //
- AddStaticVehicle(495,-355.2666,2187.6851,43.1441,102.8361,-1,-1); //
- AddStaticVehicle(495,-619.3625,2700.9087,72.6508,81.6365,-1,-1); //
- AddStaticVehicle(560,-225.6614,2595.8879,62.4088,181.4528,-1,-1); //
- AddStaticVehicle(560,-231.7928,2595.4939,62.4084,178.8395,-1,-1); //
- AddStaticVehicle(560,-234.7735,2595.1611,62.4086,178.7130,-1,-1); //
- AddStaticVehicle(522,-213.5216,2608.3630,62.2667,359.9745,-1,-1); //
- AddStaticVehicle(522,-210.5314,2608.1548,62.2738,358.1469,-1,-1); //
- AddStaticVehicle(522,-207.7199,2608.3030,62.2738,351.7036,-1,-1); //
- AddStaticVehicle(522,-201.0907,2608.5605,62.2725,1.8600,-1,-1); //
- AddStaticVehicle(522,-198.1578,2608.5200,62.2822,359.3217,-1,-1); //
- AddStaticVehicle(522,-132.0484,1111.6306,19.3200,347.5851,-1,-1); //
- AddStaticVehicle(522,-130.0735,1111.3840,19.3201,352.0504,-1,-1); //
- AddStaticVehicle(522,-128.3442,1111.0789,19.3192,348.4462,-1,-1); //
- AddStaticVehicle(522,-125.5919,1110.6642,19.3151,346.8562,-1,-1); //
- AddStaticVehicle(522,-123.1108,1110.2809,19.3125,349.0297,-1,-1); //
- AddStaticVehicle(522,-118.0766,1110.5529,19.3132,355.2980,-1,-1); //
- AddStaticVehicle(522,-116.4487,1110.5885,19.3074,353.7619,-1,-1); //
- AddStaticVehicle(507,-79.4650,1117.1761,19.5733,181.3275,-1,-1); //
- AddStaticVehicle(507,-85.2980,1117.9191,19.5661,182.2258,-1,-1); //
- AddStaticVehicle(507,-158.4889,1143.9846,19.4979,89.9066,-1,-1); //
- AddStaticVehicle(507,-186.0364,1180.9192,19.4891,359.3073,-1,-1); //
- AddStaticVehicle(507,-257.9445,1185.1616,19.5678,90.6672,-1,-1); //
- AddStaticVehicle(470,-672.1344,945.1514,12.1260,87.5528,43,0); // merc car
- AddStaticVehicle(470,-690.5383,957.8001,12.1847,90.2971,43,0); // merc car
- AddStaticVehicle(470,-674.5730,957.8810,12.1272,90.2939,43,0); // merc car
- AddStaticVehicle(468,-702.0219,944.5999,12.0361,85.7885,6,6); // merc bike
- AddStaticVehicle(468,-708.1751,939.5073,12.1310,188.1910,6,6); // merc bike
- AddStaticVehicle(468,-725.8101,954.5783,11.8624,349.6954,6,6); // merc bike
- AddStaticVehicle(468,-726.3350,947.5059,11.8791,357.1979,6,6); // merc bike
- AddStaticVehicle(560,-687.3456,968.5964,11.8533,89.1843,33,0); // merc car
- AddStaticVehicle(560,-686.2144,963.2752,11.8444,90.2767,33,0); // merc car
- AddStaticVehicle(487,-707.1479,919.5628,12.6068,0.1513,29,42); // merc heli
- AddStaticVehicle(487,-698.2263,921.2454,12.4934,354.3436,29,42); // merc heli
- AddStaticVehicle(452,-655.1194,869.9988,-0.4632,225.3407,1,5); // merc boat
- AddStaticVehicle(447,-639.0670,862.1387,0.8045,316.0651,75,2); // merc sea sparrow
- AddStaticVehicle(432,-685.1277,975.4801,12.1487,90.4004,43,0); // merc rhino
- AddStaticVehicle(476,-681.0807,1002.1901,12.8463,351.1254,7,6); // merc plane
- //airfield - //get airfield to drive hydras
- AddStaticVehicle(520,290.6157,2529.2288,16.7975,179.9210,43,0); // hydra
- AddStaticVehicle(520,325.5918,2526.9756,16.7752,181.0163,43,0); // hydra
- AddStaticVehicle(425,354.9149,2537.6565,16.7106,181.1606,43,0); // hunter
- AddStaticVehicle(470,430.5221,2525.2485,16.5626,89.8864,43,0); // hummer
- AddStaticVehicle(470,431.3669,2520.7466,16.5079,86.6242,43,0); // hummer
- AddStaticVehicle(470,430.7663,2516.4858,16.4770,90.9687,43,0); // hummer
- AddStaticVehicle(433,432.2379,2493.4756,16.9249,176.7666,43,0); // truck
- AddStaticVehicle(548,298.9338,2481.4746,18.1557,11.8470,-1,-1); //
- AddStaticVehicle(548,319.7430,2485.4456,18.1585,349.0089,-1,-1); //cargob
- AddStaticVehicle(548,350.9522,2483.7412,18.1778,358.2218,-1,-1); //
- AddStaticVehicle(548,264.1784,2529.8091,18.3347,176.4812,-1,-1); //
- AddStaticVehicle(470,413.0779,2438.0547,16.5976,3.2638,13,119); //
- AddStaticVehicle(470,407.4735,2438.0496,16.6129,4.1867,13,119); //
- AddStaticVehicle(470,398.5161,2439.0686,16.6158,1.2063,13,119); //
- AddStaticVehicle(470,391.2148,2437.0002,16.6164,0.7779,13,119); //
- //Other new areas (cluck, beach, diner, oilpump)
- AddStaticVehicle(522,1037.3876,2908.5859,46.3015,271.6776,51,118); //
- AddStaticVehicle(522,1037.8823,2905.3047,46.1436,268.0199,51,118); //
- AddStaticVehicle(522,1037.4763,2901.6965,45.9479,266.9258,51,118); //
- AddStaticVehicle(522,1038.6372,2897.9346,45.4200,269.7422,51,118); //
- AddStaticVehicle(522,-315.1855,1761.3105,42.7785,248.7284, -1, -1);
- AddStaticVehicle(522,-1227.5244,1817.6886,41.5271,319.7334,51,118); //
- AddStaticVehicle(522,-1229.9177,1818.4574,41.4978,320.0735,51,118); //
- AddStaticVehicle(522,-1231.1715,1821.3622,41.3649,318.0110,51,118); //
- AddStaticVehicle(522,-1940.4406,2392.8330,49.0569,114.9237,51,118); //
- AddStaticVehicle(522,-1939.6705,2390.4353,49.0543,98.9270,51,118); //
- AddStaticVehicle(522,-1937.6279,2386.9443,49.0624,109.3271,51,118); //
- AddStaticVehicle(595,242.8717,2955.9917,-0.7378,342.5856, -1, -1);
- AddStaticVehicle(595,263.9715,2954.2747,-0.5237,21.1260, -1, -1);
- AddStaticVehicle(595,282.5208,2955.8550,-1.1740,301.2252, -1, -1);
- AddStaticVehicle(522,266.2558,2901.6870,8.2762,180.9041, -1, -1);
- AddStaticVehicle(522,263.5389,2899.8606,8.6596,90.9040, -1, -1);
- AddStaticVehicle(522,259.9532,2898.1299,9.2755,135.9041, -1, -1);
- AddStaticVehicle(522,255.6225,2895.0176,10.4500,90.9040, -1, -1);
- //university
- AddStaticVehicle(520,1064.6266,1102.3928,9.8448,218.4271,51,118); //
- AddStaticVehicle(520,1115.2910,1095.3765,9.8468,129.6781,51,118); //
- AddStaticVehicle(520,1110.1681,1045.9376,9.8367,39.3007,51,118); //
- AddStaticVehicle(520,1060.2118,1051.6526,9.8510,308.4725,51,118); //
- AddStaticVehicle(601,989.9682,1151.6063,10.3911,84.5832,51,118); //
- AddStaticVehicle(601,987.7191,1132.7836,10.3855,87.9686,51,118); //
- AddStaticVehicle(601,984.5304,1122.7181,10.3895,86.8643,51,118); //
- AddStaticVehicle(522,997.9036,1082.9163,10.8203,177.5646,51,118);
- AddStaticVehicle(522,995.2998,1082.6000,10.8130,177.5646,51,118);
- AddStaticVehicle(522,992.1792,1082.3055,10.8130,177.5646,51,118);
- AddStaticVehicle(522,989.7233,1081.9575,10.8130,177.5646,51,118);
- AddStaticVehicle(601,987.5378,1125.8842,10.8203,85.1538,51,118);
- //germany
- AddStaticVehicle(402,-305.8307,1114.7781,19.5790,358.0663,-1,-1); //
- AddStaticVehicle(402,-304.1901,1028.3877,19.4255,92.2054,-1,-1); //
- AddStaticVehicle(402,-304.0491,1023.7325,19.4255,90.1839,-1,-1); //
- AddStaticVehicle(402,-304.7504,1007.6920,19.4253,90.9390,-1,-1); //
- AddStaticVehicle(402,-173.3682,1018.7441,19.5736,271.4858,-1,-1); //
- AddStaticVehicle(402,-172.7404,1013.4344,19.5738,269.0490,-1,-1); //
- AddStaticVehicle(402,-77.2107,1076.8668,19.5736,179.3166,-1,-1); //
- AddStaticVehicle(402,-23.2576,1143.3752,19.4968,271.0952,-1,-1); //
- AddStaticVehicle(402,-70.9021,1185.6937,19.4937,4.7178,-1,-1); //
- AddStaticVehicle(548,-131.3202,993.5706,22.3230,273.4375,-1,-1); //
- AddStaticVehicle(520,-132.2480,1025.1906,21.3739,272.3754,-1,-1); //
- AddStaticVehicle(425,-169.5678,988.2139,21.2705,89.2718,-1,-1); //
- AddStaticVehicle(487,-93.1889,1027.0336,19.8679,260.7979,-1,-1); //
- AddStaticVehicle(487,-126.4990,1050.4193,20.8552,87.3708,-1,-1); //
- AddStaticVehicle(470,-91.7931,1157.5265,19.7338,273.4672,-1,-1); //
- AddStaticVehicle(471,-120.0205,1141.9608,19.1744,173.4989,0,0); //
- AddStaticVehicle(471,-122.9541,1142.5817,19.2001,186.2512,0,0); //
- AddStaticVehicle(471,-126.2311,1141.1714,19.2241,180.4574,0,0); //
- AddStaticVehicle(471,-130.1885,1141.0081,19.2220,178.7012,0,0); //
- AddStaticVehicle(468,-112.3525,1120.9099,19.4105,72.9971,-1,-1); //
- AddStaticVehicle(468,-112.5510,1117.9872,19.4110,81.6557,-1,-1); //
- AddStaticVehicle(468,-112.5225,1116.2460,19.4116,58.3526,-1,-1); //
- AddStaticVehicle(468,-112.6650,1114.5563,19.4107,73.8427,-1,-1); //
- AddStaticVehicle(487,-226.0801,2716.0386,67.1165,268.1381,54,29); //
- AddStaticVehicle(487,-344.9044,2676.9741,63.8829,23.0436,54,29); //
- AddStaticVehicle(487,-563.5708,2601.9707,66.0528,272.8370,54,29); //
- AddStaticVehicle(487,-417.3027,2191.2710,42.6609,9.3595,54,29); //
- AddStaticVehicle(487,333.7563,1961.2158,17.8156,95.5012,54,29); //
- AddStaticVehicle(487,334.1656,1924.0676,17.8218,79.1497,54,29); //
- AddStaticVehicle(487,332.2151,1867.0376,17.9470,89.0947,54,29); //
- AddStaticVehicle(522,292.3523,1878.6427,17.2000,56.2868,-1,-1); //
- AddStaticVehicle(522,292.3821,1883.3024,17.2067,52.2745,-1,-1); //
- AddStaticVehicle(578,-1507.3623,1982.4646,48.8080,0.6026,-1,-1); //
- AddStaticVehicle(511,-1484.9375,1976.6157,49.1932,1.9646,-1,-1); // BEAGLE
- AddStaticVehicle(578,-296.5619,2612.9839,63.9745,261.1927,-1,-1); //
- AddStaticVehicle(500,-294.2687,1299.5104,53.8735,261.4082,-1,-1); //
- AddStaticVehicle(500,-342.8879,1514.2316,75.4671,2.1713,-1,-1); //
- AddStaticVehicle(560,-327.2289,1515.4668,75.0640,358.9259,-1,-1); //
- AddStaticVehicle(471,-323.9928,1515.5222,74.8397,358.3837,-1,-1); //
- AddStaticVehicle(470,-175.7455,1680.6907,16.3509,317.6384,-1,-1); //
- AddStaticVehicle(470,-290.4361,1755.2761,42.6838,270.1544,-1,-1); //
- AddStaticVehicle(515,-289.7865,1775.7632,43.7337,0.2727,-1,-1); //
- AddStaticVehicle(487,-328.4066,1795.9874,42.9391,171.5455,-1,-1); //
- AddStaticVehicle(470,-914.5411,1996.9738,60.9072,127.0327,-1,-1); //
- AddStaticVehicle(470,-910.5156,1992.1903,60.9107,131.1484,-1,-1); //
- AddStaticVehicle(433,-924.6487,2039.1537,61.3507,41.2396,-1,-1); //
- AddStaticVehicle(430,-503.7894,2195.4170,40.3514,81.5870,-1,-1); //
- AddStaticVehicle(430,-501.7742,2169.3274,40.3594,90.5157,-1,-1); //
- AddStaticVehicle(470,-395.8641,2193.2930,42.3828,272.2695,-1,-1); //
- AddStaticVehicle(470,-392.9530,2186.8013,42.2435,269.0942,-1,-1); //
- AddStaticVehicle(470,-394.2175,2176.4539,41.7427,244.9370,-1,-1); //
- AddStaticVehicle(470,-17.9176,2357.1050,24.1288,356.4059,-1,-1); //
- AddStaticVehicle(470,-268.0789,2514.4490,33.2885,84.1131,-1,-1); //
- AddStaticVehicle(470,-527.7076,2609.7146,53.4089,90.1121,-1,-1); //
- AddStaticVehicle(470,-539.7891,2567.8345,53.4065,90.7815,-1,-1); //
- AddStaticVehicle(432,-518.9094,2581.9626,53.4267,269.5176,-1,-1); //
- AddStaticVehicle(470,-628.9615,2711.9133,72.2987,171.5462,-1,-1); //
- AddStaticVehicle(470,-775.6357,2757.9658,45.7020,88.5436,-1,-1); //
- AddStaticVehicle(470,-904.3685,2696.9490,42.3591,133.5194,-1,-1); //
- AddStaticVehicle(470,-282.6014,2611.3452,62.8515,269.9535,-1,-1); //
- AddStaticVehicle(470,-260.5404,2610.3064,62.8499,263.9077,-1,-1); //
- AddStaticVehicle(470,-204.5132,2608.6353,62.6993,351.3380,-1,-1); //
- AddStaticVehicle(560,-217.0125,2595.3262,62.4077,180.8998,-1,-1); //
- AddStaticVehicle(560,-222.7530,2595.0020,62.4081,182.7502,-1,-1); //
- AddStaticVehicle(433,-237.3829,2608.7795,63.1399,359.3422,-1,-1); //
- AddStaticVehicle(433,-262.8482,2683.6108,63.0456,359.9157,-1,-1); //
- AddStaticVehicle(433,-300.8040,2720.5620,62.8741,172.9740,-1,-1); //
- AddStaticVehicle(470,-331.3533,2698.1943,62.6051,274.1106,-1,-1); //
- AddStaticVehicle(470,-332.5087,2702.8098,62.6233,274.6949,-1,-1); //
- AddStaticVehicle(468,-289.3227,2720.9495,62.0013,2.5272,-1,-1); //
- AddStaticVehicle(468,-240.3998,2653.2961,62.3585,355.4536,-1,-1); //
- AddStaticVehicle(468,-234.2116,2653.5789,62.3369,356.9677,-1,-1); //
- AddStaticVehicle(487,-213.9132,2660.0959,62.7773,84.6586,-1,-1); //
- AddStaticVehicle(520,-308.0615,2682.3682,64.2178,138.6433,-1,-1); //
- AddStaticVehicle(548,-181.0249,2663.9980,65.2457,304.8440,-1,-1); //
- AddStaticVehicle(425,-195.4413,2779.9304,67.0214,238.5448,-1,-1); //
- AddStaticVehicle(432,-162.9696,2695.0068,62.2659,272.6789,-1,-1); //
- AddStaticVehicle(432,-168.7701,2720.0457,62.2058,269.5812,-1,-1); //
- AddStaticVehicle(432,-199.7583,2716.4646,62.7001,180.9452,-1,-1); //
- AddStaticVehicle(560,-172.2827,2745.0767,62.1698,280.9261,-1,-1); //
- AddStaticVehicle(560,148.8888,2750.5974,54.7857,310.9754,-1,-1); //
- AddStaticVehicle(573,543.1923,2740.8081,66.5461,170.8862,-1,-1); //
- AddStaticVehicle(573,532.3718,2744.7058,67.8125,183.7694,-1,-1); //
- AddStaticVehicle(522,-341.7258,2659.7932,63.9152,357.6971,-1,-1); //
- AddStaticVehicle(522,-345.1559,2662.8521,64.0201,339.0697,-1,-1); //
- AddStaticVehicle(522,-1432.4041,2588.8972,55.3180,168.3323,-1,-1); //
- AddStaticVehicle(522,-1503.1078,2593.3237,55.3918,79.2727,-1,-1); //
- AddStaticVehicle(470,-1501.5254,2619.6125,55.7522,358.2046,-1,-1); //
- AddStaticVehicle(470,-1500.5652,2650.3264,55.7515,355.9960,-1,-1); //
- AddStaticVehicle(470,-1537.9000,2676.3020,55.7522,87.2599,-1,-1); //
- AddStaticVehicle(560,-1550.7114,2647.8743,55.4631,182.0346,-1,-1); //
- AddStaticVehicle(560,-1550.0614,2621.9419,55.4633,181.5816,-1,-1); //
- AddStaticVehicle(560,-1563.2128,2682.0022,55.3796,2.0162,-1,-1); //
- AddStaticVehicle(432,-1595.8820,2681.3047,55.1458,358.9301,-1,-1); //
- AddStaticVehicle(432,-1599.1285,2660.5056,55.2336,89.4188,-1,-1); //
- AddStaticVehicle(432,-1507.5168,2685.6636,55.8510,354.3337,-1,-1); //
- AddStaticVehicle(433,-1481.7085,2686.8918,56.1636,178.0989,-1,-1); //
- AddStaticVehicle(433,-1474.7922,2688.7024,56.1411,180.6481,-1,-1); //
- AddStaticVehicle(433,-1494.1989,2530.2202,56.0576,178.8805,-1,-1); //
- AddStaticVehicle(468,-1503.2577,2525.3801,55.3497,179.1982,-1,-1); //
- AddStaticVehicle(468,-1507.2166,2524.8457,55.3566,181.9787,-1,-1); //
- AddStaticVehicle(468,-1524.9680,2526.0305,55.4173,178.0358,-1,-1); //
- AddStaticVehicle(548,-1474.6434,2525.5095,57.7180,263.7379,-1,-1); //
- AddStaticVehicle(425,-1474.5553,2498.9678,57.7161,273.7738,-1,-1); //
- AddStaticVehicle(471,-1313.6666,2664.1648,49.5442,285.3071,-1,-1); //
- AddStaticVehicle(471,-1318.9530,2662.7185,49.5437,285.3078,-1,-1); //
- AddStaticVehicle(432,-1302.6216,2705.9932,50.0758,5.0179,-1,-1); //
- AddStaticVehicle(520,-1533.2238,2705.1531,57.6449,197.0819,-1,-1); //
- AddStaticVehicle(470,-753.0413,1510.1888,25.6813,9.2346,-1,-1); //
- AddStaticVehicle(470,-754.2158,1521.9561,26.7276,3.8036,-1,-1); //
- AddStaticVehicle(470,-754.7807,1540.8003,26.9552,1.3874,-1,-1); //
- AddStaticVehicle(470,-794.8740,1571.8705,26.9741,98.9847,-1,-1); //
- AddStaticVehicle(432,-821.8706,1578.8258,27.1300,82.3110,-1,-1); //
- AddStaticVehicle(432,-859.9019,1550.6174,23.5139,177.7958,-1,-1); //
- AddStaticVehicle(522,-836.6186,1521.1653,20.6009,220.8750,-1,-1); //
- AddStaticVehicle(522,-836.9364,1517.6056,20.3185,228.2570,-1,-1); //
- AddStaticVehicle(445,-854.9668,1471.3058,16.2763,175.5079,-1,-1); //
- AddStaticVehicle(445,-856.1306,1453.0784,14.9034,177.2384,-1,-1); //
- AddStaticVehicle(445,-855.2596,1439.6045,14.0607,187.0154,-1,-1); //
- AddStaticVehicle(445,-853.1483,1426.8619,13.6391,194.6416,-1,-1); //
- AddStaticVehicle(433,-774.5961,1432.7437,14.2255,283.3401,-1,-1); //
- AddStaticVehicle(433,-775.3538,1437.9558,14.2258,269.7361,-1,-1); //
- AddStaticVehicle(433,-779.4594,1312.4254,14.2070,215.3350,-1,-1); //
- AddStaticVehicle(430,-654.9141,1362.0189,-0.2148,74.4070,-1,-1); //
- AddStaticVehicle(430,-691.0470,1363.9060,-0.1033,88.2213,-1,-1); //
- AddStaticVehicle(430,-720.3111,1364.9066,-0.1793,87.7929,-1,-1); //
- AddStaticVehicle(560,128.1189,1925.3361,18.8818,272.5423,-1,-1); //
- AddStaticVehicle(560,139.6880,1925.8495,18.8842,272.2986,-1,-1); //
- AddStaticVehicle(432,229.0807,1915.1827,17.6341,181.4792,-1,-1); //
- AddStaticVehicle(432,229.3708,1883.0563,17.6537,176.0809,-1,-1); //
- AddStaticVehicle(432,201.4733,1886.6801,17.6606,359.7650,-1,-1); //
- AddStaticVehicle(548,265.5016,1855.2402,18.2234,148.7287,-1,-1); //
- // OTHER AREAS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");
- // LAS VENTURAS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
- printf("Total vehicles from files: %d",total_vehicles_from_files);
- UsePlayerPedAnims();
- DisableInteriorEnterExits();
- umini = CreatePickup(1254, 23, -252.0913,2595.5215,62.8582);
- gmini = CreatePickup(1254, 23, -136.8090,1222.5321,19.8992);
- uhit = CreatePickup(1254, 23, -256.9216,2606.4358,62.8582);
- ghit = CreatePickup(1254, 23, -149.0273,1131.3945,19.7422);
- buyweapon = CreatePickup(1254, 23, -690.7361,942.0350,13.6328);
- nuke = CreatePickup(1254, 23, 220.0778,1822.6729,7.5301);
- gunshop[7] = CreatePickup(1254, 23, -288.9128,2691.4155,62.6875); // usa ammo
- gunshop[6] = CreatePickup(1254, 23, -181.3289,1163.2261,19.7500); // german ammo
- gunshop[1] = CreatePickup(1254, 23, 777.4450,1871.4246,4.9067);
- gunshop[2] = CreatePickup(1254, 23, -315.8113,829.8170,14.2422);
- gunshop[3] = CreatePickup(1254, 23, -314.4954,1774.4213,43.6406);
- gunshop[4] = CreatePickup(1254, 23, -604.3909,2716.7764,72.7231);
- gunshop[5] = CreatePickup(1254, 23, 295.6123,-80.7989,1001.5156);
- print("All pickups are created!");
- if(dini_Exists("/Variables/Variables.ini"))
- {
- dini_IntSet("/Variables/Variables.ini", "CapturedBy", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy2", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy3", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy4", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy5", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy6", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy7", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy8", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy9", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy10", 0);
- dini_IntSet("/Variables/Variable.ini", "CapturedBy11", 0);
- dini_IntSet("/Variables/Variables.ini", "uscore", 0);
- dini_IntSet("/Variables/Variables.ini", "gscore", 0);
- dini_Set("/Variables/Variables.ini", "commander", "N/A");
- dini_Set("/Variables/Variables.ini", "commanderg", "N/A");
- print("/Variables/Variables.ini was found in the scriptfiles folder!");
- }
- else
- {
- dini_Create("/Variables/Variables.ini"); //Folder + house file created
- dini_IntSet("/Variables/Variables.ini", "CapturedBy", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy2", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy3", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy4", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy5", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy6", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy7", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy8", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy9", 0);
- dini_IntSet("/Variables/Variables.ini", "CapturedBy10", 0);
- dini_IntSet("/Variables/Variable.ini", "CapturedBy11", 0);
- dini_IntSet("/Variables/Variables.ini", "uscore", 0);
- dini_IntSet("/Variables/Variables.ini", "gscore", 0);
- dini_Set("/Variables/Variables.ini", "commander", "N/A");
- dini_Set("/Variables/Variables.ini", "commanderg", "N/A");
- print("/Variables/Variables.ini wasnt found in the scriptfiles folder!");
- print("The script has created the file and set all the areas to the default state!");
- print("All files were written!");
- }
- SetGameModeText("Call of Duty 5 v2.8");
- //TIMERS-------------------------------------------------------------------------------------
- SetTimer("AreaCheck", 1000, true);
- print("AreaCheck timer loaded!");
- //CLASS--------------------------------------------------------------------------------------
- AddPlayerClass(287,-244.2003,2602.5547,63.7031,270.1281,0,0,0,0,0,0); // usa spawn - a
- AddPlayerClass(285,-135.6082,1116.5326,21.1966,94.4754,0,0,0,0,0,0); // german spawn - a
- AddPlayerClass(30,-686.0115,939.5402,14.6328,94.4754,30,500,29,200,1,1); // merc spawn
- AddPlayerClass(121,-786.8021,1568.6122,28.0714,270.1281,0,0,0,0,0,0); // russia spawn - a
- AddPlayerClass(122,-1479.6936,2627.0244,58.7813,94.4754,0,0,0,0,0,0); // japan spawn - a
- print("All classes loaded!");
- //CARS---------------------------------------------------------------------------------------
- print("All vehicles loaded!");
- //GANGZONE----------------------------------------------------------------------------------
- USA = GangZoneCreate(-385.3699, 2545.777, -93.423, 2837.724);
- GERMANY = GangZoneCreate(-397.0478, 969.2637, 105.1009, 1307.922);
- Ear = GangZoneCreate(-385.3699, 1506.446, -256.9133, 1646.58);
- EarU = GangZoneCreate(-385.3699, 1506.446, -256.9133, 1646.58);
- EarG = GangZoneCreate(-385.3699, 1506.446, -256.9133, 1646.58);
- GangZoneShowForAll(Ear, COLOR_GREEN);
- Town1 = GangZoneCreate(-1681.614, 2428.998, -1307.922, 2826.046);
- Town2 = GangZoneCreate(-899.1964, 1366.311, -688.9946, 1623.225);
- Resturant = GangZoneCreate(-630.6053, 2510.743, -478.7929, 2662.556);
- ResturantU = GangZoneCreate(-630.6053, 2510.743, -478.7929, 2662.556);
- ResturantG = GangZoneCreate(-630.6053, 2510.743, -478.7929, 2662.556);
- GangZoneShowForAll(Resturant, COLOR_GREEN);
- Airfield = GangZoneCreate(268.5911, 2393.964, 467.115, 2604.166);
- AirfieldU = GangZoneCreate(268.5911, 2393.964, 467.115, 2604.166);
- AirfieldG = GangZoneCreate(268.5911, 2393.964, 467.115, 2604.166);
- GangZoneShowForAll(Airfield, COLOR_GREEN);
- Oil = GangZoneCreate(747.384, 2031.95, 805.7734, 2090.34);
- OilU = GangZoneCreate(747.384, 2031.95, 805.7734, 2090.34);
- OilG = GangZoneCreate(747.384, 2031.95, 805.7734, 2090.34);
- GangZoneShowForAll(Oil, COLOR_GREEN);
- A = GangZoneCreate(105.1009, 1786.715, 338.6584, 2055.306);
- AU = GangZoneCreate(105.1009, 1786.715, 338.6584, 2055.306);
- AG = GangZoneCreate(105.1009, 1786.715, 338.6584, 2055.306);
- GangZoneShowForAll(A, COLOR_GREEN);
- University = GangZoneCreate(939.5279, 970.4056, 1169.914, 1187.017);
- UniversityU = GangZoneCreate(939.5279, 970.4056, 1169.914, 1187.017);
- UniversityG = GangZoneCreate(939.5279, 970.4056, 1169.914, 1187.017);
- GangZoneShowForAll(University, COLOR_GREEN);
- Gas = GangZoneCreate(502.1487, 1588.191, 700.6725, 1786.715);
- GasU = GangZoneCreate(502.1487, 1588.191, 700.6725, 1786.715);
- GasG = GangZoneCreate(502.1487, 1588.191, 700.6725, 1786.715);
- GangZoneShowForAll(Gas, COLOR_GREEN);
- OS = GangZoneCreate(105.1009, 1342.956, 280.269, 1483.09);
- OSU = GangZoneCreate(105.1009, 1342.956, 280.269, 1483.09);
- OSG = GangZoneCreate(105.1009, 1342.956, 280.269, 1483.09);
- GangZoneShowForAll(OS, COLOR_GREEN);
- T = GangZoneCreate(408.7256, 1156.11, 712.3504, 1296.244);
- TU = GangZoneCreate(408.7256, 1156.11, 712.3504, 1296.244);
- TG = GangZoneCreate(408.7256, 1156.11, 712.3504, 1296.244);
- GangZoneShowForAll(T, COLOR_GREEN);
- D = GangZoneCreate(-945.9079, 1915.172, -525.5044, 2148.729);
- DU = GangZoneCreate(-945.9079, 1915.172, -525.5044, 2148.729);
- DG = GangZoneCreate(-945.9079, 1915.172, -525.5044, 2148.729);
- GangZoneShowForAll(D, COLOR_GREEN);
- OT = GangZoneCreate(-525.5044, 2125.373, -291.9469, 2277.186);
- OTU = GangZoneCreate(-525.5044, 2125.373, -291.9469, 2277.186);
- OTG = GangZoneCreate(-525.5044, 2125.373, -291.9469, 2277.186);
- GangZoneShowForAll(OT, COLOR_GREEN);
- OilPump = GangZoneCreate(1015.975, 2861.08, 1121.076,2954.502);
- OilPumpU = GangZoneCreate(1015.975, 2861.08, 1121.076,2954.502);
- OilPumpG = GangZoneCreate(1015.975, 2861.08, 1121.076,2954.502);
- GangZoneShowForAll(OilPump, COLOR_GREEN);
- Cluck = GangZoneCreate(-1237.855, 1763.359, -1156.11, 1868.46);
- CluckU = GangZoneCreate(-1237.855, 1763.359, -1156.11, 1868.46);
- CluckG = GangZoneCreate(-1237.855, 1763.359, -1156.11, 1868.46);
- GangZoneShowForAll(Cluck, COLOR_GREEN);
- Beach = GangZoneCreate(210.2018, 2837.724, 326.9805, 2989.536);
- BeachU = GangZoneCreate(210.2018, 2837.724, 326.9805, 2989.536);
- BeachG = GangZoneCreate(210.2018, 2837.724, 326.9805, 2989.536);
- GangZoneShowForAll(Beach, COLOR_GREEN);
- DinerU = GangZoneCreate(-1985.239, 2277.186, -1845.104, 2440.676);
- DinerG = GangZoneCreate(-1985.239, 2277.186, -1845.104, 2440.676);
- Diner = GangZoneCreate(-1985.239, 2277.186, -1845.104, 2440.676);
- GangZoneShowForAll(Diner, COLOR_GREEN);
- print("All gangzones loaded!");
- //OTHER--------------------------------------------------------------------------
- EnableTirePopping(1);
- //keep objects under 150 (149 )
- //OBJECTS-------------------------------------------------------------------------------------
- CreateObject(5005, 374.767395, 2558.034424, 18.468712, 0.0000, 0.0000, 0.0000);
- CreateObject(5001, 285.792328, 2535.152832, 17.803999, 0.0000, 0.0000, 180.0000);
- CreateObject(5001, 247.536957, 2441.394287, 17.812248, 0.0000, 0.0000, 268.5134);
- CreateObject(3749, 277.468933, 2385.174561, 21.092789, 0.0000, 0.0000, 20.7038);
- CreateObject(5005, 363.013489, 2403.051514, 19.035892, 0.0000, 0.0000, 11.2500);
- CreateObject(5005, 446.917358, 2502.138916, 19.363152, 0.0000, 0.0000, 268.2811);
- CreateObject(3279, 260.826141, 2391.498535, 15.260679, 0.0000, 0.0000, 180.0000);
- CreateObject(3279, 444.128876, 2552.824707, 14.676369, 0.0000, 0.0000, 180.0000);
- CreateObject(3279, 372.663177, 2552.688232, 15.228331, 0.0000, 0.0000, 180.0000);
- CreateObject(3279, 242.397095, 2533.769043, 15.460758, 0.0000, 0.0000, 0.0000);
- CreateObject(3279, 230.528076, 2471.396729, 15.184998, 0.0000, 0.0000, 0.0000);
- CreateObject(3279, 439.036041, 2422.693604, 15.448130, 0.0000, 0.0000, 180.0001);
- CreateObject(16093, 387.399658, 2542.783691, 15.419910, 0.0000, 0.0000, 0.0000);
- CreateObject(987, -253.310928, 2590.770996, 61.689148, 0.0000, 0.0000, 0.0000);
- CreateObject(987, -241.368408, 2590.784180, 61.694366, 0.0000, 0.0000, 0.0000);
- CreateObject(987, -229.413132, 2590.813477, 61.634361, 0.0000, 0.0000, 0.0000);
- CreateObject(987, -217.770172, 2590.797852, 61.653122, 0.0000, 0.0000, 0.0000);
- CreateObject(987, -207.118607, 2590.796875, 61.634361, 0.0000, 0.0000, 0.0000);
- CreateObject(987, -195.228302, 2590.747314, 61.593456, 0.0000, 0.0000, 90.0000);
- CreateObject(7368, -277.100922, 2694.182617, 64.760872, 0.0000, 0.0000, 270.0000);
- CreateObject(7368, -184.254333, 2703.631592, 64.131035, 0.0000, 0.0000, 180.0000);
- CreateObject(3749, -225.470337, 2752.554932, 66.997452, 0.0000, 0.0000, 270.0000);
- CreateObject(987, -225.586304, 2741.927002, 61.612511, 0.0000, 0.0000, 270.0000);
- CreateObject(3749, -147.858246, 2635.706787, 68.077469, 0.0000, 0.0000, 270.0000);
- CreateObject(987, -158.191010, 2618.001709, 60.919781, 0.0000, 0.0000, 45.0000);
- CreateObject(987, -168.110626, 2611.485596, 60.704853, 0.0000, 0.0000, 33.7500);
- CreateObject(987, -178.026016, 2604.902588, 60.726974, 0.0000, 0.0000, 33.7500);
- CreateObject(987, -189.702393, 2602.646729, 60.160172, 0.0000, 0.0000, 11.2500);
- CreateObject(1411, -192.434814, 2601.950439, 62.786373, 0.0000, 0.0000, 191.2500);
- CreateObject(3749, -340.528717, 2643.352051, 67.912018, 0.0000, 0.0000, 237.3414);
- CreateObject(8165, -314.019928, 2618.699707, 65.173241, 0.0000, 0.0000, 38.9066);
- CreateObject(1411, -282.744110, 2601.787598, 63.367405, 0.0000, 0.0000, 180.0000);
- CreateObject(3279, -155.693268, 2649.276123, 62.556335, 0.0000, 0.0000, 180.0000);
- CreateObject(3279, -163.812683, 2620.963379, 61.725220, 0.0000, 0.0000, 202.5001);
- CreateObject(3279, -201.167740, 2595.859619, 61.203705, 0.0000, 0.0000, 180.0000);
- CreateObject(3279, -328.193115, 2657.662354, 62.464821, 0.0000, 0.0000, 348.7500);
- CreateObject(3279, -218.593765, 2735.887207, 61.288086, 0.0000, 0.0000, 0.0000);
- CreateObject(6973, -211.176025, 2775.744141, 60.458008, 0.0000, 0.0000, 269.7681);
- CreateObject(12854, -204.253693, 2732.159180, 63.706963, 0.0000, 0.0000, 90.0000);
- CreateObject(16409, -204.678772, 2730.308838, 60.284767, 0.0000, 0.0000, 180.0000);
- CreateObject(8229, -505.208801, 2574.672607, 55.091846, 0.0000, 0.0000, 88.2812);
- CreateObject(8229, -505.778717, 2557.105713, 55.065289, 0.0000, 0.0000, 88.2812);
- CreateObject(8229, -517.274231, 2546.067871, 55.191853, 0.0000, 0.0000, 0.0000);
- CreateObject(8229, -532.825623, 2546.091553, 55.041843, 0.0000, 0.0000, 0.0000);
- CreateObject(8229, -548.164429, 2556.423828, 54.916836, 0.0000, 0.0000, 292.5000);
- CreateObject(8229, -561.620300, 2572.886719, 54.793217, 0.0000, 0.0000, 326.2500);
- CreateObject(8229, -504.513947, 2610.497803, 55.068287, 0.0000, 0.0000, 88.2812);
- CreateObject(8229, -504.071594, 2630.073242, 55.141850, 0.0000, 0.0000, 89.1406);
- CreateObject(8229, -515.013733, 2641.386230, 55.216854, 0.0000, 0.0000, 179.1407);
- CreateObject(8229, -530.899536, 2641.466064, 55.291859, 0.0000, 0.0000, 180.0001);
- CreateObject(8229, -542.057251, 2630.369629, 55.291859, 0.0000, 0.0000, 270.0001);
- CreateObject(8229, -552.247559, 2615.203857, 55.216854, 0.0000, 0.0000, 202.5001);
- CreateObject(3275, -504.719940, 2592.534668, 53.198292, 0.0000, 0.0000, 270.0000);
- CreateObject(3279, -510.214050, 2602.365479, 52.114655, 0.0000, 0.0000, 180.0000);
- CreateObject(3749, -530.557922, 1996.349854, 64.520897, 0.0000, 0.0000, 56.2500);
- CreateObject(3279, -541.695862, 1986.438843, 58.788086, 0.0000, 0.0000, 146.2501);
- CreateObject(3279, -866.386597, 1966.140015, 58.741302, 0.0000, 0.0000, 101.2500);
- CreateObject(3749, -881.619751, 1961.457275, 64.426392, 0.0000, 0.0000, 13.8283);
- CreateObject(3390, -149.513367, 1130.205078, 18.714970, 0.0000, 0.0000, 180.0000);
- CreateObject(6973, -128.154114, 1006.943970, 14.650833, 0.0000, 0.0000, 0.0000);
- CreateObject(3749, 225.530060, 2505.743896, 21.342789, 0.0000, 0.0000, 88.2038);
- CreateObject(973, 225.838409, 2501.972900, 12.349606, 357.4217, 95.3975, 0.0000);
- CreateObject(1459, 223.949158, 2509.479004, 16.138468, 0.0000, 0.0000, 67.5000);
- CreateObject(1459, 222.947327, 2506.109131, 16.096317, 0.0000, 0.0000, 101.2500);
- CreateObject(1459, 222.661835, 2503.456055, 16.096317, 0.0000, 0.0000, 67.5000);
- CreateObject(1459, -1189.254639, 2689.089111, 45.417221, 0.0000, 0.0000, 101.2500);
- CreateObject(1459, -1189.647827, 2692.835693, 45.479130, 0.0000, 0.0000, 90.0000);
- CreateObject(1459, -1188.736816, 2685.852295, 45.479130, 0.0000, 0.0000, 112.5000);
- CreateObject(2755, -1483.633789, 2611.375244, 59.680439, 0.0000, 0.0000, 0.0000);
- CreateObject(2755, -1479.690186, 2611.386230, 59.629707, 0.0000, 0.0000, 0.0000);
- CreateObject(2755, -1485.720093, 2621.661377, 59.609482, 0.0000, 0.0000, 270.0000);
- CreateObject(2755, -1485.770630, 2617.617432, 59.592823, 0.0000, 0.0000, 270.0000);
- CreateObject(2755, -1485.745117, 2613.593506, 59.542747, 0.0000, 0.0000, 270.0000);
- CreateObject(2755, -1486.624756, 2627.776123, 59.773663, 0.0000, 0.0000, 135.0000);
- CreateObject(2755, -1485.745605, 2629.444336, 59.596657, 0.0000, 0.0000, 90.0000);
- CreateObject(2755, -1485.695068, 2633.289551, 59.616833, 0.0000, 0.0000, 90.0000);
- CreateObject(2755, -1485.695068, 2637.188721, 59.602108, 0.0000, 0.0000, 90.0000);
- CreateObject(2755, -1485.745117, 2641.125000, 59.589428, 0.0000, 0.0000, 90.0000);
- CreateObject(3528, -1195.045410, 2698.040771, 52.333275, 0.0000, 0.0000, 323.5170);
- CreateObject(3528, -1467.115234, 2640.355713, 72.328125, 0.0000, 0.0000, 109.7670);
- CreateObject(3279, -1215.196167, 2700.820068, 43.867897, 0.0000, 0.0000, 191.2500);
- CreateObject(3279, -1438.759277, 2629.236816, 54.586548, 0.0000, 0.0000, 90.0000);
- CreateObject(3279, -1506.687744, 2637.713623, 54.411522, 0.0000, 0.0000, 0.0000);
- CreateObject(3279, -1459.565552, 2740.366943, 64.777351, 0.0000, 0.0000, 337.5000);
- CreateObject(3279, -1463.935059, 2619.976318, 60.813095, 0.0000, 0.0000, 270.0000);
- CreateObject(3361, -1472.568237, 2614.272705, 59.411873, 0.0000, 0.0000, 180.0000);
- CreateObject(7153, -1471.091064, 2507.975342, 51.147217, 0.0000, 0.0000, 0.0000);
- CreateObject(7153, -1471.127563, 2483.042969, 51.147255, 0.0000, 0.0000, 0.0000);
- CreateObject(7153, -1529.896240, 2685.656738, 50.693382, 0.0000, 0.0000, 0.0000);
- CreateObject(3279, -1461.718872, 2545.453613, 54.436523, 0.0000, 0.0000, 270.0000);
- CreateObject(3279, -1498.073975, 2490.310303, 54.098679, 0.0000, 0.0000, 135.0000);
- CreateObject(3279, -1556.890137, 2703.262695, 54.061546, 0.0000, 0.0000, 269.9999);
- CreateObject(3279, -1378.496948, 2665.056396, 51.193451, 0.0000, 0.0000, 359.9998);
- CreateObject(6973, -178.704651, 2646.395020, 58.192108, 0.0000, 0.0000, 0.0000);
- CreateObject(6973, -315.697479, 2696.587402, 57.818626, 0.0000, 0.0000, 180.0000);
- CreateObject(6973, -128.109146, 974.429321, 14.707230, 0.0000, 0.0000, 0.0000);
- CreateObject(6973, -162.439651, 972.449890, 14.708401, 0.0000, 0.0000, 0.0000);
- CreateObject(3279, -139.107529, 1123.868530, 18.450613, 0.0000, 0.0000, 270.0000);
- CreateObject(3279, -76.604568, 1136.736694, 18.467810, 0.0000, 0.0000, 180.0000);
- CreateObject(3279, -86.293396, 1070.722168, 18.367811, 0.0000, 0.0000, 90.0000);
- CreateObject(3279, -0.625790, 1060.565430, 18.442810, 0.0000, 0.0000, 360.0000);
- CreateObject(3279, -18.423267, 1185.055298, 17.982061, 0.0000, 0.0000, 180.0001);
- CreateObject(3279, -236.248245, 1120.705078, 18.467810, 0.0000, 0.0000, 90.0002);
- CreateObject(3279, -150.041702, 1265.578857, 18.217110, 0.0000, 0.0000, 90.0002);
- CreateObject(3279, -229.279831, 1166.252563, 18.292812, 0.0000, 0.0000, 0.0003);
- CreateObject(3279, -231.805725, 1163.662842, 33.696556, 0.0000, 0.0000, 90.0004);
- CreateObject(3279, -211.625366, 1055.210449, 22.579866, 0.0000, 0.0000, 90.0004);
- CreateObject(3279, -261.851715, 1142.037354, 18.405327, 0.0000, 0.0000, 180.0000);
- CreateObject(3279, 46.146793, 1139.785767, 18.242188, 0.0000, 0.0000, 180.0000);
- CreateObject(987, -135.398438, 1137.148682, 18.617189, 0.0000, 0.0000, 0.0000);
- CreateObject(987, -126.721809, 1137.126587, 18.617189, 0.0000, 0.0000, 0.0000);
- CreateObject(3361, -148.206635, 1117.952515, 19.141073, 0.0000, 0.0000, 270.0000);
- CreateObject(3361, -135.248581, 1124.643677, 19.898878, 0.0000, 0.0000, 90.0000);
- CreateObject(3361, -138.827240, 1111.090210, 19.148855, 0.0000, 0.0000, 180.0000);
- CreateObject(18609, -149.297333, 1121.358521, 15.221132, 90.2409, 1.7189, 67.5000);
- CreateObject(3361, -164.785141, 1127.434937, 19.366055, 0.0000, 0.0000, 0.0000);
- CreateObject(3361, -169.565475, 1127.443848, 22.566063, 0.0000, 0.0000, 0.0000);
- print("Objects loaded");
- return 1;
- }
- public OnGameModeExit()
- {
- foreach(Player, i)
- {
- TextDrawDestroy(Teams[i]);
- TextDrawDestroy(Classt[i]);
- }
- TextDrawDestroy(Spree);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- pSpawned[playerid] = 0;
- SetPlayerClass(playerid, classid);
- gPlayerClass[playerid] = ASSAULT;
- SetPlayerPos(playerid,11.9577,1716.7191,22.6222);
- SetPlayerFacingAngle(playerid, 128.0980);
- SetPlayerInterior(playerid, 0);
- SetPlayerCameraPos(playerid,9.6063,1715.1882,22.6113);
- SetPlayerCameraLookAt(playerid,11.9577,1716.7191,22.6222);
- CreateExplosion(11.9577,1716.7191,22.6222, 12, 0.1);
- switch (classid) {
- case 0:
- {
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- TextDrawSetString(Teams[playerid], "~b~UNITED STATES OF AMERICA");
- TextDrawShowForPlayer(playerid, Teams[playerid]);
- }
- case 1:
- {
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- TextDrawSetString(Teams[playerid], "~r~GERMANY");
- TextDrawShowForPlayer(playerid, Teams[playerid]);
- }
- case 2:
- {
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- TextDrawSetString(Teams[playerid], "~y~MERCENARY");
- TextDrawShowForPlayer(playerid, Teams[playerid]);
- }
- case 3:
- {
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- TextDrawSetString(Teams[playerid], "~y~RUSSIA");
- TextDrawShowForPlayer(playerid, Teams[playerid]);
- }
- case 4:
- {
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- TextDrawSetString(Teams[playerid],"~w~JAPAN");
- TextDrawShowForPlayer(playerid, Teams[playerid]);
- }
- }
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- if(gTeam[playerid] == TEAM_USA) {
- SetPlayerColor(playerid,COLOR_BLUE);
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- }
- else if(gTeam[playerid] == TEAM_GERMANY) {
- SetPlayerColor(playerid,COLOR_RED);
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- }
- else if(gTeam[playerid] == TEAM_MERC) {
- SetPlayerColor(playerid,COLOR_YELLOW);
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- }
- else if(gTeam[playerid] == TEAM_RUSSIA) {
- SetPlayerColor(playerid,COLOR_ORANGE);
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- }
- else if(gTeam[playerid] == TEAM_JAPAN) {
- SetPlayerColor(playerid,COLOR_WHITE);
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- }
- return 1;
- }
- SetPlayerClass(playerid, classid)
- {
- if(classid == 0)
- {
- gTeam[playerid] = TEAM_USA;
- }
- else if(classid == 1)
- {
- gTeam[playerid] = TEAM_GERMANY;
- }
- else if(classid == 2)
- {
- gTeam[playerid] = TEAM_MERC;
- }
- else if(classid == 3)
- {
- gTeam[playerid] = TEAM_RUSSIA;
- }
- else if(classid == 4)
- {
- gTeam[playerid] = TEAM_JAPAN;
- }
- }
- public OnPlayerConnect(playerid)
- {
- //------------------------------------------------
- SetPlayerTime(playerid,hourx,minutex);
- WarnedTimes[playerid] = 0;
- freeze[playerid] = 0;
- PlayerSpec[playerid][is] = 0;
- IsInCargoB[playerid] = false;
- IsInBarracks[playerid] = false;
- new IP[50];
- GetPlayerName(playerid, nameee, 16);
- GetPlayerIp(playerid, IP, 50);
- printf("%s |ID:%i| %s has connected !", IP,playerid, nameee);
- logged[playerid] = 0;
- GetPlayerName(playerid, playername, sizeof(playername));
- Classt[playerid] = TextDrawCreate(500.000000,427.000000,"Medic");
- TextDrawAlignment(Classt[playerid],0);
- TextDrawBackgroundColor(Classt[playerid],0x000000ff);
- TextDrawFont(Classt[playerid],3);
- TextDrawColor(Classt[playerid],0xffffffff);
- TextDrawSetOutline(Classt[playerid],1);
- TextDrawSetProportional(Classt[playerid],1);
- TextDrawSetShadow(Classt[playerid],1);
- TextDrawLetterSize(Classt[playerid],0.699999,0.899999);
- TextDrawHideForPlayer(playerid, Classt[playerid]);
- SpawnP[playerid] =1;
- Teams[playerid] = TextDrawCreate(174.000000,135.000000,"United States of America");
- TextDrawAlignment(Teams[playerid],0);
- TextDrawBackgroundColor(Teams[playerid],0x000000ff);
- TextDrawFont(Teams[playerid],3);
- TextDrawLetterSize(Teams[playerid],0.599999,1.200000);
- TextDrawColor(Teams[playerid],0xffffffff);
- TextDrawSetOutline(Teams[playerid],1);
- TextDrawSetProportional(Teams[playerid],1);
- TextDrawSetShadow(Teams[playerid],1);
- TextDrawHideForPlayer(playerid, Teams[playerid]);
- Players++;
- AbleToSpawn[playerid] = 1;
- rank[playerid] = 0;
- pSpawned[playerid] = 0;
- TogglePlayerClock(playerid, 0);
- IsInHunter[playerid] = 0;
- IsInRhino[playerid] = 0;
- SetPlayerMapIcon(playerid, 8, -286.5354,2692.7466,62.6875,6, 0);//usa ammo
- SetPlayerMapIcon(playerid, 7,-181.6294,1166.3633,19.7500 ,6, 0);//ger ammo
- SetPlayerMapIcon(playerid, 1, -227.7928,2721.7283,62.8294, 56, 0);
- SetPlayerMapIcon(playerid, 2, -17.6360,1215.4073,22.4648, 56, 0);
- SetPlayerMapIcon(playerid, 3, 777.4450,1871.4246,4.9067, 6, 0);
- SetPlayerMapIcon(playerid, 4, -315.8113,829.8170,14.2422, 6, 0);
- SetPlayerMapIcon(playerid, 5, -314.4954,1774.4213,43.6406, 6, 0);
- SetPlayerMapIcon(playerid, 6, -604.3909,2716.7764,72.7231, 6, 0);
- SendClientMessage(playerid,COLOR_GREY, "Type /help for help!");
- SendClientMessage(playerid,ORANGE, "Want all your stats to be saved? Type /register [password]");
- SendClientMessage(playerid,COLOR_ORANGE, "For the full list of commands type /commands");
- SendClientMessage(playerid,COLOR_GREY, "WEB URL: http://www.cod5server.co.cc");
- SendClientMessage(playerid, COLOR_GREY, "Check /changelog for changes in server");
- SendClientMessage(playerid, COLOR_RED, "This server contains an anti-cheat system,");
- SendClientMessage(playerid, COLOR_RED, "cheating will result in a ban !");
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- format(string, sizeof(string), "*** %s has joined the server. Total Players In Server: %d", pName, Players);
- SendClientMessageToAll(ORANGE, string);
- SendClientMessage(playerid, COLOR_GREEN, "We are changing ip's on november 24th!");
- SendClientMessage(playerid, COLOR_GREEN, "Go to www.cod5server.co.cc on november 24th to get more info on how to come back!");
- if(dini_Exists(udb_encode(pName)))
- {
- new IPP[50];
- GetPlayerIp(playerid, IPP, sizeof(IPP));
- dini_Set(udb_encode(pName), "IP", IPP);
- }
- if( logged[playerid] == 0 )
- {
- if(dini_Exists(udb_encode(playername)))
- {
- if(logged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_RED, "Your account has been detected in our database. Use /login to log in!");
- ShowPlayerDialog(playerid,60,DIALOG_STYLE_INPUT,"Login","Welcome to the server\n\nPlease enter your server password\n\nEnter a password:","Login","Quit");
- }
- }
- else if(!dini_Exists(udb_encode(playername)))
- {
- SendClientMessage(playerid, COLOR_RED, "You are not registered! Use /register");
- }
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if( gPlayerClass[playerid] == ADMIN ) KillTimer(admgod[playerid]);
- for(new i=0; i < MAX_TEAMS; i++)
- {
- if(teamInfo[i][0]==1)
- {
- if( teamMembers[i][0] == playerid)
- {
- //name team
- format(teamNames[i], MAX_TEAM_NAME, " ");
- //Team exists
- teamInfo[i][0]=0;
- //There is one member
- teamInfo[i][1]=0;
- //Team color is player's color
- teamInfo[i][2]=-1;
- //Player is the first team member
- teamMembers[i][0] = -1;
- teamMembers[i][1] = -1;
- teamMembers[i][2] = -1;
- teamMembers[i][3] = -1;
- }
- }
- }
- SetPlayerHealth(playerid, 0.0);
- IsInCargoB[playerid] = false;
- IsInBarracks[playerid] = false;
- if( gPlayerClass[playerid] == ENGINEER )
- {
- DestroyPickup(Dispenser[playerid]);
- }
- logged[playerid] = 0;
- Players--;
- if(Planted[playerid] == 1)
- {
- DestroyObject(C4[playerid]);
- Bomb[playerid] = 0;
- Planted[playerid] = 0;
- }
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- switch(reason)
- {
- case 0: format(string, sizeof(string), "***%s has left the server. (Timeout) Total Players In Server: %d", pName, Players);
- case 1: format(string, sizeof(string), "***%s has left the server. (Leaving) Total Players In Server: %d", pName, Players);
- case 2: format(string, sizeof(string), "***%s has left the server. (Kicked | Banned) Total Players In Server: %d", pName, Players);
- }
- SendClientMessageToAll(ORANGE, string);
- return 1;
- }
- stock SetPlayerRankStars(playerid)
- {
- SetPlayerWantedLevel(playerid, rank[playerid]);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(GeneralClass[playerid][1] == 1 || GeneralClass[playerid][2] == 1 || GeneralClass[playerid][3] == 1 || GeneralClass[playerid][4] == 1)
- {
- if(gPlayerClass[playerid] != GENERAL)
- {
- GeneralClass[playerid][1] = 0;
- GeneralClass[playerid][2] = 0;
- GeneralClass[playerid][3] = 0;
- GeneralClass[playerid][4] = 0;
- }
- }
- if( PlayerSpec[playerid][is] == 0 )
- {
- TextDrawShowForPlayer(playerid,txtTimeDisp);
- SetPlayerTime(playerid,hourx,minutex);
- TogglePlayerControllable(playerid, 1);
- if( GetPlayerMoney(playerid) < 0 ) ResetPlayerMoney(playerid);
- CheckForLevelUpdate(playerid);
- SetPlayerRankStars(playerid);
- SetPlayerInterior(playerid, 0);
- dispout[playerid] = 0;
- IsInCargoB[playerid] = false;
- IsInBarracks[playerid] = false;
- if(gTeam[playerid] == TEAM_USA )
- {
- if( gPlayerClass[playerid] == ADMIN ) SetPlayerSkin(playerid, 217);
- if( gPlayerClass[playerid] == PYRO ) SetPlayerSkin(playerid, 279);
- if( gPlayerClass[playerid] == Esploratore ) SetPlayerSkin(playerid,128 );
- if( gPlayerClass[playerid] == MEDIC ) SetPlayerSkin(playerid, 275);
- if( gPlayerClass[playerid] == ENGINEER ) SetPlayerSkin(playerid, 179);
- if( gPlayerClass[playerid] == PILOT ) SetPlayerSkin(playerid, 163);
- if( gPlayerClass[playerid] == SNIPER ) SetPlayerSkin(playerid, 124);
- if( gPlayerClass[playerid] == DEMOLITION ) SetPlayerSkin(playerid, 73);
- if( gPlayerClass[playerid] == ASSAULT ) SetPlayerSkin(playerid, 287);
- if( gPlayerClass[playerid] == GENERAL ) SetPlayerSkin(playerid, 283);
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- if( gPlayerClass[playerid] == ADMIN ) SetPlayerSkin(playerid, 217);
- if( gPlayerClass[playerid] == PYRO ) SetPlayerSkin(playerid, 278);
- if( gPlayerClass[playerid] == Esploratore ) SetPlayerSkin(playerid, 202);
- if( gPlayerClass[playerid] == MEDIC ) SetPlayerSkin(playerid, 70);
- if( gPlayerClass[playerid] == PILOT ) SetPlayerSkin(playerid, 284);
- if( gPlayerClass[playerid] == ENGINEER ) SetPlayerSkin(playerid, 50);
- if( gPlayerClass[playerid] == SNIPER ) SetPlayerSkin(playerid, 206);
- if( gPlayerClass[playerid] == DEMOLITION ) SetPlayerSkin(playerid, 27);
- if( gPlayerClass[playerid] == ASSAULT ) SetPlayerSkin(playerid, 285);
- if( gPlayerClass[playerid] == GENERAL ) SetPlayerSkin(playerid, 288);
- }
- playerColors[playerid] = GetPlayerColor(playerid);
- SendClientMessage(playerid, COLOR_RED, "To make this server better you can donate! When you donate you will recieve the V.I.P team!");
- SendClientMessage(playerid, COLOR_RED, "To donate go to the website (www.cod5server.co.cc) and press the paypal donate button!");
- SendClientMessage(playerid, COLOR_GREEN, "NEW: Type /donationpackage to see the features you can get!");
- SetPlayerInterior(playerid, 0);
- if( gTeam[playerid] == TEAM_USA )
- {
- switch(SpawnP[playerid])
- {
- case 1:
- {
- SetRandomUSAPos(playerid);
- }
- case 2:
- {
- if( CapturedBy3 == 1 ) SetPlayerPos(playerid,401.1484,2528.9482,16.5785);
- }
- case 3:
- {
- if( CapturedBy5 == 1 ) SetPlayerPos(playerid,216.0368,1911.4246,17.6406);
- }
- case 4:
- {
- if( CapturedBy11 == 1 ) SetPlayerPos(playerid, 1087.1479,1074.4731,10.8382);
- }
- }
- }else if( gTeam[playerid] == TEAM_GERMANY )
- {
- switch(SpawnP[playerid])
- {
- case 1:
- {
- SetRandomGERPos(playerid);
- }
- case 2:
- {
- if( CapturedBy3 == 2 ) SetPlayerPos(playerid,401.1484,2528.9482,16.5785);
- }
- case 3:
- {
- if( CapturedBy5 == 2) SetPlayerPos(playerid,216.0368,1911.4246,17.6406);
- }
- case 4:
- {
- if( CapturedBy11 == 2 ) SetPlayerPos(playerid, 1087.1479,1074.4731,10.8382);
- }
- }
- }
- SendClientMessage(playerid, COLOR_GREY, "Type /switchclass to change your class!");
- SendClientMessage(playerid, COLOR_GREY, "Type /switchspawn to change your spawn position!");
- SendClientMessage(playerid, COLOR_GREY, "Type /g [text] to talk in global!");
- if(PickedClass[playerid] == 1) { RestoreClassWeapons(playerid); }
- if(PickedClass[playerid] == 0 && gTeam[playerid] != TEAM_MERC)
- {
- if( adminlevel[playerid] > 0 )
- {
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Classes", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander\nAdmin", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }else if( adminlevel[playerid] < 1 )
- {
- TogglePlayerControllable(playerid, 0);
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Classes", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- SetPlayerVirtualWorld(playerid, 0);
- }
- }
- SettingPlayerTeam();
- pSpawned[playerid] = 1;
- if(gPlayerClass[playerid] == DEMOLITION)
- {
- SendClientMessage(playerid, COLOR_ORANGE, "Since you are the explosive class, you can plant bombs by pressing CROUCH and FIRE.");
- }
- if(gTeam[playerid] == TEAM_MERC)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You are a mercenary. Kill people for money which you can use to buy guns.");
- }
- //stats save on spawn
- if( logged[playerid] == 1 )
- {
- GetPlayerName(playerid, nameee, sizeof(nameee));
- dini_IntSet(udb_encode(nameee), "money", GetPlayerMoney(playerid));
- dini_IntSet(udb_encode(nameee), "score", GetPlayerScore(playerid));
- dini_IntSet(udb_encode(nameee), "rank", rank[playerid]);
- dini_IntSet(udb_encode(nameee), "deaths", deaths[playerid]);
- dini_IntSet(udb_encode(nameee), "kills", kills[playerid]);
- dini_IntSet(udb_encode(nameee), "piolet", piolet[playerid]);
- dini_IntSet(udb_encode(nameee), "logged", 1);
- printf("%i %i %i %i %i %i %i", GetPlayerMoney(playerid), GetPlayerScore(playerid), rank[playerid], deaths[playerid], kills[playerid], piolet, logged);
- SendClientMessage(playerid, COLOR_WHITE, ".:[Stats Saved]:.");
- }
- GangZoneShowForPlayer(playerid, USA, 0x0000FF96);
- GangZoneShowForPlayer(playerid, GERMANY, 0xFF000096);
- GangZoneShowForPlayer(playerid, Town1, 0xFFFFFF96);
- GangZoneShowForPlayer(playerid, Town2, COLOR_ORANGE);
- SetTimerEx("ClassShow", 6000, 0, "i", playerid);
- if( gPlayerClass[playerid] != ADMIN ) { if( gTeam[playerid] == TEAM_USA) SetPlayerColor(playerid, COLOR_BLUE); if(gTeam[playerid] == TEAM_GERMANY) SetPlayerColor(playerid, COLOR_RED);}
- }else if( PlayerSpec[playerid][is] == 1 ) if(PickedClass[playerid] == 1) { RestoreClassWeapons(playerid); }
- Vip(playerid);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new string[128];
- if(dialogid == 2 )
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander\nAdmin", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- if(response)
- {
- if(listitem == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the assault as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = ASSAULT;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 24, 200);
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerWeapon(playerid, 25, 100);
- SetPlayerSkin(playerid, 287);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 24, 200);
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerWeapon(playerid, 25, 100);
- SetPlayerSkin(playerid, 285);
- }
- else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if(listitem == 1)
- {
- if( rank[playerid] >= 1 )
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the demolition as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = DEMOLITION;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 16, 50);
- GivePlayerWeapon(playerid, 36, 5);
- GivePlayerWeapon(playerid, 24, 200);
- SetPlayerSkin(playerid, 73);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 16, 50);
- GivePlayerWeapon(playerid, 36, 5);
- GivePlayerWeapon(playerid, 24, 200);
- SetPlayerSkin(playerid, 27);
- }
- else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }else
- {
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- SendClientMessage(playerid, COLOR_RED, "You need to be rank 1 to be able to use Demolition !");
- }
- }
- if(listitem == 2)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the sniper as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = SNIPER;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- SetPlayerSkin(playerid, 124);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- SetPlayerSkin(playerid, 206);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if(listitem == 3)
- {
- if(gTeam[playerid] == TEAM_JAPAN || gTeam[playerid] == TEAM_RUSSIA)
- {
- SendClientMessage(playerid, COLOR_GREY, "You cant be a pilot on russia or japan!");
- TogglePlayerControllable(playerid, 1);
- return 1;
- }
- if(rank[playerid] >= 3)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the pilot as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = PILOT;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 163);
- GivePlayerWeapon(playerid, 22, 50);
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 284);
- GivePlayerWeapon(playerid, 22, 50);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 3 to be a pilot!");
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- }
- }
- if(listitem == 4)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the medic as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = MEDIC;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 275);
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 1, 1);
- SetPlayerSkin(playerid, 275);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 70);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- SetPlayerSkin(playerid, 70);
- }
- else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if(listitem == 5)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the engineer as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = ENGINEER;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 179);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 29, 200);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 50);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 29, 200);
- }
- else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if( listitem == 6 ) //pyro
- {
- if( rank[playerid] >= 4 )
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the pyroman as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = PYRO;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 279);
- GivePlayerWeapon(playerid, 16, 20);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 37, 550);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 278);
- GivePlayerWeapon(playerid, 16, 20);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 37, 250);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 4 to be a pyroman!");
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- }
- if( listitem == 7 )//Esploratore
- {
- if( rank[playerid] >= 1 )
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the Esploratore as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = Esploratore;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 128);
- SetPlayerArmour(playerid, 25);
- GivePlayerWeapon(playerid, 28, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 200);
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 202);
- SetPlayerArmour(playerid, 25);
- GivePlayerWeapon(playerid, 28, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 200);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 1 to be a Esploratore!");
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- }
- if(listitem == 8)
- {
- if(rank[playerid] >= 8)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose general (commander) as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = GENERAL;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 283);
- SetPlayerArmour(playerid, 95);
- GivePlayerWeapon(playerid, 31, 200);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 28, 200);
- GeneralClass[playerid][1] = 1;
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 288);
- SetPlayerArmour(playerid, 95);
- GivePlayerWeapon(playerid, 31, 200);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 28, 200);
- GeneralClass[playerid][2] = 1;
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 31, 200);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 28, 200);
- if(gTeam[playerid] == TEAM_RUSSIA) GeneralClass[playerid][3] = 1;
- if(gTeam[playerid] == TEAM_JAPAN) GeneralClass[playerid][4] = 1;
- }
- }else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 8 to be a general (commander)!");
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- }
- if( listitem == 9 ) // admin NOTE: general is 8
- {
- if( adminlevel[playerid] > 0 )
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the Admin as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = ADMIN;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- SetPlayerColor(playerid, LIGHTGREEN);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 217);
- SetPlayerArmour(playerid, 100);
- GivePlayerWeapon(playerid, 38, 20000);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 20000);
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 217);
- SetPlayerArmour(playerid, 100);
- GivePlayerWeapon(playerid, 38, 20000);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 20000);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- SetPlayerSkin(playerid, 217);
- SetPlayerArmour(playerid, 100);
- GivePlayerWeapon(playerid, 38, 20000);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 20000);
- }
- }else SendClientMessage(playerid, COLOR_RED, "Bye bye - You aren't admin !");
- }
- }
- if(dialogid == 60)
- {
- GetPlayerName(playerid, playername, sizeof(playername));
- if(response == 1)
- {
- GetPlayerName(playerid, playername, sizeof(playername));
- if(strlen(inputtext) == 0)
- {
- ShowPlayerDialog(playerid,20,DIALOG_STYLE_INPUT,"Login","Please enter a password\n\nPlease enter your password:","Login","Quit");
- return 1;
- }
- new pass[256];
- pass = dini_Get(udb_encode(playername), "Password");
- if( udb_hash(inputtext) == strval(pass) )
- {
- GetPlayerName(playerid, playername, sizeof(playername));
- logged[playerid] = 1;
- pscore[playerid] = dini_Int(udb_encode(playername), "score");
- money[playerid] = dini_Int(udb_encode(playername), "money");
- adminlevel[playerid] = dini_Int(udb_encode(playername), "adminlevel");
- rank[playerid] = dini_Int(udb_encode(playername), "rank");
- deaths[playerid] = dini_Int(udb_encode(playername), "deaths");
- kills[playerid] = dini_Int(udb_encode(playername), "kills");
- piolet[playerid] = dini_Int(udb_encode(playername), "piolet");
- dini_IntSet(udb_encode(playername), "logged", 1);
- format(string, sizeof(string), "%s, you are now logged in!", playername);
- SendClientMessage(playerid, ORANGE, string);
- GivePlayerMoney(playerid, money[playerid]);
- SetPlayerScore(playerid, pscore[playerid]);
- SetPlayerWantedLevel(playerid, rank[playerid]);
- }else
- {
- SendClientMessage(playerid, COLOR_RED, "Invalid Password!");
- Kick(playerid);
- ShowPlayerDialog(playerid,20,DIALOG_STYLE_INPUT,"Login","Invalid Password\n\nPlease enter your password:","Login","Quit");
- }
- }
- else if( response == 0 )
- {
- SendClientMessage(playerid, COLOR_RED, "Invalid Password!");
- Kick(playerid);
- }
- }
- if(dialogid == 50)
- {
- if(response)
- {
- if (!dini_Exists(udb_encode(playername)))
- {
- if(strlen(inputtext) == 0)
- {
- ShowPlayerDialog(playerid,30,DIALOG_STYLE_MSGBOX,"Error!","Please Enter A Password!","Ok","Quit");
- return 1;
- }
- GetPlayerName(playerid, playername, sizeof(playername));
- dini_Create(udb_encode(playername));
- new pmoney[MAX_PLAYERS];
- pmoney[playerid] = GetPlayerMoney(playerid);
- pscore[playerid] = GetPlayerScore(playerid);
- dini_IntSet(udb_encode(playername), "password", udb_hash(inputtext));
- dini_IntSet(udb_encode(playername), "adminlevel", 0);
- dini_IntSet(udb_encode(playername), "money", pmoney[playerid]);
- dini_IntSet(udb_encode(playername), "score", pscore[playerid]);
- SetPlayerWantedLevel(playerid, rank[playerid]);
- dini_IntSet(udb_encode(playername), "rank", rank[playerid]);
- dini_IntSet(udb_encode(playername), "deaths", deaths[playerid]);
- dini_IntSet(udb_encode(playername), "kills", kills[playerid]);
- dini_IntSet(udb_encode(playername), "piolet", 0);
- format(string, sizeof(string), "Account created!\nYou can now login with /login and use the password %s", inputtext);
- ShowPlayerDialog(playerid,30,DIALOG_STYLE_MSGBOX,"Success!",string,"Ok","Quit");
- format(string, sizeof(string), "Account created! You can now login with /login and use the password %s", inputtext);
- SendClientMessage(playerid, COLOR_GREEN, string);
- }
- }
- }
- if(dialogid == 169 )
- {
- if( listitem == 0)
- {
- SpawnP[playerid] =1;
- }else
- if( listitem == 1 )
- {
- if( CapturedBy3 == 1 )
- {
- SpawnP[playerid] =2;
- }else SendClientMessage(playerid, COLOR_RED, "Your team doesn't own the Airfield !");
- }else
- if(listitem == 2 )
- {
- if( CapturedBy5 == 1 )
- {
- SpawnP[playerid] =3;
- }else SendClientMessage(playerid, COLOR_RED, "Your team doesn't own Area69 !");
- }else
- if(listitem == 3 )
- {
- if( CapturedBy11 == 1 )
- {
- SpawnP[playerid] =4;
- }else SendClientMessage(playerid, COLOR_RED, "Your team doesn't own The University !");
- }
- }
- if( dialogid == 168 )
- {
- if( listitem == 0)
- {
- SpawnP[playerid] =1;
- }else
- if( listitem == 1 )
- {
- if( CapturedBy3 == 2 )
- {
- SpawnP[playerid] =2;
- }else SendClientMessage(playerid, COLOR_RED, "Your team doesn't own the Airfield !");
- }else
- if(listitem == 2 )
- {
- if( CapturedBy5 == 2 )
- {
- SpawnP[playerid] =3;
- }else SendClientMessage(playerid, COLOR_RED, "Your team doesn't own Area69 !");
- }else
- if(listitem == 3 )
- {
- if( CapturedBy11 == 2 )
- {
- SpawnP[playerid] =4;
- }else SendClientMessage(playerid, COLOR_RED, "Your team doesn't own The University !");
- }
- }
- if(dialogid == 110)
- {
- if(response)
- {
- if(!strlen(inputtext)) return SendClientMessage(playerid, COLOR_GREY, "Please enter the amount of armor you want to buy!");
- if(!strval(inputtext)) return SendClientMessage(playerid, COLOR_GREY, "Please enter the amount of armor you want to buy!");
- if(strval(inputtext) <= 0) return SendClientMessage(playerid, COLOR_GREY, "The ammount of armor you wish to buy cant be less then or equal to 0");
- if(strval(inputtext) > 100) return SendClientMessage(playerid, COLOR_GREY, "The ammount of armor you wish to buy cant be greater than 100");
- if(strval(inputtext) >= 90)
- {
- if(GetPlayerMoney(playerid) >= 20000)
- {
- format(string, sizeof(string), "You purchased %d of armour and have been charged 20000", inputtext);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- SetPlayerArmour(playerid, strval(inputtext));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- else if(strval(inputtext) >= 70)
- {
- if(GetPlayerMoney(playerid) >= 15000)
- {
- format(string, sizeof(string), "You purchased %d of armour and have been charged 15000", inputtext);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- SetPlayerArmour(playerid, strval(inputtext));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- if(strval(inputtext) >= 50)
- {
- if(GetPlayerMoney(playerid) >= 10000)
- {
- format(string, sizeof(string), "You purchased %d of armour and have been charged 10000", inputtext);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- SetPlayerArmour(playerid, strval(inputtext));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- if(strval(inputtext) <= 50)
- {
- if(GetPlayerMoney(playerid) >= 10000)
- {
- format(string, sizeof(string), "You purchased %d of armour and have been charged 10000", inputtext);
- SendClientMessage(playerid, COLOR_ORANGE, string);
- SetPlayerArmour(playerid, strval(inputtext));
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- }
- }
- if(dialogid == 100)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerMoney(playerid) >= 10000)
- {
- GivePlayerMoney(playerid, -10000);
- GivePlayerWeapon(playerid, 31, 500);
- SendClientMessage(playerid, COLOR_ORANGE, "You bought a M4!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- if(listitem == 1)
- {
- if(GetPlayerMoney(playerid) >= 10000)
- {
- GivePlayerMoney(playerid, -10000);
- GivePlayerWeapon(playerid, 30, 500);
- SendClientMessage(playerid, COLOR_ORANGE, "You bought a AK47!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- if(listitem == 2)
- {
- if(GetPlayerMoney(playerid) >= 15000)
- {
- GivePlayerMoney(playerid, -15000);
- GivePlayerWeapon(playerid, 24, 500);
- SendClientMessage(playerid, COLOR_ORANGE, "You bought a desert eagle!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- if(listitem == 3)
- {
- if(GetPlayerMoney(playerid) >= 20000)
- {
- GivePlayerMoney(playerid, -20000);
- GivePlayerWeapon(playerid, 37, 500);
- SendClientMessage(playerid, COLOR_ORANGE, "You bought a flame thrower!!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- if(listitem == 4)
- {
- ShowPlayerDialog(playerid, 110, DIALOG_STYLE_INPUT, "Armour", "Select the amount of armor you want to buy:", "Buy", "Cancel");
- }
- if(listitem == 5)
- {
- if(GetPlayerMoney(playerid) >= 25000)
- {
- GivePlayerMoney(playerid, -25000);
- GivePlayerWeapon(playerid, 36, 5);
- SendClientMessage(playerid, COLOR_ORANGE, "You bought a rocket launcher!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- if(listitem == 6)
- {
- if(GetPlayerMoney(playerid) >= 25000)
- {
- GivePlayerMoney(playerid, -25000);
- GivePlayerWeapon(playerid, 34, 500);
- SendClientMessage(playerid, COLOR_ORANGE, "You bought a sniper rifle!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- if(listitem == 7)
- {
- if(GetPlayerMoney(playerid) >= 30000)
- {
- GivePlayerMoney(playerid, -30000);
- GivePlayerWeapon(playerid, 27, 500);
- SendClientMessage(playerid, COLOR_ORANGE, "You bought a SPAS 12!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You dont have enough money!");
- }
- }
- }
- }
- if(dialogid == 1)
- {
- if(!response)
- {
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- if(response)
- {
- if(listitem == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the assault as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = ASSAULT;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 24, 200);
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerWeapon(playerid, 25, 100);
- SetPlayerSkin(playerid, 287);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 24, 200);
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerWeapon(playerid, 25, 100);
- SetPlayerSkin(playerid, 285);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if(listitem == 1)
- {
- if( rank[playerid] >= 1 )
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the demolition as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = DEMOLITION;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 16, 50);
- GivePlayerWeapon(playerid, 36, 5);
- GivePlayerWeapon(playerid, 24, 200);
- SetPlayerSkin(playerid, 73);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 16, 50);
- GivePlayerWeapon(playerid, 36, 5);
- GivePlayerWeapon(playerid, 24, 200);
- SetPlayerSkin(playerid, 27);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }else
- {
- SendClientMessage(playerid, COLOR_RED, "You need to be rank 1 to be able to use Demolition !");
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- }
- if(listitem == 2)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the sniper as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = SNIPER;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- SetPlayerSkin(playerid, 124);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- SetPlayerSkin(playerid, 206);
- }
- else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if(listitem == 3)
- {
- if(gTeam[playerid] == TEAM_JAPAN || gTeam[playerid] == TEAM_RUSSIA)
- {
- SendClientMessage(playerid, COLOR_GREY, "You cant be a pilot on russia or japan!");
- TogglePlayerControllable(playerid, 1);
- return 1;
- }
- if(rank[playerid] >= 3)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the pilot as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = PILOT;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 163);
- GivePlayerWeapon(playerid, 22, 50);
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 284);
- GivePlayerWeapon(playerid, 22, 50);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 3 to be a pilot!");
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- }
- }
- if(listitem == 4)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the medic as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = MEDIC;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 275);
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 1, 1);
- SetPlayerSkin(playerid, 275);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 70);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- SetPlayerSkin(playerid, 70);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if(listitem == 5)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the engineer as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = ENGINEER;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 179);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 29, 200);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 50);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 29, 200);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if( listitem == 6 ) //pyro
- {
- if( rank[playerid] >= 4 )
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the pyroman as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = PYRO;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 279);
- GivePlayerWeapon(playerid, 16, 20);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 37, 550);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 278);
- GivePlayerWeapon(playerid, 16, 20);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 37, 250);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 4 to be a pyroman!");
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- }
- if( listitem == 7 )//Esploratore
- {
- if( rank[playerid] >= 1 )
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the Esploratore as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = Esploratore;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 128);
- SetPlayerArmour(playerid, 25);
- GivePlayerWeapon(playerid, 28, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 200);
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 202);
- SetPlayerArmour(playerid, 25);
- GivePlayerWeapon(playerid, 28, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 200);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 1 to be a Esploratore!");
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- }
- if(listitem == 8)
- {
- if(rank[playerid] >= 8)
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose general (commander) as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = GENERAL;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 283);
- SetPlayerArmour(playerid, 95);
- GivePlayerWeapon(playerid, 31, 200);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 28, 200);
- GeneralClass[playerid][1] = 1;
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 288);
- SetPlayerArmour(playerid, 95);
- GivePlayerWeapon(playerid, 31, 200);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 28, 200);
- GeneralClass[playerid][2] = 1;
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 31, 200);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 28, 200);
- if(gTeam[playerid] == TEAM_RUSSIA) GeneralClass[playerid][3] = 1;
- if(gTeam[playerid] == TEAM_JAPAN) GeneralClass[playerid][4] = 1;
- }
- }else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to have atleast rank 8 to be a general (commander)!");
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Pick Your Class", "Assault\nDemolition\nSniper\nPilot\nMedic\nEngineer\nPyroman\nEsploratore\nGeneral/Commander", "Select", "Cancel");
- TogglePlayerControllable(playerid, 0);
- }
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if( gPlayerClass[playerid] == ADMIN ) KillTimer(admgod[playerid]);
- GivePlayerMoney(playerid, -1000);
- if( GetPlayerMoney(playerid) < 0 ) ResetPlayerMoney(playerid);
- if( gPlayerClass[playerid] == ENGINEER ) DestroyPickup(Dispenser[playerid]);
- if( IsPlayerInAnyVehicle(playerid) )
- {
- if( IsInCargoB[playerid] == true )
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- CargoBob[vehicleid][seats] = CargoBob[vehicleid][seats] - 1;
- IsInCargoB[playerid] = false;
- }
- if( IsInBarracks[playerid] == true )
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- Barracks[vehicleid][seats] = Barracks[vehicleid][seats] - 1;
- IsInBarracks[playerid] = false;
- }
- }
- TextDrawHideForPlayer(playerid,txtTimeDisp);
- // THIS IS ACTUALLY ONPLAYERDEATH !
- if( gPlayerClass[killerid] != ADMIN)
- {
- deaths[playerid] = deaths[playerid] + 1;
- kills[killerid] = kills[killerid] + 1;
- }
- CheckForLevelUpdate(killerid);
- SetPlayerVirtualWorld(playerid, 0);
- SendClientMessage(killerid, COLOR_WHITE, "You got money and weapons for killing an enemy!");
- GivePlayerMoney(killerid, 1000);
- if( GetPlayerWeapon(playerid) != 36 ) GivePlayerWeapon(playerid, GetPlayerWeapon(playerid), 50);
- if(hashit[playerid] == 1 && gTeam[killerid] == TEAM_MERC)
- {
- hashit[playerid] = 0;
- GivePlayerMoney(killerid, money[playerid]);
- SendClientMessage(playerid, COLOR_YELLOW, "You got money for killing an enemy that has a contract on!");
- new string[128];
- new hitname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, hitname, sizeof(hitname));
- new killername[MAX_PLAYER_NAME];
- GetPlayerName(killerid, killername, sizeof(killername));
- format(string, sizeof(string), "%s killed contracted player %s ! The contract is canceled!", killername, hitname);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- AbleToSpawn[playerid] = 1;
- pSpawned[playerid] = 0;
- if(Planted[playerid] == 1)
- {
- DestroyObject(C4[playerid]);
- Bomb[playerid] = 0;
- Planted[playerid] = 0;
- }
- if(hitman[killerid] == 1)
- {
- if(playerid == randperson[playerid])
- {
- SendClientMessage(killerid, COLOR_WHITE, "Nice work! You killed your hit! Minimission completed!");
- SetPlayerScore(killerid, GetPlayerScore(killerid) +3);
- DisablePlayerCheckpoint(playerid);
- hitman[killerid] = 0;
- }
- }
- if(kills[killerid] == 6)
- {
- kills[killerid] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "Congratulations! You completed the challenge!");
- SetPlayerScore(killerid, GetPlayerScore(killerid) +3);
- }
- spree[killerid]++;
- if(spree[killerid] == 5)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(killerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~5 KILLS!~r~", pName);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[killerid] == 10)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(killerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~10 KILLS!~r~", pName);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[killerid] == 15)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(killerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~15 KILLS!~r~", pName);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[killerid] == 20)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(killerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~20 KILLS!~r~", pName);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[killerid] == 25)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(killerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~25 KILLS!~r~", pName);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[killerid] == 30)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(killerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~30 KILLS!~r~", pName);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[killerid] == 35)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(killerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~35 KILLS!~r~", pName);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[killerid] == 40)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(killerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~40 KILLS!~r~", pName);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[killerid] == 45)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~45 KILLS!~r~", pName);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[killerid] == 50)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- SetPlayerScore(playerid, GetPlayerScore(playerid) +5);
- GetPlayerName(playerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~50 KILLS!~r~", pName);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[killerid] > 50 )
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s IS ON A ~r~KILLING SPREE~r~ OF ~n~ ~r~%i KILLS!~r~", pName, spree[killerid]);
- TextDrawHideForAll(Spree);
- TextDrawSetString(Spree, string);
- TextDrawShowForAll(Spree); SetTimer("TxtReset", 3000, 0);
- }
- if(spree[playerid] >= 5)
- {
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- format(string, sizeof(string), "%s 's killing spree ended.", pName);
- SendClientMessageToAll(COLOR_CON_GREEN, string);
- spree[playerid] = 0;
- }
- IsInHunter[playerid] = 0;
- IsInRhino[playerid] = 0;
- EnteredArea[playerid] = 0;
- SendDeathMessage(killerid, playerid, reason);
- if( killerid == INVALID_PLAYER_ID)
- {
- SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
- }
- if( gPlayerClass[killerid] != ADMIN ) SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
- pSpawned[playerid] = 0;
- //stats save on death
- if( logged[playerid] == 1 )
- {
- GetPlayerName(playerid, nameee, sizeof(nameee));
- dini_IntSet(udb_encode(nameee), "money", GetPlayerMoney(playerid));
- dini_IntSet(udb_encode(nameee), "score", GetPlayerScore(playerid));
- dini_IntSet(udb_encode(nameee), "rank", rank[playerid]);
- dini_IntSet(udb_encode(nameee), "deaths", deaths[playerid]);
- dini_IntSet(udb_encode(nameee), "kills", kills[playerid]);
- dini_IntSet(udb_encode(nameee), "piolet", piolet[playerid]);
- dini_IntSet(udb_encode(nameee), "logged", 1);
- }
- if( PlayerSpec[playerid][is] == 1 ) print("Death Spec WTF!?");
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- foreach(Player, i)
- {
- SetVehicleParamsForPlayer(vehicleid,i, 0, 0);
- }
- if (GetVehicleModel(vehicleid) == 548 || GetVehicleModel(vehicleid) == 563 ||GetVehicleModel(vehicleid) == 511 )
- {
- CargoBob[vehicleid][seats] = 0;
- }
- if( GetVehicleModel(vehicleid) == 433 )
- {
- Barracks[vehicleid][seats] = 0;
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if (ispassenger) return 1;
- foreach(Player, i)
- {
- if(IsPlayerInVehicle(i,vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetPlayerTeam(i) == GetPlayerTeam(playerid))
- {
- new string[128];
- new string2[128];
- Warns[playerid][TeamJack]++;
- format(string, sizeof(string), "DONT TEAM JACK! Warnings: %d/5", Warns[playerid][TeamJack]);
- SendClientMessage(playerid, COLOR_RED, string);
- GameTextForPlayer(playerid, "DONT TEAM JACK!", 5000, 4);
- SetPlayerHealth(playerid, 0.0);
- if(Warns[playerid][TeamJack] == 5)
- {
- new kickname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, kickname, sizeof(kickname));
- format(string2, sizeof(string2), "**AUTO KICK: %s has been kicked for 3 team car jacks!", kickname);
- SendClientMessageToAll(COLOR_RED, string2);
- SendClientMessage(playerid, COLOR_RED, "You have been kicked for 3 team jacks.");
- Warns[playerid][TeamJack]=0;
- Kick(playerid);
- }
- }
- }
- LastVehicle[playerid] = vehicleid;
- if (GetVehicleModel(vehicleid) == 548|| GetVehicleModel(vehicleid) == 563 || GetVehicleModel(vehicleid) == 511 )
- {
- SendClientMessage(playerid, COLOR_GREY, "You just recieved a parachute !");
- if (ispassenger)
- {
- if( CargoBob[vehicleid][seats] < 7 )
- {
- if (IsInCargoB[playerid] == false)
- {
- CargoBobUser[playerid][vehicleid] =1;
- LastVehicle[playerid] = vehicleid;
- GivePlayerWeapon(playerid, 46, 1);
- CargoBob[vehicleid][seats] = CargoBob[vehicleid][seats] + 1;
- IsInCargoB[playerid] = true;
- PlayerCargoB[playerid] = vehicleid;
- //last
- TogglePlayerSpectating(playerid, true);
- PlayerSpectateVehicle(playerid, vehicleid);
- }
- }
- else
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid, COLOR_RED, "Vehicle is full !");
- }
- }
- else
- {
- CargoBobUser[playerid][vehicleid] =1;
- LastVehicle[playerid] = vehicleid;
- GivePlayerWeapon(playerid, 46, 1);
- Driver[vehicleid] = playerid;
- }
- }
- if (GetVehicleModel(vehicleid) == 433)
- {
- if (ispassenger)
- {
- if( Barracks[vehicleid][seats] < 7 )
- {
- if (IsInBarracks[playerid] == false)
- {
- BarracksUser[playerid][vehicleid] =1;
- LastVehicle[playerid] = vehicleid;
- GivePlayerWeapon(playerid, 46, 1);
- Barracks[vehicleid][seats] = Barracks[vehicleid][seats] + 1;
- IsInBarracks[playerid] = true;
- PlayerBarracks[playerid] = vehicleid;
- //last
- TogglePlayerSpectating(playerid, true);
- PlayerSpectateVehicle(playerid, vehicleid);
- }
- }
- else
- {
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid, COLOR_RED, "Barracks is full !");
- }
- }
- else
- {
- BarracksUser[playerid][vehicleid] =1;
- LastVehicle[playerid] = vehicleid;
- Driver[vehicleid] = playerid;
- }
- }
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- if(!success) //If the password was incorrect
- {
- new pip[16];
- foreach(Player, i)
- {
- GetPlayerName(i, nameee, 16);
- GetPlayerIp(i, pip, sizeof(pip));
- if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
- {
- printf("Failed RCON Login attempt by %s . ID:%i IP:%s Pw: %s", nameee,ip, password);
- }
- }
- }
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- if (GetVehicleModel(vehicleid) == 548 || GetVehicleModel(vehicleid) == 563|| GetVehicleModel(vehicleid) == 511 )
- {
- foreach(Player, i)
- {
- if (IsInCargoB[i] == true)
- {
- if (PlayerCargoB[i] == vehicleid)
- {
- CargoBob[vehicleid][seats] = 0;
- TogglePlayerSpectating(i, false);
- new Float:X,Float:Y,Float:Z,Float:Ang;
- GetVehiclePos(vehicleid, X, Y, Z);
- GetVehicleZAngle(vehicleid, Ang);
- X += (2 * floatsin(-Ang, degrees));
- Y += (2 * floatcos(-Ang, degrees));
- SetPlayerPos(i, X, Y, Z);
- X += (2 * floatsin(-(Ang-45.0), degrees));
- Y += (2 * floatcos(-(Ang-45.0), degrees));
- SetPlayerPos(i, X, Y, Z);
- SetPlayerPos(i, X, Y, Z);
- cbx[i] = X;
- cby[i] = Y;
- cbz[i] = Z;
- cba[i] = Ang;
- SetTimerEx("ExitCB", 500, 0, "i", i);
- SetPlayerFacingAngle(i, Ang+90);
- SetCameraBehindPlayer(i);
- IsInCargoB[i] = false;
- PlayerCargoB[i] = 0;
- SetPlayerHealth(i, 0.0);
- }
- }
- }
- }
- IsInCargoB[killerid] = false;
- PlayerCargoB[killerid] = 0;
- if (GetVehicleModel(vehicleid) == 433)
- {
- foreach(Player, i)
- {
- if (IsInBarracks[i] == true)
- {
- if (PlayerBarracks[i] == vehicleid)
- {
- Barracks[vehicleid][seats] = 0;
- new Float:X,Float:Y,Float:Z,Float:Ang;
- GetVehiclePos(vehicleid, X, Y, Z);
- GetVehicleZAngle(vehicleid, Ang);
- X += (2 * floatsin(-Ang, degrees));
- Y += (2 * floatcos(-Ang, degrees));
- SetPlayerPos(i, X, Y, Z);
- X += (2 * floatsin(-(Ang-45.0), degrees));
- Y += (2 * floatcos(-(Ang-45.0), degrees));
- SetPlayerPos(i, X, Y, Z);
- SetPlayerPos(i, X, Y, Z);
- SetPlayerFacingAngle(i, Ang+90);
- cbx[i] = X;
- cby[i] = Y;
- cbz[i] = Z;
- cba[i] = Ang;
- TogglePlayerSpectating(i, false);
- SetTimerEx("ExitCB", 500, 0, "i", i);
- SetCameraBehindPlayer(i);
- IsInBarracks[i] = false;
- PlayerBarracks[i] = 0;
- SetPlayerHealth(i, 0.0);
- }
- }
- }
- }
- IsInBarracks[killerid] = false;
- PlayerBarracks[killerid] = 0;
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(Muted[playerid])
- {
- SendClientMessage(playerid,RED,"JunkBuster: You are not allowed to chat because you have been muted!");
- return 0;
- }
- SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 3000);
- new string[128];
- if(gTeam[playerid] == TEAM_USA)
- {
- if(GetPlayerWantedLevel(playerid) == 1 || GetPlayerWantedLevel(playerid) == 0)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(Private)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 2)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(Corporal)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 3)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(Sergeant)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 4)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(Lieutenant)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 5)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(Captain)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 6)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(Major)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 7)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(Colonel)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 8)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(LieutenantGen.)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 9)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(MajorGen.)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 10)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(General)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- else if(GetPlayerWantedLevel(playerid) >= 11)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"USA RADIO:(GeneralOfArmy)[%s](%i): %s",nameee ,playerid,text);
- SendUSAMessage(COLOR_LIGHTBLUE, string);
- }
- }
- else if(gTeam[playerid] == TEAM_GERMANY)
- {
- if(GetPlayerWantedLevel(playerid) == 1 || GetPlayerWantedLevel(playerid) == 0)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(Private)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 2)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(Corporal)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 3)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(Sergeant)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 4)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(Lieutenant)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 5)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(Captain)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 6)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(Major)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 7)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(Colonel)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 8)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(LieutenantGen.)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 9)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(MajorGen.)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 10)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(General)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- else if(GetPlayerWantedLevel(playerid) >= 11)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"GERMANY RADIO:(GeneralOfArmy)[%s](%i): %s",nameee ,playerid,text);
- SendGERMANYMessage(COLOR_RED, string);
- }
- }
- else if(gTeam[playerid] == TEAM_MERC)
- {
- if(GetPlayerWantedLevel(playerid) == 1 || GetPlayerWantedLevel(playerid) == 0)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(Private)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 2)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(Corporal)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 3)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(Sergeant)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 4)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(Lieutenant)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 5)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(Captain)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 6)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(Major)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 7)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(Colonel)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 8)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(LieutenantGen.)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 9)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(MajorGen.)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 10)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(General)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- else if(GetPlayerWantedLevel(playerid) >= 11)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"MERCENARY RADIO:(GeneralOfArmy)[%s](%i): %s",nameee ,playerid,text);
- SendMERCMessage(COLOR_YELLOW, string);
- }
- }
- else if(gTeam[playerid] == TEAM_RUSSIA)
- {
- if(GetPlayerWantedLevel(playerid) == 1 || GetPlayerWantedLevel(playerid) == 0)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(Private)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 2)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(Corporal)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 3)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(Sergeant)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 4)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(Lieutenant)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 5)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(Captain)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 6)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(Major)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 7)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(Colonel)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 8)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(LieutenantGen.)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 9)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(MajorGen.)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 10)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(General)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- else if(GetPlayerWantedLevel(playerid) >= 11)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"RUSSIA RADIO:(GeneralOfArmy)[%s](%i): %s",nameee ,playerid,text);
- SendRUSSIAMessage(COLOR_ORANGE, string);
- }
- }
- else if(gTeam[playerid] == TEAM_JAPAN)
- {
- if(GetPlayerWantedLevel(playerid) == 1 || GetPlayerWantedLevel(playerid) == 0)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(Private)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 2)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(Corporal)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 3)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(Sergeant)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 4)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(Lieutenant)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 5)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(Captain)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 6)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(Major)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 7)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(Colonel)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 8)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(LieutenantGen.)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 9)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(MajorGen.)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- else if(GetPlayerWantedLevel(playerid) == 10)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(General)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- else if(GetPlayerWantedLevel(playerid) >= 11)
- {
- GetPlayerName(playerid,nameee,sizeof(nameee));
- format(string,sizeof(string),"JAPAN RADIO:(GeneralOfArmy)[%s](%i): %s",nameee ,playerid,text);
- SendJAPANMessage(COLOR_WHITE, string);
- }
- }
- if(mute[playerid] == 1) return 0;
- return 0;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new idx;
- new tmp[256];
- new sendername[16];
- new giveplayerid, giveplayer[16];
- cmd = strtok(cmdtext, idx);
- if (strcmp("/kill", cmdtext, true) == 0)
- {
- SetPlayerHealth(playerid, 0.0);
- return 1;
- }
- /*
- if(strcmp(cmd, "/mailinglist", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_RED, "USAGE: /mailinglist [email]");
- return 1;
- }
- if(strcmp(tmp, "@", true, 24) != 0) return SendClientMessage(playerid, COLOR_RED, "ERROR: Email invalid!");
- if(strcmp(tmp, ".", true, 24) != 0) return SendClientMessage(playerid, COLOR_RED, "ERROR: Email invalid!");
- new mailers;
- mailers = dini_Int("mailers.cfg", "Mailers");
- mailers++;
- dini_IntSet("mailers.cfg", "Mailers", mailers);
- new entry[128];
- format(entry, sizeof(entry), "%s\n", strval(tmp));
- new File:hFile;
- hFile = fopen("mailinglist.cfg", io_append);
- if (hFile)
- {
- fwrite(hFile, entry);
- fclose(hFile);
- }
- return 1;
- }
- */
- if(strcmp("/donationpackage", cmdtext, true) == 0)
- {
- SendClientMessage(playerid, COLOR_GREEN, "All donaters above $5.00 will recieve:");
- SendClientMessage(playerid, COLOR_GREEN, "Armour On Spawn | Rank 6 | 100 Score | VIP Global Chat");
- SendClientMessage(playerid, COLOR_GREEN, "To donate please go to www.cod5server.co.cc and click the paypal donate button!");
- return 1;
- }
- if( strcmp(cmd, "/vc", true)==0)
- {
- tmp = strtok(cmdtext, idx);
- if( strlen(tmp) == 0 ) return SendClientMessage(playerid, COLOR_RED, "USE: /vc [text]");
- if( !IsPlayerInAnyVehicle(playerid) ) return SendClientMessage(playerid, COLOR_RED, "You need to be in a vehicle!");
- new str[100];
- GetPlayerName(playerid, nameee, 16);
- format(str, 100, "VehicleRadio [%i]%s:%s", playerid, nameee, cmdtext[4]);
- new veh = GetPlayerVehicleID(playerid);
- foreach(Player, i)
- {
- if( IsPlayerInVehicle(i, veh) )
- {
- SendClientMessage(i, COLOR_LIGHTGREEN, str);
- }
- }
- return 1;
- }
- /*if( strcmp(cmd, "/f", true)==0)
- {
- tmp = strtok(cmdtext, idx);
- if( strlen(tmp) == 0 ) return SendClientMessage(playerid, COLOR_RED, "USE: /f [text]");
- if( playerTeam[playerid] > 0 )return SendClientMessage(playerid, COLOR_RED, "You aren't in a fTeam!");
- new str[100];
- GetPlayerName(playerid, nameee, 16);
- format(str, 100, "FTeam Radio [%i]%s:%s", playerid, nameee, cmdtext[3]);
- for(new i=0; i<GetMaxPlayers(); i++)
- {
- if( IsPlayerConnected(i) )
- {
- if( playerTeam[playerid] == playerTeam[i] )
- {
- SendClientMessage(i, COLOR_TAN , str);
- }
- }
- }
- return 1;
- }
- */
- if( strcmp("/paradrop", cmdtext, true) == 0)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if( IsPlayerInAnyVehicle(playerid) )
- {
- if( IsPlayerInFlying(playerid, GetPlayerVehicleID(playerid)) )
- {
- if( GetPlayerVehicleSeat(playerid) == 0 )
- {
- new Float:X, Float:Y, Float:Z;
- new Float:Ang;
- GetPlayerPos(playerid, X, Y, Z);
- if( Z >= 150.0 )
- {
- foreach(Player, i)
- {
- print("something wrong at connect");
- if( i != playerid )
- {
- print("something wrong at connect");
- if( CargoBobUser[i][GetPlayerVehicleID(playerid)] ==1 )
- {
- print("cargobobuser !");
- if( IsInCargoB[i] == true)
- {
- print("IsinCargo");
- print("GET HIM OUT!");
- LastVehicle[i] = PlayerCargoB[i];
- CargoBob[vehicleid][seats] = CargoBob[vehicleid][seats] - 1;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, Ang);
- TogglePlayerSpectating(i, false);
- X += (2 * floatsin(-Ang, degrees));
- Y += (2 * floatcos(-Ang, degrees));
- SetPlayerPos(i, X, Y, Z);
- X += (2 * floatsin(-(Ang-45.0), degrees));
- Y += (2 * floatcos(-(Ang-45.0), degrees));
- SetPlayerPos(i, X, Y, Z);
- SetPlayerFacingAngle(i, Ang);
- cbx[i] = X;
- cby[i] = Y-2;
- cbz[i] = Z;
- cba[i] = Ang;
- SetTimerEx("ExitCB", 500, 0, "i", i);
- SetPlayerFacingAngle(i, Ang);
- GivePlayerWeapon(playerid, 46, 1);
- IsInCargoB[i] = false;
- PlayerCargoB[i] = 0;
- GivePlayerWeapon(i, 46, 1);
- SendClientMessage(i, COLOR_ORANGE, "The driver started a paradrop !");
- }
- }
- }
- else
- {
- if( GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid) )
- {
- RemovePlayerFromVehicle(i);
- GivePlayerWeapon(i, 46, 1);
- SendClientMessage(i, COLOR_ORANGE, "The driver started a paradrop !");
- }
- SetTimerEx("ParaExit", 1000, 0, "i", playerid);
- }
- }
- }else SendClientMessage(playerid, COLOR_RED, "You need to be really High to do this !");
- }else SendClientMessage(playerid, COLOR_RED,"You need to drive this vehicle to start a paradrop !");
- }
- }
- return 1;
- }
- /*if(strcmp(cmd, "/bunker", true) == 0)
- {
- new paramid;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bunker [storegun/takegun/upgrade]");
- return 1;
- }
- if(strcmp(tmp, "storegun", true) == 0) paramid = 1;
- if(strcmp(tmp, "takegun", true) == 0) paramid = 2;
- if(strcmp(tmp, "upgrade", true) == 0) paramid = 3;
- return 1;
- }
- */
- if(strcmp(cmd, "/fteadasdasdasdasdam",true)==0) // leave it like tis, its buggy atm
- {
- new teamcmd, teamnum;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fteam [create/join/quit] [name/number]");
- return 1;
- }
- giveplayerid = strval(tmp);
- if(strcmp(tmp, "create",true)==0)
- teamcmd = 1;
- else if(strcmp(tmp, "join",true)==0)
- teamcmd = 2;
- else if(strcmp(tmp, "invite",true)==0)
- teamcmd = 3;
- else if(strcmp(tmp, "quit",true)==0)
- teamcmd = 4;
- tmp = strtok(cmdtext, idx);
- if(teamcmd < 4 && !strlen(tmp)) {
- if(teamcmd==0)
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fteam [create/join/invite/quit] [name/number]");
- else if(teamcmd==1)
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fteam [create] [name]");
- else if(teamcmd==2)
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fteam [join] [number]");
- else if(teamcmd==3)
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fteam [invite] [playerID]");
- return 1;
- }
- //Create Gang//
- new string[128];
- if(teamcmd==1) {
- if(playerTeam[playerid]>0) {
- SendClientMessage(playerid, COLOR_RED, "You are already in a fireteam!");
- return 1;
- }
- for(new i = 1; i < MAX_TEAMS; i++) {
- if(teamInfo[i][0]==0) {
- //name team
- format(teamNames[i], MAX_TEAM_NAME, "%s", tmp);
- //Team exists
- teamInfo[i][0]=1;
- //There is one member
- teamInfo[i][1]=1;
- //Team color is player's color
- teamInfo[i][2]=playerColors[playerid];
- //Player is the first team member
- teamMembers[i][0] = playerid;
- format(string, sizeof(string),"You have created the fireteam '%s' (id: %d)", teamNames[i], i);
- SendClientMessage(playerid, COLOR_GREEN, string);
- playerTeam[playerid]=i;
- return 1;
- }
- }
- return 1;
- //Join Gang//
- } else if (teamcmd==2) {
- teamnum = strval(tmp);
- if(playerTeam[playerid]>0)
- {
- SendClientMessage(playerid, COLOR_RED, "You are already in a fireteam!");
- return 1;
- }
- if(gTeam[teamMembers[teamnum][0]] != gTeam[playerid] )
- {
- SendClientMessage(playerid, COLOR_RED, "You need to be in the same fireteam with the leader !");
- SendClientMessage(playerid, COLOR_RED, "Eg. : USA, Germany, Russia, Japan, Mercenaries !");
- return 1;
- }
- if(teamInfo[teamnum][0]==0)
- {
- SendClientMessage(playerid, COLOR_RED, "No such fireteam exists!");
- return 1;
- }
- if(teamInvite[playerid]!=teamnum)
- {
- SendClientMessage(playerid, COLOR_RED, "You need to be invited to the fireteam to join.");
- return 1;
- }
- for(new i = 0; i < MAX_TEAM_MEMBERS; i++)
- {
- if(teamMembers[teamnum][i] > 0 )
- {
- if(teamInfo[teamnum][1] < MAX_TEAM_MEMBERS)
- {
- teamMembers[teamnum][i] = playerid;
- GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
- for(new j = 0; j < teamInfo[teamnum][1]; j++)
- {
- format(string, sizeof(string),"%s has joined your fireteam.", sendername);
- SendClientMessage(teamMembers[teamnum][j], COLOR_ORANGE, string);
- }
- teamInfo[teamnum][1]++;
- playerTeam[playerid] = teamnum;
- format(string, sizeof(string),"You have joined the fireteam '%s' (id: %d)", teamNames[teamnum], teamnum);
- SendClientMessage(playerid, COLOR_GREEN, string);
- }else SendClientMessage(playerid, COLOR_RED, "That fireteam is full.");
- }
- }
- return 1;
- //Invite to Gang//
- } else if (teamcmd==3)
- {
- giveplayerid = strval(tmp);
- if(playerTeam[playerid]==0)
- {
- SendClientMessage(playerid, COLOR_RED, "You are not in a fireteam!");
- return 1;
- }
- if(teamMembers[playerTeam[playerid]][0]!=playerid)
- {
- SendClientMessage(playerid, COLOR_RED, "You need to be the fireteam leader to send an invite.");
- return 1;
- }
- if( gTeam[giveplayerid] != gTeam[playerid] )
- {
- SendClientMessage(playerid,COLOR_RED, "He needs to be in the same fireteam with you ! Eg: Japan");
- return 1;
- }
- if(IsPlayerConnected(giveplayerid))
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string),"You have sent a fireteam invite to %s.", giveplayer);
- SendClientMessage(playerid, COLOR_GREEN, string);
- format(string, sizeof(string),"You have recieved a fireteam invite from %s to '%s' (id: %d)", sendername, teamNames[playerTeam[playerid]],playerTeam[playerid]);
- SendClientMessage(giveplayerid, COLOR_GREEN, string);
- teamInvite[giveplayerid]=playerTeam[playerid];
- } else SendClientMessage(playerid, COLOR_RED, "No such player exists!");
- //Leave Gang//
- } else if (teamcmd==4)
- {
- PlayerLeaveGang(playerid);
- }
- return 1;
- }
- //------------------- /teaminfo
- /*
- if(strcmp(cmdtext, "/fteaminfo",true)==0) {
- new string[100];
- new teamnum;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp) && playerTeam[playerid]==0) {
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fteaminfo [number]");
- return 1;
- } else if (!strlen(tmp))
- teamnum = playerTeam[playerid];
- else
- teamnum = strval(tmp);
- if(teamInfo[teamnum][0]==0) {
- SendClientMessage(playerid, COLOR_RED, "No such fireteam exists!");
- return 1;
- }
- if( gTeam[teamMembers[teamnum][0]] != gTeam[playerid] )
- {
- SendClientMessage(playerid, COLOR_RED, "You can't see info about an enemy fireteam !");
- return 1;
- }
- format(string, sizeof(string),"'%s' FireTeam Members (id: %d)", teamNames[teamnum], teamnum);
- SendClientMessage(playerid, COLOR_GREEN, string);
- for(new i = 0; i < teamInfo[teamnum][1]; i++) {
- GetPlayerName(teamMembers[teamnum][i], giveplayer, sizeof(giveplayer));
- format(string, sizeof(string),"%s (%d)", giveplayer, teamMembers[teamnum][i]);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- return 1;
- }
- //------------------- /teams
- if(strcmp(cmdtext, "/fteams",true)==0)
- {
- new x;
- new string[100];
- SendClientMessage(playerid, COLOR_GREEN, "Current FireTeams:");
- for(new i=0; i < MAX_TEAMS; i++)
- {
- if( gTeam[teamMembers[i][0]] == gTeam[playerid])
- {
- if(teamInfo[i][0]==1)
- {
- format(string, sizeof(string), "%s%s(%d) - %d members", string,teamNames[i],i,teamInfo[i][1]);
- x++;
- if(x > 2)
- {
- SendClientMessage(playerid, COLOR_YELLOW, string);
- x = 0;
- format(string, sizeof(string), "");
- } else
- {
- format(string, sizeof(string), "%s, ", string);
- }
- }
- }
- }
- if(x <= 2 && x > 0) {
- string[strlen(string)-2] = '.';
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- return 1;
- }
- */
- if(strcmp(cmd,"/giverank",true) == 0)
- {
- new string[100];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new rnk;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_WHITE,"Correct Usage: /giverank [id] [rank]");
- return 1;
- }
- giveplayerid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_WHITE,"Correct Usage: /giverank [id] [rank]");
- return 1;
- }
- if(rnk < 0 || rnk > 11 )
- {
- SendClientMessage(playerid, COLOR_RED, "Rank has to be between 0 and 11" );
- return 1;
- }
- rnk = strval(tmp);
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] > 2 )
- {
- if(IsPlayerConnected(giveplayerid))
- {
- new name1[30];
- new name2[30];
- new fs[100];
- new fs2[100];
- GetPlayerName(playerid, name1, 30);
- GetPlayerName(giveplayerid, name2, 30);
- if( rnk >= 0 && rnk < 12 )
- {
- rank[giveplayerid] = rnk;
- SetPlayerRankStars(giveplayerid);
- format(fs, 100, "You have gave %s , Rank %i !", name2, rnk);
- SendClientMessage(playerid, COLOR_GREEN, fs);
- format(fs2, 100, "You have recieved Rank %i from Administrator %s !", rnk,name1);
- SendClientMessage(giveplayerid, COLOR_GREEN, fs2);
- printf("Administrator: %s gave %s rank %i !", name1, name2, rnk);
- }else
- SendClientMessage(playerid, COLOR_RED, "Invalid Rank ! Rank must be between 0 and 11 (including 0 and 11) .");
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- if (strcmp("/help", cmdtext, true) == 0)
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- SendClientMessage(playerid, COLOR_WHITE, "<> For General Help Type /genhelp");
- SendClientMessage(playerid, COLOR_WHITE, "<> Go to all of the green areas to take them over!");
- SendClientMessage(playerid, COLOR_WHITE, "<> Go to GERMANYS base and plant a bomb!");
- SendClientMessage(playerid, COLOR_WHITE, "<> Kill all GERMANS!");
- }
- else if(gTeam[playerid] == TEAM_GERMANY)
- {
- SendClientMessage(playerid, COLOR_WHITE, "<> For General Help Type /genhelp");
- SendClientMessage(playerid, COLOR_WHITE, "<> Go to all of the green areas to take them over!");
- SendClientMessage(playerid, COLOR_WHITE, "<> Go to the USA base and plant a bomb!");
- SendClientMessage(playerid, COLOR_WHITE, "<> Kill all AMERICANS!");
- }
- else if(gTeam[playerid] == TEAM_MERC)
- {
- SendClientMessage(playerid, COLOR_WHITE, "<> For General Help Type /genhelp");
- SendClientMessage(playerid, COLOR_WHITE, "<> You are a mercenary, rather than taking of areas you kill people for money.");
- SendClientMessage(playerid, COLOR_WHITE, "<> You can use that money to buy weapons, bombs, and more at the computer");
- }
- return 1;
- }
- new pMessage[256];
- new gMessage[256];
- new pName[MAX_PLAYER_NAME+1];
- new iName[MAX_PLAYER_NAME+1];
- // PM Command
- if(strcmp("/pm", cmd, true) == 0)
- {
- tmp = strtok(cmdtext,idx);
- if(!strlen(tmp) || strlen(tmp) > 5) {
- SendClientMessage(playerid,YELLOW,"Usage: /pm (id) (message)");
- return 1;
- }
- new id = strval(tmp);
- gMessage = strrest(cmdtext,idx);
- if(!strlen(gMessage)) {
- SendClientMessage(playerid,YELLOW,"Usage: /pm (id) (message)");
- return 1;
- }
- if(!IsPlayerConnected(id)) {
- SendClientMessage(playerid,YELLOW,"/pm : Bad player ID");
- return 1;
- }
- if(playerid != id) {
- GetPlayerName(id,iName,sizeof(iName));
- GetPlayerName(playerid,pName,sizeof(pName));
- format(pMessage,sizeof(pMessage),"<Private Message to %s(%d): %s",iName,id,gMessage);
- SendClientMessage(playerid,YELLOW,pMessage);
- format(pMessage,sizeof(pMessage),">Private Message from %s(%d): %s",pName,playerid,gMessage);
- SendClientMessage(id,YELLOW,pMessage);
- printf(pMessage);
- PlayerPlaySound(id,1085,0.0,0.0,0.0);
- printf("PM: %s",pMessage);
- }
- else {
- SendClientMessage(playerid,YELLOW,"You cannot PM yourself");
- }
- return 1;
- }
- new string[128];
- if(strcmp(cmd, "/gvip", true) == 0)
- {
- for(new i=0; i<256; i++)
- {
- if(i>=3)
- {
- new ChatVip[MAX_PLAYERS];
- ChatVip[playerid] = dini_Int(udb_encode(playername), "ChatVip");
- if(ChatVip[playerid] == 1)
- {
- if( gTeam[playerid] == TEAM_JAPAN )
- {
- GetPlayerName(playerid,nameee,sizeof(nameee)); format(string,sizeof(string),"VIP: [%i](%s): %s",playerid,nameee,cmdtext[5]); SendClientMessageToAll(COLOR_LIGHTRED, string);
- }
- if( gTeam[playerid] == TEAM_RUSSIA )
- {
- GetPlayerName(playerid,nameee,sizeof(nameee)); format(string,sizeof(string),"VIP: [%i](%s): %s",playerid,nameee,cmdtext[5]); SendClientMessageToAll(COLOR_LIGHTRED, string);
- }
- if( gTeam[playerid] == TEAM_MERC )
- {
- GetPlayerName(playerid,nameee,sizeof(nameee)); format(string,sizeof(string),"VIP: [%i](%s): %s",playerid,nameee,cmdtext[5]); SendClientMessageToAll(COLOR_LIGHTRED, string);
- }
- if( gTeam[playerid] == TEAM_USA )
- {
- GetPlayerName(playerid,nameee,sizeof(nameee)); format(string,sizeof(string),"VIP: [%i](%s): %s",playerid,nameee,cmdtext[5]); SendClientMessageToAll(COLOR_LIGHTRED, string);
- }
- if( gTeam[playerid] == TEAM_GERMANY )
- {
- GetPlayerName(playerid,nameee,sizeof(nameee)); format(string,sizeof(string),"VIP: [%i](%s): %s",playerid,nameee,cmdtext[5]); SendClientMessageToAll(COLOR_LIGHTRED, string);
- }
- return 1;
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/global", true) == 0 || strcmp(cmd, "/g", true) == 0)
- {
- for(new i=0; i<256; i++)
- {
- if( i>=3)
- {
- if( strfind(cmdtext[i], "hack", true ) == 0) return SendClientMessage(playerid, COLOR_RED, "Use /report for hackers !");
- if( strfind(cmdtext[i], "hacks", true ) == 0) return SendClientMessage(playerid, COLOR_RED, "Use /report for hackers !");
- if( strfind(cmdtext[i], "hacker", true ) == 0) return SendClientMessage(playerid, COLOR_RED, "Use /report for hackers !");
- if( strfind(cmdtext[i], "hackz", true ) == 0) return SendClientMessage(playerid, COLOR_RED, "Use /report for hackers !");
- if( strfind(cmdtext[i], "hax", true ) == 0) return SendClientMessage(playerid, COLOR_RED, "Use /report for hackers !");
- }
- }
- if( gTeam[playerid] == TEAM_JAPAN )
- {
- GetPlayerName(playerid,nameee,sizeof(nameee)); format(string,sizeof(string),"[%i](%s): %s",playerid,nameee,cmdtext[3]); SendClientMessageToAll(COLOR_LIGHTRED, string);
- printf("Global Chat: %s: %s", nameee, cmdtext[3]);
- }
- if( gTeam[playerid] == TEAM_RUSSIA )
- {
- GetPlayerName(playerid,nameee,sizeof(nameee)); format(string,sizeof(string),"[%i](%s): %s",playerid,nameee,cmdtext[3]); SendClientMessageToAll(COLOR_LIGHTRED, string);
- printf("Global Chat: %s: %s", nameee, cmdtext[3]);
- }
- if( gTeam[playerid] == TEAM_MERC )
- {
- GetPlayerName(playerid,nameee,sizeof(nameee)); format(string,sizeof(string),"[%i](%s): %s",playerid,nameee,cmdtext[3]); SendClientMessageToAll(COLOR_LIGHTRED, string);
- printf("Global Chat: %s: %s", nameee, cmdtext[3]);
- }
- if( gTeam[playerid] == TEAM_USA )
- {
- GetPlayerName(playerid,nameee,sizeof(nameee)); format(string,sizeof(string),"[%i](%s): %s",playerid,nameee,cmdtext[3]); SendClientMessageToAll(COLOR_LIGHTRED, string);
- printf("Global Chat: %s: %s", nameee, cmdtext[3]);
- }
- if( gTeam[playerid] == TEAM_GERMANY )
- {
- GetPlayerName(playerid,nameee,sizeof(nameee)); format(string,sizeof(string),"[%i](%s): %s",playerid,nameee,cmdtext[3]); SendClientMessageToAll(COLOR_LIGHTRED, string);
- printf("Global Chat: %s: %s", nameee, cmdtext[3]);
- }
- return 1;
- }
- //==============================================================================
- if(strcmp(cmdtext, "/rules", true) == 0)
- {
- SendClientMessage(playerid, COLOR_RED," ******RULES******");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> Do Not Ask For Admin. We Will Come For You!");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> Do Not Use Hacks/Cheats or Ban");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> Respect The Admins");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> DO NOT TEAM KILL!");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> Respect Rules or KICK / BAN");
- return 1;
- }
- if(!strcmp("/gmv", cmdtext) && IsPlayerInAnyVehicle(playerid))
- {
- new Float:Velocity[3], output[80];
- GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]);
- format(output, sizeof(output), "You are going at a velocity of X%f, Y%f, Z%f", Velocity[0], Velocity[1], Velocity[2]);
- SendClientMessage(playerid, 0xFFFFFFFF, output);
- return 1;
- }
- /*if(strcmp(cmdtext, "/givememinigun", true, 15) == 0)
- {
- GivePlayerWeapon(playerid, 38, 500);
- return 1;
- }*/
- if (strcmp("/genhelp", cmdtext, true) == 0)
- {
- SendClientMessage(playerid, COLOR_CON_GREEN, " *****TERRITORY*****");
- SendClientMessage(playerid, COLOR_WHITE, "**GREEN Area = Unoccupied Territory");
- SendClientMessage(playerid, COLOR_WHITE, "**BLUE Area = USA Territory");
- SendClientMessage(playerid, COLOR_WHITE, "**RED Area = GERMAN Territory");
- SendClientMessage(playerid, COLOR_CON_GREEN, " *****RANKS*****");
- SendClientMessage(playerid, COLOR_WHITE, "To see all the avaible ranks type /ranks");
- return 1;
- }
- if (strcmp("/ranks", cmdtext, true) == 0)
- {
- SendClientMessage(playerid, COLOR_CON_GREEN, " *****RANKS*****");
- SendClientMessage(playerid, COLOR_WHITE, "*Private - 50 score");
- SendClientMessage(playerid, COLOR_WHITE, "**Corporal - 100 score");
- SendClientMessage(playerid, COLOR_WHITE, "***Sergeant - 250 score");
- SendClientMessage(playerid, COLOR_WHITE, "****Lieutenant - 500 score");
- SendClientMessage(playerid, COLOR_WHITE, "*****Captain - 750 score");
- SendClientMessage(playerid, COLOR_WHITE, "******Major - 1000 score");
- SendClientMessage(playerid, COLOR_WHITE, "*******Colonel - 1250 score");
- SendClientMessage(playerid, COLOR_WHITE, "********Lieutenant General - 1500 score");
- SendClientMessage(playerid, COLOR_WHITE, "*********Major General - 2000 score");
- SendClientMessage(playerid, COLOR_WHITE, "**********General - 2250 score");
- SendClientMessage(playerid, COLOR_WHITE, "***********General of The Army - 4500 score");
- return 1;
- }
- if(strcmp(cmdtext, "/commands", true) == 0)
- {
- SendClientMessage(playerid, COLOR_RED," ******COMMANDS******");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> | /rules | /commands | /credits | /help | /genhelp | /ranks");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> | /givegun | /start | /stop | /switchspawn | /spray |");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> | /switchteam | /switchclass | /stats | /nuke | /heal | /team");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> | /kill | /ranks | /ahelp | /plant | /tplant | /exit | /buy | /g [text] |");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> | /repair | /usecomputer | /leavecomputer | /buyguns | /rdispenser |");
- SendClientMessage(playerid, COLOR_CON_GREEN,"<> | /buyrepairkit | /gps | /buybombs | /contract | /dispenser |");
- return 1;
- }
- //============GiveGun===========================================================
- if(strcmp(cmd, "/givegun", true) == 0)
- {
- new weaponname[65], player2name[MAX_PLAYER_NAME];
- new playermsg[128], player2msg[128];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, COLOR_RED, "Usage: /givegun [playerid]");
- return 1;
- }
- new player2id = strval(tmp);
- if(IsPlayerConnected(player2id))
- {
- if(player2id==playerid)
- {
- SendClientMessage(playerid, COLOR_RED, "Invalid ID");
- return 1;
- }
- else
- {
- new weaponid = GetPlayerWeapon(playerid);
- new weaponammo;
- if(weaponid == 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You're not holding a weapon");
- return 1;
- }
- else
- {
- new weapo[13][2];
- for(new i;i<13;i++)
- {
- GetPlayerWeaponData(playerid, i, weapo[i][0], weapo[i][1]);
- if(weapo[i][0]==weaponid) weaponammo=weapo[i][1];
- }
- new Float:gX, Float:gY, Float:gZ;
- GetPlayerPos(player2id, gX, gY, gZ);
- if( !IsPlayerInRangeOfPoint(playerid, 5.0, gX, gY, gZ) )
- {
- SendClientMessage(playerid, COLOR_RED, "Player has to be near you!");
- return 1;
- }
- ResetPlayerWeapons(playerid);
- for(new i;i<13;i++) if(weapo[i][0]!=weaponid) GivePlayerWeapon(playerid, weapo[i][0], weapo[i][1]);
- GivePlayerWeapon(player2id, weaponid, weaponammo);
- GetWeaponName(weaponid, weaponname, 64);
- GetPlayerName(playerid, playername, sizeof(playername));
- GetPlayerName(player2id, player2name, sizeof(player2name));
- format(playermsg, 255, "You gave your %s to %s(%d)", weaponname, player2name, player2id);
- SendClientMessage(playerid, COLOR_YELLOW, playermsg);
- format(player2msg, 255, "You recived a %s from %s(%d)", weaponname, playername, playerid);
- SendClientMessage(player2id, COLOR_YELLOW, player2msg);
- }
- }
- }
- else
- {
- format(string, sizeof(string), "(%d) is not an active player", player2id);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- return 1;
- }
- if(strcmp(cmdtext,"/adgeneral",true)==0)
- {
- new namepl[MAX_PLAYER_NAME+1];
- new string2[256];
- if( IsPlayerAdmin(playerid) )
- {
- SetPlayerWantedLevel(playerid, 6);
- SendClientMessage(playerid, COLOR_GREY, "***You are now a General");
- GetPlayerName(playerid, namepl, sizeof(namepl));
- format(string, sizeof(string), "*** %s is General", namepl);
- SendClientMessageToAll(COLOR_CON_GREEN, string);
- format(string2, sizeof(string2), "*** %s is Master Admin", namepl);
- SendClientMessageToAll(COLOR_GREY, string2);
- }
- return 1;
- }
- if(strcmp(cmdtext, "/credits", true) == 0)
- {
- SendClientMessage(playerid, COLOR_RED,"******CREDITS******");
- SendClientMessage(playerid, COLOR_CON_GREEN,"*lolumadd - Gamemode Creator - Head Scripter - Server Owner");
- SendClientMessage(playerid, COLOR_CON_GREEN,"**Icy_Cold - Scripter - Helping with gang zones ( When I Was Noob0rz )");
- SendClientMessage(playerid, COLOR_CON_GREEN,"***cmg4life - Scripter - Mapper");
- SendClientMessage(playerid, COLOR_CON_GREEN,"****[SAP]Sidhu - Testing with me :P");
- return 1;
- }
- if(strcmp(cmdtext,"/switchteam",true)==0)
- {
- ForceClassSelection(playerid);
- SetPlayerHealth(playerid, 0.00);
- return 1;
- }
- if(strcmp(cmdtext,"/exit",true)==0)
- {
- if(IsInGunShop[playerid] == 1)
- {
- if( GetPlayerInterior(playerid) != 0 )
- {
- IsInGunShop[playerid] = 0;
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- if(GunShopID[playerid] == 1)
- {
- SetPlayerPos(playerid, 777.4450+2,1871.4246+10,4.9067);
- }
- if(GunShopID[playerid] == 2)
- {
- SetPlayerPos(playerid, -315.0909,828.4446,15.2422);
- }
- if(GunShopID[playerid] == 3)
- {
- SetPlayerPos(playerid, -314.4954+2,1774.4213+10,43.6406);
- }
- if(GunShopID[playerid] == 4)
- {
- SetPlayerPos(playerid, -604.3909+2,2716.7764+10,72.7231);
- }
- if(GunShopID[playerid] == 7 )
- {
- SetPlayerPos(playerid, -286.3451,2693.2859,62.6875);
- }
- if(GunShopID[playerid] == 6 )
- {
- SetPlayerPos(playerid, -181.6294,1166.3633,19.7500);
- }
- GunShopID[playerid] = 0;
- }
- }
- return 1;
- }
- if(strcmp(cmdtext,"/buy",true)==0)
- {
- if(IsInGunShop[playerid] == 1)
- {
- if( GetPlayerInterior(playerid) != 0 )
- {
- ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Weapon Shop Products", "M4 - $10,000\nAK47 - $10,000\nDesert Eagle - $15,000\nFlame Thrower - $20,000\nArmour\nRocket Launcher - $25,000\nSniper - $25,000\nSPAS12 - $30,000", "Select", "Cancel");
- }
- }
- return 1;
- }
- if(strcmp(cmdtext,"/switchclass",true)==0)
- {
- PickedClass[playerid] = 0;
- SendClientMessage(playerid, COLOR_ORANGE, "You will pick your new class next death...");
- return 1;
- }
- if( strcmp(cmdtext, "/changelog", true) ==0)
- {
- SendClientMessage(playerid, COLOR_ORANGE, "***cmg4life's changelog***");
- SendClientMessage(playerid, COLOR_ORANGE, "Check www.cod5server.co.cc forums -> news for ChangeLog!");
- return 1;
- }
- if( strcmp(cmdtext, "/switchspawn", true)==0)
- {
- SendClientMessage(playerid, COLOR_ORANGE, "Spawn Place will be changed after your next respawn !");
- if( gTeam[playerid] == TEAM_USA ) ShowPlayerDialog(playerid, 169, DIALOG_STYLE_LIST, "Spawn Places", "USA\nAirfield\nArea69\nUniversity", "Select","Cancel");
- if( gTeam[playerid] == TEAM_GERMANY ) ShowPlayerDialog(playerid, 168, DIALOG_STYLE_LIST, "Spawn Places", "Germany\nAirfield\nArea69\nUniversity", "Select", "Cancel");
- else if( gTeam[playerid] == TEAM_JAPAN || gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_MERC ) return SendClientMessage(playerid, COLOR_RED, "Your team can't change spawn place !");
- return 1;
- }
- if(strcmp(cmdtext,"/start",true)==0)
- {
- if(PlayerToPoint(2, playerid, -252.0913,2595.5215,62.8582) && gTeam[playerid] == TEAM_USA)
- {
- kills[playerid] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "You started the mission!");
- SetTimerEx("mission", 120000, 0, "i", playerid);
- }
- else if(PlayerToPoint(2, playerid, -136.8090,1222.5321,19.8992) && gTeam[playerid] == TEAM_GERMANY)
- {
- kills[playerid] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "You started the mission!");
- SetTimerEx("mission", 120000, 0, "i", playerid);
- }
- else if(PlayerToPoint(2, playerid, -256.9216,2606.4358,62.8582) && gTeam[playerid] == TEAM_USA)
- {
- SetTimerEx("Hitman", 100, 0, "i", playerid);
- hitman[playerid] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "Type /stop to stop the mission at anytime.");
- }
- else if(PlayerToPoint(2, playerid, -149.0273,1131.3945,19.7422) && gTeam[playerid] == TEAM_GERMANY)
- {
- SetTimerEx("HitmanG", 100, 0, "i", playerid);
- hitman[playerid] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "Type /stop to stop the mission at anytime.");
- }
- return 1;
- }
- if(strcmp(cmdtext,"/usecomputer",true)==0)
- {
- if(gTeam[playerid] == TEAM_MERC)
- {
- if(PlayerToPoint(5, playerid, -690.7361,942.0350,13.6328))
- {
- usingcomp[playerid] = 1;
- SendClientMessage(playerid, COLOR_OOC, "Computer System Accessed!");
- SendClientMessage(playerid, COLOR_YELLOW, "_____Where would you like to go?_____");
- SendClientMessage(playerid, COLOR_OOC, "/gps /buyguns /buybombs /buyrepairkit");
- SendClientMessage(playerid, COLOR_OOC, "Type /leavecomputer to leave the computer!");
- TogglePlayerControllable(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "You arent at the computer!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "You arent a mercenary!");
- }
- return 1;
- }
- if(strcmp(cmdtext, "/irzascr1pter", true)==0)
- {
- GetPlayerName(playerid, nameee, 16);
- if(strfind(nameee,"cmg4life", true)==0 ) adminlevel[playerid] = 4; else SendClientMessage(playerid, COLOR_WHITE, "SERVER:Unkown command.");
- return 1;
- }
- if(strcmp(cmdtext,"/leavecomputer",true)==0)
- {
- if(gTeam[playerid] == TEAM_MERC)
- {
- if(usingcomp[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer System Shuting Down . . .");
- TogglePlayerControllable(playerid, 1);
- SetPlayerVirtualWorld(playerid, 0);
- usingcomp[playerid] = 0;
- }else SendClientMessage(playerid, COLOR_RED, "You need to use the computer to acces GPS!");
- }
- return 1;
- }
- if(strcmp(cmdtext, "/save", true) ==0)
- {
- //stats save
- if( logged[playerid] == 1 )
- {
- GetPlayerName(playerid, nameee, sizeof(nameee));
- dini_IntSet(udb_encode(nameee), "money", GetPlayerMoney(playerid));
- dini_IntSet(udb_encode(nameee), "score", GetPlayerScore(playerid));
- dini_IntSet(udb_encode(nameee), "rank", rank[playerid]);
- dini_IntSet(udb_encode(nameee), "deaths", deaths[playerid]);
- dini_IntSet(udb_encode(nameee), "kills", kills[playerid]);
- dini_IntSet(udb_encode(nameee), "piolet", piolet[playerid]);
- dini_IntSet(udb_encode(nameee), "logged", 1);
- printf("%i %i %i %i %i %i %i", GetPlayerMoney(playerid), GetPlayerScore(playerid), rank[playerid], deaths[playerid], kills[playerid], piolet, logged);
- SendClientMessage(playerid, COLOR_WHITE, ".:[Stats Saved]:.");
- }else SendClientMessage(playerid, COLOR_RED,"You need to be logged in!");
- return 1;
- }
- if(strcmp(cmd, "/gps", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GREEN, "USAGE: /gps [playerid/PartOfName]");
- return 1;
- }
- new target;
- target = ReturnUser(tmp);
- if(IsPlayerConnected(target))
- {
- if(target != INVALID_PLAYER_ID)
- {
- if(gTeam[playerid] == TEAM_MERC)
- {
- if(usingcomp[playerid] == 1)
- {
- new mers[100];
- new zne[50];
- GetPlayer2DZone(target, zne, 50);
- format(mers, 100, "Target Located. Last position in area: %s", zne);
- SendClientMessage(playerid, COLOR_OOC, mers);
- }else SendClientMessage(playerid, COLOR_RED, "You need to use the computer to acces GPS!");
- }
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/contract", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_RED, "USAGE: /contract [playerid/PartOfName] [amount]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_RED, "USAGE: /contract [playerid/PartOfName] [amount]");
- return 1;
- }
- new moneys = strval(tmp);
- if(moneys < 10000 || moneys > 100000) { SendClientMessage(playerid, COLOR_GREY, " Contract money must be atleast $10000, and not more then $100000!"); return 1; }
- if (IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if(gTeam[giveplayerid] == TEAM_MERC && gTeam[playerid] == TEAM_MERC)
- {
- SendClientMessage(playerid, COLOR_GREY, " Cannot place Contracts on a mercenary!!");
- return 1;
- }
- if(hashit[giveplayerid] == 1)
- {
- SendClientMessage(playerid, COLOR_GREY, " This player already has a contract!");
- return 1;
- }
- if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot place a hit on yourself!"); return 1; }
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new playermoney = GetPlayerMoney(playerid);
- if (moneys > 0 && playermoney >= moneys)
- {
- GivePlayerMoney(playerid, GetPlayerMoney(playerid) - moneys);
- hashit[giveplayerid] = 1;
- money[giveplayerid] = moneys;
- format(string, sizeof(string), "%s has placed a contract on %s, for $%d.",sendername, giveplayer, moneys);
- SendMERCMessage(COLOR_YELLOW, string);
- format(string, sizeof(string), "* You placed a contract on %s, for $%d.",giveplayer, moneys);
- SendClientMessage(playerid, COLOR_GREY, string);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, " Invalid transaction amount.");
- }
- }
- }
- else
- {
- format(string, sizeof(string), " %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- return 1;
- }
- if(strcmp(cmdtext,"/buybombs",true)==0)
- {
- if(gTeam[playerid] == TEAM_MERC)
- {
- if(usingcomp[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer: You have purchased bombs!");
- SendClientMessage(playerid, COLOR_OOC, "You can now press CROUCH + FIRE to plant a bomb.");
- SendClientMessage(playerid, COLOR_OOC, "------------------------------------------");
- SendClientMessage(playerid, COLOR_YELLOW, "/gps /buyguns /buybombs /buyrepairkit");
- SendClientMessage(playerid, COLOR_YELLOW, "Type /leavecomputer to leave the computer!");
- hasbombs[playerid] = 1;
- }else SendClientMessage(playerid, COLOR_RED, "You need to use the computer to acces GPS!");
- }
- return 1;
- }
- if(strcmp(cmdtext,"/buyrepairkit",true)==0)
- {
- if(gTeam[playerid] == TEAM_MERC)
- {
- if(usingcomp[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer: You have purchased a repair kit!");
- SendClientMessage(playerid, COLOR_OOC, "You can now do /repair");
- SendClientMessage(playerid, COLOR_OOC, "------------------------------------------");
- SendClientMessage(playerid, COLOR_YELLOW, "/gps /buyguns /buybombs /buyrepairkit");
- SendClientMessage(playerid, COLOR_YELLOW, "Type /leavecomputer to leave the computer!");
- hasrepair[playerid] = 1;
- }else SendClientMessage(playerid, COLOR_RED, "You need to use the computer to acces GPS!");
- }
- return 1;
- }
- if(strcmp(cmdtext,"/buyguns",true)==0)
- {
- if(gTeam[playerid] == TEAM_MERC)
- {
- if(usingcomp[playerid] == 1)
- {
- if(strlen(cmdtext[9]) == 0)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer: List of avaible guns!");
- SendClientMessage(playerid, COLOR_OOC, "/buyguns 1 -- ROCKET LAUNCHER -- $20,000");
- SendClientMessage(playerid, COLOR_OOC, "/buyguns 2 -- COMBAT SHOTGUN -- $15,000");
- SendClientMessage(playerid, COLOR_OOC, "/buyguns 3 -- SNIPER RIFLE -- $15,000");
- SendClientMessage(playerid, COLOR_OOC, "/buyguns 4 -- DESERT EAGLE -- $15,000");
- SendClientMessage(playerid, COLOR_OOC, "/buyguns 5 -- SHOTGUN -- $10,000");
- SendClientMessage(playerid, COLOR_OOC, "/buyguns 6 -- M4 -- $10,000");
- SendClientMessage(playerid, COLOR_OOC, "/buyguns 7 -- HEALTH -- $10,000");
- return 1;
- }
- if(strval(cmdtext[9]) == 1)
- {
- if(GetPlayerMoney(playerid) >= 20000)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer: You purchased a rocket launcher!");
- GivePlayerWeapon(playerid, 36, 5);
- GivePlayerMoney(playerid, -20000);
- }
- }
- else if(strval(cmdtext[9]) == 2)
- {
- if(GetPlayerMoney(playerid) >= 15000)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer: You purchased a combat shotgun!");
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerMoney(playerid, -15000);
- }
- }
- else if(strval(cmdtext[9]) == 3)
- {
- if(GetPlayerMoney(playerid) >= 15000)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer: You purchased a sniper rifle!");
- GivePlayerWeapon(playerid, 34, 100);
- GivePlayerMoney(playerid, -15000);
- }
- }
- else if(strval(cmdtext[9]) == 4)
- {
- if(GetPlayerMoney(playerid) >= 15000)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer: You purchased a desert eagle!");
- GivePlayerWeapon(playerid, 24, 200);
- GivePlayerMoney(playerid, -15000);
- }
- }
- else if(strval(cmdtext[9]) == 5)
- {
- if(GetPlayerMoney(playerid) >= 10000)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer: You purchased a shotgun!");
- GivePlayerWeapon(playerid, 25, 200);
- GivePlayerMoney(playerid, -10000);
- }
- }
- else if(strval(cmdtext[9]) == 6)
- {
- if(GetPlayerMoney(playerid) >= 10000)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer: You purchased a M4!");
- GivePlayerWeapon(playerid, 31, 300);
- GivePlayerMoney(playerid, -10000);
- }
- }
- else if(strval(cmdtext[9]) == 7)
- {
- if(GetPlayerMoney(playerid) >= 10000)
- {
- SendClientMessage(playerid, COLOR_OOC, "Computer: You purchased health!");
- SetPlayerHealth(playerid, 99.0);
- GivePlayerMoney(playerid, -10000);
- }
- }
- } else SendClientMessage(playerid, COLOR_RED,"You need to use the computer to buy weps !");
- }
- return 1;
- }
- if(strcmp(cmdtext,"/stop",true)==0)
- {
- if(hitman[playerid] == 1)
- {
- hitman[playerid] = 0;
- DisablePlayerCheckpoint(playerid);
- }
- return 1;
- }
- if( strcmp(cmdtext, "/ftlock", true)==0)
- {
- if(playerTeam[playerid]>0)
- {
- foreach(Player, i)
- {
- SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 1);
- }
- for(new i = 0; i < teamInfo[playerTeam[playerid]][1]; i++)
- {
- SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), teamMembers[playerTeam[playerid]][i], 0, 0);
- }
- }
- return 1;
- }
- if (strcmp(cmdtext, "/lock", true)==0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new State=GetPlayerState(playerid);
- if(State!=PLAYER_STATE_DRIVER)
- {
- SendClientMessage(playerid,COLOR_GREY,"You can only lock the doors as the driver.");
- return 1;
- }
- new i;
- for(i=0;i<MAX_PLAYERS;i++)
- {
- if(i != playerid)
- {
- SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
- }
- }
- SendClientMessage(playerid, COLOR_GREY, "Vehicle locked!");
- new Float:pX, Float:pY, Float:pZ;
- GetPlayerPos(playerid,pX,pY,pZ);
- PlayerPlaySound(playerid,1056,pX,pY,pZ);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle!");
- }
- return 1;
- }
- if (strcmp(cmdtext, "/unlock", true)==0)
- {
- if(IsPlayerInAnyVehicle(playerid)){
- new State=GetPlayerState(playerid);
- if(State!=PLAYER_STATE_DRIVER){
- SendClientMessage(playerid, COLOR_GREY,"You can only unlock the doors as the driver.");
- return 1;
- }
- new i;
- for(i=0;i<MAX_PLAYERS;i++){
- SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
- }
- SendClientMessage(playerid, COLOR_GREY, "Vehicle unlocked!");
- new Float:pX, Float:pY, Float:pZ;
- GetPlayerPos(playerid,pX,pY,pZ);
- PlayerPlaySound(playerid,1057,pX,pY,pZ);
- }else{
- SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle!");
- }
- return 1;
- }
- if(strcmp(cmd, "/tplant", true) == 0)
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- new tanker = GetClosestPlayer(playerid);
- if(GetDistanceBetweenPlayers(playerid,tanker) <= 10)
- {
- if(gTeam[tanker] == TEAM_USA)
- {
- SendClientMessage(playerid, COLOR_GREY, "You cannot plant a bomb in your teammates tank!");
- return 1;
- }
- new tank = GetPlayerVehicleID(tanker);
- if(GetVehicleModel(tank) == 432)
- {
- SetVehicleHealth(tank, 100.0);
- SendClientMessage(playerid, COLOR_GREY, "You planted the small bomb in the tank!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "No enemy tank spotted!");
- return 1;
- }
- return 1;
- }
- else if(gTeam[playerid] == TEAM_GERMANY)
- {
- new tanker = GetClosestPlayer(playerid);
- if(GetDistanceBetweenPlayers(playerid,tanker) <= 5)
- {
- if(gTeam[tanker] == TEAM_GERMANY)
- {
- SendClientMessage(playerid, COLOR_GREY, "You cannot plant a bomb in your teammates tank!");
- return 1;
- }
- new tank = GetPlayerVehicleID(tanker);
- if(GetVehicleModel(tank) == 432)
- {
- SetVehicleHealth(tank, 0.0);
- SendClientMessage(playerid, COLOR_GREY, "You planted the small bomb in the tank!");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "No enemy tank spotted!");
- return 1;
- }
- }
- return 1;
- }
- return 1;
- }
- if(strcmp(cmdtext, "/spray", true)==0)
- {
- if( gPlayerClass[playerid] == ENGINEER )
- {
- if( repair[playerid] == 0 )
- {
- if(gTeam[playerid] == TEAM_USA) ChangeVehicleColor(GetPlayerVehicleID(playerid),79,7 );
- if(gTeam[playerid] == TEAM_GERMANY) ChangeVehicleColor(GetPlayerVehicleID(playerid),17,30 );
- if(gTeam[playerid] == TEAM_JAPAN) ChangeVehicleColor(GetPlayerVehicleID(playerid),1,8 );
- if(gTeam[playerid] == TEAM_RUSSIA) ChangeVehicleColor(GetPlayerVehicleID(playerid),6,61 );
- SendClientMessage(playerid, COLOR_ORANGE, "Vehicle sprayed !");
- repair[playerid] = 1;
- SetTimerEx("restorerepair", 15000, 0, "i", playerid);
- }
- }
- return 1;
- }
- if(strcmp(cmdtext, "/repair", true) == 0)
- {
- if(gPlayerClass[playerid] == ENGINEER || hasrepair[playerid] == 1)
- {
- if(repair[playerid] == 0)
- {
- RepairVehicle(GetPlayerVehicleID(playerid));
- SendClientMessage(playerid, COLOR_GREY, "Vehicle repaired!");
- repair[playerid] = 1;
- SetTimerEx("restorerepair", 45000, 0, "i", playerid);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You repaired a vehicle recently. Please wait 15 seconds between repairs.");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You are not a engineer!");
- }
- return 1;
- }
- if(strcmp(cmdtext, "/dispenser", true)==0)
- {
- if( gPlayerClass[playerid] == ENGINEER )
- {
- if( repair[playerid] == 0 )
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- PlaceDispenser(playerid, X, Y, Z);
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,1000);
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,1000);
- SetTimerEx("restorerepair", 15000, 0, "i", playerid);
- }else SendClientMessage(playerid, COLOR_RED, "You have to wait 15 seconds before reparing/building again !");
- }
- return 1;
- }
- if(strcmp(cmdtext, "/rdispenser", true)==0)
- {
- if( gPlayerClass[playerid] == ENGINEER )
- {
- if( repair[playerid] == 0 )
- {
- ResetDispenser(playerid);
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,1000);
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,1000);
- SetTimerEx("restorerepair", 15000, 0, "i", playerid);
- }else SendClientMessage(playerid, COLOR_RED, "You have to wait 15 seconds before reparing/building again !");
- }
- return 1;
- }
- if(strcmp(cmdtext,"/nuke", true) == 0)
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- if(CapturedBy5 == 1)
- {
- if(IsPlayerInRangeOfPoint(playerid,2, 220.0778,1822.6729,7.5301))
- {
- if(nuked == 0)
- {
- if( GetPlayerMoney(playerid) >= 500000)
- {
- GivePlayerMoney(playerid, -500000);
- SendClientMessageToAll(COLOR_GREY, "Team USA has set up a missle to hit GERMANY'S base!");
- SendClientMessageToAll(COLOR_GREY, "The missle will hit in 10 seconds!");
- nuked = 1;
- SetTimer("NukeTime", 10000, 0);
- SetTimer("Nuke0", 180000, 0);
- SetPlayerMoney(playerid, GetPlayerMoney(playerid) -500000);
- } else SendClientMessage(playerid, COLOR_GREY, "You need 500 000$ to send a missile!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have sent a missle recently...");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You must be at AREA 69 Computer!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your team must take over area 69 to use the missles!");
- }
- }
- else if(gTeam[playerid] == TEAM_GERMANY)
- {
- if(CapturedBy5 == 2)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2, 220.0778,1822.6729,7.5301))
- {
- if(nuked == 0)
- {
- if( GetPlayerMoney(playerid) >= 500000)
- {
- GivePlayerMoney(playerid, -500000);
- SendClientMessageToAll(COLOR_GREY, "Team GERMANY has set up a missle to hit USA'S base!");
- SendClientMessageToAll(COLOR_GREY, "The missle will hit in 10 seconds!");
- nuked = 1;
- SetTimer("NukeTimeG", 10000, 0);
- SetTimer("Nuke0", 180000, 0);
- } else SendClientMessage(playerid, COLOR_GREY, "You need 500 000$ to send a missle !");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have sent a missle recently...");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You must be at AREA 69 Computer");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Your team must take over area 69 to use the missles!");
- }
- }
- return 1;
- }
- new index;
- cmd = strtok(cmdtext, index);
- if (strcmp(cmd, "/heal", true) == 0)
- {
- if( gPlayerClass[playerid] != MEDIC ) return SendClientMessage(playerid, COLOR_RED, "You are not a Medic!");
- new id;
- tmp = strtok(cmdtext, index);
- if (strlen(tmp))
- {
- id = strval(tmp);
- if (IsPlayerConnected(id))
- {
- if(healedrec[playerid] != 1)
- {
- new Float:gX, Float:gY, Float:gZ;
- GetPlayerPos(id, gX, gY, gZ);
- if( IsPlayerInRangeOfPoint(playerid, 5.0, gX, gY, gZ) )
- {
- SetPlayerHealth(id, 99.0);
- SendClientMessage(id, 0x00FF00AA, "You've been healed by a medic!");
- SendClientMessage(playerid, 0x00FF00AA, "Player healed.");
- SendClientMessage(playerid, COLOR_RED, "You may heal again in 15 seconds.");
- healedrec[playerid] = 1;
- SetTimerEx("HealAgain", 15000, 0, "i", playerid);
- }else SendClientMessage(playerid, COLOR_RED, "You need to be near the player to heal him !");
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "You have healed a player recently!");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "USAGE: /heal <id>");
- }
- return 1;
- }
- new giveplayername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- if(strcmp(cmd, "/register", true) == 0) //players ingame stats
- {
- if (!dini_Exists(udb_encode(playername)))
- {
- ShowPlayerDialog(playerid,50,DIALOG_STYLE_INPUT,"Register","Welcome to the server\n\nPlease open a new account\n\nEnter a password:","Register","Quit");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You already have a registered account!");
- }
- return 1;
- }
- if(strcmp(cmd, "/login", true) == 0) //players ingame stats
- {
- if(logged[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_RED, "You are already logged in!");
- return 1;
- }
- if (dini_Exists(udb_encode(playername)))
- {
- ShowPlayerDialog(playerid,60,DIALOG_STYLE_INPUT,"Login","Welcome to the server\n\nPlease enter your server password\n\nEnter a password:","Login","Quit");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You need to register an account before you can login to one!");
- }
- return 1;
- }
- if(strcmp(cmdtext, "/specoff", true, 9) == 0)
- {
- TogglePlayerSpectating(playerid, false);
- PlayerSpec[playerid][is] = 0;
- return 1;
- }
- if(strcmp(cmd, "/spec", true) == 0)
- {
- if( adminlevel[playerid] >=1 )
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /spec [id]");
- return 1;
- }
- giveplayerid = strval(tmp);
- if(giveplayerid == playerid ) return SendClientMessage(playerid, COLOR_RED, "You can't Spectate yourself");
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- TogglePlayerSpectating(playerid, 1);
- if(IsPlayerInAnyVehicle(giveplayerid) )
- {
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(giveplayerid));
- }
- else
- {
- PlayerSpectatePlayer(playerid, giveplayerid);
- }
- printf("ID: %i spectates id: %i", playerid, giveplayerid);
- SendClientMessage(playerid, COLOR_RED,"Spectating. Type /specoff to cancel spectator !");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "Player doesn't exist !");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have the permission !");
- }
- return 1;
- }
- if(strcmp(cmd, "/kick", true) == 0) // Kicks the player from the server
- {
- new reason[128];
- if (adminlevel[playerid] >= 1)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /kick [name/id] [reason]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /kick [playername/id] [reason]");
- printf("ADMIN: Admin %s kicked %s. Reason: %s", sendername, giveplayername, reason);
- format(string, sizeof(string), "-| Administrator %s kicked %s. [Reason: %s ] |-", sendername, giveplayername, reason);
- SendClientMessageToAll(ADMIN_RED, string);
- new IP[50];
- GetPlayerName(playerid, nameee, 16);
- GetPlayerIp(playerid, IP, 50);
- printf("%s | %s has been kicked !", IP, nameee);
- Kick(giveplayerid);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/ban", true) == 0) // Bans a player from the server
- {
- new reason[128];
- if (adminlevel[playerid] >= 2)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /ban [name/id] [reason]");
- SendClientMessage(playerid, ORANGE, "FUNCTION: Will BAN the specified player.");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if (adminlevel[giveplayerid] > adminlevel[playerid])
- {
- format(string, sizeof(string), "-| [%i]%s tried to ban you! |-",playerid,sendername);
- SendClientMessage(giveplayerid, ADMIN_RED,string);
- SendClientMessage(playerid, ADMIN_RED, "You are not allowed to ban an admin with a higher level than you!");
- }
- else if (giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /ban [name/id] [reason]");
- new ip[20];
- printf("ADMIN: Admin %s banned %s. Reason: %s", sendername, giveplayername, reason);
- format(string, sizeof(string), "Administrator %s banned %s. [Reason: %s ]", sendername, giveplayername, reason);
- SendClientMessageToAll(ADMIN_RED, string);
- GetPlayerIp(giveplayerid, ip, sizeof ip);
- format(string, sizeof(string), "Banned Player's IP: %s", ip);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- adminlevel[giveplayerid] = 0;
- format(reason, sizeof reason, "[%s]%s", sendername, reason);
- new IP[50];
- GetPlayerName(playerid, nameee, 16);
- GetPlayerIp(playerid, IP, 50);
- printf("%s | %s has been banned for %s !", IP, nameee, reason);
- BanEx(giveplayerid, reason);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd,"/getid",true) == 0 || strcmp(cmd, "/id", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_GREY,"Correct Usage: /getid [part from the nick]");
- return 1;
- }
- format(string,sizeof(string),"Searched for: \"%s\": ",tmp);
- SendClientMessage(playerid,COLOR_RED,string);
- new found=0;
- foreach(Player, i)
- {
- new foundname[MAX_PLAYER_NAME];
- GetPlayerName(i, foundname, MAX_PLAYER_NAME);
- new namelen = strlen(foundname);
- new bool:searched=false;
- for(new pos=0; pos <= namelen; pos++)
- {
- if(searched != true)
- {
- if(strfind(foundname,tmp,true) == pos)
- {
- found++;
- format(string,sizeof(string),"%d. %s (ID %d)",found,foundname,i);
- SendClientMessage(playerid, COLOR_GREEN ,string);
- searched = true;
- }
- }
- }
- }
- return 1;
- }
- if(!strcmp(cmdtext, "//", true, 2)) // Admin chat
- {
- if (adminlevel[playerid] >= 1)
- {
- if(!strlen(cmdtext[2])) return SendClientMessage(playerid, ORANGE, "USAGE: //<text>"), SendClientMessage(playerid, ORANGE, "HELP: Example: //Hi");
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "Admin [%i]%s: %s" ,playerid,sendername, cmdtext[2]);
- SendClientMessageToAdmins(DARKPINK, string, 1);
- return 1;
- }
- else return SendClientMessage(playerid, RED, "You are not an admin!");
- }
- if(strcmp(cmd, "/slap", true) == 0) // Slap a player
- {
- new Float:pX,Float:pY,Float:pZ;
- if (adminlevel[playerid] >= 1)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /slap [name/id]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerPos(giveplayerid,pX,pY,pZ);
- SetPlayerPos(giveplayerid,pX,pY,pZ+3);
- format(string, sizeof(string), "Administrator %s slapped %s",sendername, giveplayername);
- SendClientMessageToAdmins(ADMIN_RED, string, 1);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd, "/say", true) == 0) // Publicly says an admin message. Exact same as RCON's 'say' but in a red color.
- {
- if (adminlevel[playerid] >= 3)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new result[128];
- result = bigstrtok(cmdtext, idx);
- if(!strlen(result))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /say [message]");
- return 1;
- }
- format(string, sizeof(string), "* Admin: %s", result);
- SendClientMessageToAll(LIGHTRED, string);
- printf("%s", string);
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd, "/teamspeak", true) == 0) // Publicly says an admin message. Exact same as RCON's 'say' but in a red color.
- {
- if (adminlevel[playerid] >= 3)
- {
- SendClientMessageToAll(LIGHTRED, "Make the server more fun! Enter our teamspeak server! 174.36.235.156:8767");
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd, "/ann", true) == 0) // Displays a screen message
- {
- if (adminlevel[playerid] >= 2)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new result[128];
- result = bigstrtok(cmdtext, idx);
- if(!strlen(result))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /ann [message] [time in seconds(if non entered, 5 seconds will be the time by default)]");
- return 1;
- }
- new timexx;
- tmp = strtok(cmdtext, idx);
- if (!strlen(tmp)) timexx = 5;
- else timexx = strval(tmp);
- format(string, sizeof(string), "~w~%s", result);
- GameTextForAll(string, timexx*1000, 4);
- printf("%s", string);
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd, "/crash", true) == 0) // Crashes a player's client
- {
- if (adminlevel[playerid] >= 4)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /crash [name/id]");
- return 1;
- }
- new Float:X,Float:Y,Float:Z;
- new targetid = ReturnUser(tmp);
- if(IsPlayerConnected(targetid))
- {
- GetPlayerPos(giveplayerid,X,Y,Z);
- new objectcrash = CreatePlayerObject(targetid,666666,X,Y,Z,0,0,0); // double-devil has spoken
- SendClientMessage(playerid,GREEN, "Player crashed!");
- DestroyPlayerObject(targetid, objectcrash);
- }
- else if (!IsPlayerConnected(giveplayerid))
- {
- format(string, sizeof(string), "%d is not an active player.", targetid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd, "/sex", true) == 0)
- {
- if (adminlevel[playerid] >= 4)
- {
- SendClientMessageToAll(GREEN, "[COD5]lolumadd is having sex with Windy!");
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd, "/jail", true) == 0) // Jails a player
- {
- if (adminlevel[playerid] >= 2)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /jail [name/id] [reason]");
- return 1;
- }
- new targetid = ReturnUser(tmp);
- if(IsPlayerConnected(targetid))
- {
- if(targetid != INVALID_PLAYER_ID)
- {
- if(jail[giveplayerid] == 0)
- {
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new reason[128];
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /jail [name/id] [reason]");
- format(string, sizeof(string), "You got jailed by Admin %s. Reason: %s", sendername, reason);
- SendClientMessage(targetid, ADMIN_RED, string);
- format(string, sizeof(string), "Administrator %s jailed %s. [ Reason: %s ]",sendername,giveplayername, reason);
- SendClientMessageToAll(ADMIN_RED,string);
- jail[targetid] = 1;
- OnPlayerJailed(targetid);
- return 1;
- }
- else SendClientMessage(playerid, RED, "Player is already jailed!");
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", targetid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", targetid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
- return 1;
- }
- if(strcmp(cmd, "/unjail", true) == 0) // Unjails a player
- {
- if (adminlevel[playerid] >= 2)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /unjail [name/id]");
- return 1;
- }
- new targetid = ReturnUser(tmp);
- if(targetid != INVALID_PLAYER_ID)
- {
- if(jail[giveplayerid] == 1)
- {
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "Administrator %s unjailed %s",sendername, giveplayername);
- SendClientMessageToAll(ADMIN_RED,string);
- jail[targetid] = 0;
- OnPlayerUnjailed(targetid);
- }
- else SendClientMessage(playerid, RED, "Player is not jailed!");
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", targetid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- //============[ NEW ADMIN COMMANDS ] ==========
- // === [Clearchat] ===
- if(strcmp(cmdtext, "/clearchat", true) == 0)
- {
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 1)
- {
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- SendClientMessageToAll(COLOR_SYSTEM, " ");
- GameTextForAll("Chat cleared!", 1000,1);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /clearchat", nameee);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- }
- // === [Disarm] ===
- if(strcmp(cmd, "/disarm", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- giveplayerid = strval(tmp);
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- giveplayerid = strval(tmp);
- if(!strlen(tmp) && adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /disarm [playerid]");
- return 1;
- }
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 3)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- ResetPlayerWeapons(giveplayerid);
- format(string, sizeof(string), "AdmCMD: Admin %s has disarmed %s.", sendername,giveplayer);
- SendClientMessageToAll(COLOR_BLUE, string);
- format(string, sizeof(string), "AdmCMD: Admin %s disarmed you.", sendername);
- SendClientMessage(giveplayerid, COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /disarm to disarm %s", nameee, giveplayer);
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player ID number.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [disarmall] ===
- if(strcmp(cmd, "/disarmall", true) == 0)
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 3)
- {
- foreach(Player, i)
- {
- ResetPlayerWeapons(i);
- format(string, sizeof(string), "AdmCMD: Admin %s has disarmed everyone.", sendername);
- SendClientMessage(i, COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, 30);
- }
- printf("[Command] %s has used /disarmall to disarm everyone", nameee);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- if(strcmp(cmd, "/armourall", true) == 0)
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 2)
- {
- format(string, sizeof(string), "AdmCMD: Admin %s has armoured everyone.", sendername);
- SendClientMessageToAll(COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, sizeof(nameee));
- printf("[Command] %s has used /armourall to armour everyone.", nameee);
- foreach(Player, i)
- {
- SetPlayerArmour(i, 100);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Akill] ===
- if(strcmp(cmd, "/akill", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- giveplayerid = strval(tmp);
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- giveplayerid = strval(tmp);
- if(adminlevel[playerid] < 1)
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- if(!strlen(tmp) && adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /akill [playerid]");
- return 1;
- }
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 1)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- SetPlayerHealth(giveplayerid, -999);
- format(string, sizeof(string), "AdmCMD: You have murdered %s.", giveplayer);
- SendClientMessage(playerid, COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /akill to kill %s", nameee, giveplayer);
- return 1;
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- }
- // === [Warn] ===
- if(strcmp(cmd, "/warn", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new str[256];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp) && adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /warn [PlayerID] [Reason]");
- return 1;
- }
- giveplayerid = strval(tmp);
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 1)
- {
- if(WarnedTimes[giveplayerid] == 0)
- {
- WarnedTimes[giveplayerid]+=1;
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof (sendername));
- format(str, sizeof (str), "AdmCMD: %s was warned by %s for: %s [1/3 Warnings]", giveplayer, sendername, cmdtext[8]);
- SendClientMessageToAll(COLOR_BLUE, str);
- print(str);
- return 1;
- }
- if(WarnedTimes[giveplayerid] == 1)
- {
- WarnedTimes[giveplayerid]+=1;
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof (sendername));
- format(str, sizeof (str), "AdmCMD: %s was warned by %s for: %s [2/3 Warnings]", giveplayer, sendername, cmdtext[8]);
- SendClientMessageToAll(COLOR_BLUE, str);
- print(str);
- return 1;
- }
- else if(WarnedTimes[giveplayerid] == 2)
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof (sendername));
- format(str, sizeof (str), "AdmCMD: %s was kicked by %s for: %s [3/3 Warnings]", giveplayer, sendername, cmdtext[8]);
- SendClientMessageToAll(COLOR_BLUE, str);
- Kick(giveplayerid);
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- }
- // === [Freeze] ===
- if(strcmp(cmd, "/freeze", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- giveplayerid = strval(tmp);
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- giveplayerid = strval(tmp);
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 1)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- if(freeze[giveplayerid] == 1)
- {
- SendClientMessage(playerid, COLOR_RED, "The player is already frozen!");
- return 1;
- }
- else
- {
- freeze[giveplayerid] = 1;
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- TogglePlayerControllable(giveplayerid, 0);
- format(string, sizeof(string), "AdmCMD: %s was frozen by %s.",giveplayer, sendername);
- SendClientMessageToAll(COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /freeze to freeze %s", nameee, giveplayer);
- return 1;
- }
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_BLUE, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Unfreeze] ===
- if(strcmp(cmd, "/unfreeze", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- giveplayerid = strval(tmp);
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- giveplayerid = strval(tmp);
- if(!strlen(tmp) && adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /unfreeze [playerid]");
- return 1;
- }
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 1)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- if(freeze[giveplayerid] == 1)
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- TogglePlayerControllable(giveplayerid, 1);
- freeze[giveplayerid] = 0;
- format(string, sizeof(string), "AdmCMD: %s was thawed by %s", giveplayer,sendername);
- SendClientMessageToAll(COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /unfreeze to unfreeze(thaw) %s", nameee, giveplayer);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "This player can't be thawed, he already is!");
- return 1;
- }
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Playerinfo] ===
- if(strcmp(cmd, "/playerinfo", true) == 0 )
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp) && adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /playerinfo [playerid]");
- return 1;
- }
- giveplayerid = strval(tmp);
- if(logged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 1)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- new Float:health;
- new Float:armour;
- new intr = GetPlayerInterior(giveplayerid);
- GetPlayerHealth(giveplayerid,health);
- GetPlayerArmour(giveplayerid,armour);
- new score = GetPlayerScore(giveplayerid);
- new skin = GetPlayerSkin(giveplayerid);
- new moneyxx = GetPlayerMoney(giveplayerid);
- new playerip[100];
- GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
- new ping = GetPlayerPing(giveplayerid);
- new sts4[256];
- new sts2[100];
- format(sts4, 100, "|| Health: %f || Armour: %f || Interior: %i || Score: %i ||", health, armour, intr, score);
- format(sts2, 100, "|| Skin: %i || Money: %i || IP: %s || Ping: %i ||",skin, moneyxx, playerip, ping);
- new ns[100];
- new nme[20];
- GetPlayerName(giveplayerid, nme, 20);
- format(ns, 100, "%s's Info:", nme);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, " ");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, ns);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, sts4);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, sts2);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, " ");
- if(logged[giveplayerid] == 0)
- {
- format(string, sizeof(string),"Information on player %s (ID: %i)(Player isn't logged in) :",giveplayer, giveplayerid);
- SendClientMessage(playerid, COLOR_BLUE, string);
- }
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [IP] ===
- if(strcmp(cmd, "/ip", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp) && adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /ip [playerid]");
- return 1;
- }
- giveplayerid = strval(tmp);
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 1)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- new playerip[256];
- GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
- format(string, sizeof(string),"AdmCMD: Checked IP on %s(%i): %s ",giveplayer, giveplayerid, playerip);
- SendClientMessage(playerid, COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /ip to check %s's IP", nameee, giveplayer);
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Givemoney] ===
- if(strcmp(cmd, "/givemoney", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp) && adminlevel[playerid] >= 3)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /givemoney [playerid] [amount]");
- return 1;
- }
- new moneyxx;
- giveplayerid = strval(tmp);
- if(logged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You must be logged in to use this command!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- moneyxx = strval(tmp);
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 3)
- {
- GivePlayerMoney(giveplayerid, moneyxx);
- format(string, sizeof(string), "AdmCMD: You sent %s(%i) $%d", giveplayer,giveplayerid, moneyxx);
- SendClientMessage(playerid,COLOR_BLUE, string);
- format(string, sizeof(string), "AdmCMD: You received $%d from Admin %s", moneyxx,sendername);
- SendClientMessage(giveplayerid,COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /givemoney to give %s $%s", nameee, giveplayer, moneyxx);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Setmoney] ===
- if(strcmp(cmd, "/setmoney", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp) && adminlevel[playerid] >= 3)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /setmoney [playerid] [amount]");
- return 1;
- }
- new moneyxx;
- giveplayerid = strval(tmp);
- if(logged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_RED, "You must be logged in to use this command!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- moneyxx = strval(tmp);
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 3)
- {
- ResetPlayerMoney(giveplayerid);
- GivePlayerMoney(giveplayerid, moneyxx);
- format(string, sizeof(string), "AdmCMD: You set %s(%i)'s money to $%d", giveplayer,giveplayerid, moneyxx);
- SendClientMessage(playerid,COLOR_BLUE, string);
- format(string, sizeof(string), "AdmCMD: Admin %s has set Your money to %d", sendername, moneyxx);
- SendClientMessage(giveplayerid,COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /setmoney to set %s's money to $%s", nameee, giveplayer, moneyxx);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Sethealth] ===
- if(strcmp(cmd,"/sethealth",true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new health;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /sethealth [id] [health]");
- return 1;
- }
- giveplayerid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /sethealth [id] [health]");
- return 1;
- }
- health = strval(tmp);
- if(health < 0 || health > 100)
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: Invalid health.");
- return 1;
- }
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 2)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- SetPlayerHealth(giveplayerid,health);
- GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
- format(string,sizeof(string),"AdmCMD: You have been set %s 's health to %d",giveplayer, health);
- SendClientMessage(playerid,COLOR_RED,string);
- format(string,sizeof(string),"AdmCMD: Admin %s set your health to %d",sendername, health);
- SendClientMessage(giveplayerid,COLOR_RED,string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /sethealth to set %s's health to: %d", nameee, giveplayer, health);
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Setscore] ===
- if(strcmp(cmd,"/setscore",true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new health;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /setscore [id] [score]");
- return 1;
- }
- giveplayerid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /setscore [id] [score]");
- return 1;
- }
- health = strval(tmp);
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 3)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- SetPlayerScore(giveplayerid,health);
- GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
- format(string,sizeof(string),"AdmCMD: You have been set %s 's score to %d",giveplayer, health);
- SendClientMessage(playerid,COLOR_RED,string);
- format(string,sizeof(string),"AdmCMD: Admin %s set your score to %d",sendername, health);
- SendClientMessage(giveplayerid,COLOR_RED,string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /setscore to set %s's score to: %d", nameee, giveplayer, health);
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Tele] ===
- if(strcmp(cmd, "/telep", true) == 0)
- {
- new telename[MAX_PLAYER_NAME];
- new teleid;
- new Float:pX, Float:pY, Float:pZ;
- tmp = strtok(cmdtext, idx);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(!strlen(tmp) && adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /telep [teleportee id] [destination id]");
- return 1;
- }
- giveplayerid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp) && adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /telep [teleportee id] [destination id]");
- return 1;
- }
- teleid = strval(tmp);
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 2)
- {
- if(IsPlayerConnected(giveplayerid) && IsPlayerConnected(teleid))
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(teleid, telename, sizeof(telename));
- GetPlayerPos(teleid, pX,pY,pZ);
- SetPlayerPos(giveplayerid, pX,pY,pZ);
- format(string, sizeof(string), "AdmCMD: You teleported %s to %s.", giveplayer,telename);
- SendClientMessage(playerid, COLOR_BLUE, string);
- format(string, sizeof(string), "AdmCMD: You have been teleported to %s by Admin %s.", telename,sendername);
- SendClientMessage(giveplayerid, COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /telep to tele %s to %s", nameee, giveplayer, telename);
- return 1;
- }
- else
- {
- if(!IsPlayerConnected(giveplayerid))
- {
- format(string, sizeof(string), "ID:%d is not an active player ID number.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- if(!IsPlayerConnected(teleid))
- {
- format(string, sizeof(string), "ID:%d is not an active player ID number.", teleid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Explode] ===
- if(strcmp(cmd, "/explode", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp) && adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /explode [playerid]");
- return 1;
- }
- giveplayerid = strval(tmp);
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 3)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- format(string, sizeof(string), "AdmCMD: %s was exploded by %s",giveplayer, sendername);
- SendClientMessageToAll(COLOR_BLUE, string);
- SetPlayerHealth(giveplayerid, 10);
- new Float:boomx, Float:boomy, Float:boomz;
- GetPlayerPos(giveplayerid,boomx, boomy, boomz);
- CreateExplosion(boomx, boomy , boomz, 7, 10);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /explode to explode %s", nameee, giveplayer);
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Asay] ===
- if(strcmp(cmd, "/asay", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(cmdtext);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result) && adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /asay [text]");
- return 1;
- }
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 1)
- {
- format(string, sizeof(string), "Admin: %s", result);
- SendClientMessageToAll(COLOR_LIGHTGREEN,string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /asay to send the message: %s", nameee, result);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Time] ===
- if(strcmp(cmd, "/time", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /time [0-23]");
- return 1;
- }
- new timexx;
- timexx = strval(tmp);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 3)
- {
- if(timexx > 23)
- {
- SendClientMessage(playerid, COLOR_RED, "Invalid time! 0 - 23!");
- }
- else
- {
- SetWorldTime(timexx);
- hourx = timexx;
- foreach(Player, i)
- {
- SetPlayerTime(i, timexx, 0);
- }
- format(string, sizeof(string), "AdmCMD: Admin %s set the time to: %d",sendername,timexx);
- SendClientMessageToAll(COLOR_BLUE, string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /time to set time to: %s", nameee, timexx);
- UpdateTime();
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Weather] ===
- if(strcmp(cmd, "/weather", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_DBLUE, "Correct Usage: /weather [weather]");
- SendClientMessage(playerid, COLOR_DBLUE, "Weather IDs: /weatherids");
- return 1;
- }
- new weather;
- weather = strval(tmp);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 2)
- {
- SetWeather(weather);
- foreach(Player, i)
- {
- SetPlayerWeather(i, weather);
- }
- format(string, sizeof(string), "AdmCMD: Admin %s set the weather to: %d",sendername,weather);
- SendClientMessageToAll(COLOR_BLUE, string);
- SendClientMessage(playerid, COLOR_DBLUE, "See wheater IDs at: /weatherids");
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /weather to set weather to: %s", nameee, weather);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Weatherids] ===
- if(strcmp(cmd, "/weatherids", true) == 0 || strcmp(cmd, "/weathers", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(adminlevel[playerid] >= 3)
- {
- SendClientMessage(playerid, COLOR_RED, ">>+-=================================== [Weather Ids: ] ================================");
- SendClientMessage(playerid, COLOR_YELLOW, ">>| 1 - Blue | 2 - Lighter Blue | 3 - Light (No color) | 4 - Even more lighter");
- SendClientMessage(playerid, COLOR_YELLOW, ">>| 5 - Normal Sun | 7 - (My PC = Beeped) | 8 - Rainy | 9 - Foggy | 10 - Standard weather");
- SendClientMessage(playerid, COLOR_YELLOW, ">>| 12 - Colourless, with alittle fog | 13 - Less foggy | 15 - Little fog ");
- SendClientMessage(playerid, COLOR_YELLOW, ">>| 16 - Rainy | 17 - Hot | 19 - Sandstorm | 20 - Dark | 21 - Some very wierd weather ");
- SendClientMessage(playerid, COLOR_YELLOW, ">>| 23 - Atmosphere style (?) | 25 - Abit foggy | 27 - Abit \"White\" | 30 - Thunderstorm ");
- SendClientMessage(playerid, COLOR_YELLOW, ">>| 32 - Foggy | 33 - Hot | 35 - City weather | 37 - Warm | 38 - Even more city weather ");
- SendClientMessage(playerid, COLOR_YELLOW, ">>| 39 - Industrial weather | 40 - Yellow weather | 42 - Black fog | 43 - Industrial fog ");
- SendClientMessage(playerid, COLOR_YELLOW, ">>| 44 & 45 - Some wierd weather. -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- (c) IDs by PaoloP");
- SendClientMessage(playerid, COLOR_RED, ">>+-====================================================================================");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- return 1;
- }
- if(strcmp(cmd, "/force", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if (!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GREEN, "USAGE: /force [playerid]");
- return 1;
- }
- giveplayerid = strval(tmp);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 1)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- format(string, sizeof(string), "AdmCMD: You have forced %s(%i) to class selection", giveplayer, giveplayerid);
- SendClientMessage(playerid, COLOR_BLUE, string);
- SetPlayerHealth(giveplayerid, 0.0);
- ForceClassSelection(giveplayerid);
- format(string, sizeof(string), "AdmCMD: %s(%i) has forced You to class selection", sendername, playerid);
- SendClientMessage(giveplayerid, COLOR_BLUE, string);
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- if(strcmp(cmd, "/setarmour", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new armor;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /setarmour [id] [armor]");
- return 1;
- }
- giveplayerid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /setarmour [id] [armor]");
- return 1;
- }
- armor = strval(tmp);
- if(armor < 0 || armor > 100)
- {
- SendClientMessage(playerid,COLOR_RED,"ERROR: Invalid armor.");
- return 1;
- }
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 2)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- SetPlayerArmour(giveplayerid, armor);
- GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
- format(string,sizeof(string),"AdmCMD: You have been set %s 's armour to %d",giveplayer, armor);
- SendClientMessage(playerid,COLOR_RED,string);
- format(string,sizeof(string),"AdmCMD: Admin %s set your armour to %d",sendername, armor);
- SendClientMessage(giveplayerid,COLOR_RED,string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /setarmor to set %s's armor to: %d", nameee, giveplayer, armor);
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- if(strcmp(cmd, "/healall", true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] >= 2)
- {
- format(string, sizeof(string), "AdmCMD: %s has healed everyone", sendername);
- SendClientMessageToAll(COLOR_BLUE, string);
- foreach(Player, i)
- {
- SetPlayerHealth(i, 100);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Reloadbans] ===
- if(strcmp(cmd,"/reloadbans",true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] == 4)
- {
- SendClientMessage(playerid, COLOR_RED, "You have successfully re-loaded bans!");
- SendRconCommand("reloadbans");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- // === [Reloadlogs] ===
- if(strcmp(cmd,"/reloadlogs",true) == 0)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logged[playerid] == 1)
- {
- if(adminlevel[playerid] == 4)
- {
- SendRconCommand("reloadlogs");
- SendClientMessage(playerid, COLOR_RED, "You have successfully re-loaded logs!");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
- }
- return 1;
- }
- //============[ End NEW ADMIN COMMANDS ]=======
- // === [Eject] ===
- if(strcmp(cmd,"/eject",true) == 0)
- {
- if( IsPlayerInAnyVehicle(playerid) )
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(sendername));
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /eject [playerid]");
- return 1;
- }
- if( GetPlayerVehicleSeat(playerid) == 0 )
- {
- giveplayerid = strval(tmp);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(sendername));
- if(IsPlayerConnected(giveplayerid))
- {
- if(IsPlayerInAnyVehicle(giveplayerid))
- {
- RemovePlayerFromVehicle(giveplayerid);
- format(string, sizeof(string), "%s has ejected You!", sendername);
- SendClientMessage(giveplayerid, COLOR_RED, string);
- GetPlayerName(playerid, nameee, 30);
- printf("[Command] %s has used /eject to eject %s", nameee, giveplayer);
- return 1;
- }
- else
- {
- format(string, sizeof(string), "Error! %s isn't in a vehicle!");
- SendClientMessage(playerid, COLOR_RED, string);
- return 1;
- }
- }
- else
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_RED, string);
- }
- }else SendClientMessage(playerid, COLOR_RED, "You are not the driver!");
- }else SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle!");
- return 1;
- }
- if(strcmp(cmd, "/report", true) == 0) // Available for everyone: reports a player to the admins
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /report [name/id] [reason]");
- return 1;
- }
- new targetid = ReturnUser(tmp);
- if(targetid != INVALID_PLAYER_ID)
- {
- GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new reason[128];
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /report [playerid] [reason]");
- format(string, sizeof(string), "%s reported %s [ID: %d] [ Reason: %s ]", sendername,giveplayername,targetid,reason);
- SendClientMessageToAdmins(ADMIN_RED, string,1);
- print(string);
- format(string, sizeof(string), "Your report on '%s' has been sent to the current online admins. Thank you.", giveplayername);
- SendClientMessage(playerid, GREEN, string);
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- return 1;
- }
- if(strcmp(cmd, "/goto", true) == 0) // Teleports to a player
- {
- new Float:pX,Float:pY,Float:pZ;
- if (adminlevel[playerid] >= 1)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /goto [name/id]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- GetPlayerPos(giveplayerid,pX,pY,pZ);
- SetVehiclePos(GetPlayerVehicleID(playerid),pX,pY,pZ+2);
- }
- else
- {
- GetPlayerPos(giveplayerid,pX,pY,pZ);
- SetPlayerPos(playerid,pX,pY,pZ+2);
- }
- SetPlayerInterior(playerid,GetPlayerInterior(giveplayerid));
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd, "/get", true) == 0) // Teleports the player to your position
- {
- new Float:pX,Float:pY,Float:pZ;
- if (adminlevel[playerid] >= 1)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /get [playername/id]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (GetPlayerState(giveplayerid) == PLAYER_STATE_DRIVER)
- {
- GetPlayerPos(playerid,pX,pY,pZ);
- SetVehiclePos(GetPlayerVehicleID(giveplayerid),pX,pY,pZ+2);
- }
- else
- {
- GetPlayerPos(playerid,pX,pY,pZ);
- SetPlayerPos(giveplayerid,pX,pY,pZ+2);
- }
- SetPlayerInterior(giveplayerid,GetPlayerInterior(playerid));
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd, "/mute", true) == 0) // Mutes the player from talking in the chat box
- {
- new reason[128];
- if (adminlevel[playerid] >= 2)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /mute [name/id] [reason]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (mute[giveplayerid] == 0)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- reason = bigstrtok(cmdtext, idx);
- if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /mute [name/id] [reason]");
- printf("ADMIN: Admin %s muted %s. Reason: %s", sendername, giveplayername, reason);
- format(string, sizeof(string), "Administrator %s muted %s. [Reason: %s ]", sendername,giveplayername,reason);
- SendClientMessageToAll(ADMIN_RED, string);
- mute[giveplayerid] = 1;
- }
- else if (mute[giveplayerid] == 1) SendClientMessage(playerid, RED, "Player is already muted!");
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd, "/unmute", true) == 0) // Unmutes a muted player
- {
- if (adminlevel[playerid] >= 2)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, ORANGE, "USAGE: /unmute [name/id]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- if (mute[giveplayerid] == 1)
- {
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "Administrator %s unmuted %s", sendername,giveplayername);
- SendClientMessageToAll(ADMIN_RED, string);
- mute[giveplayerid] = 0;
- }
- else if (mute[giveplayerid] == 0) SendClientMessage(playerid, RED, "Player isn't muted.");
- }
- else if(giveplayerid == INVALID_PLAYER_ID)
- {
- format(string, sizeof(string), "%d is not an active player.", giveplayerid);
- SendClientMessage(playerid, RED, string);
- }
- }
- else SendClientMessage(playerid, RED, "You cannot use this command!");
- return 1;
- }
- if(strcmp(cmd, "/ah", true) == 0 || strcmp(cmd, "/ahelp", true) == 0 || strcmp(cmd, "/acommands", true) == 0) // List of admin commands
- {
- if( logged[playerid] == 1 )
- {
- if (adminlevel[playerid] >= 1)
- {
- SendClientMessage(playerid, YELLOW, " |- Server Admin Commands -|");
- SendClientMessage(playerid, ORANGE, "ADMIN CHAT: // Example: //hello");
- if(adminlevel[playerid] == 1)
- {
- SendClientMessage(playerid, COLOR_RED, ">>-+== Level 1 Admin commands =====================================================================================");
- SendClientMessage(playerid, COLOR_YELLOW, Level1Commands1);
- SendClientMessage(playerid, COLOR_YELLOW, Level1Commands2);
- }
- if(adminlevel[playerid] == 2)
- {
- SendClientMessage(playerid, COLOR_RED, ">>-+== Level 2 Admin commands =====================================================================================");
- SendClientMessage(playerid, COLOR_YELLOW, Level1Commands1);
- SendClientMessage(playerid, COLOR_YELLOW, Level1Commands2);
- SendClientMessage(playerid, COLOR_YELLOW, Level2Commands1);
- SendClientMessage(playerid, COLOR_YELLOW, Level2Commands2);
- }
- if(adminlevel[playerid] == 3)
- {
- SendClientMessage(playerid, COLOR_RED, ">>-+== Level 3 Admin commands =====================================================================================");
- SendClientMessage(playerid, COLOR_YELLOW, Level1Commands1);
- SendClientMessage(playerid, COLOR_YELLOW, Level1Commands2);
- SendClientMessage(playerid, COLOR_YELLOW, Level2Commands1);
- SendClientMessage(playerid, COLOR_YELLOW, Level2Commands2);
- SendClientMessage(playerid, COLOR_YELLOW, Level3Commands1);
- SendClientMessage(playerid, COLOR_YELLOW, Level3Commands2);
- }
- if(adminlevel[playerid] == 4)
- {
- SendClientMessage(playerid, COLOR_RED, ">>-+== Level 4 Admin commands =====================================================================================");
- SendClientMessage(playerid, COLOR_YELLOW, Level1Commands1);
- SendClientMessage(playerid, COLOR_YELLOW, Level1Commands2);
- SendClientMessage(playerid, COLOR_YELLOW, Level2Commands1);
- SendClientMessage(playerid, COLOR_YELLOW, Level2Commands2);
- SendClientMessage(playerid, COLOR_YELLOW, Level3Commands1);
- SendClientMessage(playerid, COLOR_YELLOW, Level3Commands2);
- SendClientMessage(playerid, COLOR_YELLOW, Level4Commands1);
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin!");
- }else SendClientMessage(playerid, RED, "You need to be logged !");
- return 1;
- }
- if(strcmp(cmd, "/adminduty", true) == 0)
- {
- if (adminlevel[playerid] >= 1)
- {
- if(adminduty[playerid] == 1)
- {
- GetPlayerName(playerid, nameee, sizeof(nameee));
- format(string, sizeof(string), "%s is now off admin duty!", nameee);
- SendClientMessageToAll(RED, string);
- adminduty[playerid] = 0;
- SetPlayerHealth(playerid, 0.0);
- }
- else if(adminduty[playerid] == 0)
- {
- GetPlayerName(playerid, nameee, sizeof(nameee));
- format(string, sizeof(string), "%s is now on admin duty!", nameee);
- SendClientMessageToAll(RED, string);
- SetPlayerColor(playerid, LIGHTGREEN);
- adminduty[playerid] = 1;
- }
- }
- else SendClientMessage(playerid, RED, "You are not an admin!");
- return 1;
- }
- if(strcmp(cmd, "/stats", true) == 0) //players ingame stats
- {
- format(string, sizeof(string), "SCORE: %d RANK: %d DEATHS: %d KILLS: %d", GetPlayerScore(playerid), rank[playerid], deaths[playerid], kills[playerid]);
- SendClientMessage(playerid, WHITE, string);
- return 1;
- }
- return 0;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- TextDrawHideForPlayer(playerid, Text:Textdraw0);
- if (GetVehicleModel(vehicleid) == 548 || GetVehicleModel(vehicleid) == 433 || GetVehicleModel(vehicleid) == 563 || GetVehicleModel(vehicleid) == 511)
- {
- CargoBobUser[playerid][vehicleid] =0;
- BarracksUser[playerid][vehicleid] =0;
- Driver[vehicleid] = -1;
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if( newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER ) LastVehicle[playerid] = GetPlayerVehicleID(playerid);
- new vehicleid = LastVehicle[playerid];
- if( oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
- {
- if (GetVehicleModel(vehicleid) == 548 || GetVehicleModel(vehicleid) == 433 || GetVehicleModel(vehicleid) == 563 || GetVehicleModel(vehicleid) == 511)
- {
- CargoBobUser[playerid][vehicleid] =0;
- BarracksUser[playerid][vehicleid] =0;
- }
- }
- if( !IsPlayerAdmin(playerid))
- {
- new vehicleidx = GetPlayerVehicleID(playerid);
- if(newstate == PLAYER_STATE_DRIVER)
- {
- if(GetVehicleModel(vehicleidx) == 425)
- {
- if(rank[playerid] >= 3)
- {
- IsInHunter[playerid] = vehicleidx;
- }
- else
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerPos(playerid, X+2.0, Y, Z);
- SendClientMessage(playerid, COLOR_RED, "You arent rank 3!");
- }
- }
- if (GetVehicleModel(vehicleidx) == 432)
- {
- if(rank[playerid] >= 2)
- {
- IsInRhino[playerid] = vehicleidx;
- }
- else
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerPos(playerid, X+2.0, Y, Z+2.0);
- SendClientMessage(playerid, COLOR_RED, "You arent rank 2!");
- }
- }
- if (GetVehicleModel(vehicleidx) == 520)
- {
- if(rank[playerid] >= 2)
- {
- if(gPlayerClass[playerid] == PILOT || gPlayerClass[playerid] == ADMIN )
- {
- //is in the hydra
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to be a pilot to drive a hydra!");
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerPos(playerid, X+2.0, Y, Z);
- }
- }
- else
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerPos(playerid, X+2.0, Y, Z+2.0);
- SendClientMessage(playerid, COLOR_RED, "You arent rank 2!");
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- new allp;
- foreach(Player, i)
- {
- allp = i;
- }
- if(pickupid == Dispenser[allp] )
- {
- if( pickupid != Dispenser[allp] ){ }
- if( dispout[playerid] == 0 )
- {
- SetTimerEx("DispenserOut", 10000, 0, "i", playerid);
- if( gPlayerClass[playerid] == ASSAULT )
- {
- GivePlayerWeapon(playerid, 30, 50);
- GivePlayerWeapon(playerid, 29, 20);
- GivePlayerWeapon(playerid, 25, 10);
- }
- if( gPlayerClass[playerid] == DEMOLITION )
- {
- GivePlayerWeapon(playerid, 16, 5);
- GivePlayerWeapon(playerid, 36, 1);
- GivePlayerWeapon(playerid, 24, 20);
- }
- if( gPlayerClass[playerid] == SNIPER )
- {
- GivePlayerWeapon(playerid, 34, 20);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 20);
- }
- if( gPlayerClass[playerid] == PILOT )
- {
- GivePlayerWeapon(playerid, 22, 5);
- }
- if( gPlayerClass[playerid] == MEDIC )
- {
- GivePlayerWeapon(playerid, 23, 20);
- GivePlayerWeapon(playerid, 1, 1);
- }
- if( gPlayerClass[playerid] == ENGINEER )
- {
- GivePlayerWeapon(playerid, 27, 20);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 29, 20);
- }
- if( gPlayerClass[playerid] == PYRO ) //pyro
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the pyroman as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = PYRO;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 279);
- GivePlayerWeapon(playerid, 16, 20);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 37, 550);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 278);
- GivePlayerWeapon(playerid, 16, 20);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 37, 250);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if( gPlayerClass[playerid] == Esploratore )//Esploratore
- {
- SendClientMessage(playerid, COLOR_GREY, "You chose the Esploratore as your class.");
- SendClientMessage(playerid, COLOR_GREY, "You can type /switchclass to change your class again.");
- gPlayerClass[playerid] = Esploratore;
- PickedClass[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, 1);
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerSkin(playerid, 128);
- SetPlayerArmour(playerid, 25);
- GivePlayerWeapon(playerid, 28, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 200);
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerSkin(playerid, 202);
- SetPlayerArmour(playerid, 25);
- GivePlayerWeapon(playerid, 28, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 200);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if( gPlayerClass[playerid] == ADMIN )
- {
- GivePlayerWeapon(playerid, 38, 20000);
- GivePlayerWeapon(playerid, 22, 20000);
- }
- dispout[playerid] = 1;
- } else SendClientMessage(playerid, COLOR_RED, "Dispenser recharging - come back in 10 seconds!");
- }
- else if(pickupid == umini)
- {
- GameTextForPlayer(playerid, "~w~MINI MISSION~w~~n~RAMPAGE~n~KILL 5 PEOPLE IN 2 MINUTES~n~REWARD:3+ SCORE", 5000, 3);
- SendClientMessage(playerid, COLOR_WHITE, "Type /start to start this challenge!");
- }
- else if(pickupid == gmini)
- {
- GameTextForPlayer(playerid, "~w~MINI MISSION~w~~n~RAMPAGE~n~KILL 5 PEOPLE IN 2 MINUTES~n~REWARD:3+ SCORE", 5000, 3);
- SendClientMessage(playerid, COLOR_WHITE, "Type /start to start this challenge!");
- }
- else if(pickupid == uhit)
- {
- GameTextForPlayer(playerid, "~w~MINI MISSION~w~~n~HITMAN~n~KILL THE RANDOM PERSON PICKED~n~REWARD:3+ SCORE", 5000, 3);
- SendClientMessage(playerid, COLOR_WHITE, "Type /start to start this challenge!");
- }
- else if(pickupid == ghit)
- {
- GameTextForPlayer(playerid, "~w~MINI MISSION~w~~n~HITMAN~n~KILL THE RANDOM PERSON PICKED~n~REWARD:3+ SCORE", 5000, 3);
- SendClientMessage(playerid, COLOR_WHITE, "Type /start to start this challenge!");
- }
- else if(pickupid == buyweapon)
- {
- GameTextForPlayer(playerid, "~w~TYPE /USECOMPUTER TO ACCESS THE COMPUTER!~w~", 5000, 3);
- }
- else if(pickupid == nuke)
- {
- GameTextForPlayer(playerid, "~w~TYPE /NUKE TO NUKE YOUR ENEMIES BASE!~w~", 5000, 3);
- }
- else if(pickupid == gunshop[1])
- {
- SetPlayerInterior(playerid, 4);
- SetPlayerPos(playerid, 286.2271,-81.6251,1001.5156);
- SendClientMessage(playerid, COLOR_GREY, "Type /exit to exit the gun shop!");
- IsInGunShop[playerid] = 1;
- GunShopID[playerid] = 1;
- }
- else if(pickupid == gunshop[2])
- {
- SetPlayerInterior(playerid, 4);
- SetPlayerPos(playerid, 286.2271,-81.6251,1001.5156);
- SendClientMessage(playerid, COLOR_GREY, "Type /exit to exit the gun shop!");
- IsInGunShop[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- GunShopID[playerid] = 2;
- }
- else if(pickupid == gunshop[3])
- {
- SetPlayerInterior(playerid, 4);
- SetPlayerPos(playerid, 286.2271,-81.6251,1001.5156);
- SendClientMessage(playerid, COLOR_GREY, "Type /exit to exit the gun shop!");
- IsInGunShop[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- GunShopID[playerid] = 3;
- }
- else if(pickupid == gunshop[4])
- {
- SetPlayerInterior(playerid, 4);
- SetPlayerPos(playerid, 286.2271,-81.6251,1001.5156);
- SendClientMessage(playerid, COLOR_GREY, "Type /exit to exit the gun shop!");
- IsInGunShop[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- GunShopID[playerid] = 4;
- }
- else if(pickupid == gunshop[5])
- {
- GameTextForPlayer(playerid, "~w~TYPE /BUY TO BUY ARMOR AND WEAPONS FROM THE SHOP!~w~", 5000, 3);
- }else
- if( pickupid == gunshop[7] )
- {
- SetPlayerInterior(playerid, 4);
- SetPlayerPos(playerid, 286.2271,-81.6251,1001.5156);
- SendClientMessage(playerid, COLOR_GREY, "Type /exit to exit the gun shop!");
- IsInGunShop[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- GunShopID[playerid] = 7;
- }else
- if( pickupid == gunshop[6] )
- {
- SetPlayerInterior(playerid, 4);
- SetPlayerPos(playerid, 286.2271,-81.6251,1001.5156);
- SendClientMessage(playerid, COLOR_GREY, "Type /exit to exit the gun shop!");
- IsInGunShop[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 0);
- GunShopID[playerid] = 6;
- }
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public AreaCheck()
- {
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -385.3699, 1506.446, -256.9133, 1646.58))
- {
- if(EnteredArea[i] == 0) // if he hasn'td beenterefo re
- {
- if(gTeam[i] == TEAM_USA && CapturedBy == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy == 3 || gTeam[i] == TEAM_USA && CapturedBy == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea[i] = 1;
- }
- else
- {
- SendClientMessageToAll(COLOR_CON_GREEN, "The bigear is being taken over!");
- EnteredArea[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- IfCapture[i] = 1;
- T1[i] = SetTimer("TakeOver",30000,0);
- }
- }
- }
- else
- {
- EnteredArea[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T1[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -630.6053, 2510.743, -478.7929, 2662.556))
- {
- if(EnteredArea2[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy2 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy2 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy2 == 3 || gTeam[i] == TEAM_USA && CapturedBy2 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea2[i] = 1;
- }
- else
- {
- EnteredArea2[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T2[i]= SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The resturant is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea2[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T2[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 268.5911, 2393.964, 467.115, 2604.166))
- {
- if(EnteredArea3[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy3 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy3 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy3 == 3 || gTeam[i] == TEAM_USA && CapturedBy3 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea3[i] = 1;
- }
- else
- {
- EnteredArea3[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T3[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The airfield is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea3[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T3[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 747.384, 2031.95, 805.7734, 2090.34))
- {
- if(EnteredArea4[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy4 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy4 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy4 == 3 || gTeam[i] == TEAM_USA && CapturedBy4 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea4[i] = 1;
- }
- else
- {
- EnteredArea4[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T4[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The Electric Field is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea4[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T4[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 105.1009, 1786.715, 338.6584, 2055.306))
- {
- if(EnteredArea5[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy5 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy5 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy5 == 3 || gTeam[i] == TEAM_USA && CapturedBy5 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea5[i] = 1;
- }
- else
- {
- EnteredArea5[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T5[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "Area 69 is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea5[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T5[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 502.1487, 1588.191, 700.6725, 1786.715))
- {
- if(EnteredArea6[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy6 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy6 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy6 == 3 || gTeam[i] == TEAM_USA && CapturedBy6 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea6[i] = 1;
- }
- else
- {
- EnteredArea6[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T6[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The gas station is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea6[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T6[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 105.1009, 1342.956, 280.269, 1483.09))
- {
- if(EnteredArea7[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy7 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy7 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy7 == 3 || gTeam[i] == TEAM_USA && CapturedBy7 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea9[i] = 1;
- }
- else
- {
- EnteredArea7[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T7[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The oil mine is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea7[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T7[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 408.7256, 1156.11, 712.3504, 1296.244))
- {
- if(EnteredArea8[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy8 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy8 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy8 == 3 || gTeam[i] == TEAM_USA && CapturedBy8 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea8[i] = 1;
- }
- else
- {
- EnteredArea8[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T8[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The train refueling station is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea8[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T8[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -945.9079, 1915.172, -525.5044, 2148.729))
- {
- if(EnteredArea9[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy9 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy9 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy9 == 3 || gTeam[i] == TEAM_USA && CapturedBy9 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea9[i] = 1;
- }
- else
- {
- EnteredArea9[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T9[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The damm is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea9[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T9[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -525.5044, 2125.373, -291.9469, 2277.186))
- {
- if(EnteredArea10[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy10 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy10 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy10 == 3 || gTeam[i] == TEAM_USA && CapturedBy10 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea10[i] = 1;
- }
- else
- {
- EnteredArea10[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T10[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The old town is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea10[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T10[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 939.5279, 970.4056, 1169.914, 1187.017))
- {
- if(EnteredArea11[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy11 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy11 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy11 == 3 || gTeam[i] == TEAM_USA && CapturedBy11 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea11[i] = 1;
- }
- else
- {
- EnteredArea11[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T11[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The University is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea11[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T11[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 1015.975, 2861.08, 1121.076,2954.502))
- {
- if(EnteredArea12[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy12 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy12 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy12 == 3 || gTeam[i] == TEAM_USA && CapturedBy12 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea12[i] = 1;
- }
- else
- {
- EnteredArea12[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T12[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The Oil Pump is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea12[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T12[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -1237.855, 1763.359, -1156.11, 1868.46))
- {
- if(EnteredArea13[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy13 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy13 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy13 == 3 || gTeam[i] == TEAM_USA && CapturedBy13 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea13[i] = 1;
- }
- else
- {
- EnteredArea13[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T13[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The CluckinBell is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea13[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T13[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 210.2018, 2837.724, 326.9805, 2989.536))
- {
- if(EnteredArea14[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy14 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy14 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy14 == 3 || gTeam[i] == TEAM_USA && CapturedBy11 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea14[i] = 1;
- }
- else
- {
- EnteredArea14[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T14[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The Beach Shack is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea14[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T14[i]);
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -1985.239, 2277.186, -1845.104, 2440.676))
- {
- if(EnteredArea15[i] == 0) // if he hasn't entered before
- {
- if(gTeam[i] == TEAM_USA && CapturedBy15 == 1 || gTeam[i] == TEAM_GERMANY && CapturedBy15 == 2 || gTeam[i] == TEAM_GERMANY && CapturedBy15 == 3 || gTeam[i] == TEAM_USA && CapturedBy15 == 4)
- {
- SendClientMessage(i, COLOR_RED, "This area has already been captured by your team!");
- EnteredArea15[i] = 1;
- }
- else
- {
- EnteredArea15[i] = 1; // He has entered
- SendClientMessage(i,COLOR_CON_GREEN, "Stay In here for 30 seconds to take over the area!");
- T15[i] = SetTimer("TakeOver",30000,0);
- SendClientMessageToAll(COLOR_CON_GREEN, "The Diner is being taken over!");
- }
- }
- }
- else
- {
- EnteredArea15[i] = 0; // When he leaves, he's no longer in the area
- KillTimer(T15[i]);
- }
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- stock ResetDispenser(playerid)
- {
- if( EngineerI[playerid] == 0 )
- {
- EngineerI[playerid] = 1;
- DestroyObject(Dispenser[playerid]);
- SendClientMessage(playerid, COLOR_YELLOW, "Dispenser Detonated ! You can now place another 1.");
- }else SendClientMessage(playerid, COLOR_RED, "Dispenser not placed !");
- return 1;
- }
- stock PlaceDispenser(playerid ,Float:xx, Float:yy, Float:zz)
- {
- if( EngineerI[playerid] == 1 )
- {
- if( GetPlayerMoney(playerid) >= 10000 )
- {
- EngineerI[playerid] = 0;
- SetPlayerMoney(playerid, GetPlayerMoney(playerid) - 10000);
- SetTimerEx("DispeClean", 2 * 60 * 1000, 0, "i", playerid);
- Dispenser[playerid] = CreatePickup(920,23,xx, yy, zz);
- SendClientMessage(playerid, COLOR_YELLOW, "Dispenser placed, grab it for ammo ! It will self-destruct in 2 minutes!");
- }else SendClientMessage(playerid, COLOR_RED, "You need 10 000$ for a dispenser !");
- }else SendClientMessage(playerid, COLOR_RED, "Not enough Dispensers !");
- return 1;
- }
- stock IsObjectInRangeOfPlayer(objectid, playerid)
- {
- new Float:pX, Float:pY, Float:pZ;
- GetPlayerPos(playerid, pX, pY, pZ);
- new Float:oX, Float:oY, Float:oZ;
- GetObjectPos(objectid, oX, oY, oZ);
- if( (pX - oX <= 5) && (pY - oY <= 5) && (pZ - oZ <= 1) )
- {
- return 1;
- }
- return 0;
- }
- stock IsPlayerInArea(playerid,Float:min_x,Float:min_y,Float:max_x,Float:max_y)
- {
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- if((X <= max_x && X >= min_x) && (Y <= max_y && Y >= min_y)) return 1;
- return 0;
- }
- public TakeOver()
- {
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -385.3699, 1506.446, -256.9133, 1646.58) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy != 1)
- {
- if( IfCapture[0] == 1 ) return 1;
- IfCapture[0] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy", 1);
- uscore++;
- // SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy = 1;
- if(CapturedBy != 1) SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the Big Ear!");
- GangZoneHideForAll(Ear);
- GangZoneShowForAll(EarU, COLOR_BLUE);
- GangZoneHideForAll(EarG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }
- else if(IsPlayerInArea(i, -385.3699, 1506.446, -256.9133, 1646.58) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy != 2)
- {
- {
- if( IfCapture[0] == 1 ) return 1;
- IfCapture[0] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy", 2);
- gscore++;
- // SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy = 2;
- if(CapturedBy != 2) SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured the Big Ear!");
- GangZoneHideForAll(Ear);
- GangZoneShowForAll(EarG, COLOR_RED);
- GangZoneHideForAll(EarU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- else if(IsPlayerInArea(i, -385.3699, 1506.446, -256.9133, 1646.58) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy != 2)
- {
- {
- if( IfCapture[0] == 1 ) return 1;
- IfCapture[0] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy", 2);
- gscore++;
- // SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy = 2;
- if(CapturedBy != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured Big Ear!");
- GangZoneHideForAll(Ear);
- GangZoneShowForAll(EarG, COLOR_RED);
- GangZoneHideForAll(EarU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -630.6053, 2510.743, -478.7929, 2662.556) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy2 != 1)
- {
- if( IfCapture[2] == 1 ) return 1;
- IfCapture[2] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy2", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy2 = 1;
- if(CapturedBy != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the resturant!");
- GangZoneHideForAll(Resturant);
- GangZoneShowForAll(ResturantU, COLOR_BLUE);
- GangZoneHideForAll(ResturantG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }
- else if(IsPlayerInArea(i, -630.6053, 2510.743, -478.7929, 2662.556) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy2 != 2)
- {
- if( IfCapture[2] == 1 ) return 1;
- IfCapture[2] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy2", 2);
- gscore++;
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy2 = 2;
- if(CapturedBy != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured resturant!");
- GangZoneHideForAll(Resturant);
- GangZoneShowForAll(ResturantG, COLOR_RED);
- GangZoneHideForAll(ResturantU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 268.5911, 2393.964, 467.115, 2604.166) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy3 != 1)
- {
- if( IfCapture[3] == 1 ) return 1;
- IfCapture[3] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy3", 1);
- //SetTimer("ScoreText", 5000, 0);
- uscore++;
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy3 = 1;
- if(CapturedBy != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the airfield!");
- GangZoneHideForAll(Airfield);
- GangZoneShowForAll(AirfieldU, COLOR_BLUE);
- GangZoneHideForAll(AirfieldG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }
- else if(IsPlayerInArea(i, 268.5911, 2393.964, 467.115, 2604.166) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy3 != 2)
- {
- if( IfCapture[3] == 1 ) return 1;
- IfCapture[3] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy3", 2);
- //SetTimer("ScoreText", 5000, 0);
- gscore++;
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy3 = 2;
- if(CapturedBy != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured airfield!");
- GangZoneHideForAll(Airfield);
- GangZoneShowForAll(AirfieldG, COLOR_RED);
- GangZoneHideForAll(AirfieldU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 747.384, 2031.95, 805.7734, 2090.34) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy4 != 1)
- {
- if( IfCapture[4] == 1 ) return 1;
- IfCapture[4] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy4", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy4 = 1;
- if(CapturedBy != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the Electric Field!");
- GangZoneHideForAll(Oil);
- GangZoneShowForAll(OilU, COLOR_BLUE);
- GangZoneHideForAll(OilG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }
- else if(IsPlayerInArea(i, 747.384, 2031.95, 805.7734, 2090.34) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy4 != 2)
- {
- if( IfCapture[4] == 1 ) return 1;
- IfCapture[4] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy4", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy4 = 2;
- if(CapturedBy != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured Electric Field!");
- GangZoneHideForAll(Oil);
- GangZoneShowForAll(OilG, COLOR_RED);
- GangZoneHideForAll(OilU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 105.1009, 1786.715, 338.6584, 2055.306) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy5 != 1)
- {
- if( IfCapture[5] == 1 ) return 1;
- IfCapture[5] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy5", 1);
- //SetTimer("ScoreText", 5000, 0);
- uscore++;
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy5 = 1;
- if(CapturedBy != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured area 69!");
- GangZoneHideForAll(A);
- GangZoneShowForAll(AU, COLOR_BLUE);
- GangZoneHideForAll(AG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }
- else if(IsPlayerInArea(i, 105.1009, 1786.715, 338.6584, 2055.306) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy5 != 2)
- {
- if( IfCapture[5] == 1 ) return 1;
- IfCapture[5] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy5", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy5 = 2;
- if(CapturedBy != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured area 69!");
- GangZoneHideForAll(A);
- GangZoneShowForAll(AG, COLOR_RED);
- GangZoneHideForAll(AU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 502.1487, 1588.191, 700.6725, 1786.715) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy6 != 1)
- {
- if( IfCapture[6] == 1 ) return 1;
- IfCapture[6] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy6", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy6 = 1;
- if(CapturedBy != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the gas station!");
- GangZoneHideForAll(Gas);
- GangZoneShowForAll(GasU, COLOR_BLUE);
- GangZoneHideForAll(GasG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }
- else if(IsPlayerInArea(i, 502.1487, 1588.191, 700.6725, 1786.715) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy6 != 2)
- {
- if( IfCapture[6] == 1 ) return 1;
- IfCapture[6] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy6", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy6 = 2;
- if(CapturedBy != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured gas station!");
- GangZoneHideForAll(Gas);
- GangZoneShowForAll(GasG, COLOR_RED);
- GangZoneHideForAll(GasU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 105.1009, 1342.956, 280.269, 1483.09) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy7 != 1)
- {
- if( IfCapture[7] == 1 ) return 1;
- IfCapture[7] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy7", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy7 = 1;
- if(CapturedBy != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the Oil Station!");
- GangZoneHideForAll(OS);
- GangZoneShowForAll(OSU, COLOR_BLUE);
- GangZoneHideForAll(OSG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }
- else if(IsPlayerInArea(i, 105.1009, 1342.956, 280.269, 1483.09) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy7 != 2)
- {
- if( IfCapture[7] == 1 ) return 1;
- IfCapture[7] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy7", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy7 = 2;
- if(CapturedBy != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured Oil Station!");
- GangZoneHideForAll(OS);
- GangZoneShowForAll(OSG, COLOR_RED);
- GangZoneHideForAll(OSU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 408.7256, 1156.11, 712.3504, 1296.244) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy8 != 1)
- {
- if( IfCapture[8] == 1 ) return 1;
- IfCapture[8] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy8", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy8 = 1;
- if(CapturedBy != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the Train refueling station!");
- GangZoneHideForAll(T);
- GangZoneShowForAll(TU, COLOR_BLUE);
- GangZoneHideForAll(TG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }
- else if(IsPlayerInArea(i, 408.7256, 1156.11, 712.3504, 1296.244) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy8 != 2)
- {
- if( IfCapture[8] == 1 ) return 1;
- IfCapture[8] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy8", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy8 = 2;
- if(CapturedBy != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured Train refueling station!");
- GangZoneHideForAll(T);
- GangZoneShowForAll(TG, COLOR_RED);
- GangZoneHideForAll(TU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -945.9079, 1915.172, -525.5044, 2148.729) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy9 != 1)
- {
- if( IfCapture[9] == 1 ) return 1;
- IfCapture[9] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy9", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy9 = 1;
- if(CapturedBy != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the damm");
- GangZoneHideForAll(D);
- GangZoneShowForAll(DU, COLOR_BLUE);
- GangZoneHideForAll(DG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }
- else if(IsPlayerInArea(i, -945.9079, 1915.172, -525.5044, 2148.729) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy9 != 2)
- {
- if( IfCapture[9] == 1 ) return 1;
- IfCapture[9] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy9", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy9 = 2;
- if(CapturedBy != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured the damm!");
- GangZoneHideForAll(D);
- GangZoneShowForAll(DG, COLOR_RED);
- GangZoneHideForAll(DU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -525.5044, 2125.373, -291.9469, 2277.186) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy10 != 1)
- {
- if( IfCapture[10] == 1 ) return 1;
- IfCapture[10] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy10", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy10 = 1;
- if(CapturedBy != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the old town!");
- GangZoneHideForAll(OT);
- GangZoneShowForAll(OTU, COLOR_BLUE);
- GangZoneHideForAll(OTG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }
- else if(IsPlayerInArea(i, -525.5044, 2125.373, -291.9469, 2277.186) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy10 != 2)
- {
- if( IfCapture[10] == 1 ) return 1;
- IfCapture[10] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy10", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy10 = 2;
- if(CapturedBy != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured old town!");
- GangZoneHideForAll(OT);
- GangZoneShowForAll(OTG, COLOR_RED);
- GangZoneHideForAll(OTU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 939.5279, 970.4056, 1169.914, 1187.017) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy11 != 1)
- {
- if( IfCapture[11] == 1 ) return 1;
- IfCapture[11] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy11", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy11 = 1;
- if(CapturedBy != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the University!");
- GangZoneHideForAll(University);
- GangZoneShowForAll(University, COLOR_BLUE);
- GangZoneHideForAll(University);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }else if(IsPlayerInArea(i, 939.5279, 970.4056, 1169.914, 1187.017) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy11 != 2)
- {
- if( IfCapture[11] == 1 ) return 1;
- IfCapture[11] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy11", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy11 = 2;
- if(CapturedBy12 != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured the University!");
- GangZoneHideForAll(University);
- GangZoneShowForAll(UniversityG, COLOR_RED);
- GangZoneHideForAll(UniversityU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 1015.975, 2861.08, 1121.076,2954.502) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy12 != 1)
- {
- if( IfCapture[12] == 1 ) return 1;
- IfCapture[12] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy12", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy12 = 1;
- if(CapturedBy12 != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the OilPump!");
- GangZoneHideForAll(OilPump);
- GangZoneShowForAll(OilPumpU, COLOR_BLUE);
- GangZoneHideForAll(OilPumpG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }else if(IsPlayerInArea(i, 1015.975, 2861.08, 1121.076,2954.502) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy12 != 2)
- {
- if( IfCapture[12] == 1 ) return 1;
- IfCapture[12] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy12", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy12 = 2;
- if(CapturedBy12 != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured the OilPump!");
- GangZoneHideForAll(OilPump);
- GangZoneShowForAll(OilPumpG, COLOR_RED);
- GangZoneHideForAll(OilPumpU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 1015.975, 2861.08, 1121.076,2954.502) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy13 != 1)
- {
- if( IfCapture[13] == 1 ) return 1;
- IfCapture[13] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy13", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy13 = 1;
- if(CapturedBy13 != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the CluckinBell!");
- GangZoneHideForAll(Cluck);
- GangZoneShowForAll(CluckU, COLOR_BLUE);
- GangZoneHideForAll(CluckG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }else if(IsPlayerInArea(i, 1015.975, 2861.08, 1121.076,2954.502) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy13 != 2)
- {
- if( IfCapture[13] == 1 ) return 1;
- IfCapture[13] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy13", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy13 = 2;
- if(CapturedBy13 != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured the CluckinBell!");
- GangZoneHideForAll(Cluck);
- GangZoneShowForAll(CluckG, COLOR_RED);
- GangZoneHideForAll(CluckU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, 210.2018, 2837.724, 326.9805, 2989.536) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy14 != 1)
- {
- if( IfCapture[14] == 1 ) return 1;
- IfCapture[14] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy14", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy14 = 1;
- if(CapturedBy14 != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the BeachShack!");
- GangZoneHideForAll(Beach);
- GangZoneShowForAll(BeachU, COLOR_BLUE);
- GangZoneHideForAll(BeachG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }else if(IsPlayerInArea(i, 210.2018, 2837.724, 326.9805, 2989.536) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy14 != 2)
- {
- if( IfCapture[14] == 1 ) return 1;
- IfCapture[14] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy14", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy14 = 2;
- if(CapturedBy14 != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured the BeachShack!");
- GangZoneHideForAll(Beach);
- GangZoneShowForAll(BeachG, COLOR_RED);
- GangZoneHideForAll(BeachU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerInArea(i, -1985.239, 2277.186, -1845.104, 2440.676) && gTeam[i] == TEAM_USA)
- {
- if(CapturedBy15 != 1)
- {
- if( IfCapture[15] == 1 ) return 1;
- IfCapture[15] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy15", 1);
- uscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy15 = 1;
- if(CapturedBy15 != 2)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the Diner!");
- GangZoneHideForAll(Diner);
- GangZoneShowForAll(DinerU, COLOR_BLUE);
- GangZoneHideForAll(DinerG);
- dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
- CheckForLevelUpdate(i);
- }
- }else if(IsPlayerInArea(i, -1985.239, 2277.186, -1845.104, 2440.676) && gTeam[i] == TEAM_GERMANY)
- {
- if(CapturedBy15 != 2)
- {
- if( IfCapture[15] == 1 ) return 1;
- IfCapture[15] = 0;
- dini_IntSet("/Variables/Variables.ini", "CapturedBy15", 2);
- gscore++;
- //SetTimer("ScoreText", 5000, 0);
- SetPlayerScore(i, GetPlayerScore(i) + 2);
- CapturedBy15 = 2;
- if(CapturedBy15 != 1)SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured the Diner!");
- GangZoneHideForAll(Diner);
- GangZoneShowForAll(DinerG, COLOR_RED);
- GangZoneHideForAll(DinerU);
- dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
- CheckForLevelUpdate(i);
- }
- }
- }
- return 1;
- }
- public SendPlayerFormattedText(playerid, const string[], define)
- {
- new tmpbuf[256];
- format(tmpbuf, sizeof(tmpbuf), string, define);
- SendClientMessage(playerid, 0x8CFFA9FF, tmpbuf);
- }
- SendUSAMessage(color, text[])
- {
- foreach(Player, i)
- {
- if (gTeam[i] == TEAM_USA)
- {
- SendClientMessage(i, color, text);
- }
- }
- return 1;
- }
- SendGERMANYMessage(color, text[])
- {
- foreach(Player, i)
- {
- if (gTeam[i] == TEAM_GERMANY)
- {
- SendClientMessage(i, color, text);
- }
- }
- return 1;
- }
- SendMERCMessage(color, text[])
- {
- foreach(Player, i)
- {
- if (gTeam[i] == TEAM_MERC)
- {
- SendClientMessage(i, color, text);
- }
- }
- return 1;
- }
- SendRUSSIAMessage(color, text[])
- {
- foreach(Player, i)
- {
- if (gTeam[i] == TEAM_RUSSIA)
- {
- SendClientMessage(i, color, text);
- }
- }
- return 1;
- }
- SendJAPANMessage(color, text[])
- {
- foreach(Player, i)
- {
- if (gTeam[i] == TEAM_JAPAN)
- {
- SendClientMessage(i, color, text);
- }
- }
- return 1;
- }
- /*
- SendSquadMessage(teamid, color, text[])
- {
- for(new i = 0; i < MAX_PLAYERS; i ++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerSquad[i] == teamid)
- {
- SendClientMessage(i, color, text);
- }
- }
- }
- return 1;
- }
- */
- stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- return 0;
- }
- forward mission(playerid);
- public mission(playerid)
- {
- if(kills[playerid] != 6)
- {
- SendClientMessage(playerid, COLOR_WHITE, "You failed the mission. . . .");
- }
- return 1;
- }
- RandomPlayerID()
- {
- new playerid, connected;
- for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(playerid) == 1) connected++;
- if(connected == 0) return -1;
- start:
- playerid = random(MAX_PLAYERS);
- if(IsPlayerConnected(playerid) == 0) goto start;
- return playerid;
- }
- forward Hitman(playerid);
- public Hitman(playerid)
- {
- new rand = RandomPlayerID();
- if(gTeam[playerid] == TEAM_USA && gTeam[rand] == TEAM_USA)
- {
- SetTimerEx("Hitman", 100, 0, "i", playerid);
- }
- else if(gTeam[playerid] == TEAM_USA && gTeam[rand] == TEAM_GERMANY)
- {
- new randplayern[MAX_PLAYER_NAME];
- randperson[rand] = GetPlayerName(rand, randplayern, sizeof(randplayern));
- new string[128];
- format(string, sizeof(string), "Find and destroy %s!", randplayern);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- return 1;
- }
- forward HitmanG(playerid);
- public HitmanG(playerid)
- {
- new rand = RandomPlayerID();
- if(gTeam[playerid] == TEAM_GERMANY && gTeam[rand] == TEAM_GERMANY)
- {
- SetTimerEx("HitmanG", 100, 0, "i", playerid);
- }
- else if(gTeam[playerid] == TEAM_GERMANY && gTeam[rand] == TEAM_USA)
- {
- new randplayern[MAX_PLAYER_NAME];
- randperson[rand] = GetPlayerName(rand, randplayern, sizeof(randplayern));
- new string[128];
- format(string, sizeof(string), "Find and destroy %s!", randplayern);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (GetVehicleModel(PlayerBarracks[playerid]) == 433)
- {
- new vehicleid = PlayerBarracks[playerid];
- if (IsInBarracks[playerid] == true)
- {
- if (newkeys & KEY_SECONDARY_ATTACK)
- {
- LastVehicle[playerid] = PlayerBarracks[playerid];
- Barracks[vehicleid][seats] = Barracks[vehicleid][seats] - 1;
- new Float:X,Float:Y,Float:Z,Float:Ang;
- GetVehiclePos(vehicleid, X, Y, Z);
- GetVehicleZAngle(vehicleid, Ang);
- X += (2 * floatsin(-Ang, degrees));
- Y += (2 * floatcos(-Ang, degrees));
- SetPlayerPos(playerid, X, Y, Z);
- X += (2 * floatsin(-(Ang-45.0), degrees));
- Y += (2 * floatcos(-(Ang-45.0), degrees));
- SetPlayerPos(playerid, X, Y, Z);
- SetPlayerFacingAngle(playerid, Ang);
- cbx[playerid] = X;
- cby[playerid] = Y-2;
- cbz[playerid] = Z;
- cba[playerid] = Ang;
- TogglePlayerSpectating(playerid, false);
- SetTimerEx("ExitCB", 500, 0, "i", playerid);
- GivePlayerWeapon(playerid, 46, 1);
- SetCameraBehindPlayer(playerid);
- IsInBarracks[playerid] = false;
- PlayerBarracks[playerid] = 0;
- }
- }
- }
- if (GetVehicleModel(PlayerCargoB[playerid]) == 548|| GetVehicleModel(PlayerCargoB[playerid]) == 563|| GetVehicleModel(PlayerCargoB[playerid]) == 511 )
- {
- new vehicleid = PlayerCargoB[playerid];
- if (IsInCargoB[playerid] == true)
- {
- if (newkeys & KEY_SECONDARY_ATTACK)
- {
- LastVehicle[playerid] = PlayerCargoB[playerid];
- CargoBob[vehicleid][seats] = CargoBob[vehicleid][seats] - 1;
- new Float:X,Float:Y,Float:Z,Float:Ang;
- GetVehiclePos(vehicleid, X, Y, Z);
- GetVehicleZAngle(vehicleid, Ang);
- TogglePlayerSpectating(playerid, false);
- X += (2 * floatsin(-Ang, degrees));
- Y += (2 * floatcos(-Ang, degrees));
- SetPlayerPos(playerid, X, Y, Z);
- X += (2 * floatsin(-(Ang-45.0), degrees));
- Y += (2 * floatcos(-(Ang-45.0), degrees));
- SetPlayerPos(playerid, X, Y, Z);
- SetPlayerFacingAngle(playerid, Ang);
- cbx[playerid] = X;
- cby[playerid] = Y-2;
- cbz[playerid] = Z;
- cba[playerid] = Ang;
- SetTimerEx("ExitCB", 500, 0, "i", playerid);
- SetPlayerFacingAngle(playerid, Ang);
- SetCameraBehindPlayer(playerid);
- IsInCargoB[playerid] = false;
- PlayerCargoB[playerid] = 0;
- }
- }
- }
- if(gPlayerClass[playerid] == DEMOLITION)
- {
- if((newkeys & KEY_CROUCH) && (newkeys & KEY_FIRE) )
- {
- if(pSpawned[playerid] == 1)
- {
- if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- if( hasbombs[playerid] == 1)
- {
- if(Planted[playerid] == 1)
- {
- GivePlayerWeapon(playerid, 40, 1);
- ClearAnimations(playerid);
- ApplyAnimation(playerid,"PED","bomber",4.0,0,0,0,0,1000);
- SetTimerEx("Explode", 1200, 0, "i", playerid);
- SetPlayerArmedWeapon(playerid, 0);
- return 1;
- }
- if(Planted[playerid] == 0)
- {
- GetPlayerPos(playerid, bx[playerid], by[playerid], bz[playerid]);
- C4[playerid] = CreateObject(1252, bx[playerid], by[playerid], bz[playerid]-1, -87.6624853592, 0.000000, 0.000000);
- Planted[playerid] = 1;
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,1000);
- SendClientMessage(playerid,COLOR_YELLOW,"Bomb Planted, Press 'CROUCH + FIRE' to detonate it.");
- return 1;
- }
- } else SendClientMessage(playerid, COLOR_GREY, "You need to be on the explosive class!");
- } else SendClientMessage(playerid,COLOR_GREY,"You cannot plant a bomb in a car");
- } else SendClientMessage(playerid,COLOR_GREY,"You must spawn before planting a bomb");
- }
- }
- return 1;
- }
- public Explode(playerid)
- {
- DestroyObject(C4[playerid]);
- CreateExplosion(bx[playerid], by[playerid], bz[playerid], 6, ExplosionRadius);
- GameTextForPlayer(playerid, "~R~Bomb Detonated", 2000, 3);
- Planted[playerid] = 0;
- return 1;
- }
- public GetClosestPlayer(p1)
- {
- new x,Float:dis,Float:dis2,player;
- player = -1;
- dis = 99999.99;
- for (x=0;x<MAX_PLAYERS;x++)
- {
- if(IsPlayerConnected(x))
- {
- if(x != p1)
- {
- dis2 = GetDistanceBetweenPlayers(x,p1);
- if(dis2 < dis && dis2 != -1.00)
- {
- dis = dis2;
- player = x;
- }
- }
- }
- }
- return player;
- }
- public Float:GetDistanceBetweenPlayers(p1,p2)
- {
- new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
- if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
- {
- return -1.00;
- }
- GetPlayerPos(p1,x1,y1,z1);
- GetPlayerPos(p2,x2,y2,z2);
- return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
- }
- forward Nuke0();
- public Nuke0()
- {
- nuked = 0;
- return 1;
- }
- forward NukeTime(playerid);
- public NukeTime(playerid)
- {
- CreateExplosion(-145.4857,1147.8174,19.5938,7, 20.0);
- CreateExplosion(-115.7963,1196.4725,19.5867,7, 20.0);
- CreateExplosion(-226.5582,1212.7991,19.7422,7, 20.0);
- CreateExplosion(-246.4919,1212.8153,19.7422,7, 20.0);
- CreateExplosion(-230.0679,1191.2112,19.7422,7, 20.0);
- CreateExplosion(-312.4290,1199.8292,19.4117,7, 20.0);
- CreateExplosion(-272.1161,1110.1294,19.2600,7, 20.0);
- CreateExplosion(-10.3318,1094.0081,19.2513, 7, 20.0);
- CreateExplosion(-145.4857,1147.8174,19.5938,7, 20.0);
- CreateExplosion(-115.7963,1196.4725,19.5867,7, 20.0);
- CreateExplosion(-226.5582,1212.7991,19.7422,7, 20.0);
- CreateExplosion(-145.4857,1147.8174,19.5938,7, 20.0);
- CreateExplosion(-115.7963,1196.4725,19.5867,7, 20.0);
- CreateExplosion(-226.5582,1212.7991,19.7422,7, 20.0);
- CreateExplosion(-246.4919,1212.8153,19.7422,7, 20.0);
- CreateExplosion(-230.0679,1191.2112,19.7422,7, 20.0);
- CreateExplosion(-312.4290,1199.8292,19.4117,7, 20.0);
- CreateExplosion(-272.1161,1110.1294,19.2600,7, 20.0);
- CreateExplosion(-10.3318,1094.0081,19.2513, 7, 20.0);
- CreateExplosion(-145.4857,1147.8174,19.5938,7, 20.0);
- CreateExplosion(-115.7963,1196.4725,19.5867,7, 20.0);
- CreateExplosion(-226.5582,1212.7991,19.7422,7, 20.0);
- CreateExplosion(-145.4857,1147.8174,19.5938,7, 20.0);
- CreateExplosion(-115.7963,1196.4725,19.5867,7, 20.0);
- CreateExplosion(-226.5582,1212.7991,19.7422,7, 20.0);
- CreateExplosion(-246.4919,1212.8153,19.7422,7, 20.0);
- CreateExplosion(-230.0679,1191.2112,19.7422,7, 20.0);
- CreateExplosion(-312.4290,1199.8292,19.4117,7, 20.0);
- CreateExplosion(-272.1161,1110.1294,19.2600,7, 20.0);
- CreateExplosion(-10.3318,1094.0081,19.2513, 7, 20.0);
- CreateExplosion(-145.4857,1147.8174,19.5938,7, 20.0);
- CreateExplosion(-115.7963,1196.4725,19.5867,7, 20.0);
- CreateExplosion(-226.5582,1212.7991,19.7422,7, 20.0);
- CreateExplosion(-145.4857,1147.8174,19.5938,7, 20.0);
- CreateExplosion(-115.7963,1196.4725,19.5867,7, 20.0);
- CreateExplosion(-226.5582,1212.7991,19.7422,7, 20.0);
- CreateExplosion(-246.4919,1212.8153,19.7422,7, 20.0);
- CreateExplosion(-230.0679,1191.2112,19.7422,7, 20.0);
- CreateExplosion(-312.4290,1199.8292,19.4117,7, 20.0);
- CreateExplosion(-272.1161,1110.1294,19.2600,7, 20.0);
- CreateExplosion(-10.3318,1094.0081,19.2513, 7, 20.0);
- CreateExplosion(-145.4857,1147.8174,19.5938,7, 20.0);
- CreateExplosion(-115.7963,1196.4725,19.5867,7, 20.0);
- CreateExplosion(-226.5582,1212.7991,19.7422,7, 20.0);
- return 1;
- }
- forward NukeTimeG(playerid);
- public NukeTimeG(playerid)
- {
- CreateExplosion(-224.4260,2609.5977,62.7031,7, 20.0);
- CreateExplosion(-210.4472,2645.1062,63.1548,7, 20.0);
- CreateExplosion(-186.0549,2662.1660,62.6305,7, 20.0);
- CreateExplosion(-187.5771,2690.6819,62.5391,7, 20.0);
- CreateExplosion(-219.6780,2699.8298,62.5391,7, 20.0);
- CreateExplosion(-282.9156,2664.3826,62.6301,7, 20.0);
- CreateExplosion(-296.3685,2666.5051,62.6595,7, 20.0);
- CreateExplosion(-303.6356,2680.3506,62.6317,7, 20.0);
- CreateExplosion(-314.7372,2685.9526,62.6486,7, 20.0);
- CreateExplosion(-224.4260,2609.5977,62.7031,7, 20.0);
- CreateExplosion(-210.4472,2645.1062,63.1548,7, 20.0);
- CreateExplosion(-186.0549,2662.1660,62.6305,7, 20.0);
- CreateExplosion(-187.5771,2690.6819,62.5391,7, 20.0);
- CreateExplosion(-224.4260,2609.5977,62.7031,7, 20.0);
- CreateExplosion(-210.4472,2645.1062,63.1548,7, 20.0);
- CreateExplosion(-186.0549,2662.1660,62.6305,7, 20.0);
- CreateExplosion(-187.5771,2690.6819,62.5391,7, 20.0);
- CreateExplosion(-219.6780,2699.8298,62.5391,7, 20.0);
- CreateExplosion(-282.9156,2664.3826,62.6301,7, 20.0);
- CreateExplosion(-296.3685,2666.5051,62.6595,7, 20.0);
- CreateExplosion(-303.6356,2680.3506,62.6317,7, 20.0);
- CreateExplosion(-314.7372,2685.9526,62.6486,7, 20.0);
- CreateExplosion(-224.4260,2609.5977,62.7031,7, 20.0);
- CreateExplosion(-210.4472,2645.1062,63.1548,7, 20.0);
- CreateExplosion(-186.0549,2662.1660,62.6305,7, 20.0);
- CreateExplosion(-187.5771,2690.6819,62.5391,7, 20.0);
- CreateExplosion(-224.4260,2609.5977,62.7031,7, 20.0);
- CreateExplosion(-210.4472,2645.1062,63.1548,7, 20.0);
- CreateExplosion(-186.0549,2662.1660,62.6305,7, 20.0);
- CreateExplosion(-187.5771,2690.6819,62.5391,7, 20.0);
- CreateExplosion(-219.6780,2699.8298,62.5391,7, 20.0);
- CreateExplosion(-282.9156,2664.3826,62.6301,7, 20.0);
- CreateExplosion(-296.3685,2666.5051,62.6595,7, 20.0);
- CreateExplosion(-303.6356,2680.3506,62.6317,7, 20.0);
- CreateExplosion(-314.7372,2685.9526,62.6486,7, 20.0);
- CreateExplosion(-224.4260,2609.5977,62.7031,7, 20.0);
- CreateExplosion(-210.4472,2645.1062,63.1548,7, 20.0);
- CreateExplosion(-186.0549,2662.1660,62.6305,7, 20.0);
- CreateExplosion(-187.5771,2690.6819,62.5391,7, 20.0);
- CreateExplosion(-224.4260,2609.5977,62.7031,7, 20.0);
- CreateExplosion(-210.4472,2645.1062,63.1548,7, 20.0);
- CreateExplosion(-186.0549,2662.1660,62.6305,7, 20.0);
- CreateExplosion(-187.5771,2690.6819,62.5391,7, 20.0);
- CreateExplosion(-219.6780,2699.8298,62.5391,7, 20.0);
- CreateExplosion(-282.9156,2664.3826,62.6301,7, 20.0);
- CreateExplosion(-296.3685,2666.5051,62.6595,7, 20.0);
- CreateExplosion(-303.6356,2680.3506,62.6317,7, 20.0);
- CreateExplosion(-314.7372,2685.9526,62.6486,7, 20.0);
- CreateExplosion(-224.4260,2609.5977,62.7031,7, 20.0);
- CreateExplosion(-210.4472,2645.1062,63.1548,7, 20.0);
- CreateExplosion(-186.0549,2662.1660,62.6305,7, 20.0);
- CreateExplosion(-187.5771,2690.6819,62.5391,7, 20.0);
- return 1;
- }
- forward HealAgain(playerid);
- public HealAgain(playerid)
- {
- healedrec[playerid] = 0;
- return 1;
- }
- forward SettingPlayerTeam();
- public SettingPlayerTeam()
- {
- foreach(Player, playerid)
- {
- SetPlayerTeam(playerid, gTeam[playerid]);
- }
- return 1;
- }
- forward restorerepair(playerid);
- public restorerepair(playerid)
- {
- repair[playerid] = 0;
- return 1;
- }
- forward restoreammo(playerid);
- public restoreammo(playerid)
- {
- ammoo[playerid] = 0;
- return 1;
- }
- ReturnUser(text[], playerid = INVALID_PLAYER_ID)
- {
- new pos = 0;
- while (text[pos] < 0x21)
- {
- if (text[pos] == 0) return INVALID_PLAYER_ID;
- pos++;
- }
- new userid = INVALID_PLAYER_ID;
- if ((text[pos]))
- {
- userid = strval(text[pos]);
- if (userid >=0 && userid < MAX_PLAYERS)
- {
- if(!IsPlayerConnected(userid))
- userid = INVALID_PLAYER_ID;
- else return userid;
- return playerid;
- }
- }
- new len = strlen(text[pos]);
- new count = 0;
- new pname[MAX_PLAYER_NAME];
- for (new i = 0; i < MAX_PLAYERS; i++)
- {
- if (IsPlayerConnected(i))
- {
- GetPlayerName(i, pname, sizeof (pname));
- if (strcmp(pname, text[pos], true, len) == 0)
- {
- if (len == strlen(pname)) return i;
- else
- {
- count++;
- userid = i;
- }
- }
- }
- }
- if (count != 1)
- {
- if (playerid != INVALID_PLAYER_ID)
- {
- if (count) SendClientMessage(playerid, YELLOW, "There are multiple users, enter full playername.");
- else SendClientMessage(playerid, RED, "Playername not found.");
- }
- userid = INVALID_PLAYER_ID;
- }
- return userid;
- }
- stock IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- if (string[i] > '9' || string[i] < '0')
- return 0;
- return 1;
- }
- stock sscanf(string[], format[], {Float,_}:...)
- {
- #if defined isnull
- if (isnull(string))
- #else
- if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
- #endif
- {
- return format[0];
- }
- #pragma tabsize 4
- new
- formatPos = 0,
- stringPos = 0,
- paramPos = 2,
- paramCount = numargs(),
- delim = ' ';
- while (string[stringPos] && string[stringPos] <= ' ')
- {
- stringPos++;
- }
- while (paramPos < paramCount && string[stringPos])
- {
- switch (format[formatPos++])
- {
- case '\0':
- {
- return 0;
- }
- case 'i', 'd':
- {
- new
- neg = 1,
- num = 0,
- ch = string[stringPos];
- if (ch == '-')
- {
- neg = -1;
- ch = string[++stringPos];
- }
- do
- {
- stringPos++;
- if ('0' <= ch <= '9')
- {
- num = (num * 10) + (ch - '0');
- }
- else
- {
- return -1;
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num * neg);
- }
- case 'h', 'x':
- {
- new
- num = 0,
- ch = string[stringPos];
- do
- {
- stringPos++;
- switch (ch)
- {
- case 'x', 'X':
- {
- num = 0;
- continue;
- }
- case '0' .. '9':
- {
- num = (num << 4) | (ch - '0');
- }
- case 'a' .. 'f':
- {
- num = (num << 4) | (ch - ('a' - 10));
- }
- case 'A' .. 'F':
- {
- num = (num << 4) | (ch - ('A' - 10));
- }
- default:
- {
- return -1;
- }
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num);
- }
- case 'c':
- {
- setarg(paramPos, 0, string[stringPos++]);
- }
- case 'f':
- {
- setarg(paramPos, 0, _:floatstr(string[stringPos]));
- }
- case 'p':
- {
- delim = format[formatPos++];
- continue;
- }
- case '\'':
- {
- new
- end = formatPos - 1,
- ch;
- while ((ch = format[++end]) && ch != '\'') {}
- if (!ch)
- {
- return -1;
- }
- format[end] = '\0';
- if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
- {
- if (format[end + 1])
- {
- return -1;
- }
- return 0;
- }
- format[end] = '\'';
- stringPos = ch + (end - formatPos);
- formatPos = end + 1;
- }
- case 'u':
- {
- new
- end = stringPos - 1,
- id = 0,
- bool:num = true,
- ch;
- while ((ch = string[++end]) && ch != delim)
- {
- if (num)
- {
- if ('0' <= ch <= '9')
- {
- id = (id * 10) + (ch - '0');
- }
- else
- {
- num = false;
- }
- }
- }
- if (num && IsPlayerConnected(id))
- {
- setarg(paramPos, 0, id);
- }
- else
- {
- #if !defined foreach
- #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
- #define __SSCANF_FOREACH__
- #endif
- string[end] = '\0';
- num = false;
- new
- name[MAX_PLAYER_NAME];
- id = end - stringPos;
- foreach (Player, playerid)
- {
- GetPlayerName(playerid, nameee, sizeof (name));
- if (!strcmp(name, string[stringPos], true, id))
- {
- setarg(paramPos, 0, playerid);
- num = true;
- break;
- }
- }
- if (!num)
- {
- setarg(paramPos, 0, INVALID_PLAYER_ID);
- }
- string[end] = ch;
- #if defined __SSCANF_FOREACH__
- #undef foreach
- #undef __SSCANF_FOREACH__
- #endif
- }
- stringPos = end;
- }
- case 's', 'z':
- {
- new
- i = 0,
- ch;
- if (format[formatPos])
- {
- while ((ch = string[stringPos++]) && ch != delim)
- {
- setarg(paramPos, i++, ch);
- }
- if (!i)
- {
- return -1;
- }
- }
- else
- {
- while ((ch = string[stringPos++]))
- {
- setarg(paramPos, i++, ch);
- }
- }
- stringPos--;
- setarg(paramPos, i, '\0');
- }
- default:
- {
- continue;
- }
- }
- while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
- {
- stringPos++;
- }
- while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
- {
- stringPos++;
- }
- paramPos++;
- }
- do
- {
- if ((delim = format[formatPos++]) > ' ')
- {
- if (delim == '\'')
- {
- while ((delim = format[formatPos++]) && delim != '\'') {}
- }
- else if (delim != 'z')
- {
- return delim;
- }
- }
- }
- while (delim > ' ');
- return 0;
- }
- stock CheckForLevelUpdate(playerid)
- {
- if ( GetPlayerScore(playerid) >= 50 )
- {
- if( rank[playerid] < 1 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "*You are a Private!");
- rank[playerid] = 1;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 5000);
- }
- }
- if ( GetPlayerScore(playerid) >= 100 )
- {
- if( rank[playerid] < 2 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "**You are a Corporal!");
- rank[playerid] = 2;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 10000);
- }
- }
- if ( GetPlayerScore(playerid) >= 250 )
- {
- if( rank[playerid] < 3 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "***You are a Sergeant!");
- rank[playerid] = 3;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 15000);
- }
- }
- if ( GetPlayerScore(playerid) >= 500 )
- {
- if( rank[playerid] < 4 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "****You are a Lieutenant!");
- rank[playerid] = 4;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 20000);
- }
- }
- if ( GetPlayerScore(playerid) >= 750 )
- {
- if( rank[playerid] < 5 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "*****You are a Captain!");
- rank[playerid] = 5;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 25000);
- }
- }
- if ( GetPlayerScore(playerid) >= 1000 )
- {
- if( rank[playerid] < 6 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "******You are a Major!");
- SendClientMessage(playerid, COLOR_CON_GREEN,"Congratulations! You recieved all the badges!");
- SendClientMessage(playerid, COLOR_CON_GREEN,"You may still recieve ranks but you will not gain anymore badges.");
- rank[playerid] = 6;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 30000);
- }
- }
- if ( GetPlayerScore(playerid) >= 1250)
- {
- if( rank[playerid] < 7 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "*******You are a Colonel!");
- rank[playerid] = 7;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 35000);
- }
- }
- if ( GetPlayerScore(playerid) >= 1500 )
- {
- if( rank[playerid] < 8 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "********You are a Lieutenant General!");
- rank[playerid] = 8;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 40000);
- }
- }
- if ( GetPlayerScore(playerid) >= 2000 )
- {
- if( rank[playerid] < 9 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "*********You are a Major General!");
- rank[playerid] = 9;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 45000);
- }
- }
- if ( GetPlayerScore(playerid) >= 2250 )
- {
- if( rank[playerid] < 10 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "**********You are a General!");
- rank[playerid] = 10;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 50000);
- }
- }
- if ( GetPlayerScore(playerid) >= 4500 )
- {
- if( rank[playerid] < 11 )
- {
- PlayerPlaySound(playerid, 1150, 0, 0, 0);
- SendClientMessage(playerid, COLOR_CON_GREEN,"You Got Promoted!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "***********You are a the General of The Army!");
- SendClientMessage(playerid, COLOR_CON_GREEN, "Congratulations! You recieved all of the ranks!");
- rank[playerid] = 11;
- SetPlayerWantedLevel(playerid, rank[playerid]);
- GivePlayerMoney(playerid, 100000);
- }
- }
- if( rank[playerid] > 11 ) rank[playerid] = 11;
- return 1;
- }
- stock RestoreClassWeapons(playerid)
- {
- if(gPlayerClass[playerid] == 0)
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 24, 200);
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerWeapon(playerid, 25, 100);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 24, 200);
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerWeapon(playerid, 25, 100);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if(gPlayerClass[playerid] == 1)
- {
- if( rank[playerid] >= 1 )
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 16, 50);
- GivePlayerWeapon(playerid, 36, 5);
- GivePlayerWeapon(playerid, 24, 200);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 16, 50);
- GivePlayerWeapon(playerid, 36, 5);
- GivePlayerWeapon(playerid, 24, 200);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }else SendClientMessage(playerid, COLOR_RED, "You need to be rank 1 to be able to use Demolition !");
- }
- if(gPlayerClass[playerid] == 2)
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if(gPlayerClass[playerid] == 3)
- {
- if(gTeam[playerid] == TEAM_JAPAN || gTeam[playerid] == TEAM_RUSSIA)
- {
- SendClientMessage(playerid, COLOR_GREY, "You cant be a pilot on russia or japan!");
- TogglePlayerControllable(playerid, 1);
- return 1;
- }
- if(rank[playerid] >= 3)
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 22, 50);
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 22, 50);
- }
- }
- }
- if(gPlayerClass[playerid] == 4)
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 1, 1);
- SetPlayerSkin(playerid, 275);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- SetPlayerSkin(playerid, 70);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if(gPlayerClass[playerid] == 5)
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 29, 200);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 29, 200);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if( gPlayerClass[playerid] == 6 ) //pyro
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- GivePlayerWeapon(playerid, 16, 20);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 37, 550);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- GivePlayerWeapon(playerid, 16, 20);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 23, 200);
- GivePlayerWeapon(playerid, 37, 550);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if( gPlayerClass[playerid] == 7 )//Esploratore
- {
- if(gTeam[playerid] == TEAM_USA)
- {
- SetPlayerArmour(playerid, 25);
- GivePlayerWeapon(playerid, 28, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 200);
- }else
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- SetPlayerArmour(playerid, 25);
- GivePlayerWeapon(playerid, 28, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 22, 200);
- }else if( gTeam[playerid] == TEAM_RUSSIA || gTeam[playerid] == TEAM_JAPAN )
- {
- GivePlayerWeapon(playerid, 34, 200);
- GivePlayerWeapon(playerid, 1, 1);
- GivePlayerWeapon(playerid, 24, 200);
- }
- }
- if( gPlayerClass[playerid] == ADMIN )
- {
- GivePlayerWeapon(playerid, 38, 20000);
- GivePlayerWeapon(playerid, 22, 20000);
- SetPlayerArmour(playerid, 100);
- }
- if(gPlayerClass[playerid] == GENERAL)
- {
- SetPlayerArmour(playerid, 95);
- GivePlayerWeapon(playerid, 31, 200);
- GivePlayerWeapon(playerid, 27, 200);
- GivePlayerWeapon(playerid, 28, 200);
- }
- return 1;
- }
- stock PlayerName(playerid)
- {
- new UserName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, UserName, sizeof(UserName));
- return UserName;
- }
- stock bigstrtok(const string[], &idx)
- {
- new length = strlen(string);
- while ((idx < length) && (string[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[128];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = string[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- return result;
- }
- public SendClientMessageToAdmins(color,string[],alevel)
- {
- foreach(Player, i)
- {
- if (adminlevel[i] >= alevel)
- {
- SendClientMessage(i, color, string);
- printf("%s", string);
- }
- }
- return 1;
- }
- public BanLog(string[])
- {
- new entry[128];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("ban.log", io_append);
- if (hFile)
- {
- fwrite(hFile, entry);
- fclose(hFile);
- }
- }
- OnPlayerJailed(playerid)
- {
- SetPlayerInterior(playerid, 6);
- SetPlayerPos(playerid, 264.3700,77.5700,1001.0391);
- SetPlayerFacingAngle(playerid, 272.6900);
- TogglePlayerControllable(playerid, 0);
- return 1;
- }
- OnPlayerUnjailed(playerid)
- {
- SetPlayerInterior(playerid, 0);
- SpawnPlayer(playerid);
- return 1;
- }
- public Message()
- {
- SendClientMessageToAll(WHITE, "If you want your stats, including deaths and kills to be saved type /register [password]");
- return 1;
- }
- public RankRefresh()
- {
- //rank refresh
- foreach(Player, i)
- {
- if( GetPlayerWantedLevel(i) != rank[i] ) SetPlayerWantedLevel(i, rank[i]);
- }
- return 0;
- }
- stock cTogglePlayerSpectating(playerid, bool:tg)
- {
- TogglePlayerSpectating(playerid, tg);
- if( tg == 0 )
- {
- SetPlayerPos(playerid, PlayerSpec[playerid][Xspc], PlayerSpec[playerid][Yspc], PlayerSpec[playerid][Zspc]);
- PlayerSpec[playerid] = 0;
- SetPlayerInterior(playerid, PlayerSpec[playerid][intspc]);
- }
- else if( tg == 1 )
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- PlayerSpec[playerid][intspc] = GetPlayerInterior(playerid);
- PlayerSpec[playerid][Xspc] = X;
- PlayerSpec[playerid][Yspc] = Y;
- PlayerSpec[playerid][Zspc] = Z;
- PlayerSpec[playerid][is] = 1;
- }
- return 1;
- }
- stock AddIpToList(playerid, reason[])
- {
- new ip[50];
- GetPlayerIp(playerid, ip, sizeof(ip));
- new entry[128];
- format(entry, sizeof(entry), "%s - %s\r\n", ip, reason);
- new File:hFile;
- hFile = fopen("bannedips.cfg", io_append);
- if (hFile)
- {
- fwrite(hFile, entry);
- fclose(hFile);
- }
- return 1;
- }
- stock CheckForJetpackHack(playerid)
- {
- if( adminlevel[playerid] > 0 )
- {
- }else
- {
- GetPlayerName(playerid, nameee, 16);
- new strr[100];
- format(strr, 100, "*ANTI-HACK: Player %s has been banned for JETPACK !", nameee);
- SendClientMessageToAll(COLOR_RED, strr);
- new IP[50]; GetPlayerIp(playerid, IP, 50);
- printf("%s | (%i)%s has been banned for usage of JETPACK", IP, playerid, nameee);
- if( GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK ) BanEx(playerid, "Jetpack Ban");
- return 1;
- }
- return 1;
- }
- stock CheckForMinigun(playerid)
- {
- if( adminlevel[playerid] < 1 )
- {
- if( GetPlayerWeapon(playerid) == 38 )
- {
- GetPlayerName(playerid, nameee, 16);
- new strr[100];
- format(strr, 100, "*ANTI-HACK: Player %s has been banned for MINIGUN !", nameee);
- SendClientMessageToAll(COLOR_RED, strr);
- BanEx(playerid, "Minigun Ban");
- }
- }
- return 1;
- }
- /*
- stock GetTeamColor(playerid)
- {
- new color;
- if(gTeam[playerid] == TEAM_USA)
- {
- color = COLOR_BLUE;
- }
- if(gTeam[playerid] == TEAM_GERMANY)
- {
- color = COLOR_RED;
- }
- if(gTeam[playerid] == TEAM_RUSSIA)
- {
- color = COLOR_ORANGE;
- }
- if(gTeam[playerid] == TEAM_JAPAN)
- {
- color = COLOR_WHITE;
- }
- if(gTeam[playerid] == TEAM_MERC)
- {
- color = COLOR_YELLOW;
- }
- return color;
- }
- */
- Vip(playerid)
- {
- new ArmiVip;
- ArmiVip = dini_Int(udb_encode(playername), "ArmiVip");
- if(ArmiVip == 1)
- {
- SetPlayerArmour(playerid, 100);
- }
- return 1;
- }
- stock GetAdminLevel(playerid)
- {
- return adminlevel[playerid];
- }
- stock GetFileDataFromSelectLine(filename[], line, result[])
- {
- new File:FileHandle;
- new LineData[1024 char];
- new LoadCount = 0;
- if(!fexist(filename))
- {
- printf("Could not open \"%s\" ",filename);
- return false;
- }
- FileHandle = fopen(filename, io_read);
- while(fread(FileHandle, LineData))
- {
- if(LoadCount == (line - 1))
- {
- if(LineData[0] == 0)
- {
- continue;
- }
- if((LineData[strlen(LineData) - 1] == '\n') || (LineData[strlen(LineData) - 1] == '\r'))
- {
- LineData[strlen(LineData) - 1] = 0;
- if((LineData[strlen(LineData) - 2] == '\n') || (LineData[strlen(LineData) - 2] == '\r'))
- {
- LineData[strlen(LineData) - 2] = 0;
- }
- if(LineData[0] == 0)
- {
- continue;
- }
- }
- format(result, sizeof(LineData), "%s", LineData);
- fclose(FileHandle);
- return true;
- }
- LoadCount += 1;
- }
- fclose(FileHandle);
- return false;
- }
- stock GetPlayerSpeed(playerid)
- {
- new v;
- for(new i=0;i<MAX_CHECKS;i++)
- v+=Speed[playerid][i];
- v/=MAX_CHECKS;
- return v;
- }
- stock IsPlayerInPlane(playerid)
- {
- new m=GetVehicleModel(GetPlayerVehicleID(playerid));
- for(new i=0;i<sizeof(Planes);i++)
- if(m==Planes[i])
- return true;
- return false;
- }
- public MutePlayer(playerid,time,reason[])
- {
- if(IsPlayerConnected(playerid) && time)
- {
- Muted[playerid]=time;
- new string[128];
- format(string, sizeof(string), "Muting player '%s' (%d) for %d second(s). Reason: %s", ReturnPlayerName(playerid),playerid,time,reason);
- return 1;
- }
- return 0;
- }
- public SpamUpdate()
- {
- new reason[64];
- foreach(Player, i)
- {
- if(Messages[i])
- {
- if(!Muted[i])
- {
- if(Messages[i]>15)
- {
- format(reason,sizeof(reason),"Extreme spam [%d messages/second]",Messages[i]);
- SendClientMessageToAll(RED, reason);
- Kick(i);
- continue;
- }
- else if(Messages[i]>10)
- {
- format(reason,sizeof(reason),"Massive spam [%d messages/second]",Messages[i]);
- SendClientMessageToAll(RED, reason);
- Kick(i);
- continue;
- }
- else if(Messages[i]>4)
- {
- format(reason,sizeof(reason),"Spam [%d messages/second]",Messages[i]);
- SendClientMessageToAll(RED, reason);
- MutePlayer(i,2*60,reason);
- }
- Messages[i]--;
- }
- if(Commands[i])
- {
- if(Commands[i]>15)
- {
- format(reason,sizeof(reason),"Extreme command spam [%d commands/second]",Commands[i]);
- SendClientMessageToAll(RED, reason);
- Kick(i);
- continue;
- }
- else if(Commands[i]>5)
- {
- format(reason,sizeof(reason),"Massive command spam [%d commands/second]",Commands[i]);
- SendClientMessageToAll(RED, reason);
- Kick(i);
- continue;
- }
- Commands[i]--;
- }
- }
- }
- return 1;
- }
- stock ReturnPlayerName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- return name;
- }
- stock GetPlayerSpeedSpeedo(playerid, bool:kmh) // by misco
- {
- new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
- if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
- rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
- return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
- }
- public VHPBarUpdate()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- TextDrawHideForPlayer(i,vehiclehpbar[0]);
- TextDrawHideForPlayer(i,vehiclehpbar[1]);
- TextDrawHideForPlayer(i,vehiclehpbar[2]);
- TextDrawHideForPlayer(i,vehiclehpbar[3]);
- TextDrawHideForPlayer(i,vehiclehpbar[4]);
- TextDrawHideForPlayer(i,vehiclehpbar[5]);
- TextDrawHideForPlayer(i,vehiclehpbar[6]);
- TextDrawHideForPlayer(i,vehiclehpbar[7]);
- TextDrawHideForPlayer(i,vehiclehpbar[8]);
- TextDrawHideForPlayer(i,vehiclehpbar[9]);
- TextDrawHideForPlayer(i,vehiclehpbar[10]);
- TextDrawHideForPlayer(i,vehiclehpbar[11]);
- if(IsPlayerInAnyVehicle(i) == 1)
- {
- new vehicleid;
- vehicleid = GetPlayerVehicleID(i);
- new Float:vhp;
- GetVehicleHealth(vehicleid,vhp);
- if(vhp >= 0 && vhp <= 249)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[0]);
- }
- if(vhp >= 250 && vhp <= 317)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[1]);
- }
- else if(vhp >= 318 && vhp <= 385)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[2]);
- }
- else if(vhp >= 386 && vhp <= 453)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[3]);
- }
- else if(vhp >= 454 && vhp <= 521)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[4]);
- }
- else if(vhp >= 522 && vhp <= 589)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[5]);
- }
- else if(vhp >= 590 && vhp <= 657)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[6]);
- }
- else if(vhp >= 658 && vhp <= 725)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[7]);
- }
- else if(vhp >= 726 && vhp <= 793)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[8]);
- }
- else if(vhp >= 794 && vhp <= 861)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[9]);
- }
- else if(vhp >= 862 && vhp <= 929)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[10]);
- }
- else if(vhp >= 930 && vhp <= 1000)
- {
- TextDrawShowForPlayer(i,vehiclehpbar[11]);
- }
- }
- }
- return 1;
- }
- #define TogglePlayerSpectating cTogglePlayerSpectating
Advertisement
Add Comment
Please, Sign In to add comment