· 9 years ago · Oct 30, 2016, 07:38 AM
1
2#define GM_NAME "A/D - Attack/Defense"
3
4#include <a_samp>
5#include <foreach>
6#include <zcmd>
7#include <geolocation>
8#include <strlib>
9#include <Dini>
10#include <progress2>
11#include <sscanf2>
12
13//================================= Definitions ================================
14
15#define NONTEAM 0
16#define GREENTEAM 1
17#define BLUETEAM 2
18
19#define GREEN_COLOR 0xFF3333FF
20#define BLUE_COLOR 0x0080FF44
21#define YELLOW_COLOR 0xFFFF00FF
22#define RED_COLOR 0xFF3333FF
23#define AC_COLOR 0xFF6600FF
24#define ADMIN_COLOR 0x88FFBBFF
25
26#define COLOR_ORANGE 0xFF9900AA
27#define COLOR_LIME 0x10F441AA
28
29#define DRAW_DISTANCE 20
30#define MAX_TEAMS 3
31#define MAX_INI_ENTRY_TEXT 80
32#define MAPLISTFILE "Maps/1maplist.ini"
33
34#define PUNCH 0
35#define DEAGLE 24
36#define SHOTGUN 25
37#define SPAS 27
38#define MP5 29
39#define AK47 30
40#define M4 31
41#define RIFLE 33
42#define SNIPER 34
43#define GRENADE 16
44
45#define DIALOG_HELPS 1
46#define DIALOG_LOGIN 2
47#define DIALOG_REGISTER 3
48#define DIALOG_MAPNAME 4
49#define DIALOG_MAPPERNAME 5
50#define DIALOG_REWARDS 6
51
52#define RADIO1 "http://yp.shoutcast.com/sbin/tunein-station.pls?id=53630"
53#define RADIO2 "http://yp.shoutcast.com/sbin/tunein-station.pls?id=31645"
54#define RADIO3 "http://yp.shoutcast.com/sbin/tunein-station.pls?id=12337"
55#define RADIO4 "http://yp.shoutcast.com/sbin/tunein-station.pls?id=914897"
56#define RADIO5 "http://yp.shoutcast.com/sbin/tunein-station.pls?id=611786"
57#define RADIO6 "http://cent4.serverhostingcenter.com/tunein.php/theaebn/playlist.pls"
58
59//1=Hardcore NL, 2=ChartHits, 3=MUSIK.MAIN, 4=idobi, 5=181.FM Hiphop, 6=Indian Radio HSL
60
61
62//================================== Variables =================================
63enum PlayerVariables
64{
65 Name[MAX_PLAYER_NAME],
66 DLlast,
67 FPS,
68 Team,
69 LastHitWith, //antide
70 LastHitBy, //antide
71 LastKilled, //tbag
72 Level,
73 ClassID,
74 Kills,
75 Deaths,
76 RKills,
77 RDeaths,
78 Float:RDamage,
79 Score,
80 Spree,
81 VIP,
82 MaxRoundKills,
83 Float:MaxRoundDamage,
84 Headshots,
85 Tbags,
86 PunchK,
87 DeagleK,
88 ShotgunK,
89 SpasK,
90 MP5K,
91 Rank,
92 AK47K,
93 M4K,
94 RifleK,
95 SniperK,
96 GrenadeK,
97 Gun2,
98 Gun3,
99 Gun4,
100 Gun5,
101 Gun6,
102 BlockedID,
103 LastMessager,
104 FPSWarning,
105 PingWarning,
106 PLWarning,
107 SpecID,
108 bool:UnlockedEagleEye,
109 bool:UnlockedMP5,
110 bool:UnlockedSpas,
111 bool:UnlockedSniper,
112 bool:UnlockedAK47,
113 bool:UnlockedM4,
114 bool:UnlockedGrenade,
115 bool:UnlockedCigar,
116 bool:UnlockedHorns,
117 bool:UnlockedFlame,
118 bool:TableOnScreen,
119 bool:Mapping,
120 bool:Logged,
121 bool:Syncing,
122 bool:Muted,
123 bool:Spawned,
124 bool:IsKicked,
125 bool:BlockedAll,
126 bool:ChangedWeather,
127 bool:OnMenu,
128 bool:SafeJetpack,
129 bool:SafeGun,
130 bool:Specing,
131 bool:Checking
132}
133
134new DB:sqliteconnection;
135new ChatString[128];
136new AKAString[512];
137new Player[MAX_PLAYERS][PlayerVariables];
138new TextColor[MAX_TEAMS][10];
139new TDColor[MAX_TEAMS][10];
140new gLastHit[6][MAX_PLAYERS];
141new TakeDmgCD[6][MAX_PLAYERS];
142new Float:DamageDone[6][MAX_PLAYERS];
143
144
145new DB:bans;
146
147new Menu:MapMenu;
148new CreateFileString[256];
149new TempZone;
150new Float:TempMax[2];
151new Float:TempMin[2];
152new Float:GSpawn1[4] = {1544.1759, -1352.7307, 329.4753, 0.0000};
153new Float:GSpawn2[4] = {1544.1759, -1352.7307, 329.4753, 0.0000};
154new Float:GSpawn3[4] = {1544.1759, -1352.7307, 329.4753, 0.0000};
155new Float:BSpawn1[4] = {1544.1759, -1352.7307, 329.4753, 0.0000};
156new Float:BSpawn2[4] = {1544.1759, -1352.7307, 329.4753, 0.0000};
157new Float:BSpawn3[4] = {1544.1759, -1352.7307, 329.4753, 0.0000};
158new MapZone;
159new Float:Min[2];
160new Float:Max[2];
161new MapInterior = 0;
162new MapFileName[64];
163new MapName[64];
164new MapperName[64];
165new CurrentMap;
166new MapObjects[2000];
167new AllowEnter = 1;
168new EndTime;
169new MinFPS = 4;
170new MaxPing = 1200;
171new Float:MaxPL = 31.0;
172
173new GKills;
174new BKills;
175new bool:ServerLocked = false;
176
177//easter
178
179new Float:EasterX = 0.0;
180new Float:EasterY = 0.0;
181new Text3D:EasterText;
182new bool:EggFound = false;
183
184new Text3D:BodyStuffs[MAX_PLAYERS];
185new Text3D:VIPStuffs[MAX_PLAYERS];
186
187// -- BC Setup --
188#define BC_MODEL 1210
189new BCID;
190// -- End --
191
192// -- By fakeD
193#pragma tabsize 0
194#define GivePlayerScore(%0,%1) SetPlayerScore(%0,GetPlayerScore(%0) + %1)
195
196
197new aVehicleNames[212][] =
198{
199 {"Landstalker"}, {"Bravura"}, {"Buffalo"}, {"Linerunner"}, {"Perrenial"}, {"Sentinel"}, {"Dumper"},
200 {"Firetruck"}, {"Trashmaster"}, {"Stretch"}, {"Manana"}, {"Infernus"}, {"Voodoo"}, {"Pony"}, {"Mule"},
201 {"Cheetah"}, {"Ambulance"}, {"Leviathan"}, {"Moonbeam"}, {"Esperanto"}, {"Taxi"}, {"Washington"},
202 {"Bobcat"}, {"Mr Whoopee"}, {"BF Injection"}, {"Hunter"}, {"Premier"}, {"Enforcer"}, {"Securicar"},
203 {"Banshee"}, {"Predator"}, {"Bus"},{"Rhino"}, {"Barracks"}, {"Hotknife"}, {"Artic Trailer 1"}, {"Previon"},
204 {"Coach"}, {"Cabbie"}, {"Stallion"}, {"Rumpo"}, {"RC Bandit"}, {"Romero"}, {"Packer"}, {"Monster"},
205 {"Admiral"}, {"Squalo"}, {"Seasparrow"}, {"Pizzaboy"}, {"Tram"}, {"Artic Trailer 2"}, {"Turismo"},
206 {"Speeder"}, {"Reefer"}, {"Tropic"}, {"Flatbed"}, {"Yankee"}, {"Caddy"}, {"Solair"}, {"Berkley's RC Van"},
207 {"Skimmer"}, {"PCJ-6_0_0"}, {"Faggio"}, {"Freeway"}, {"RC Baron"}, {"RC Raider"}, {"Glendale"}, {"Oceanic"},
208 {"Sanchez"}, {"Sparrow"}, {"Patriot"}, {"Quad"}, {"Coastguard"}, {"Dinghy"}, {"Hermes"}, {"Sabre"},
209 {"Rustler"}, {"ZR-3_5_0"}, {"Walton"}, {"Regina"}, {"Comet"},{"BMX"}, {"Burrito"}, {"Camper"}, {"Marquis"},
210 {"Baggage"}, {"Dozer"}, {"Maverick"}, {"News Chopper"}, {"Rancher"}, {"FBI Rancher"}, {"Virgo"}, {"Greenwood"},
211 {"Jetmax"}, {"Hotring"}, {"Sandking"}, {"Blista Compact"}, {"Police Maverick"},{"Boxville"}, {"Benson"},
212 {"Mesa"}, {"RC Goblin"}, {"Hotring Racer A"}, {"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
213 {"Super GT"}, {"Elegant"}, {"Journey"}, {"Bike"}, {"Mountain Bike"}, {"Beagle"}, {"Cropdust"}, {"Stunt"},
214 {"Tanker"}, {"Roadtrain"}, {"Nebula"}, {"Majestic"}, {"Buccaneer"}, {"Shamal"}, {"Hydra"}, {"FCR-900"},
215 {"NRG-500"}, {"HPV1000"}, {"Cement Truck"}, {"Tow Truck"}, {"Fortune"}, {"Cadrona"}, {"FBI Truck"},
216 {"Willard"}, {"Forklift"}, {"Tractor"}, {"Combine"}, {"Feltzer"}, {"Remington"}, {"Slamvan"},
217 {"Blade"}, {"Freight"}, {"Streak"}, {"Vortex"}, {"Vincent"}, {"Bullet"}, {"Clover"}, {"Sadler"},
218 {"Firetruck LA"}, {"Hustler"}, {"Intruder"}, {"Primo"}, {"Cargobob"}, {"Tampa"}, {"Sunrise"}, {"Merit"},
219 {"Utility"}, {"Nevada"}, {"Yosemite"}, {"Windsor"}, {"Monster A"}, {"Monster B"}, {"Uranus"}, {"Jester"},
220 {"Sultan"}, {"Stratum"}, {"Elegy"}, {"Raindance"}, {"RC Tiger"}, {"Flash"}, {"Tahoma"}, {"Savanna"},
221 {"Bandito"}, {"Freight Flat"}, {"Streak Carriage"}, {"Kart"}, {"Mower"}, {"Duneride"}, {"Sweeper"},
222 {"Broadway"}, {"Tornado"}, {"AT-400"}, {"DFT-30"}, {"Huntley"}, {"Stafford"}, {"BF-400"}, {"Newsvan"},
223 {"Tug"}, {"Chemical Trailer"}, {"Emperor"}, {"Wayfarer"}, {"Euros"}, {"Hotdog"}, {"Club"}, {"Freight Carriage"},
224 {"Artic Trailer 3"}, {"Andromada"}, {"Dodo"}, {"RC Cam"}, {"Launch"}, {"Police Car LSPD"},{"Police Car SFPD"},
225 {"Police _LVPD"}, {"Police Ranger"}, {"Picador"}, {"Blue Van"}, {"Alpha"}, {"Phoenix"}, {"Glendale"},
226 {"Sadler"}, {"Luggage Trailer A"}, {"Luggage Trailer B"}, {"Stair Trailer"},{"Boxville"}, {"Farm Plow"},
227 {"Utility Trailer"}
228};
229
230new WeaponNames[55][] =
231{
232 {"Punch"},{"Brass Knuckles"},{"Golf Club"},{"Nite Stick"},{"Knife"},{"Baseball Bat"},{"Shovel"},{"Pool Cue"},{"Katana"},{"Chainsaw"},{"Purple Dildo"},
233 {"Smal White Vibrator"},{"Large White Vibrator"},{"Silver Vibrator"},{"Flowers"},{"Cane"},{"Grenade"},{"Tear Gas"},{"Molotov Cocktail"},
234 {""},{""},{""},
235 {"9mm"},{"Silenced 9mm"},{"Deagle"},{"Shotgun"},{"Sawn-off"},{"Combat"},{"Micro SMG"},{"MP5"},{"AK-47"},{"M4"},{"Tec9"},
236 {"Rifle"},{"Sniper"},{"Rocket"},{"HS Rocket"},{"Flamethrower"},{"Minigun"},{"Satchel Charge"},{"Detonator"},
237 {"Spraycan"},{"Fire Extinguisher"},{"Camera"},{"Nightvision Goggles"},{"Thermal Goggles"},{"Parachute"}, {"Fake Pistol"},{""}, {"Vehicle"}, {"Helicopter Blades"},
238 {"Explosion"}, {""}, {"Suicide"}, {"Collision"}
239};
240
241
242//================================= Textdraws ==================================
243
244new Text: WebTextTD;
245new Text: BalanceTD;
246new Text: ScoreTableTD[6];
247new Text: RoundStatsTD;
248
249new PlayerText: Textdraw0;
250new PlayerText: Textdraw1;
251new PlayerText: Textdraw2;
252new PlayerText: Textdraw3;
253new PlayerText: Textdraw4;
254new PlayerText: Textdraw5;
255new PlayerText: Textdraw6;
256new PlayerText: Textdraw7;
257new PlayerText: Textdraw8;
258
259
260
261new PlayerText: GboxTD;
262new PlayerText: GunTypes;
263new PlayerText: GunNames1;
264new PlayerText: GunNames2;
265new PlayerText: GunNames3;
266new PlayerText: ExitTD;
267new PlayerText: G1TD;
268new PlayerText: G2TD;
269new PlayerText: G2bTD;
270new PlayerText: G30TD;
271new PlayerText: G3TD;
272new PlayerText: G3bTD;
273new PlayerText: G40TD;
274new PlayerText: G4TD;
275new PlayerText: G5TD;
276new PlayerText: G5bTD;
277new PlayerText: G60TD;
278new PlayerText: G6TD;
279
280new PlayerBar: Bar1;
281
282new PlayerText: FPSPingPacket;
283new PlayerText: DoingDamage[3];
284new PlayerText: GettingDamaged[3];
285new PlayerText: DeathText[2];
286new PlayerText: ScoreTD;
287new PlayerText: Ann1TD;
288new PlayerText: Ann2TD;
289new PlayerText: AInfoTD;
290new PlayerText: HideTD;
291new PlayerText: AchTD;
292
293//=================================== Main =====================================
294
295main() {}
296
297public OnGameModeInit()
298{
299 UsePlayerPedAnims();
300 AllowInteriorWeapons(1);
301 DisableInteriorEnterExits();
302 EnableStuntBonusForAll(0);
303 SetNameTagDrawDistance(DRAW_DISTANCE);
304 EnableVehicleFriendlyFire();
305 SetGameModeText(GM_NAME);
306 LoadMainTextDraws();
307
308 TextColor[NONTEAM] = "{DDDDDD}";
309 TextColor[GREENTEAM] = "{55FF55}";
310 TextColor[BLUETEAM] = "{0080FF}";
311
312 TDColor[NONTEAM] = "~w~";
313 TDColor[GREENTEAM] = "~R~~H~~H~";
314 TDColor[BLUETEAM] = "~b~~h~~h~";
315
316 BCID = -1;
317
318 LoadNextMap();
319
320 SetTimer("OnScriptUpdate", 1000, true);
321 SetTimer("UpdateTeamBalance", 3000, true);
322 SetTimer("SaveTimer", 3000, true);
323
324 db_close(sqliteconnection);
325 sqliteconnection = db_open("1HK.db");
326
327 AddPlayerClassEx(GREENTEAM, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //green granny
328 AddPlayerClassEx(GREENTEAM, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //green barber like guy
329 AddPlayerClassEx(GREENTEAM, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //green shorts beach guy
330 AddPlayerClassEx(GREENTEAM, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //green Helena girl
331
332 AddPlayerClassEx(BLUETEAM, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //blue hobo
333 AddPlayerClassEx(BLUETEAM, 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //blue barber blonde
334 AddPlayerClassEx(BLUETEAM, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //blue shorts beach guy
335 AddPlayerClassEx(BLUETEAM, 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //blue farmer girl
336
337 bans = db_open("BanList.db");
338 db_query(bans, "CREATE TABLE IF NOT EXISTS `BANNED` (`NAME`, `IP`, `REASON`, `ADMIN`, `DATE`, `TIME`)");
339
340
341//53 250 45 191 230 177 154 198
342 return 1;
343}
344
345forward OnScriptUpdate();
346public OnScriptUpdate()
347{
348 ACChecks();
349
350 new iString[160];
351
352 new Float:HP;
353 foreach(new i : Player)
354 {
355 if(IsPlayerConnected(i) && Player[i][Spawned] == true && Player[i][Mapping] == false && Player[i][TableOnScreen] == false && EndTime > 0 && Player[i][Specing] == false)
356 {
357 GetPlayerHealth(i, HP);
358 if( (IsPlayerInArea(i,Min[0]-25, Max[0]+25, Min[1]-25, Max[1]+25) != 1) && HP > 0)
359 {
360 SetPlayerHealth(i, HP-5);
361 GameTextForPlayer(i, "~r~~h~Stay inside map boundaries ~n~~w~or you will be killed!", 1000, 3);
362 }
363 }
364
365 if(Player[i][Specing] == true)
366 {
367 UpdateAInfo(i);
368 PlayerTextDrawShow(i, AInfoTD);
369 }
370
371 if(Player[i][Checking] == true)
372 {
373 UpdateAInfo(i);
374 PlayerTextDrawShow(i, AInfoTD);
375 PlayerTextDrawShow(i, HideTD);
376 }
377
378 if(Player[i][Specing] == false && Player[i][Checking] == false)
379 {
380 PlayerTextDrawHide(i, AInfoTD);
381 PlayerTextDrawHide(i, HideTD);
382 }
383
384 new Float:x, Float:y, Float:z;
385 new tbagged = Player[i][LastKilled];
386
387 GetPlayerPos(tbagged, x, y, z);
388
389 if(IsPlayerInArea(i, x-2, x+2, y-2, y+2) && GetPlayerSpecialAction(i) == SPECIAL_ACTION_DUCK)
390 {
391 format(iString, sizeof(iString), "%s%s {FFFF00}has t-bagged %s%s{FFFF00} to refill his ammo!", TextColor[Player[i][Team]], Player[i][Name], TextColor[Player[tbagged][Team]], Player[tbagged][Name]);
392 SendClientMessageToAll(YELLOW_COLOR, iString);
393 GiveScore(i, 5);
394 GivePlayerMoney(i, 4000);
395 Player[i][Tbags]++;
396 switch(Player[i][Team])
397 {
398 case GREENTEAM: SendClientMessage(i, GREEN_COLOR, "+5 Score for t-bagging!");
399 case BLUETEAM: SendClientMessage(i, BLUE_COLOR, "+5 Score for t-bagging!");
400 }
401 Player[i][LastKilled] = -1;
402
403 new Weapon[13], Ammo[13], InHandID = GetPlayerWeapon(i);
404
405 for(new k = 0; k < 13; k++) GetPlayerWeaponData(i, k, Weapon[k], Ammo[k]);
406
407 if(Player[i][VIP] == 1)
408 {
409 if(Ammo[2] < 200) SetPlayerAmmo(i, DEAGLE, 200); //deagle
410 if(Ammo[3] < 200) SetPlayerAmmo(i, Player[i][Gun2], 200); //shotgun
411 if(Ammo[4] < 200) SetPlayerAmmo(i, Player[i][Gun3], 400); //ak
412 if(Ammo[5] < 400) SetPlayerAmmo(i, Player[i][Gun4], 200); //mp5
413 if(Ammo[6] < 200) SetPlayerAmmo(i, Player[i][Gun5], 200); //sniper
414 if(Ammo[8] < 2) SetPlayerAmmo(i, Player[i][Gun6], 2); //grenade
415 }
416 else if(Player[i][VIP] == 0)
417 {
418 if(Ammo[2] < 100) SetPlayerAmmo(i, DEAGLE, 100); //deagle
419 if(Ammo[3] < 100) SetPlayerAmmo(i, Player[i][Gun2], 100); //shotgun
420 if(Ammo[4] < 100) SetPlayerAmmo(i, Player[i][Gun3], 200); //ak
421 if(Ammo[5] < 200) SetPlayerAmmo(i, Player[i][Gun4], 100); //mp5
422 if(Ammo[6] < 100) SetPlayerAmmo(i, Player[i][Gun5], 100); //sniper
423 if(Ammo[8] == 0) SetPlayerAmmo(i, Player[i][Gun6], 1); //grenade
424 }
425
426 SetPlayerArmedWeapon(i, InHandID);
427
428 if( Player[i][Tbags] == 5 || Player[i][Tbags] == 10 || Player[i][Tbags] == 15 ||
429 Player[i][Tbags] == 20 || Player[i][Tbags] == 25 || Player[i][Tbags] == 30 ||
430 Player[i][Tbags] == 35 || Player[i][Tbags] == 40 || Player[i][Tbags] == 45 ||
431 Player[i][Tbags] == 49 )
432 {
433 format(iString, sizeof(iString), "Balls of Steel~n~~n~%d / 50 T-bags", Player[i][Tbags]);
434 ShowAch(i, iString, Player[i][Tbags], 50);
435 }
436
437 if(Player[i][Tbags] == 50 && Player[i][UnlockedHorns] == false)
438 {
439 SendClientMessage(i, YELLOW_COLOR, "Horns unlocked! You will spawn with horns next time");
440 PlayerPlaySound(i, 1133, 0, 0, 0);
441 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~Balls of Steel~n~%d / 50 T-bags~n~You will now spawn with Horns!", Player[i][Tbags]);
442 ShowAch(i, iString, Player[i][Tbags], 50);
443 }
444 CheckRewards(i);
445 }
446 }
447
448 EndTime--;
449 format(iString, sizeof(iString), "%sRed Team Kills: ~w~%d ~y~%02d:%02d %sBlue Kills: ~w~%d", TDColor[GREENTEAM], GKills, EndTime/60, EndTime%60, TDColor[BLUETEAM], BKills);
450 TextDrawSetString(RoundStatsTD, iString);
451
452 if(EndTime < 0)
453 {
454 format(iString, sizeof(iString), "%sRed Teams Kills: ~w~%d ~r~~h~~h~TIME UP! %sBlue Kills: ~w~%d", TDColor[GREENTEAM], GKills, TDColor[BLUETEAM], BKills);
455 TextDrawSetString(RoundStatsTD, iString);
456 }
457
458 if(EndTime == 0)
459 {
460 if(GKills > BKills)
461 {
462 GameTextForAll("~r~~h~~h~Red Team~w~won!", 5000, 4);
463 OnRoundEnd(GREENTEAM);
464 }
465 else if(GKills < BKills)
466 {
467 GameTextForAll("~b~~h~~h~Blue ~w~won!", 5000, 4);
468
469 OnRoundEnd(BLUETEAM);
470 }
471 else
472 {
473 EndTime = 30;
474 }
475 }
476
477 if(EndTime == 419)
478 {
479 foreach(new i : Player)
480 {
481 if(Player[i][ChangedWeather] == false)
482 {
483 new weatherrandom = random(19);
484 SetPlayerWeather(i, weatherrandom);
485
486 new timerandom = random(23);
487 SetPlayerTime(i, timerandom, 0);
488 }
489 }
490 }
491
492
493 foreach(new i : Player)
494 {
495 new pPing = GetPlayerPing(i);
496 new Float:pPacket = GetPlayerPacketLoss(i);
497 GetPlayerFPS(i);
498
499 if(IsPlayerConnected(i) && Player[i][Spawned] == true && Player[i][FPS] < MinFPS && Player[i][FPS] != 0)
500 {
501 Player[i][FPSWarning]++;
502 format(iString,sizeof(iString),"Low FPS! Warning %d/5", Player[i][FPSWarning]);
503 SendClientMessage(i, 0xCCCCCCFF, iString);
504
505 if (Player[i][FPSWarning] == 5)
506 {
507 format(iString, sizeof(iString), "%s%s {CCCCCC}has been kicked from the server (Low FPS)", TextColor[Player[i][Team]], Player[i][Name]);
508 SendClientMessageToAll(0xCCCCCCFF, iString);
509 SetTimerEx("OnPlayerKicked", 500, false, "i", i);
510 } else if (Player[i][FPSWarning] > 5) {
511 Player[i][FPSWarning] = 0;
512 }
513 } else {
514 Player[i][FPSWarning] = 0;
515 }
516
517 if(IsPlayerConnected(i) && Player[i][Spawned] == true && pPing > MaxPing)
518 {
519 Player[i][PingWarning]++;
520 format(iString,sizeof(iString),"High Ping! Warning %d/10", Player[i][PingWarning]);
521 SendClientMessage(i, 0xCCCCCCFF, iString);
522
523 if (Player[i][PingWarning] == 10)
524 {
525 format(iString, sizeof(iString), "%s%s {CCCCCC}has been kicked from the server (High Ping)", TextColor[Player[i][Team]], Player[i][Name]);
526 SendClientMessageToAll(0xCCCCCCFF, iString);
527 SetTimerEx("OnPlayerKicked", 500, false, "i", i);
528 } else if (Player[i][PingWarning] > 10) {
529 Player[i][PingWarning] = 0;
530 }
531 } else {
532 Player[i][PingWarning] = 0;
533 }
534
535 ResetPlayerMoney(i);
536 GivePlayerMoney(i, Player[i][Score]);
537
538 new FPSstr[16];
539 if(Player[i][FPS] < 4) format(FPSstr, sizeof(FPSstr), "~r~~h~%d", Player[i][FPS]);
540 if(Player[i][FPS] >= 4) format(FPSstr, sizeof(FPSstr), "%d", Player[i][FPS]);
541
542 new Pingstr[16];
543 if(pPing >= 1000) format(Pingstr, sizeof(Pingstr), "~r~~h~%d", pPing);
544 if(pPing < 1000) format(Pingstr, sizeof(Pingstr), "%d", pPing);
545
546 new PLstr[16];
547 if(pPacket >= 2) format(PLstr, sizeof(PLstr), "~r~~h~%.1f%%", pPacket);
548 if(pPacket < 2) format(PLstr, sizeof(PLstr), "%.1f%%", pPacket);
549
550// format(iString,sizeof(iString),"%sFPS : %d Ping : %d PL : %.1f%%", TDColor[Player[i][Team]], Player[i][FPS], pPing, pPacket);
551 format(iString,sizeof(iString),"%sFPS : %s %sPing : %s %sPL : %.1f%%", TDColor[Player[i][Team]], FPSstr, TDColor[Player[i][Team]], Pingstr, TDColor[Player[i][Team]], PLstr);
552
553 PlayerTextDrawSetString(i, FPSPingPacket, iString);
554
555// format(iString, sizeof(iString), "%s%i {FFFFFF}/ %s%.1f%%\n{FFFFFF}FPS: %s%i", TextColor[Player[i][Team]], pPing, TextColor[Player[i][Team]], pPacket, TextColor[Player[i][Team]], Player[i][FPS]);
556 format(iString, sizeof(iString), "%s%s {FFFFFF}/ %s%s\n{FFFFFF}FPS: %s%s", TextColor[Player[i][Team]], Pingstr, TextColor[Player[i][Team]], PLstr, TextColor[Player[i][Team]], FPSstr);
557 Update3DTextLabelText(BodyStuffs[i], 0xFFFFFFFF, iString);
558
559 if(TakeDmgCD[0][i] > 0){
560 TakeDmgCD[0][i]++;
561 if(TakeDmgCD[0][i] == 5) {
562 DamageDone[0][i] = 0;
563 gLastHit[0][i] = -1;
564 PlayerTextDrawSetString(i, DoingDamage[0], "_");
565 TakeDmgCD[0][i] = 0;
566 }
567 } if(TakeDmgCD[1][i] > 0) {
568 TakeDmgCD[1][i]++;
569 if(TakeDmgCD[1][i] == 5) {
570 DamageDone[1][i] = 0;
571 gLastHit[1][i] = -1;
572 PlayerTextDrawSetString(i, DoingDamage[1], "_");
573 TakeDmgCD[1][i] = 0;
574 }
575 } if(TakeDmgCD[2][i] > 0) {
576 TakeDmgCD[2][i]++;
577 if(TakeDmgCD[2][i] == 5) {
578 DamageDone[2][i] = 0;
579 PlayerTextDrawSetString(i, DoingDamage[2], "_");
580 gLastHit[2][i] = -1;
581 TakeDmgCD[2][i] = 0;
582 }
583 } if(TakeDmgCD[3][i] > 0) {
584 TakeDmgCD[3][i]++;
585 if(TakeDmgCD[3][i] == 5) {
586 DamageDone[3][i] = 0;
587 gLastHit[3][i] = -1;
588 PlayerTextDrawSetString(i, GettingDamaged[0], "_");
589 TakeDmgCD[3][i] = 0;
590 }
591 }
592 if(TakeDmgCD[4][i] > 0) {
593 TakeDmgCD[4][i]++;
594 if(TakeDmgCD[4][i] == 5) {
595 DamageDone[4][i] = 0;
596 gLastHit[4][i] = -1;
597 PlayerTextDrawSetString(i, GettingDamaged[1], "_");
598 TakeDmgCD[4][i] = 0;
599 }
600 }
601 if(TakeDmgCD[5][i] > 0) {
602 TakeDmgCD[5][i]++;
603 if(TakeDmgCD[5][i] == 5) {
604 DamageDone[5][i] = 0;
605 gLastHit[5][i] = -1;
606 PlayerTextDrawSetString(i, GettingDamaged[2], "_");
607 TakeDmgCD[5][i] = 0;
608 }
609 }
610 }
611 return 1;
612}
613
614
615public OnGameModeExit()
616{
617 foreach(new i : Player)
618 {
619 if(IsPlayerConnected(i) && Player[i][Logged] == true)
620 {
621 SavePlayer(i);
622 }
623 }
624 UnloadMap();
625 db_close(sqliteconnection);
626 return 1;
627}
628
629public OnPlayerRequestClass(playerid, classid)
630{
631 Player[playerid][Spawned] = false;
632
633 SetPlayerPos(playerid, 154.3345,-1946.3103,5.1966);
634 SetPlayerCameraLookAt(playerid, 154.3345,-1946.3103,5.1966);
635 SetPlayerCameraPos(playerid, 154.0967,-1942.9741,3.7734);
636 SetPlayerFacingAngle(playerid, 0);
637
638 if(Player[playerid][Logged] == false)
639 {
640 new Query[150];
641 format(Query, sizeof(Query), "SELECT Name FROM Players WHERE Name = '%s'", Player[playerid][Name]);
642 new DBResult:result = db_query(sqliteconnection, Query);
643
644 if(!db_num_rows(result))
645 {
646 ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"{FFFFFF}Registration Dialog","{FFFFFF}Type your password below to register:","Register","Leave");
647 } else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{FFFFFF}Login Dialog","{FFFFFF}Type your password below to log in:","Login","Leave");
648
649 db_free_result(result);
650 }
651
652 new iString[32];
653 if(classid == 0 || classid == 1)
654 {
655 Player[playerid][Team] = GREENTEAM;
656 format(iString,sizeof(iString),"%sRed Team", TDColor[GREENTEAM]);
657 SetPlayerColor(playerid, GREEN_COLOR);
658 SetPlayerTeam(playerid, GREENTEAM);
659 }
660 if(classid == 2 || classid == 3)
661 {
662 Player[playerid][Team] = GREENTEAM;
663 format(iString,sizeof(iString),"%sRed Team VIP", TDColor[GREENTEAM]);
664 SetPlayerColor(playerid, GREEN_COLOR);
665 SetPlayerTeam(playerid, GREENTEAM);
666 }
667 if(classid == 4 || classid == 5)
668 {
669 Player[playerid][Team] = BLUETEAM;
670 format(iString,sizeof(iString),"%sBlue", TDColor[BLUETEAM]);
671 SetPlayerColor(playerid, BLUE_COLOR);
672 SetPlayerTeam(playerid, BLUETEAM);
673 }
674 if(classid == 6 || classid == 7)
675 {
676 Player[playerid][Team] = BLUETEAM;
677 format(iString,sizeof(iString),"%sBlue VIP", TDColor[BLUETEAM]);
678 SetPlayerColor(playerid, BLUE_COLOR);
679 SetPlayerTeam(playerid, BLUETEAM);
680 }
681 GameTextForPlayer(playerid, iString, 3000, 4);
682
683 Player[playerid][ClassID] = classid;
684
685 SetPlayerSpawn(playerid);
686 db_close(bans);
687 return 1;
688}
689
690public OnPlayerConnect(playerid)
691{
692 new iString[128];
693 new IP[MAX_PLAYER_NAME];
694 GetPlayerIp(playerid, IP, sizeof(IP));
695
696 GetPlayerName(playerid, Player[playerid][Name], 24);
697
698 if(!MatchAKA(playerid))
699 {
700 AKAString = "";
701 AKAString = GetPlayerAKA(playerid);
702 new add[MAX_PLAYER_NAME+1];
703 format(add, sizeof(add), ",%s", Player[playerid][Name]);
704
705 if(strlen(AKAString) > 0) strcat(AKAString, add);
706 else strcat(AKAString, add[1]);
707
708 new query[256];
709 format(query, sizeof(query), "UPDATE `AKAs` SET `Names` = '%s' WHERE `IP` = '%s'", DB_Escape(AKAString), IP);
710 db_free_result(db_query(sqliteconnection, query));
711 }
712
713 foreach(new i : Player)
714 {
715 if(Player[i][Level] > 0)
716 {
717 format(iString, sizeof(iString), "{FFFFFF}%s {BABABA}(%d) connected [%s]", Player[playerid][Name], playerid, IP);
718 } else
719 {
720 format(iString, sizeof(iString), "{FFFFFF}%s {BABABA}(%d) connected", Player[playerid][Name], playerid);
721 }
722 SendClientMessage(i, -1, iString);
723 }
724
725 format(iString, sizeof(iString), "ID %d AKA: %s", playerid, GetPlayerAKA(playerid));
726 SendAdminMessage(1, iString);
727
728
729 //vendingmachines
730 RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 6000.0);
731 RemoveBuildingForPlayer(playerid, 956, 0.0, 0.0, 0.0, 6000.0);
732 RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 6000.0);
733 RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 6000.0);
734 RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 6000.0);
735 RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 6000.0);
736 RemoveBuildingForPlayer(playerid, 1977, 0.0, 0.0, 0.0, 6000.0);
737
738 //traffic lights
739 RemoveBuildingForPlayer(playerid, 1262, 0.0, 0.0, 0.0, 6000.0); //only lights
740 RemoveBuildingForPlayer(playerid, 1283, 0.0, 0.0, 0.0, 6000.0);
741 RemoveBuildingForPlayer(playerid, 1284, 0.0, 0.0, 0.0, 6000.0);
742 RemoveBuildingForPlayer(playerid, 1315, 0.0, 0.0, 0.0, 6000.0);
743 RemoveBuildingForPlayer(playerid, 1350, 0.0, 0.0, 0.0, 6000.0);
744 RemoveBuildingForPlayer(playerid, 1351, 0.0, 0.0, 0.0, 6000.0);
745 RemoveBuildingForPlayer(playerid, 1352, 0.0, 0.0, 0.0, 6000.0);
746 RemoveBuildingForPlayer(playerid, 3516, 0.0, 0.0, 0.0, 6000.0);
747 RemoveBuildingForPlayer(playerid, 3855, 0.0, 0.0, 0.0, 6000.0);
748
749 //small lamposts
750 RemoveBuildingForPlayer(playerid, 1223, 0.0, 0.0, 0.0, 6000.0);
751 RemoveBuildingForPlayer(playerid, 1231, 0.0, 0.0, 0.0, 6000.0);
752 RemoveBuildingForPlayer(playerid, 1232, 0.0, 0.0, 0.0, 6000.0);
753 RemoveBuildingForPlayer(playerid, 1568, 0.0, 0.0, 0.0, 6000.0);
754
755 //long lamposts
756 RemoveBuildingForPlayer(playerid, 1226, 0.0, 0.0, 0.0, 6000.0);
757 RemoveBuildingForPlayer(playerid, 1290, 0.0, 0.0, 0.0, 6000.0);
758 RemoveBuildingForPlayer(playerid, 1294, 0.0, 0.0, 0.0, 6000.0);
759 RemoveBuildingForPlayer(playerid, 1295, 0.0, 0.0, 0.0, 6000.0);
760 RemoveBuildingForPlayer(playerid, 1296, 0.0, 0.0, 0.0, 6000.0);
761 RemoveBuildingForPlayer(playerid, 1297, 0.0, 0.0, 0.0, 6000.0);
762 RemoveBuildingForPlayer(playerid, 1298, 0.0, 0.0, 0.0, 6000.0);
763
764
765 new Query[98], DBResult:Result;
766 format(Query, sizeof(Query), "SELECT * FROM `BANNED` WHERE `NAME` = '%s' OR `IP` = '%s'", DB_Escape(GetName(playerid)), DB_Escape(PlayerIP(playerid))); // this checks if player's username is in "BANNED" table
767 Result = db_query(bans, Query);
768 if(db_num_rows(Result))
769 {
770 new banreason[50], bannedby[24], banname[24], banip[18], string[300];
771 db_get_field_assoc(Result, "REASON", banreason, sizeof(banreason)); db_get_field_assoc(Result, "ADMIN", bannedby, sizeof(bannedby));
772 db_get_field_assoc(Result, "NAME", banname, sizeof(banname)); db_get_field_assoc(Result, "IP", banip, sizeof(banip));
773 format(string, sizeof(string), "{FFFFFF}Our system has detected that your {FC4949}username/IP{FFFFFF}is {FC4949}banned.\n{FFFFFF}Banned Name: {FC4949}%s\n{FFFFFF}Banned IP:{FC4949}%s\nBanned by: {FC4949}%s\n{FFFFFF}Reason: {FC4949}%s\n* If you wish to be unbanned, contact the server owner.", banname, banip, bannedby, banreason);
774 ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{FC4949}Ban detected.", string, "Close", ""), string = "\0";
775 printf("%s has been kicked from OnPlayerConnect - Username ban detection", GetName(playerid));
776 SetTimerEx("KickTimer", 75, false, "i", playerid);
777 db_free_result(Result);
778 string = "\0";
779 }
780
781 Player[playerid][ClassID] = 0;
782 Player[playerid][BlockedID] = -1;
783 Player[playerid][BlockedAll] = false;
784 Player[playerid][ChangedWeather] = false;
785 Player[playerid][OnMenu] = false;
786 Player[playerid][SafeJetpack] = false;
787 Player[playerid][SafeGun] = false;
788 Player[playerid][Specing] = false;
789 Player[playerid][Checking] = false;
790 Player[playerid][SpecID] = -1;
791 Player[playerid][LastMessager] = -1;
792 Player[playerid][RKills] = 0;
793 Player[playerid][RDeaths] = 0;
794 Player[playerid][RDamage] = 0;
795 Player[playerid][Syncing] = false;
796 Player[playerid][Muted] = false;
797 Player[playerid][Spawned] = false;
798 Player[playerid][LastHitWith] = -1; //antide
799 Player[playerid][LastHitBy] = -1; //antide
800 Player[playerid][LastKilled] = -1;
801 Player[playerid][Mapping] = false;
802 Player[playerid][Spree] = 0;
803 Player[playerid][UnlockedEagleEye] = false;
804 Player[playerid][UnlockedMP5] = false;
805 Player[playerid][UnlockedSpas] = false;
806 Player[playerid][UnlockedSniper] = false;
807 Player[playerid][UnlockedAK47] = false;
808 Player[playerid][UnlockedM4] = false;
809 Player[playerid][UnlockedGrenade] = false;
810 Player[playerid][UnlockedCigar] = false;
811 Player[playerid][UnlockedHorns] = false;
812 Player[playerid][UnlockedFlame] = false;
813 Player[playerid][Gun2] = SHOTGUN;
814 Player[playerid][Gun3] = 0;
815 Player[playerid][Gun4] = 0;
816 Player[playerid][Gun5] = RIFLE;
817 Player[playerid][Gun6] = 0;
818 Player[playerid][FPSWarning] = 0;
819 Player[playerid][PingWarning] = 0;
820 Player[playerid][PLWarning] = 0;
821
822 Player[playerid][FPS] = 50;
823 Player[playerid][Logged] = false;
824
825 LoadPlayerTextDraws(playerid);
826
827 PlayerTextDrawShow(playerid, FPSPingPacket);
828 TextDrawShowForPlayer(playerid, BalanceTD);
829
830 for(new i = 0; i < 3; i++)
831 {
832 PlayerTextDrawShow(playerid, DoingDamage[i]);
833 PlayerTextDrawShow(playerid, GettingDamaged[i]);
834 }
835
836 BodyStuffs[playerid] = Create3DTextLabel("_", 0xFFFFFFFF, 0, 0, 0, DRAW_DISTANCE, 0, 1);
837 Attach3DTextLabelToPlayer(BodyStuffs[playerid], playerid, 0.0, 0.0, -0.9);
838
839// PlayAudioStreamForPlayer(playerid, "http://tinyurl.com/1hitkillxk");
840 SendClientMessage(playerid, YELLOW_COLOR, "To turn on radio, type {FFFFFF}/radio [1 - 6]");
841//easter
842
843 SendClientMessage(playerid, 0xFFA500FF, " ");
844 SendClientMessage(playerid, 0xFFA500FF, "Halloween Event is on! Find Halloween Pumpkins in map and get an awesome surprise!");
845
846 TextDrawShowForPlayer(playerid, WebTextTD);
847
848
849 return 1;
850}
851
852public OnPlayerDisconnect(playerid, reason)
853{
854 if(Player[playerid][VIP] == 1) Delete3DTextLabel(VIPStuffs[playerid]);
855 Delete3DTextLabel(BodyStuffs[playerid]);
856 Player[playerid][Level] = 0;
857 Player[playerid][VIP] = 0;
858
859 //antide
860 if((Player[playerid][LastHitWith] != -1) && (Player[playerid][LastHitBy] != -1))
861 {
862 new weap, killahid;
863 weap = Player[playerid][LastHitWith];
864 killahid = Player[playerid][LastHitBy];
865
866 SendDeathMessage(killahid, playerid, weap);
867
868 GiveScore(killahid, 1 * Player[killahid][Spree]);
869 GiveKill(killahid);
870 GiveWKill(killahid, weap);
871 CheckRewards(killahid);
872
873 Player[playerid][LastHitWith] = -1;
874 Player[playerid][LastHitBy] = -1;
875 }
876 //antide
877
878 new iString[128];
879
880 switch (reason)
881 {
882 case 0: format(iString, sizeof(iString), "{FFFFFF}%s (%d) {BABABA}disconnected (Timeout)",Player[playerid][Name], playerid);
883 case 1: format(iString, sizeof(iString), "{FFFFFF}%s (%d) {BABABA}disconnected (Quit)",Player[playerid][Name], playerid);
884 case 2:
885 {
886 if(Player[playerid][IsKicked] == true) format(iString, sizeof(iString), "{FFFFFF}%s (%d) {BABABA}disconnected (Kicked)",Player[playerid][Name], playerid);
887 else format(iString, sizeof(iString), "{FFFFFF}%s (%d) {BABABA}disconnected (Banned)",Player[playerid][Name], playerid);
888 }
889 }
890 SendClientMessageToAll(-1,iString);
891
892
893 Textdraw0 = CreatePlayerTextDraw(playerid,169.000000, 153.000000, "SameerPhoto");
894PlayerTextDrawBackgroundColor(playerid,Textdraw0, 255);
895PlayerTextDrawFont(playerid,Textdraw0, 5);
896PlayerTextDrawLetterSize(playerid,Textdraw0, 0.500000, 1.000000);
897PlayerTextDrawColor(playerid,Textdraw0, -1);
898PlayerTextDrawSetOutline(playerid,Textdraw0, 0); // photo
899PlayerTextDrawSetProportional(playerid,Textdraw0, 1);
900PlayerTextDrawSetShadow(playerid,Textdraw0, 1);
901PlayerTextDrawUseBox(playerid,Textdraw0, 1);
902PlayerTextDrawBoxColor(playerid,Textdraw0, 255);
903PlayerTextDrawTextSize(playerid,Textdraw0, 80.000000, 132.000000);
904PlayerTextDrawSetPreviewModel(playerid, Textdraw0, 120);
905PlayerTextDrawSetPreviewRot(playerid, Textdraw0, -16.000000, 0.000000, -55.000000, 1.000000);
906PlayerTextDrawSetSelectable(playerid,Textdraw0, 0);
907
908Textdraw1 = CreatePlayerTextDraw(playerid,316.000000, 156.000000, "Sameer");
909PlayerTextDrawBackgroundColor(playerid,Textdraw1, 255);
910PlayerTextDrawFont(playerid,Textdraw1, 1);
911PlayerTextDrawLetterSize(playerid,Textdraw1, 0.500000, 1.000000);
912PlayerTextDrawColor(playerid,Textdraw1, -65281);
913PlayerTextDrawSetOutline(playerid,Textdraw1, 0);
914PlayerTextDrawSetProportional(playerid,Textdraw1, 1);
915PlayerTextDrawSetShadow(playerid,Textdraw1, 1);
916PlayerTextDrawSetSelectable(playerid,Textdraw1, 0);
917
918Textdraw2 = CreatePlayerTextDraw(playerid,174.000000, 154.000000, "Waqas");
919PlayerTextDrawBackgroundColor(playerid,Textdraw2, 255);
920PlayerTextDrawFont(playerid,Textdraw2, 1);
921PlayerTextDrawLetterSize(playerid,Textdraw2, 0.500000, 1.000000);
922PlayerTextDrawColor(playerid,Textdraw2, 65535);
923PlayerTextDrawSetOutline(playerid,Textdraw2, 0);
924PlayerTextDrawSetProportional(playerid,Textdraw2, 1);
925PlayerTextDrawSetShadow(playerid,Textdraw2, 1);
926PlayerTextDrawSetSelectable(playerid,Textdraw2, 0);
927
928Textdraw3 = CreatePlayerTextDraw(playerid,299.000000, 154.000000, "WaqasPhoto");
929PlayerTextDrawBackgroundColor(playerid,Textdraw3, 255);
930PlayerTextDrawFont(playerid,Textdraw3, 5);
931PlayerTextDrawLetterSize(playerid,Textdraw3, 0.500000, 1.000000); // photo
932PlayerTextDrawColor(playerid,Textdraw3, -1);
933PlayerTextDrawSetOutline(playerid,Textdraw3, 0);
934PlayerTextDrawSetProportional(playerid,Textdraw3, 1);
935PlayerTextDrawSetShadow(playerid,Textdraw3, 1);
936PlayerTextDrawUseBox(playerid,Textdraw3, 1);
937PlayerTextDrawBoxColor(playerid,Textdraw3, 255);
938PlayerTextDrawTextSize(playerid,Textdraw3, 80.000000, 132.000000);
939PlayerTextDrawSetPreviewModel(playerid, Textdraw3, 122);
940PlayerTextDrawSetPreviewRot(playerid, Textdraw3, -16.000000, 0.000000, -55.000000, 1.000000);
941PlayerTextDrawSetSelectable(playerid,Textdraw3, 0);
942
943Textdraw4 = CreatePlayerTextDraw(playerid,433.000000, 156.000000, "[J]izz[Y]");
944PlayerTextDrawBackgroundColor(playerid,Textdraw4, 255);
945PlayerTextDrawFont(playerid,Textdraw4, 1);
946PlayerTextDrawLetterSize(playerid,Textdraw4, 0.500000, 1.000000);
947PlayerTextDrawColor(playerid,Textdraw4, -16776961);
948PlayerTextDrawSetOutline(playerid,Textdraw4, 0);
949PlayerTextDrawSetProportional(playerid,Textdraw4, 1);
950PlayerTextDrawSetShadow(playerid,Textdraw4, 1);
951PlayerTextDrawSetSelectable(playerid,Textdraw4, 0);
952
953Textdraw5 = CreatePlayerTextDraw(playerid,423.000000, 154.000000, "[J]izz[Y]photo");
954PlayerTextDrawBackgroundColor(playerid,Textdraw5, 255);
955PlayerTextDrawFont(playerid,Textdraw5, 5);
956PlayerTextDrawLetterSize(playerid,Textdraw5, 0.500000, 1.000000);
957PlayerTextDrawColor(playerid,Textdraw5, -1);
958PlayerTextDrawSetOutline(playerid,Textdraw5, 0);
959PlayerTextDrawSetProportional(playerid,Textdraw5, 1);
960PlayerTextDrawSetShadow(playerid,Textdraw5, 1); // photo
961PlayerTextDrawUseBox(playerid,Textdraw5, 1);
962PlayerTextDrawBoxColor(playerid,Textdraw5, 255);
963PlayerTextDrawTextSize(playerid,Textdraw5, 80.000000, 132.000000);
964PlayerTextDrawSetPreviewModel(playerid, Textdraw5, 230);
965PlayerTextDrawSetPreviewRot(playerid, Textdraw5, -16.000000, 0.000000, -55.000000, 1.000000);
966PlayerTextDrawSetSelectable(playerid,Textdraw5, 0);
967
968Textdraw6 = CreatePlayerTextDraw(playerid,250.000000, 210.000000, ">>>>");
969PlayerTextDrawBackgroundColor(playerid,Textdraw6, 255);
970PlayerTextDrawFont(playerid,Textdraw6, 1);
971PlayerTextDrawLetterSize(playerid,Textdraw6, 0.500000, 1.000000);
972PlayerTextDrawColor(playerid,Textdraw6, -1);
973PlayerTextDrawSetOutline(playerid,Textdraw6, 0);
974PlayerTextDrawSetProportional(playerid,Textdraw6, 1);
975PlayerTextDrawSetShadow(playerid,Textdraw6, 1);
976PlayerTextDrawUseBox(playerid,Textdraw6, 1);
977PlayerTextDrawBoxColor(playerid,Textdraw6, 255);
978PlayerTextDrawTextSize(playerid,Textdraw6, 302.000000, 0.000000);
979PlayerTextDrawSetSelectable(playerid,Textdraw6, 0);
980
981Textdraw7 = CreatePlayerTextDraw(playerid,378.000000, 210.000000, "<<<<");
982PlayerTextDrawBackgroundColor(playerid,Textdraw7, 255);
983PlayerTextDrawFont(playerid,Textdraw7, 1);
984PlayerTextDrawLetterSize(playerid,Textdraw7, 0.500000, 1.000000);
985PlayerTextDrawColor(playerid,Textdraw7, -1);
986PlayerTextDrawSetOutline(playerid,Textdraw7, 0);
987PlayerTextDrawSetProportional(playerid,Textdraw7, 1);
988PlayerTextDrawSetShadow(playerid,Textdraw7, 1);
989PlayerTextDrawUseBox(playerid,Textdraw7, 1);
990PlayerTextDrawBoxColor(playerid,Textdraw7, 255);
991PlayerTextDrawTextSize(playerid,Textdraw7, 420.000000, 0.000000);
992PlayerTextDrawSetSelectable(playerid,Textdraw7, 0);
993
994Textdraw8 = CreatePlayerTextDraw(playerid,260.000000, 121.000000, "Type /hide to hide");
995PlayerTextDrawBackgroundColor(playerid,Textdraw8, 255);
996PlayerTextDrawFont(playerid,Textdraw8, 1);
997PlayerTextDrawLetterSize(playerid,Textdraw8, 0.500000, 1.000000);
998PlayerTextDrawColor(playerid,Textdraw8, 16711935);
999PlayerTextDrawSetOutline(playerid,Textdraw8, 0);
1000PlayerTextDrawSetProportional(playerid,Textdraw8, 1);
1001PlayerTextDrawSetShadow(playerid,Textdraw8, 1);
1002PlayerTextDrawUseBox(playerid,Textdraw8, 1);
1003PlayerTextDrawBoxColor(playerid,Textdraw8, 255);
1004PlayerTextDrawTextSize(playerid,Textdraw8, 420.000000, 0.000000);
1005PlayerTextDrawSetSelectable(playerid,Textdraw8, 0);
1006
1007// You can now use PlayerTextDrawShow, PlayerTextDrawHide and
1008// PlayerTextDrawDestroy functions to show, hide, and destroy the textdraw.
1009 return 1;
1010}
1011
1012public OnPlayerSpawn(playerid)
1013{
1014/*
1015 if(Player[playerid][IgnoreSpawn] == true)
1016 {
1017 Player[playerid][IgnoreSpawn] = false;
1018 return 0;
1019 }
1020*/
1021 Player[playerid][Spawned] = true;
1022
1023 TextDrawShowForPlayer(playerid, RoundStatsTD);
1024 SetPlayerSpawn(playerid);
1025 GangZoneShowForPlayer(playerid, MapZone, BLUE_COLOR);
1026
1027 SetCameraBehindPlayer(playerid);
1028 ClearAnimations(playerid);
1029 TogglePlayerSpectating(playerid, false);
1030
1031 SetPlayerHealth(playerid, 20.0);
1032 SetPlayerArmour(playerid, 0.0);
1033
1034//vip
1035 new skin = GetPlayerSkin(playerid);
1036
1037 if(Player[playerid][VIP] == 1)
1038 {
1039 SetPlayerArmour(playerid, 25.0);
1040 GivePlayerWeapon(playerid, DEAGLE, 200);
1041 GivePlayerWeapon(playerid, Player[playerid][Gun2], 200);
1042 GivePlayerWeapon(playerid, Player[playerid][Gun3], 400);
1043 GivePlayerWeapon(playerid, Player[playerid][Gun4], 200);
1044 GivePlayerWeapon(playerid, Player[playerid][Gun5], 200);
1045 GivePlayerWeapon(playerid, Player[playerid][Gun6], 2);
1046 switch(skin) //armor
1047 {
1048 case 53: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.000, 0.036, 0.000, 0.000, -1.800, 0.000, 1.068, 1.163, 1.000, 0xFF55FF55, 0xFF55FF55);
1049 case 250: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.022, 0.037, 0.000, 0.000, -1.800, 0.000, 1.318, 1.393, 1.000, 0xFF55FF55, 0xFF55FF55);
1050 case 45: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.013, 0.049, 0.000, 0.000, -1.800, 0.000, 1.160, 1.171, 1.000, 0xFF55FF55, 0xFF55FF55);
1051 case 191: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.074, 0.041, 0.000, 0.000, -1.800, 9.599, 1.178, 1.253, 0.868, 0xFF55FF55, 0xFF55FF55);
1052 case 230: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.017, 0.058, 0.000, 0.000, -1.800, 0.000, 1.160, 1.087, 0.857, 0xFF0080FF, 0xFF0080FF);
1053 case 177: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.004, 0.054, 0.000, 0.000, -1.800, 0.599, 1.317, 1.392, 1.213, 0xFF0080FF, 0xFF0080FF);
1054 case 154: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.013, 0.049, 0.000, 0.000, -1.800, 0.000, 1.160, 1.171, 1.000, 0xFF0080FF, 0xFF0080FF);
1055 case 198: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.042, 0.074, 0.000, 0.000, -1.800, 5.500, 1.230, 1.392, 0.860, 0xFF0080FF, 0xFF0080FF);
1056 }
1057 }
1058 else if(Player[playerid][VIP] == 0)
1059 {
1060 GivePlayerWeapon(playerid, DEAGLE, 100);
1061 GivePlayerWeapon(playerid, Player[playerid][Gun2], 100);
1062 GivePlayerWeapon(playerid, Player[playerid][Gun3], 200);
1063 GivePlayerWeapon(playerid, Player[playerid][Gun4], 100);
1064 GivePlayerWeapon(playerid, Player[playerid][Gun5], 100);
1065 GivePlayerWeapon(playerid, Player[playerid][Gun6], 1);
1066 }
1067//vip
1068
1069 SetPlayerInterior(playerid, MapInterior);
1070 SetPlayerArmedWeapon(playerid, 0);
1071
1072 foreach(new i : Player)
1073 {
1074 if(Player[i][LastKilled] == playerid)
1075 {
1076 Player[i][LastKilled] = -1;
1077 }
1078 }
1079
1080 if(Player[playerid][UnlockedCigar] == true) //cigar
1081 {
1082 switch(skin)
1083 {
1084 case 53: SetPlayerAttachedObject(playerid, 1, 3044, 2, -0.054, 0.066, -0.043, -151.398, 0.0, 0.0, 1.0, 1.0, 1.0);
1085 case 250: SetPlayerAttachedObject(playerid, 1, 3044, 2, -0.057, 0.066, -0.043, -151.398, 0.0, 0.0, 1.0, 1.0, 1.0);
1086 case 45: SetPlayerAttachedObject(playerid, 1, 3044, 2, -0.078, 0.052, -0.043, -151.398, 0.0, 0.0, 1.0, 1.0, 1.0);
1087 case 191: SetPlayerAttachedObject(playerid, 1, 3044, 2, -0.054, 0.047, -0.043, -151.398, 0.0, 0.0, 1.0, 1.0, 1.0);
1088 case 230: SetPlayerAttachedObject(playerid, 1, 3044, 2, -0.081, 0.051, -0.043, -151.398, 0.0, 0.0, 1.0, 1.0, 1.0);
1089 case 177: SetPlayerAttachedObject(playerid, 1, 3044, 2, -0.054, 0.066, -0.043, -151.398, 0.0, 0.0, 1.0, 1.0, 1.0);
1090 case 154: SetPlayerAttachedObject(playerid, 1, 3044, 2, -0.087, 0.050, -0.043, -151.398, 0.0, 0.0, 1.0, 1.0, 1.0);
1091 case 198: SetPlayerAttachedObject(playerid, 1, 3044, 2, -0.066, 0.054, -0.043, -151.398, 0.0, 0.0, 1.0, 1.0, 1.0);
1092 }
1093
1094 }
1095
1096 if(Player[playerid][UnlockedHorns] == true) //horns
1097 {
1098 switch(skin)
1099 {
1100 case 53: SetPlayerAttachedObject(playerid, 2, 19314, 2, 0.133, -0.048, 0.000, 0.000, 0.000, -107.200, 1.000, 1.000, 0.349, 0xFF55FF55, 0xFF55FF55);
1101 case 250: SetPlayerAttachedObject(playerid, 2, 19314, 2, 0.133, -0.048, 0.000, 0.000, 0.000, -107.200, 1.000, 1.000, 0.349, 0xFF55FF55, 0xFF55FF55);
1102 case 45: SetPlayerAttachedObject(playerid, 2, 19314, 2, 0.133, -0.048, 0.000, 0.000, 0.000, -107.200, 1.000, 1.000, 0.349, 0xFF55FF55, 0xFF55FF55);
1103 case 191: SetPlayerAttachedObject(playerid, 2, 19314, 2, 0.133, -0.048, 0.000, 0.000, 0.000, -107.200, 1.000, 1.000, 0.349, 0xFF55FF55, 0xFF55FF55);
1104 case 230: SetPlayerAttachedObject(playerid, 2, 19314, 2, 0.133, -0.048, 0.000, 0.000, 0.000, -107.200, 1.000, 1.000, 0.349, 0xFF0080FF, 0xFF0080FF);
1105 case 177: SetPlayerAttachedObject(playerid, 2, 19314, 2, 0.133, -0.048, 0.000, 0.000, 0.000, -107.200, 1.000, 1.000, 0.349, 0xFF0080FF, 0xFF0080FF);
1106 case 154: SetPlayerAttachedObject(playerid, 2, 19314, 2, 0.133, -0.048, 0.000, 0.000, 0.000, -107.200, 1.000, 1.000, 0.349, 0xFF0080FF, 0xFF0080FF);
1107 case 198: SetPlayerAttachedObject(playerid, 2, 19314, 2, 0.133, -0.048, 0.000, 0.000, 0.000, -107.200, 1.000, 1.000, 0.349, 0xFF0080FF, 0xFF0080FF);
1108 }
1109 }
1110
1111 if(Player[playerid][UnlockedFlame] == true) //flame
1112 {
1113 SetPlayerAttachedObject(playerid, 3, 18693, 2, -1.572, -0.098, -0.011, 90.0, 90.0, 0.0, 1.0, 1.0, 1.0);
1114 }
1115
1116 if(Player[playerid][UnlockedMP5] == true) //mp5
1117 {
1118 SetPlayerAttachedObject(playerid, 4, 353, 7, 0.189, -0.127, -0.083, -83.399, 0.000, 0.000, 1.000, 1.000, 1.000);
1119 }
1120
1121 if(Player[playerid][UnlockedAK47] == true) //ak47
1122 {
1123 if(Player[playerid][VIP] == 0)
1124 {
1125 SetPlayerAttachedObject(playerid, 5, 355, 15, 0.167, 0.134, -0.160, 0.000, -72.199, 177.100, 1.000, 1.000, 1.000);
1126 }
1127 else if(Player[playerid][VIP] == 1)
1128 {
1129 SetPlayerAttachedObject(playerid, 5, 355, 15, 0.167, 0.194, -0.160, 0.000, -72.199, 177.100, 1.000, 1.000, 1.000);
1130 }
1131 }
1132
1133 if(Player[playerid][UnlockedM4] == true) //m4
1134 {
1135 if(Player[playerid][VIP] == 0)
1136 {
1137 SetPlayerAttachedObject(playerid, 6, 356, 15, 0.167, 0.134, -0.160, 0.000, -72.199, 177.100, 1.000, 1.000, 1.000);
1138 }
1139 else if(Player[playerid][VIP] == 1)
1140 {
1141 SetPlayerAttachedObject(playerid, 6, 356, 15, 0.167, 0.194, -0.160, 0.000, -72.199, 177.100, 1.000, 1.000, 1.000);
1142 }
1143 }
1144
1145 if(Player[playerid][UnlockedSpas] == true) //spas
1146 {
1147 if(Player[playerid][VIP] == 0)
1148 {
1149 SetPlayerAttachedObject(playerid, 7, 351, 1, 0.290, -0.047, -0.096, 0.699, -8.399, -167.700, 1.000, 1.000, 1.000);
1150 }
1151 else if(Player[playerid][VIP] == 1)
1152 {
1153 SetPlayerAttachedObject(playerid, 7, 351, 1, 0.290, -0.107, -0.096, 0.699, -8.399, -167.700, 1.000, 1.000, 1.000);
1154 }
1155 }
1156
1157 if(Player[playerid][UnlockedSniper] == true) //sniper
1158 {
1159 if(Player[playerid][VIP] == 0)
1160 {
1161 SetPlayerAttachedObject(playerid, 8, 358, 16, 0.171, 0.116, 0.150, 0.000, -101.699, 0.000, 1.000, 1.000, 1.000);
1162 }
1163 else if(Player[playerid][VIP] == 1)
1164 {
1165 SetPlayerAttachedObject(playerid, 8, 358, 16, 0.171, 0.176, 0.150, 0.000, -101.699, 0.000, 1.000, 1.000, 1.000);
1166 }
1167 }
1168
1169 if(Player[playerid][UnlockedGrenade] == true) //grenade
1170 {
1171 SetPlayerAttachedObject(playerid, 9, 342, 8, 0.231, 0.050, 0.091, -26.200, -87.399, -138.500, 1.000, 1.000, 1.000);
1172 }
1173
1174
1175return 1;
1176}
1177public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
1178{
1179
1180 if(playerid != INVALID_PLAYER_ID && issuerid != INVALID_PLAYER_ID && Player[playerid][Team] != Player[issuerid][Team] && bodypart == 9 && (weaponid == RIFLE || weaponid == DEAGLE || weaponid == SNIPER) )
1181 {
1182 SetPlayerHealth(playerid, 0.0);
1183 SetPlayerArmour(playerid, 0.0);
1184 ShowAnn1(issuerid, "BOOM HEADSHOT");
1185
1186 Player[issuerid][Headshots]++;
1187 GiveScore(issuerid, 10);
1188
1189 switch(Player[issuerid][Team])
1190 {
1191 case GREENTEAM: SendClientMessage(issuerid, GREEN_COLOR, "+10 Score for headshot!");
1192 case BLUETEAM: SendClientMessage(issuerid, BLUE_COLOR, "+10 Score for headshot!");
1193 }
1194
1195 new str[256];
1196 format(str, sizeof(str), "%s%s {FFFFFF}has put a bullet in %s%s's {FFFFFF}head!", TextColor[Player[issuerid][Team]], Player[issuerid][Name], TextColor[Player[playerid][Team]], Player[playerid][Name]);
1197 SendClientMessageToAll(-1,str);
1198 Player[playerid][LastHitWith] = -1; //antide
1199 Player[playerid][LastHitBy] = -1; //antide
1200 Player[issuerid][LastKilled] = playerid;
1201 }
1202
1203 new Float:Health[3], Float:Damage;
1204 GetPlayerHealth(playerid, Health[0]);
1205 GetPlayerArmour(playerid, Health[1]);
1206
1207 if(Health[0] > 0)
1208 {
1209 if(amount > Health[0])
1210 {
1211 Damage = amount - Health[0];
1212 amount = amount - Damage;
1213 }
1214 }
1215
1216 new iString[200], iColor[10];
1217
1218 Health[2] = (Health[0] + Health[1]) - amount;
1219 if(Health[2] < 0) { Health[2] = 0; iColor = "~r~~h~"; }
1220 else if(Health[2] > 100) iColor = "~w~";
1221 else iColor = "~r~~h~";
1222
1223 if(issuerid != INVALID_PLAYER_ID)
1224 {
1225 if(Player[issuerid][Team] == Player[playerid][Team]) return 1;
1226 Player[playerid][LastHitWith] = weaponid; //antide
1227 Player[playerid][LastHitBy] = issuerid; //antide
1228
1229 PlayerPlaySound(issuerid, 6401, 0.0, 0.0, 0.0);
1230 PlayerPlaySound(playerid, 1131, 0, 0, 0);
1231 Player[issuerid][RDamage] += amount;
1232
1233 if(gLastHit[0][issuerid] == -1 && gLastHit[1][issuerid] != playerid && gLastHit[2][issuerid] != playerid) gLastHit[0][issuerid] = playerid;
1234
1235 if(gLastHit[0][issuerid] == playerid) {
1236 DamageDone[0][issuerid] += amount;
1237 format(iString, sizeof(iString), "~g~~h~~h~%s ~w~~h~~h~/ -%.2f ~g~~h~~h~%s ~w~~h~~h~(%s~h~~h~%.2f~w~~h~~h~)",Player[playerid][Name], DamageDone[0][issuerid], WeaponNames[weaponid], iColor, Health[2]);
1238 PlayerTextDrawSetString(issuerid, DoingDamage[0], iString);
1239 TakeDmgCD[0][issuerid] = 1;
1240
1241 } else {
1242 if(gLastHit[1][issuerid] == -1 && gLastHit[2][issuerid] != playerid) gLastHit[1][issuerid] = playerid;
1243 if(gLastHit[1][issuerid] == playerid ) {
1244 DamageDone[1][issuerid] += amount;
1245 format(iString, sizeof(iString), "~g~~h~~h~%s ~w~~h~~h~/ -%.2f ~g~~h~~h~%s ~w~~h~~h~(%s~h~~h~%.2f~w~~h~~h~)",Player[playerid][Name], DamageDone[1][issuerid], WeaponNames[weaponid], iColor, Health[2]);
1246 PlayerTextDrawSetString(issuerid, DoingDamage[1], iString);
1247 TakeDmgCD[1][issuerid] = 1;
1248
1249 } else {
1250 DamageDone[2][issuerid] += amount;
1251 gLastHit[2][issuerid] = playerid;
1252
1253 format(iString, sizeof(iString), "~g~~h~~h~%s ~w~~h~~h~/ -%.2f ~g~~h~~h~%s ~w~~h~~h~(%s~h~~h~%.2f~w~~h~~h~)",Player[playerid][Name], DamageDone[2][issuerid], WeaponNames[weaponid], iColor, Health[2]);
1254 PlayerTextDrawSetString(issuerid, DoingDamage[2], iString);
1255 TakeDmgCD[2][issuerid] = 1;
1256
1257 }
1258 }
1259
1260
1261 if(gLastHit[3][playerid] == -1 && gLastHit[4][playerid] != issuerid && gLastHit[5][playerid] != issuerid) gLastHit[3][playerid] = issuerid;
1262
1263 if(gLastHit[3][playerid] == issuerid) {
1264 DamageDone[3][playerid] += amount;
1265
1266 format(iString, sizeof(iString), "~r~~h~~h~%s ~w~~h~~h~/ -%.2f ~r~~h~~h~%s ~w~~h~~h~(%s~h~~h~%.2f~w~~h~~h~)", Player[issuerid][Name], DamageDone[3][playerid], WeaponNames[weaponid], iColor, Health[2]);
1267 PlayerTextDrawSetString(playerid, GettingDamaged[0], iString);
1268 TakeDmgCD[3][playerid] = 1;
1269
1270 } else {
1271 if(gLastHit[4][playerid] == -1 && gLastHit[5][playerid] != issuerid) gLastHit[4][playerid] = issuerid;
1272 if(gLastHit[4][playerid] == issuerid) {
1273 DamageDone[4][playerid] += amount;
1274
1275 format(iString, sizeof(iString), "~r~~h~~h~%s ~w~~h~~h~/ -%.2f ~r~~h~~h~%s ~w~~h~~h~(%s~h~~h~%.2f~w~~h~~h~)", Player[issuerid][Name], DamageDone[4][playerid], WeaponNames[weaponid], iColor, Health[2]);
1276 PlayerTextDrawSetString(playerid, GettingDamaged[1], iString);
1277 TakeDmgCD[4][playerid] = 1;
1278
1279 } else {
1280 DamageDone[5][playerid] += amount;
1281 gLastHit[5][playerid] = issuerid;
1282
1283 format(iString, sizeof(iString), "~r~~h~~h~%s ~w~~h~~h~/ -%.2f ~r~~h~~h~%s ~w~~h~~h~(%s~h~~h~%.2f~w~~h~~h~)", Player[issuerid][Name], DamageDone[5][playerid], WeaponNames[weaponid], iColor, Health[2]);
1284 PlayerTextDrawSetString(playerid, GettingDamaged[2], iString);
1285 TakeDmgCD[5][playerid] = 1;
1286
1287 }
1288 }
1289 } else {
1290 if(GetPlayerState(playerid) != PLAYER_STATE_WASTED) {
1291
1292 PlayerPlaySound(playerid, 1131, 0, 0, 0);
1293
1294 if(gLastHit[3][playerid] == -1 && gLastHit[4][playerid] != playerid && gLastHit[5][playerid] != playerid) gLastHit[3][playerid] = playerid;
1295 if(gLastHit[3][playerid] == playerid) {
1296 DamageDone[3][playerid] += amount;
1297
1298 format(iString, sizeof(iString), "~w~~h~~h~-%.2f ~r~~h~~h~%s ~w~~h~~h~(%s~h~~h~%.2f~w~~h~~h~)", DamageDone[3][playerid], WeaponNames[weaponid], iColor, Health[2]);
1299 PlayerTextDrawSetString(playerid, GettingDamaged[0], iString);
1300 TakeDmgCD[3][playerid] = 1;
1301
1302 } else {
1303 if(gLastHit[4][playerid] == -1 && gLastHit[5][playerid] != playerid) gLastHit[4][playerid] = playerid;
1304 if(gLastHit[4][playerid] == playerid) {
1305 DamageDone[4][playerid] += amount;
1306
1307 format(iString, sizeof(iString), "~w~~h~~h~-%.2f ~r~~h~~h~%s ~w~~h~~h~(%s~h~~h~%.2f~w~~h~~h~)", DamageDone[4][playerid], WeaponNames[weaponid], iColor, Health[2]);
1308 PlayerTextDrawSetString(playerid, GettingDamaged[1], iString);
1309 TakeDmgCD[4][playerid] = 1;
1310
1311 } else {
1312 DamageDone[5][playerid] += amount;
1313
1314 format(iString, sizeof(iString), "~w~~h~~h~-%.2f ~r~~h~~h~%s ~w~~h~~h~(%s~h~~h~%.2f~w~~h~~h~)", DamageDone[5][playerid], WeaponNames[weaponid], iColor, Health[2]);
1315 PlayerTextDrawSetString(playerid, GettingDamaged[2], iString);
1316 gLastHit[5][playerid] = playerid;
1317 TakeDmgCD[5][playerid] = 1;
1318
1319 }
1320 }
1321 }
1322 }
1323
1324 return 1;
1325}
1326
1327
1328public OnPlayerDeath(playerid, killerid, reason)
1329{
1330 if(reason == 255) reason = 53;
1331 new iString[180];
1332 GivePlayerMoney(killerid, 2000);
1333
1334 //antide
1335 if(reason == 54 && Player[playerid][LastHitWith] != -1 && Player[playerid][LastHitBy] != -1)
1336 {
1337 new weap, killahid;
1338 weap = Player[playerid][LastHitWith];
1339 killahid = Player[playerid][LastHitBy];
1340
1341 SendDeathMessage(killahid, playerid, weap);
1342
1343 GiveDeath(playerid);
1344 GiveScore(killahid, 1 * Player[killerid][Spree]);
1345 GiveKill(killahid);
1346 GiveWKill(killahid, weap);
1347 CheckRewards(killahid);
1348
1349 Player[killahid][Spree]++;
1350
1351 Player[playerid][LastHitWith] = -1;
1352 Player[playerid][LastHitBy] = -1;
1353 Player[killahid][LastKilled] = playerid;
1354 }
1355 //antide
1356
1357 if(killerid == INVALID_PLAYER_ID)
1358 {
1359 SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
1360 GiveDeath(playerid);
1361 }
1362
1363 else if(killerid != INVALID_PLAYER_ID && IsPlayerConnected(killerid))
1364 {
1365 format(iString, sizeof(iString), "%sYou Killed: %s%s", TDColor[Player[killerid][Team]], TDColor[Player[playerid][Team]], Player[playerid][Name]);
1366 PlayerTextDrawSetString(killerid, DeathText[0], iString);
1367 PlayerTextDrawShow(killerid, DeathText[0]);
1368
1369 format(iString, sizeof(iString), "%sKilled by: %s%s", TDColor[Player[playerid][Team]], TDColor[Player[killerid][Team]], Player[killerid][Name]);
1370 PlayerTextDrawSetString(playerid, DeathText[1], iString);
1371 PlayerTextDrawShow(playerid, DeathText[1]);
1372
1373 SetTimerEx("DeathMessage", 4000, false, "ii", killerid, playerid);
1374
1375 SendDeathMessage(killerid, playerid, reason);
1376
1377 if(reason == 0 || reason == 24 || reason == 25 || reason == 27 || reason == 29 || reason == 30 || reason == 31 || reason == 33 || reason == 34 || reason == 51) GiveWKill(killerid, reason);
1378
1379 GiveKill(killerid);
1380 GiveDeath(playerid);
1381 Player[killerid][Spree]++;
1382 GiveScore(killerid, 1 * Player[killerid][Spree]);
1383
1384 switch(Player[killerid][Spree])
1385 {
1386 case 2: ShowAnn2(killerid, "DOUBLE KILL");
1387 case 3: ShowAnn2(killerid, "MULTI KILL");
1388 case 4: ShowAnn2(killerid, "MEGA KILL");
1389 case 5: ShowAnn2(killerid, "ULTRA KILL");
1390 case 6: ShowAnn2(killerid, "M-M-M-MONSTER KILL!");
1391 case 7: ShowAnn2(killerid, "L-L-L-LUDICROUS KILL!");
1392 case 8: ShowAnn2(killerid, "UNSTOPPABLE!");
1393 case 9: ShowAnn2(killerid, "WICKED SICK!");
1394 case 10 .. 200:
1395 {
1396 format(iString, sizeof(iString), "HOLY SHIT!~n~%s%s %d KILLS!", TDColor[Player[killerid][Team]], Player[killerid][Name], Player[killerid][Spree]);
1397 ShowAnn2(killerid, iString);
1398 }
1399 }
1400
1401 switch(Player[killerid][Team])
1402 {
1403 case GREENTEAM: GKills++;
1404 case BLUETEAM: BKills++;
1405 }
1406
1407 if( Player[killerid][SniperK] == 5 || Player[killerid][SniperK] == 25 || Player[killerid][SniperK] == 50 ||
1408 Player[killerid][SniperK] == 100 || Player[killerid][SniperK] == 150 || Player[killerid][SniperK] == 200 ||
1409 Player[killerid][SniperK] == 250 || Player[killerid][SniperK] == 300 || Player[killerid][SniperK] == 350 ||
1410 Player[killerid][SniperK] == 400 || Player[killerid][SniperK] == 450 || Player[killerid][SniperK] == 499 )
1411 {
1412 format(iString, sizeof(iString), "Eagle Eye~n~~n~%d / 500 Sniper Kills", Player[killerid][DeagleK]);
1413 ShowAch(killerid, iString, Player[killerid][SniperK], 500);
1414 }
1415
1416 if( Player[killerid][DeagleK] == 5 || Player[killerid][DeagleK] == 25 || Player[killerid][DeagleK] == 50 ||
1417 Player[killerid][DeagleK] == 75 || Player[killerid][DeagleK] == 100 || Player[killerid][DeagleK] == 125 ||
1418 Player[killerid][DeagleK] == 150 || Player[killerid][DeagleK] == 175 || Player[killerid][DeagleK] == 200 ||
1419 Player[killerid][DeagleK] == 225 || Player[killerid][DeagleK] == 249 )
1420 {
1421 format(iString, sizeof(iString), "The Eagle of Desert~n~~n~%d / 250 Deagle Kills", Player[killerid][DeagleK]);
1422 ShowAch(killerid, iString, Player[killerid][DeagleK], 250);
1423 }
1424
1425 if( Player[killerid][ShotgunK] == 5 || Player[killerid][ShotgunK] == 50 || Player[killerid][ShotgunK] == 100 ||
1426 Player[killerid][ShotgunK] == 150 || Player[killerid][ShotgunK] == 200 || Player[killerid][ShotgunK] == 250 ||
1427 Player[killerid][ShotgunK] == 300 || Player[killerid][ShotgunK] == 350 || Player[killerid][ShotgunK] == 400 ||
1428 Player[killerid][ShotgunK] == 450 || Player[killerid][ShotgunK] == 500 || Player[killerid][ShotgunK] == 550 ||
1429 Player[killerid][ShotgunK] == 600 || Player[killerid][ShotgunK] == 650 || Player[killerid][ShotgunK] == 700 ||
1430 Player[killerid][ShotgunK] == 750 || Player[killerid][ShotgunK] == 800 || Player[killerid][ShotgunK] == 850 ||
1431 Player[killerid][ShotgunK] == 900 || Player[killerid][ShotgunK] == 950 || Player[killerid][ShotgunK] == 999 )
1432 {
1433 format(iString, sizeof(iString), "Double Barrel Power~n~~n~%d / 1000 Shotgun Kills", Player[killerid][ShotgunK]);
1434 ShowAch(killerid, iString, Player[killerid][ShotgunK], 1000);
1435 }
1436
1437 if( Player[killerid][RifleK] == 5 || Player[killerid][RifleK] == 25 || Player[killerid][RifleK] == 50 ||
1438 Player[killerid][RifleK] == 75 || Player[killerid][RifleK] == 100 || Player[killerid][RifleK] == 125 ||
1439 Player[killerid][RifleK] == 150 || Player[killerid][RifleK] == 175 || Player[killerid][RifleK] == 200 ||
1440 Player[killerid][RifleK] == 225 || Player[killerid][RifleK] == 249 )
1441 {
1442 format(iString, sizeof(iString), "Patience pays off~n~~n~%d / 250 Rifle Kills", Player[killerid][RifleK]);
1443 ShowAch(killerid, iString, Player[killerid][RifleK], 250);
1444 }
1445
1446 if( Player[killerid][MP5K] == 5 || Player[killerid][MP5K] == 10 || Player[killerid][MP5K] == 15 ||
1447 Player[killerid][MP5K] == 20 || Player[killerid][MP5K] == 25 || Player[killerid][MP5K] == 30 ||
1448 Player[killerid][MP5K] == 35 || Player[killerid][MP5K] == 40 || Player[killerid][MP5K] == 45 ||
1449 Player[killerid][MP5K] == 49 )
1450 {
1451 format(iString, sizeof(iString), "Newbies love me~n~~n~%d / 50 MP5 Kills", Player[killerid][MP5K]);
1452 ShowAch(killerid, iString, Player[killerid][MP5K], 50);
1453 }
1454
1455 if( Player[killerid][AK47K] == 5 || Player[killerid][AK47K] == 10 || Player[killerid][AK47K] == 20 ||
1456 Player[killerid][AK47K] == 30 || Player[killerid][AK47K] == 40 || Player[killerid][AK47K] == 50 ||
1457 Player[killerid][AK47K] == 60 || Player[killerid][AK47K] == 70 || Player[killerid][AK47K] == 80 ||
1458 Player[killerid][AK47K] == 90 || Player[killerid][AK47K] == 99 )
1459 {
1460 format(iString, sizeof(iString), "For Mother Russia!~n~~n~%d / 100 AK47 Kills", Player[killerid][AK47K]);
1461 ShowAch(killerid, iString, Player[killerid][AK47K], 100);
1462 }
1463
1464 if( Player[killerid][M4K] == 5 || Player[killerid][M4K] == 25 || Player[killerid][M4K] == 50 ||
1465 Player[killerid][M4K] == 75 || Player[killerid][M4K] == 100 || Player[killerid][M4K] == 125 ||
1466 Player[killerid][M4K] == 150 || Player[killerid][M4K] == 175 || Player[killerid][M4K] == 200 ||
1467 Player[killerid][M4K] == 225 || Player[killerid][M4K] == 249 )
1468 {
1469 format(iString, sizeof(iString), "Counter-Red Team win~n~~n~%d / 250 M4 Kills", Player[killerid][M4K]);
1470 ShowAch(killerid, iString, Player[killerid][M4K], 250);
1471 }
1472
1473 if( Player[killerid][Headshots] == 5 || Player[killerid][Headshots] == 10 || Player[killerid][Headshots] == 15 ||
1474 Player[killerid][Headshots] == 20 || Player[killerid][Headshots] == 25 || Player[killerid][Headshots] == 30 ||
1475 Player[killerid][Headshots] == 35 || Player[killerid][Headshots] == 40 || Player[killerid][Headshots] == 45 ||
1476 Player[killerid][Headshots] == 49 )
1477 {
1478 format(iString, sizeof(iString), "The Head Hunter~n~~n~%d / 50 Headshots", Player[killerid][Headshots]);
1479 ShowAch(killerid, iString, Player[killerid][Headshots], 50);
1480 }
1481
1482 if( Player[killerid][GrenadeK] == 5 || Player[killerid][GrenadeK] == 10 || Player[killerid][GrenadeK] == 15 ||
1483 Player[killerid][GrenadeK] == 20 || Player[killerid][GrenadeK] == 25 || Player[killerid][GrenadeK] == 30 ||
1484 Player[killerid][GrenadeK] == 35 || Player[killerid][GrenadeK] == 40 || Player[killerid][GrenadeK] == 45 ||
1485 Player[killerid][GrenadeK] == 49 )
1486 {
1487 format(iString, sizeof(iString), "YIPPE KI-YAY~n~~n~%d / 50 Grenade Kills", Player[killerid][MP5K]);
1488 ShowAch(killerid, iString, Player[killerid][GrenadeK], 50);
1489 }
1490
1491 if(Player[killerid][SniperK] == 500 && Player[killerid][UnlockedEagleEye] == false)
1492 {
1493 PlayerPlaySound(killerid, 1133, 0, 0, 0);
1494 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~Eagle Eye~n~%d / 500 Sniper Kills", Player[killerid][SniperK]);
1495 ShowAch(killerid, iString, Player[killerid][SniperK], 500);
1496 }
1497 if(Player[killerid][DeagleK] == 250 && Player[killerid][UnlockedMP5] == false)
1498 {
1499 SendClientMessage(killerid, YELLOW_COLOR, "MP5 unlocked! Type {FFFFFF}/guns {FFFF00}to select it");
1500 PlayerPlaySound(killerid, 1133, 0, 0, 0);
1501 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~The Eagle of Desert~n~%d / 250 Deagle Kills~n~MP5 unlocked in /guns menu", Player[killerid][DeagleK]);
1502 ShowAch(killerid, iString, Player[killerid][DeagleK], 250);
1503 }
1504 if(Player[killerid][ShotgunK] == 1000 && Player[killerid][UnlockedSpas] == false)
1505 {
1506 SendClientMessage(killerid, YELLOW_COLOR, "Spas unlocked! Type {FFFFFF}/guns {FFFF00}to select it");
1507 PlayerPlaySound(killerid, 1133, 0, 0, 0);
1508 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~Double Barrel Power~n~%d / 1000 Shotgun Kills~n~Spas unlocked in /guns menu", Player[killerid][ShotgunK]);
1509 ShowAch(killerid, iString, Player[killerid][ShotgunK], 1000);
1510 }
1511 if(Player[killerid][RifleK] == 250 && Player[killerid][UnlockedSniper] == false)
1512 {
1513 SendClientMessage(killerid, YELLOW_COLOR, "Sniper unlocked! Type {FFFFFF}/guns {FFFF00}to select it");
1514 PlayerPlaySound(killerid, 1133, 0, 0, 0);
1515 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~Patience pays off~n~%d / 250 Rifle Kills~n~Sniper unlocked in /guns menu", Player[killerid][RifleK]);
1516 ShowAch(killerid, iString, Player[killerid][RifleK], 250);
1517 }
1518 if(Player[killerid][MP5K] == 50 && Player[killerid][UnlockedAK47] == false)
1519 {
1520 SendClientMessage(killerid, YELLOW_COLOR, "AK47 unlocked! Type {FFFFFF}/guns {FFFF00}to select it");
1521 PlayerPlaySound(killerid, 1133, 0, 0, 0);
1522 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~Newbies love me~n~%d / 50 MP5 Kills~n~AK47 unlocked in /guns menu", Player[killerid][MP5K]);
1523 ShowAch(killerid, iString, Player[killerid][MP5K], 50);
1524 }
1525 if(Player[killerid][AK47K] == 100 && Player[killerid][UnlockedM4] == false)
1526 {
1527 SendClientMessage(killerid, YELLOW_COLOR, "M4 ulocked! Type {FFFFFF}/guns {FFFF00}to select it");
1528 PlayerPlaySound(killerid, 1133, 0, 0, 0);
1529 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~For Mother Russia!~n~%d / 100 AK47 Kills~n~M4 unlocked in /guns menu", Player[killerid][AK47K]);
1530 ShowAch(killerid, iString, Player[killerid][AK47K], 100);
1531 }
1532 if(Player[killerid][M4K] == 250 && Player[killerid][UnlockedGrenade] == false)
1533 {
1534 SendClientMessage(killerid, YELLOW_COLOR, "Grenade unlocked! Type {FFFFFF}/guns {FFFF00}to select it");
1535 PlayerPlaySound(killerid, 1133, 0, 0, 0);
1536 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~Counter-Red Team win~n~%d / 250 M4 Kills~n~Grenade unlocked in /guns menu", Player[killerid][M4K]);
1537 ShowAch(killerid, iString, Player[killerid][M4K], 250);
1538 }
1539 if(Player[killerid][Headshots] == 50 && Player[killerid][UnlockedCigar] == false)
1540 {
1541 SendClientMessage(killerid, YELLOW_COLOR, "Cigar unlocked! You will spawn with a Cigar next time");
1542 PlayerPlaySound(killerid, 1133, 0, 0, 0);
1543 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~The Head Hunter~n~%d / 50 Headshots~n~You will now spawn with a Cigar!", Player[killerid][Headshots]);
1544 ShowAch(killerid, iString, Player[killerid][Headshots], 50);
1545 }
1546 if(Player[killerid][GrenadeK] == 50 && Player[killerid][UnlockedFlame] == false)
1547 {
1548 SendClientMessage(killerid, YELLOW_COLOR, "Flame Head unlocked! You will spawn with a Flaming Head next time");
1549 PlayerPlaySound(killerid, 1133, 0, 0, 0);
1550 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~YIPPE KI-YAY~n~%d / 50 Grenade Kills~n~You will now spawn with a Flaming Head!", Player[killerid][MP5K]);
1551 ShowAch(killerid, iString, Player[killerid][GrenadeK], 50);
1552 }
1553
1554 CheckRewards(killerid);
1555 }
1556
1557 Player[playerid][LastHitWith] = -1; //antide
1558 Player[playerid][LastHitBy] = -1; //antide
1559 Player[playerid][Spree] = 0;
1560 Player[killerid][LastKilled] = playerid;
1561
1562 return 1;
1563}
1564
1565
1566
1567public OnPlayerText(playerid, text[])
1568{
1569 if(text[0] == '!') {
1570 new ChatColor;
1571 switch(Player[playerid][Team]) {
1572 case GREENTEAM: ChatColor = 0x55FF55FF;
1573 case BLUETEAM: ChatColor = 0x0080FF44;
1574 }
1575 format(ChatString,sizeof(ChatString),"[TEAM] %s (%d): %s", Player[playerid][Name], playerid, text[1]);
1576
1577 foreach(new i : Player)
1578 {
1579 if(Player[playerid][Team] == GREENTEAM && Player[i][Team] == GREENTEAM) { SendClientMessage(i, ChatColor, ChatString); PlayerPlaySound(i,1137,0.0,0.0,0.0); }
1580 if(Player[playerid][Team] == BLUETEAM && Player[i][Team] == BLUETEAM) { SendClientMessage(i, ChatColor, ChatString); PlayerPlaySound(i,1137,0.0,0.0,0.0); }
1581 }
1582 return 0;
1583 } else {
1584 if(Player[playerid][Muted] == true) { SendErrorMessage(playerid,"You are muted"); return 0; }
1585 }
1586
1587 if(text[0] == '@' && Player[playerid][Level] > 0) {
1588 format(ChatString, sizeof(ChatString), "[ADMIN] %s (%d): %s", Player[playerid][Name], playerid, text[1]);
1589 foreach(new i : Player) {
1590 if(Player[i][Level] > 0) {
1591 SendClientMessage(i, ADMIN_COLOR, ChatString);
1592 PlayerPlaySound(i,1137,0.0,0.0,0.0);
1593 }
1594 }
1595
1596 return 0;
1597 }
1598
1599 if(text[0] == '>') {
1600 format(ChatString, sizeof(ChatString), "(%d) {00EE00}>%s", playerid, text[1]);
1601 SendPlayerMessageToAll(playerid, ChatString);
1602 return 0;
1603 }
1604
1605
1606 format(ChatString, sizeof(ChatString),"(%d) %s", playerid, text);
1607 SendPlayerMessageToAll(playerid,ChatString);
1608
1609 return 0;
1610}
1611
1612public OnPlayerCommandReceived(playerid, cmdtext[])
1613{
1614 return 1;
1615}
1616
1617public OnPlayerCommandPerformed(playerid, cmdtext[], success)
1618{
1619 if(success == 0)
1620 {
1621 new iString[128];
1622 format(iString, sizeof(iString), "ERROR: {FFFFFF}Command {FF0000}%s {FFFFFF}is unknown. Available commands list: {FFFF00}/cmds", cmdtext);
1623 SendClientMessage(playerid, 0xFF0000FF, iString);
1624 }
1625 return 1;
1626}
1627
1628public OnPlayerStateChange(playerid, newstate, oldstate)
1629{
1630 return 1;
1631}
1632
1633public OnPlayerRequestSpawn(playerid)
1634{
1635 if(Player[playerid][Logged] == false)
1636 {
1637 GameTextForPlayer(playerid, "~r~~h~Please login or ~r~~h~register first", 3000, 4);
1638 return 0;
1639 }
1640
1641 if(Player[playerid][Team] == GREENTEAM)
1642 {
1643 if(GetTeamBalance(GREENTEAM) > GetTeamBalance(BLUETEAM))
1644 {
1645 GameTextForPlayer(playerid, "~r~~h~This team is full~n~~r~~h~Choose other team", 3000, 4);
1646 return 0;
1647 }
1648 }
1649
1650 if(Player[playerid][Team] == BLUETEAM)
1651 {
1652 if(GetTeamBalance(BLUETEAM) > GetTeamBalance(GREENTEAM))
1653 {
1654 GameTextForPlayer(playerid, "~r~~h~This team is full~n~~r~~h~Choose other team", 3000, 4);
1655 return 0;
1656 }
1657 }
1658
1659 if(Player[playerid][ClassID] == 2 || Player[playerid][ClassID] == 3 || Player[playerid][ClassID] == 6 || Player[playerid][ClassID] == 7)
1660 {
1661 if(Player[playerid][VIP] == 0)
1662 {
1663 GameTextForPlayer(playerid, "~r~~h~Only for VIPS!", 3000, 4);
1664 return 0;
1665 }
1666 }
1667
1668 return 1;
1669}
1670
1671public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
1672{
1673 if(newkeys == 160 && GetPlayerWeapon(playerid) == 0 && !IsPlayerInAnyVehicle(playerid))
1674 {
1675 SyncPlayer(playerid);
1676 return 1;
1677 }
1678
1679 if( (oldkeys & KEY_FIRE) || (oldkeys & KEY_HANDBRAKE) || (oldkeys & KEY_SECONDARY_ATTACK) || (oldkeys & KEY_SPRINT) || (oldkeys & KEY_JUMP) )
1680 {
1681 CloseTable(playerid);
1682 }
1683
1684 if( (oldkeys & KEY_SECONDARY_ATTACK) && Player[playerid][Checking] == true)
1685 {
1686 Player[playerid][Checking] = false;
1687 }
1688
1689//easter
1690
1691 if(oldkeys & KEY_SECONDARY_ATTACK)
1692 {
1693 if((IsPlayerInArea(playerid, EasterX-1, EasterX+1, EasterY-1, EasterY+1)) && EggFound == false)
1694 {
1695 GameTextForPlayer(playerid, "~y~Halloween Pumpkin Found!", 3000, 3);
1696 GiveScore(playerid, 10);
1697
1698
1699//easter1
1700 SendClientMessage(playerid, YELLOW_COLOR, "You found a Grenade in Halloween Pumpkin!");
1701 GivePlayerWeapon(playerid, GRENADE, 1);
1702//easter1
1703
1704
1705//easter2
1706
1707 new Float:AP;
1708 new skin = GetPlayerSkin(playerid);
1709
1710 GetPlayerArmour(playerid, AP);
1711 SetPlayerArmour(playerid, AP+25);
1712 SendClientMessage(playerid, YELLOW_COLOR, "You found some {FFFFFF}Armour {FFFF00}in Halloween Pumpkin!");
1713 switch(skin) //armor
1714 {
1715 case 53: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.000, 0.036, 0.000, 0.000, -1.800, 0.000, 1.068, 1.163, 1.000, 0xFF55FF55, 0xFF55FF55);
1716 case 250: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.022, 0.037, 0.000, 0.000, -1.800, 0.000, 1.318, 1.393, 1.000, 0xFF55FF55, 0xFF55FF55);
1717 case 45: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.013, 0.049, 0.000, 0.000, -1.800, 0.000, 1.160, 1.171, 1.000, 0xFF55FF55, 0xFF55FF55);
1718 case 191: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.074, 0.041, 0.000, 0.000, -1.800, 9.599, 1.178, 1.253, 0.868, 0xFF55FF55, 0xFF55FF55);
1719 case 230: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.017, 0.058, 0.000, 0.000, -1.800, 0.000, 1.160, 1.087, 0.857, 0xFF0080FF, 0xFF0080FF);
1720 case 177: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.004, 0.054, 0.000, 0.000, -1.800, 0.599, 1.317, 1.392, 1.213, 0xFF0080FF, 0xFF0080FF);
1721 case 154: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.013, 0.049, 0.000, 0.000, -1.800, 0.000, 1.160, 1.171, 1.000, 0xFF0080FF, 0xFF0080FF);
1722 case 198: SetPlayerAttachedObject(playerid, 0, 19515, 1, 0.042, 0.074, 0.000, 0.000, -1.800, 5.500, 1.230, 1.392, 0.860, 0xFF0080FF, 0xFF0080FF);
1723 }
1724
1725//easter2
1726
1727//easter3
1728 SendClientMessage(playerid, YELLOW_COLOR, "You found a {FFFFFF}HS Rocket Launcher {FFFF00}in Halloween Pumpkin!");
1729 GivePlayerWeapon(playerid, 36, 1);
1730//easter3
1731
1732 EggFound = true;
1733 new iString[128];
1734 format(iString, sizeof(iString), "%s%s {FFFF00}found an Halloween Pumpkin!", TextColor[Player[playerid][Team]], Player[playerid][Name]);
1735 SendClientMessageToAll(YELLOW_COLOR, iString);
1736 Update3DTextLabelText(EasterText, 0xFFFF00FF, "Already opened by someone");
1737 }
1738 }
1739
1740//easter
1741
1742 return 1;
1743}
1744
1745public OnPlayerUpdate(playerid)
1746{
1747 return 1;
1748}
1749
1750public OnPlayerStreamIn(playerid, forplayerid)
1751{
1752 if(Player[forplayerid][Team] != Player[playerid][Team])
1753 {
1754 SetPlayerMarkerForPlayer(forplayerid, playerid, GetPlayerColor(playerid) & 0xFFFFFF00);
1755 } else {
1756 SetPlayerMarkerForPlayer(forplayerid, playerid, GetPlayerColor(playerid) | 0x00000077);
1757 }
1758 return 1;
1759}
1760
1761public OnPlayerStreamOut(playerid, forplayerid)
1762{
1763 if(Player[forplayerid][Team] != Player[playerid][Team])
1764 {
1765 SetPlayerMarkerForPlayer(forplayerid,playerid, GetPlayerColor(playerid) & 0xFFFFFF00);
1766 } else {
1767 SetPlayerMarkerForPlayer(forplayerid,playerid, GetPlayerColor(playerid) | 0x00000055);
1768 }
1769 return 1;
1770}
1771
1772public OnPlayerClickPlayer(playerid, clickedplayerid, source)
1773{
1774 return 1;
1775}
1776
1777public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
1778{
1779 if(Player[playerid][Level] == 4)
1780 {
1781 SetPlayerPosFindZ(playerid, fX, fY, fZ);
1782 }
1783 return 1;
1784}
1785
1786public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
1787{
1788 new iString[160];
1789
1790 new Weapon[13], Ammo[13];
1791 for(new k = 0; k < 13; k++) GetPlayerWeaponData(playerid, k, Weapon[k], Ammo[k]);
1792
1793 if(playertextid == ExitTD)
1794 {
1795 Player[playerid][OnMenu] = false;
1796 CancelSelectTextDraw(playerid);
1797 HideGunsTDs(playerid);
1798 SendClientMessage(playerid, YELLOW_COLOR, "Exited weapon selection menu.");
1799 }
1800
1801 if(playertextid == G1TD)
1802 {
1803 SendClientMessage(playerid, YELLOW_COLOR, "Primary weapon changed to: Deagle");
1804 }
1805
1806 if(playertextid == G2TD)
1807 {
1808 SendClientMessage(playerid, YELLOW_COLOR, "Secondary weapon changed to: Shotgun");
1809 Player[playerid][Gun2] = SHOTGUN;
1810 GivePlayerWeapon(playerid, Player[playerid][Gun2], 0);
1811 SetPlayerAmmo(playerid, Player[playerid][Gun2], Ammo[3]);
1812 UpdateTDs(playerid);
1813 }
1814
1815 if(playertextid == G2bTD)
1816 {
1817 if(Player[playerid][UnlockedSpas] == true)
1818 {
1819 SendClientMessage(playerid, YELLOW_COLOR, "Secondary weapon changed to: Spas");
1820 Player[playerid][Gun2] = SPAS;
1821 GivePlayerWeapon(playerid, Player[playerid][Gun2], 0);
1822 SetPlayerAmmo(playerid, Player[playerid][Gun2], Ammo[3]);
1823 UpdateTDs(playerid);
1824 } else {
1825 format(iString, sizeof(iString), "You need {FFFFFF}%d {FF0000}more shotgun kills to unlock Spas", 1000 - Player[playerid][ShotgunK]);
1826 SendClientMessage(playerid, RED_COLOR, iString);
1827 }
1828 }
1829
1830 if(playertextid == G30TD)
1831 {
1832 SendClientMessage(playerid, YELLOW_COLOR, "Tertiary weapon changed to: None");
1833 SetPlayerAmmo(playerid, Player[playerid][Gun3], 0);
1834 Player[playerid][Gun3] = 0;
1835 UpdateTDs(playerid);
1836 }
1837
1838 if(playertextid == G3TD)
1839 {
1840 if(Player[playerid][UnlockedAK47] == true)
1841 {
1842 SendClientMessage(playerid, YELLOW_COLOR, "Tertiary weapon changed to: AK47");
1843 Player[playerid][Gun3] = AK47;
1844 GivePlayerWeapon(playerid, Player[playerid][Gun3], 0);
1845 SetPlayerAmmo(playerid, Player[playerid][Gun3], Ammo[5]);
1846 UpdateTDs(playerid);
1847 } else {
1848 format(iString, sizeof(iString), "You need {FFFFFF}%d {FF0000}more MP5 kills to unlock AK47", 50 - Player[playerid][MP5K]);
1849 SendClientMessage(playerid, RED_COLOR, iString);
1850 }
1851 }
1852
1853 if(playertextid == G3bTD)
1854 {
1855 if(Player[playerid][UnlockedM4] == true)
1856 {
1857 SendClientMessage(playerid, YELLOW_COLOR, "Tertiary weapon changed to: M4");
1858 Player[playerid][Gun3] = M4;
1859 GivePlayerWeapon(playerid, Player[playerid][Gun3], 0);
1860 SetPlayerAmmo(playerid, Player[playerid][Gun3], Ammo[5]);
1861 UpdateTDs(playerid);
1862 } else {
1863 format(iString, sizeof(iString), "You need {FFFFFF}%d {FF0000}more AK47 kills or {FFFF00}VIP {FF0000}to unlock M4", 100 - Player[playerid][AK47K]);
1864 SendClientMessage(playerid, RED_COLOR, iString);
1865 }
1866 }
1867
1868 if(playertextid == G40TD)
1869 {
1870 SendClientMessage(playerid, YELLOW_COLOR, "Short-range weapon changed to: None");
1871 SetPlayerAmmo(playerid, Player[playerid][Gun4], 0);
1872 Player[playerid][Gun4] = 0;
1873 UpdateTDs(playerid);
1874 }
1875
1876 if(playertextid == G4TD)
1877 {
1878 if(Player[playerid][UnlockedMP5] == true)
1879 {
1880 SendClientMessage(playerid, YELLOW_COLOR, "Short-range weapon changed to: MP5");
1881 Player[playerid][Gun4] = MP5;
1882 GivePlayerWeapon(playerid, Player[playerid][Gun4], 0);
1883 SetPlayerAmmo(playerid, Player[playerid][Gun4], Ammo[4]);
1884 UpdateTDs(playerid);
1885 } else {
1886 format(iString, sizeof(iString), "You need {FFFFFF}%d {FF0000}more Deagle kills to unlock MP5", 250 - Player[playerid][DeagleK]);
1887 SendClientMessage(playerid, RED_COLOR, iString);
1888 }
1889 }
1890
1891 if(playertextid == G5TD)
1892 {
1893 SendClientMessage(playerid, YELLOW_COLOR, "Long-range weapon changed to: Country Rifle");
1894 Player[playerid][Gun5] = RIFLE;
1895 GivePlayerWeapon(playerid, Player[playerid][Gun5], 0);
1896 SetPlayerAmmo(playerid, Player[playerid][Gun5], Ammo[6]);
1897 UpdateTDs(playerid);
1898 }
1899
1900 if(playertextid == G5bTD)
1901 {
1902 if(Player[playerid][UnlockedSniper] == true)
1903 {
1904 SendClientMessage(playerid, YELLOW_COLOR, "Long-range weapon changed to: Sniper Rifle");
1905 Player[playerid][Gun5] = SNIPER;
1906 GivePlayerWeapon(playerid, Player[playerid][Gun5], 0);
1907 SetPlayerAmmo(playerid, Player[playerid][Gun5], Ammo[6]);
1908 UpdateTDs(playerid);
1909 } else {
1910 format(iString, sizeof(iString), "You need {FFFFFF}%d {FF0000}more Rifle kills or {FFFF00}VIP {FF0000}to unlock Sniper", 250 - Player[playerid][RifleK]);
1911 SendClientMessage(playerid, RED_COLOR, iString);
1912 }
1913 }
1914
1915 if(playertextid == G60TD)
1916 {
1917 SendClientMessage(playerid, YELLOW_COLOR, "Throwable weapon changed to: None");
1918 SetPlayerAmmo(playerid, Player[playerid][Gun6], 0);
1919 Player[playerid][Gun6] = 0;
1920 UpdateTDs(playerid);
1921 }
1922
1923 if(playertextid == G6TD)
1924 {
1925 if(Player[playerid][UnlockedGrenade] == true)
1926 {
1927 SendClientMessage(playerid, YELLOW_COLOR, "Throwable weapon changed to: Grenade");
1928 Player[playerid][Gun6] = GRENADE;
1929 GivePlayerWeapon(playerid, Player[playerid][Gun6], 0);
1930 SetPlayerAmmo(playerid, Player[playerid][Gun6], Ammo[8]);
1931 UpdateTDs(playerid);
1932 } else {
1933 format(iString, sizeof(iString), "You need {FFFFFF}%d {FF0000}more M4 kills to unlock Grenade", 250 - Player[playerid][M4K]);
1934 SendClientMessage(playerid, RED_COLOR, iString);
1935 }
1936 }
1937 PlayerPlaySound(playerid, 1150, 0, 0, 0);
1938 return 1;
1939}
1940
1941public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
1942{
1943 new iString[160];
1944
1945 if(dialogid == DIALOG_REGISTER)
1946 {
1947 if(response)
1948 {
1949 if(isnull(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"{FFFFFF}Registration Dialog","{FFFFFF}Type your password below to register:","Register","Leave");
1950
1951 new HashPass[140];
1952 format(HashPass, sizeof(HashPass), "%d", udb_hash(inputtext));
1953
1954 new query[356];
1955 //ac
1956 format(query, sizeof(query), "INSERT INTO Players (Name, Password, Level, ForceAC, Kills, Deaths, Score, VIP, MaxRoundKills, MaxRoundDamage, Headshots, Tbags, PunchK, DeagleK, ShotgunK, SpasK, MP5K, AK47K, M4K, RifleK, SniperK, GrenadeK, Gun2, Gun3, Gun4, Gun5, Gun6) VALUES('%s', '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 33, 0)", DB_Escape(Player[playerid][Name]), HashPass);
1957 db_free_result(db_query(sqliteconnection, query));
1958
1959 format(HashPass, sizeof(HashPass), "You have been successfully registered. Password: {55FF55}%s", inputtext);
1960 SendClientMessage(playerid, YELLOW_COLOR, HashPass);
1961 SendClientMessage(playerid, YELLOW_COLOR, "Type {FFFFFF}/cmds {FFFF00}for commands and {FFFFFF}/updates {FFFF00}to read about latest updates");
1962
1963 Player[playerid][Logged] = true;
1964 Player[playerid][Level] = 0;
1965 Player[playerid][Kills] = 0;
1966 Player[playerid][Deaths] = 0;
1967 Player[playerid][RKills] = 0;
1968 Player[playerid][RDeaths] = 0;
1969 Player[playerid][RDamage] = 0;
1970 Player[playerid][Score] = 0;
1971 Player[playerid][Spree] = 0;
1972 Player[playerid][VIP] = 0;
1973 Player[playerid][MaxRoundKills] = 0;
1974 Player[playerid][MaxRoundDamage] = 0;
1975 Player[playerid][Headshots] = 0;
1976 Player[playerid][Tbags] = 0;
1977 Player[playerid][PunchK] = 0;
1978 Player[playerid][DeagleK] = 0;
1979 Player[playerid][ShotgunK] = 0;
1980 Player[playerid][SpasK] = 0;
1981 Player[playerid][MP5K] = 0;
1982 Player[playerid][AK47K] = 0;
1983 Player[playerid][M4K] = 0;
1984 Player[playerid][RifleK] = 0;
1985 Player[playerid][SniperK] = 0;
1986 Player[playerid][GrenadeK] = 0;
1987
1988 } else {
1989 format(iString, sizeof(iString),"{FFFFFF}%s (%d) {BABABA}kicked from server for not registering", Player[playerid][Name], playerid);
1990 SendClientMessageToAll(-1, iString);
1991 SetTimerEx("OnPlayerKicked", 500, false, "i", playerid);
1992 }
1993
1994 return 1;
1995 }
1996
1997 if(dialogid == DIALOG_LOGIN)
1998 {
1999 if(response)
2000 {
2001 if(isnull(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{FFFFFF}Login Dialog","{FFFFFF}Type your password below to log in:","Login","Leave");
2002
2003 new HashPass[140];
2004 format(HashPass, sizeof(HashPass), "%d", udb_hash(inputtext));
2005
2006 new Query[256];
2007 format(Query, sizeof(Query), "SELECT * FROM `Players` WHERE `Name` = '%s' AND `Password` = '%s'", DB_Escape(Player[playerid][Name]), HashPass);
2008 new DBResult:res = db_query(sqliteconnection, Query);
2009
2010 if(db_num_rows(res))
2011 {
2012 db_get_field_assoc(res, "Level", iString, sizeof(iString));
2013 Player[playerid][Level] = strval(iString);
2014
2015 db_get_field_assoc(res, "Kills", iString, sizeof(iString));
2016 Player[playerid][Kills] = strval(iString);
2017
2018 db_get_field_assoc(res, "Deaths", iString, sizeof(iString));
2019 Player[playerid][Deaths] = strval(iString);
2020
2021 db_get_field_assoc(res, "Score", iString, sizeof(iString));
2022 Player[playerid][Score] = strval(iString);
2023
2024 db_get_field_assoc(res, "VIP", iString, sizeof(iString));
2025 Player[playerid][VIP] = strval(iString);
2026
2027 db_get_field_assoc(res, "MaxRoundKills", iString, sizeof(iString));
2028 Player[playerid][MaxRoundKills] = strval(iString);
2029
2030 db_get_field_assoc(res, "MaxRoundDamage", iString, sizeof(iString));
2031 Player[playerid][MaxRoundDamage] = strval(iString);
2032
2033 db_get_field_assoc(res, "Headshots", iString, sizeof(iString));
2034 Player[playerid][Headshots] = strval(iString);
2035
2036 db_get_field_assoc(res, "Tbags", iString, sizeof(iString));
2037 Player[playerid][Tbags] = strval(iString);
2038
2039 db_get_field_assoc(res, "PunchK", iString, sizeof(iString));
2040 Player[playerid][PunchK] = strval(iString);
2041
2042 db_get_field_assoc(res, "DeagleK", iString, sizeof(iString));
2043 Player[playerid][DeagleK] = strval(iString);
2044
2045 db_get_field_assoc(res, "ShotgunK", iString, sizeof(iString));
2046 Player[playerid][ShotgunK] = strval(iString);
2047
2048 db_get_field_assoc(res, "SpasK", iString, sizeof(iString));
2049 Player[playerid][SpasK] = strval(iString);
2050
2051 db_get_field_assoc(res, "MP5K", iString, sizeof(iString));
2052 Player[playerid][MP5K] = strval(iString);
2053
2054 db_get_field_assoc(res, "AK47K", iString, sizeof(iString));
2055 Player[playerid][AK47K] = strval(iString);
2056
2057 db_get_field_assoc(res, "M4K", iString, sizeof(iString));
2058 Player[playerid][M4K] = strval(iString);
2059
2060 db_get_field_assoc(res, "RifleK", iString, sizeof(iString));
2061 Player[playerid][RifleK] = strval(iString);
2062
2063 db_get_field_assoc(res, "SniperK", iString, sizeof(iString));
2064 Player[playerid][SniperK] = strval(iString);
2065
2066 db_get_field_assoc(res, "GrenadeK", iString, sizeof(iString));
2067 Player[playerid][GrenadeK] = strval(iString);
2068
2069 db_get_field_assoc(res, "Gun2", iString, sizeof(iString));
2070 Player[playerid][Gun2] = strval(iString);
2071
2072 db_get_field_assoc(res, "Gun3", iString, sizeof(iString));
2073 Player[playerid][Gun3] = strval(iString);
2074
2075 db_get_field_assoc(res, "Gun4", iString, sizeof(iString));
2076 Player[playerid][Gun4] = strval(iString);
2077
2078 db_get_field_assoc(res, "Gun5", iString, sizeof(iString));
2079 Player[playerid][Gun5] = strval(iString);
2080
2081 db_get_field_assoc(res, "Gun6", iString, sizeof(iString));
2082 Player[playerid][Gun6] = strval(iString);
2083
2084 Player[playerid][Logged] = true;
2085 SetPlayerScore(playerid, Player[playerid][Score]);
2086
2087 CheckRewards(playerid);
2088
2089 SendClientMessage(playerid, YELLOW_COLOR, "You have successfully logged in");
2090 SendClientMessage(playerid, YELLOW_COLOR, "Type {FFFFFF}/cmds {FFFF00}for commands and {FFFFFF}/updates {FFFF00}to read about latest updates");
2091
2092 new weatherrandom1 = random(19);
2093 SetPlayerWeather(playerid, weatherrandom1);
2094
2095 new timerandom1 = random(23);
2096 SetPlayerTime(playerid, timerandom1, 0);
2097
2098 if(Player[playerid][VIP] == 1) //vip
2099 {
2100 Player[playerid][UnlockedM4] = true;
2101 Player[playerid][Gun3] = M4;
2102 Player[playerid][UnlockedSniper] = true;
2103 Player[playerid][Gun5] = SNIPER;
2104 VIPStuffs[playerid] = Create3DTextLabel("VIP", 0xFFFF00FF, 0, 0, 0, DRAW_DISTANCE, 0, 1);
2105 Attach3DTextLabelToPlayer(VIPStuffs[playerid], playerid, 0.0, 0.0, 0.5);
2106 SendClientMessage(playerid, YELLOW_COLOR, " ");
2107 SendClientMessage(playerid, YELLOW_COLOR, "You are a VIP.");
2108 }
2109
2110 } else {
2111 SendErrorMessage(playerid,"Wrong Password. Please try again.");
2112 ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{FFFFFF}Login Dialog","{FFFFFF}Type your password below to log in:","Login","Leave");
2113 }
2114 db_free_result(res);
2115
2116 } else {
2117
2118 format(iString, sizeof(iString),"{FFFFFF}%s (%d) {BABABA}kicked from the server for not logging in", Player[playerid][Name], playerid);
2119 SendClientMessageToAll(-1, iString);
2120
2121 SetTimerEx("OnPlayerKicked", 500, false, "i", playerid);
2122 }
2123 return 1;
2124 }
2125
2126 if(dialogid == DIALOG_MAPNAME)
2127 {
2128 if(response)
2129 {
2130 dini_Set(CreateFileString,"Name",inputtext);
2131 new str2[128];
2132 format(str2,sizeof(str2),">> Map name set to {FFFFFF}%s", inputtext);
2133 SendClientMessage(playerid,YELLOW_COLOR,str2);
2134 }
2135 return 1;
2136 }
2137 if(dialogid == DIALOG_MAPPERNAME)
2138 {
2139 if(response)
2140 {
2141 dini_Set(CreateFileString,"Mapper",inputtext);
2142 new str2[128];
2143 format(str2,sizeof(str2),">> Mapper name set to {FFFFFF}%s", inputtext);
2144 SendClientMessage(playerid,YELLOW_COLOR,str2);
2145 }
2146 return 1;
2147 }
2148
2149
2150 return 1;
2151}
2152
2153public OnPlayerExitedMenu(playerid) {
2154 new Menu:CurrentMenu = GetPlayerMenu(playerid);
2155 if(CurrentMenu == MapMenu)
2156 {
2157 TogglePlayerControllable(playerid, 1);
2158 }
2159}
2160
2161public OnPlayerSelectedMenuRow(playerid, row)
2162{
2163 new Menu:CurrentMenu = GetPlayerMenu(playerid);
2164 if(CurrentMenu == MapMenu)
2165 {
2166 TogglePlayerControllable(playerid,true);
2167 new string1[256];
2168 new Float:PlayerPos[4];
2169 GetPlayerPos(playerid,PlayerPos[0],PlayerPos[1],PlayerPos[2]);
2170 GetPlayerFacingAngle(playerid, PlayerPos[3]);
2171 switch(row)
2172 {
2173 case 0:
2174 {
2175 ShowPlayerDialog(playerid, DIALOG_MAPNAME, DIALOG_STYLE_INPUT,"Map Name","Enter the name of Map:","Ok","Cancel");
2176 }
2177 case 1:
2178 {
2179 ShowPlayerDialog(playerid, DIALOG_MAPPERNAME, DIALOG_STYLE_INPUT,"Mapper Name","Enter the name of Mapper:","Ok","Cancel");
2180 }
2181 case 2:
2182 {
2183 format(string1,256, "%f,%f",PlayerPos[0],PlayerPos[1]);
2184 dini_Set(CreateFileString,"MaxXY",string1);
2185
2186 GangZoneDestroy(TempZone);
2187
2188 TempMax[0] = PlayerPos[0];
2189 TempMax[1] = PlayerPos[1];
2190
2191 TempZone = GangZoneCreate(TempMin[0],TempMin[1],TempMax[0],TempMax[1]);
2192 GangZoneShowForPlayer(playerid, TempZone, 0xFF000055);
2193 GangZoneFlashForPlayer(playerid, TempZone, 0xFF000088);
2194
2195 format(string1,sizeof(string1), ">> Maximum XY set to {FFFFFF}%.2f, %.2f",PlayerPos[0],PlayerPos[1]);
2196 SendClientMessage(playerid,YELLOW_COLOR,string1);
2197 }
2198 case 3:
2199 {
2200 format(string1,256, "%f,%f",PlayerPos[0],PlayerPos[1]);
2201 dini_Set(CreateFileString,"MinXY",string1);
2202
2203 GangZoneDestroy(TempZone);
2204
2205 TempMin[0] = PlayerPos[0];
2206 TempMin[1] = PlayerPos[1];
2207
2208 TempZone = GangZoneCreate(TempMin[0],TempMin[1],TempMax[0],TempMax[1]);
2209 GangZoneShowForPlayer(playerid, TempZone, 0xFF000055);
2210 GangZoneFlashForPlayer(playerid, TempZone, 0xFF000088);
2211
2212 format(string1,sizeof(string1), ">> Minimum XY set to {FFFFFF}%.2f, %.2f",PlayerPos[0],PlayerPos[1]);
2213 SendClientMessage(playerid,YELLOW_COLOR,string1);
2214 }
2215 case 4: //GSpawn1
2216 {
2217 format(string1,256, "%f,%f,%f,%f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2218 dini_Set(CreateFileString,"GSpawn1",string1);
2219
2220 format(string1,sizeof(string1), ">> Red Spawn 1 set to {FFFFFF}%.3f, %.3f, %.3f, %.0f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2221 SendClientMessage(playerid,GREEN_COLOR,string1);
2222 }
2223 case 5: //GSpawn2
2224 {
2225 format(string1,256, "%f,%f,%f,%f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2226 dini_Set(CreateFileString,"GSpawn2",string1);
2227
2228 format(string1,sizeof(string1), ">> Red Spawn 2 set to {FFFFFF}%.3f, %.3f, %.3f, %.0f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2229 SendClientMessage(playerid,GREEN_COLOR,string1);
2230 }
2231 case 6: //GSpawn3
2232 {
2233 format(string1,256, "%f,%f,%f,%f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2234 dini_Set(CreateFileString,"GSpawn3",string1);
2235
2236 format(string1,sizeof(string1), ">> Red Spawn 3 set to {FFFFFF}%.3f, %.3f, %.3f, %.0f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2237 SendClientMessage(playerid,GREEN_COLOR,string1);
2238 }
2239 case 7: //BSpawn1
2240 {
2241 format(string1,256, "%f,%f,%f,%f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2242 dini_Set(CreateFileString,"BSpawn1",string1);
2243
2244 format(string1,sizeof(string1), ">> Blue Spawn 1 set to {FFFFFF}%.3f, %.3f, %.3f, %.0f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2245 SendClientMessage(playerid,BLUE_COLOR,string1);
2246 }
2247 case 8: //BSpawn2
2248 {
2249 format(string1,256, "%f,%f,%f,%f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2250 dini_Set(CreateFileString,"BSpawn2",string1);
2251
2252 format(string1,sizeof(string1), ">> Blue Spawn 2 set to {FFFFFF}%.3f, %.3f, %.3f, %.0f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2253 SendClientMessage(playerid,BLUE_COLOR,string1);
2254 }
2255 case 9: //BSpawn3
2256 {
2257 format(string1,256, "%f,%f,%f,%f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2258 dini_Set(CreateFileString,"BSpawn3",string1);
2259
2260 format(string1,sizeof(string1), ">> Blue Spawn 3 set to {FFFFFF}%.3f, %.3f, %.3f, %.0f",PlayerPos[0],PlayerPos[1],PlayerPos[2],PlayerPos[3]);
2261 SendClientMessage(playerid,BLUE_COLOR,string1);
2262 }
2263 case 10:
2264 {
2265 dini_IntSet(CreateFileString, "Interior", GetPlayerInterior(playerid));
2266 HideMenuForPlayer(MapMenu, playerid);
2267 GangZoneDestroy(TempZone);
2268 format(string1,sizeof(string1), ">> Finished mapping: {FFFFFF}%s", CreateFileString);
2269 SendClientMessage(playerid,GREEN_COLOR,string1);
2270 SendClientMessage(playerid,YELLOW_COLOR,"Before creating another map, remember to type {FFFFFF}/makemap [Map ID] {FFFF00}again");
2271 Player[playerid][Mapping] = false;
2272 }
2273 }
2274 }
2275}
2276forward CreateMenus();
2277public CreateMenus()
2278{
2279 MapMenu = CreateMenu("Map Menu", 1, 12.0, 150.0, 200.0, 150.0);
2280 AddMenuItem(MapMenu, 0, "Map Name");
2281 AddMenuItem(MapMenu, 0, "Mapper Name");
2282 AddMenuItem(MapMenu, 0, "Maximum XY boundary (North-East)");
2283 AddMenuItem(MapMenu, 0, "Minimum XY boundary (South-West)");
2284 AddMenuItem(MapMenu, 0, "Red Spawn 1");
2285 AddMenuItem(MapMenu, 0, "Red Spawn 2");
2286 AddMenuItem(MapMenu, 0, "Red Spawn 3");
2287 AddMenuItem(MapMenu, 0, "Blue Spawn 1");
2288 AddMenuItem(MapMenu, 0, "Blue Spawn 2");
2289 AddMenuItem(MapMenu, 0, "Blue Spawn 3");
2290 AddMenuItem(MapMenu, 0, ">> ~g~~h~~h~Finish mapping");
2291}
2292
2293MapFile(mapid)
2294{
2295 new iString[64];
2296 format(iString, sizeof(iString),"Maps/%d.ini", mapid);
2297 return iString;
2298}
2299
2300CreateMap(playerid, mapid)
2301{
2302 new fmap[256];
2303 fmap = MapFile(mapid);
2304 if(dini_Exists(fmap)) return SendErrorMessage(playerid, "A map with that ID already exists. Please choose a different map ID.");
2305
2306 new iString[128];
2307 format(iString, sizeof(iString), "You have started creating map: {FFFFFF}Maps/%d.ini", mapid);
2308 SendClientMessage(playerid,YELLOW_COLOR,iString);
2309 SendClientMessage(playerid,YELLOW_COLOR,"Go to locations and type {FFFFFF}/ok {FFFF00}to start saving each coordinate");
2310
2311 format(iString,128,"Maps/%d.ini",mapid);
2312
2313 dini_Create(iString);
2314 format(CreateFileString,256,"%s",iString);
2315
2316 return 1;
2317}
2318
2319
2320forward UpdateTeamBalance();
2321public UpdateTeamBalance()
2322{
2323 new iString[64];
2324 format(iString, sizeof(iString), "%s%d ~w~vs %s%d", TDColor[GREENTEAM], GetTeamBalance(GREENTEAM), TDColor[BLUETEAM], GetTeamBalance(BLUETEAM));
2325 TextDrawSetString(BalanceTD, iString);
2326}
2327
2328
2329SavePlayer(playerid)
2330{
2331 new savequery[512];
2332
2333 savequery = "UPDATE players SET ";
2334 strcat(savequery, "Level=%d,ForceAC=%d,Kills=%d,Deaths=%d,Score=%d,");
2335 strcat(savequery, "VIP=%d,MaxRoundKills=%d,MaxRoundDamage=%.2f,Headshots=%d,Tbags=%d,");
2336 strcat(savequery, "PunchK=%d,DeagleK=%d,ShotgunK=%d,SpasK=%d,MP5K=%d,");
2337 strcat(savequery, "AK47K=%d,M4K=%d,RifleK=%d,SniperK=%d,GrenadeK=%d,");
2338 strcat(savequery, "Gun2=%d,Gun3=%d,Gun4=%d,Gun5=%d,Gun6=%d");
2339
2340 strcat(savequery, " WHERE Name = '%s'");
2341
2342 format(savequery, sizeof(savequery), savequery,
2343 Player[playerid][Level],0,Player[playerid][Kills],Player[playerid][Deaths],Player[playerid][Score],
2344 Player[playerid][VIP],Player[playerid][MaxRoundKills],Player[playerid][MaxRoundDamage],Player[playerid][Headshots],Player[playerid][Tbags],
2345 Player[playerid][PunchK],Player[playerid][DeagleK],Player[playerid][ShotgunK],Player[playerid][SpasK],Player[playerid][MP5K],
2346 Player[playerid][AK47K],Player[playerid][M4K],Player[playerid][RifleK],Player[playerid][SniperK],Player[playerid][GrenadeK],
2347 Player[playerid][Gun2],Player[playerid][Gun3],Player[playerid][Gun4],Player[playerid][Gun5],Player[playerid][Gun6],
2348 DB_Escape(Player[playerid][Name]));
2349
2350 db_free_result(db_query(sqliteconnection, savequery));
2351}
2352
2353
2354forward SaveTimer();
2355public SaveTimer()
2356{
2357 foreach(new i : Player)
2358 {
2359 if(IsPlayerConnected(i) && Player[i][Logged] == true)
2360 {
2361 SavePlayer(i);
2362 }
2363 }
2364}
2365
2366
2367public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
2368{
2369 if(response)
2370 {
2371 SendClientMessage(playerid, GREEN_COLOR, "Attached object values:");
2372 new iString[128];
2373
2374 format(iString, sizeof(iString), "Offsets: %.3f, %.3f, %.3f | Rotations: %.3f, %.3f, %.3f | Scales: %.3f, %.3f, %.3f", fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
2375
2376 SendClientMessage(playerid, YELLOW_COLOR, iString);
2377 }
2378 else
2379 {
2380 SendClientMessage(playerid, RED_COLOR, "Attached object positions not saved");
2381 }
2382 return 1;
2383}
2384
2385
2386//============================================================================
2387//===============================Admin Commands===============================
2388//============================================================================
2389
2390CMD:freeze(playerid,params[])
2391{
2392 if(Player[playerid][Level] < 1) return SendErrorMessage(playerid,"You need to be an admin to do that");
2393 {
2394 new id;
2395 if(sscanf(params,"u",id)) return SendClientMessage(playerid,0xFF0000AA,"USAGE: /freeze [playerid]");
2396 if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000AA,"ERROR: Invalid playerid");
2397 TogglePlayerControllable(id,0);
2398 SendClientMessage(playerid,0xFF0000AA,"( ! ) You are frozen by an Admin ! ");
2399 }
2400 return 1;
2401}
2402
2403CMD:unfreeze(playerid,params[])
2404{
2405 if(Player[playerid][Level] < 1) return SendErrorMessage(playerid,"You need to be an admin to do that");
2406 {
2407 new id;
2408 if(sscanf(params,"u",id)) return SendClientMessage(playerid,0xFF0000AA,"USAGE: /unfreeze [playerid]");
2409 if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000AA,"ERROR: Invalid playerid");
2410 TogglePlayerControllable(id,1);
2411 SendClientMessage(playerid,0xFF0000AA,"( ! ) You are unfrozen by an Admin ");
2412 }
2413 return 1;
2414}
2415
2416
2417CMD:clearchat(playerid,params[])
2418{
2419 if(Player[playerid][Level] < 1) return SendClientMessage( playerid, YELLOW_COLOR, "ERROR: You must be level 1 to use this command!" );
2420{
2421 for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll( -1, "" );
2422} return 1;
2423}
2424
2425CMD:acmds(playerid, params[])
2426{
2427 if(Player[playerid][Level] < 1) return SendErrorMessage(playerid,"You need to be an admin to do that");
2428
2429 new string[512];
2430 string = "";
2431
2432 strcat(string, "{3377FF}Level 1:\n");
2433 strcat(string, "{FFFFFF}/asay /admins /slap /kick /mute /unmute /spec /specoff /check");
2434 strcat(string, "{FFFFFF}/ban /freeze /unfreeze /clearchat");
2435 if(Player[playerid][Level] > 1)
2436 {
2437 strcat(string, "\n\n{3377FF}Level 2:\n");
2438 strcat(string, "{FFFFFF}/ann /offlineban /unban /searchban /skin");
2439 }
2440
2441 if(Player[playerid][Level] > 2)
2442 {
2443 strcat(string, "\n\n{3377FF}Level 3:\n");
2444 strcat(string, "{FFFFFF}/banip /setlevel /v /getgun /jetpack /(un)lock /skipmap");
2445 }
2446
2447 if(Player[playerid][Level] > 3)
2448 {
2449 strcat(string, "\n\n{3377FF}Level 4:\n");
2450 strcat(string, "{FFFFFF}/minfps /maxping /crash /setvip /makemap /ok /addscore /skin /givescore");
2451 }
2452
2453 ShowPlayerDialog(playerid,DIALOG_HELPS,DIALOG_STYLE_MSGBOX,"{FFFF00}Admin Commands", string, "OK","");
2454 return 1;
2455}
2456
2457
2458//LEVEL 4// /minfps /maxping /crash /setvip /makemap /ok /addscore /skin /givescore
2459
2460CMD:a(playerid, params[])
2461{
2462 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 3 admin to do that");
2463 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/a [0 - 8]");
2464
2465 new aid;
2466 aid = strval(params);
2467 new killerid;
2468 killerid = playerid;
2469 if(aid < 0 || aid > 8) return SendUsageMessage(playerid,"/a [0 - 8]");
2470
2471 new iString[160];
2472
2473 switch(aid)
2474 {
2475 case 0:
2476 {
2477 format(iString, sizeof(iString), "The Eagle of Desert~n~~n~%d / 250 Deagle Kills", Player[killerid][DeagleK]);
2478 ShowAch(killerid, iString, Player[killerid][DeagleK], 250);
2479 }
2480 case 1:
2481 {
2482 format(iString, sizeof(iString), "Double Barrel Power~n~~n~%d / 1000 Shotgun Kills", Player[killerid][ShotgunK]);
2483 ShowAch(killerid, iString, Player[killerid][ShotgunK], 1000);
2484 }
2485 case 2:
2486 {
2487 format(iString, sizeof(iString), "Patience pays off~n~~n~%d / 250 Rifle Kills", Player[killerid][RifleK]);
2488 ShowAch(killerid, iString, Player[killerid][RifleK], 250);
2489 }
2490 case 3:
2491 {
2492 format(iString, sizeof(iString), "Newbies love me~n~~n~%d / 50 MP5 Kills", Player[killerid][MP5K]);
2493 ShowAch(killerid, iString, Player[killerid][MP5K], 50);
2494 }
2495 case 4:
2496 {
2497 format(iString, sizeof(iString), "For Mother Russia!~n~~n~%d / 100 AK47 Kills", Player[killerid][AK47K]);
2498 ShowAch(killerid, iString, Player[killerid][AK47K], 100);
2499 }
2500 case 5:
2501 {
2502 format(iString, sizeof(iString), "King of Assault Machines win~n~~n~%d / 250 M4 Kills", Player[killerid][M4K]);
2503 ShowAch(killerid, iString, Player[killerid][M4K], 250);
2504 }
2505 case 6:
2506 {
2507 format(iString, sizeof(iString), "The Head Hunter~n~~n~%d / 50 Headshots", Player[killerid][Headshots]);
2508 ShowAch(killerid, iString, Player[killerid][Headshots], 50);
2509 }
2510 case 7:
2511 {
2512 format(iString, sizeof(iString), "YIPPE KI-YAY~n~~n~%d / 50 Grenade Kills", Player[killerid][MP5K]);
2513 ShowAch(killerid, iString, Player[killerid][GrenadeK], 50);
2514 }
2515 case 8:
2516 {
2517 format(iString, sizeof(iString), "~g~~h~~h~~h~Unlocked Achievement!~n~~n~~g~~h~~h~~h~The Eagle of Desert~n~%d / 250 Deagle Kills~n~MP5 unlocked in /guns menu", Player[killerid][DeagleK]);
2518 ShowAch(killerid, iString, Player[killerid][DeagleK], 250);
2519 }
2520 }
2521
2522 return 1;
2523}
2524
2525/*
2526CMD:tdtest(playerid, params[])
2527{
2528 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 3 admin to do that");
2529
2530 PlayerTextDrawSetString(playerid, DeathText[0], "You Killed: A_Guy_Named_Noob");
2531 PlayerTextDrawShow(playerid, DeathText[0]);
2532
2533 PlayerTextDrawSetString(playerid, DeathText[1], "Killed by: A_Guy_Named_Pro");
2534 PlayerTextDrawShow(playerid, DeathText[1]);
2535
2536 PlayerTextDrawSetString(playerid, DoingDamage[0], "~g~~h~~h~Some_noob1 ~w~/ 100.00 ~g~~h~~h~Combat Shotgun ~w~(~r~~h~~h~100.00~w~)");
2537 PlayerTextDrawSetString(playerid, DoingDamage[1], "~g~~h~~h~Some_noob2 ~w~/ 100.00 ~g~~h~~h~Combat Shotgun ~w~(~r~~h~~h~100.00~w~)");
2538 PlayerTextDrawSetString(playerid, DoingDamage[2], "~g~~h~~h~Some_noob3 ~w~/ 100.00 ~g~~h~~h~Combat Shotgun ~w~(~r~~h~~h~100.00~w~)");
2539
2540 PlayerTextDrawSetString(playerid, GettingDamaged[0], "~r~~h~~h~Some_pro1 ~w~/ 100.00 ~r~~h~~h~Combat Shotgun ~w~(~r~~h~~h~100.00~w~)");
2541 PlayerTextDrawSetString(playerid, GettingDamaged[1], "~r~~h~~h~Some_pro2 ~w~/ 100.00 ~r~~h~~h~Combat Shotgun ~w~(~r~~h~~h~100.00~w~)");
2542 PlayerTextDrawSetString(playerid, GettingDamaged[2], "~r~~h~~h~Some_pro3 ~w~/ 100.00 ~r~~h~~h~Combat Shotgun ~w~(~r~~h~~h~100.00~w~)");
2543
2544 GameTextForPlayer(playerid, "~r~~h~BOOM HEADSHOT", 3000, 4);
2545
2546 ShowAnn1(playerid, "BOOM HEADSHOT");
2547 ShowAnn2(playerid, "HOLY SHIT!~n~~g~~h~X.K 20 KILLS!");
2548 new iString[160];
2549 format(iString,sizeof(iString),"{FFFFFF}%s (%d) %d", Player[playerid][Name], playerid, 22);
2550 SendAdminMessage(3, iString);
2551 return 1;
2552}
2553*/
2554/*
2555CMD:tbag(playerid, params[])
2556{
2557 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2558
2559 new Weapon[13];
2560 new Ammo[13];
2561 for(new k = 0; k < 13; k++)
2562 {
2563 GetPlayerWeaponData(playerid, k, Weapon[k], Ammo[k]);
2564 }
2565
2566 if(Player[playerid][VIP] == 1)
2567 {
2568 if(Ammo[2] < 200) SetPlayerAmmo(playerid, DEAGLE, 200); //deagle
2569 if(Ammo[3] < 200) SetPlayerAmmo(playerid, Player[playerid][Gun2], 200); //shotgun
2570 if(Ammo[4] < 200) SetPlayerAmmo(playerid, Player[playerid][Gun3], 400); //mp5
2571 if(Ammo[5] < 400) SetPlayerAmmo(playerid, Player[playerid][Gun4], 200); //ak
2572 if(Ammo[6] < 200) SetPlayerAmmo(playerid, Player[playerid][Gun5], 200); //sniper
2573 if(Ammo[8] < 2) SetPlayerAmmo(playerid, Player[playerid][Gun6], 2); //grenade
2574 }
2575 else if(Player[playerid][VIP] == 0)
2576 {
2577 if(Ammo[2] < 100) SetPlayerAmmo(playerid, DEAGLE, 100); //deagle
2578 if(Ammo[3] < 100) SetPlayerAmmo(playerid, Player[playerid][Gun2], 100); //shotgun
2579 if(Ammo[4] < 100) SetPlayerAmmo(playerid, Player[playerid][Gun3], 200); //mp5
2580 if(Ammo[5] < 200) SetPlayerAmmo(playerid, Player[playerid][Gun4], 100); //ak
2581 if(Ammo[6] < 100) SetPlayerAmmo(playerid, Player[playerid][Gun5], 100); //sniper
2582 if(Ammo[8] == 0) SetPlayerAmmo(playerid, Player[playerid][Gun6], 1); //grenade
2583 }
2584
2585 Player[playerid][Tbags]++;
2586 new iString[160];
2587 format(iString,sizeof(iString),"{FFFFFF}%s (%d) {88FFBB}has t-bagged to refill ammo", Player[playerid][Name], playerid);
2588 SendAdminMessage(4, iString);
2589 return 1;
2590}
2591*/
2592
2593CMD:report(playerid, params[]) {
2594 new id;
2595 new reason[128];
2596 if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_ORANGE, "[SERVER] - USAGE: /report [ID] [REASON]");
2597 new string[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
2598 GetPlayerName(playerid, sender, sizeof(sender));
2599 GetPlayerName(id, receiver, sizeof(receiver));
2600 format(string, sizeof(string), "[ADMIN] - %s(%d) has reported %s(%d)", sender, playerid, receiver, id);
2601 SendMessageToAdmins(string);
2602 format(string, sizeof(string), "[ADMIN] - Reason: %s", reason);
2603 SendMessageToAdmins(string);
2604 SendClientMessage(playerid, COLOR_ORANGE, "Your report has been sent.");
2605 return 1;
2606}
2607
2608CMD:minfps(playerid, params[])
2609{
2610 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2611 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/minfps [Minimum FPS]");
2612
2613 new iPacket = strval(params);
2614 if(iPacket < 20 || iPacket > 60) return SendErrorMessage(playerid,"FPS limit can only be between 20 and 60");
2615
2616 MinFPS = iPacket;
2617
2618 new iString[128];
2619 format(iString,sizeof(iString),"{FFFFFF}%s (%d) {88FFBB}has set Minimum FPS to {FFFFFF}%d", Player[playerid][Name], playerid, iPacket);
2620 SendAdminMessage(4, iString);
2621
2622 return 1;
2623}
2624
2625CMD:maxping(playerid, params[])
2626{
2627 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2628 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/maxping [Maximum Ping]");
2629
2630 new iPacket = strval(params);
2631 if(iPacket < 200 || iPacket > 1000) return SendErrorMessage(playerid,"Ping limit can only be between 200 and 1000");
2632
2633 MaxPing = iPacket;
2634
2635 new iString[128];
2636 format(iString,sizeof(iString),"{FFFFFF}%s (%d) {88FFBB}has set Maximum Ping to {FFFFFF}%d", Player[playerid][Name], playerid, iPacket);
2637 SendAdminMessage(4, iString);
2638
2639 return 1;
2640}
2641/* Disabled
2642CMD:maxpl(playerid, params[])
2643{
2644 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2645 if(isnull(params)) return SendUsageMessage(playerid," [Maximum PL]");
2646
2647 new Float:iPacket = floatstr(params);
2648 if(iPacket <= 0 || iPacket > 20) return SendErrorMessage(playerid,"PL limit can only be between 0 and 20");
2649
2650 MaxPL = iPacket;
2651
2652 new iString[128];
2653 format(iString,sizeof(iString),"{FFFFFF}%s (%d) {88FFBB}has set Maximum PL to {FFFFFF}%.2f", Player[playerid][Name], playerid, iPacket);
2654 SendAdminMessage(4, iString);
2655
2656 return 1;
2657}
2658*/
2659CMD:crash(playerid,params[])
2660{
2661 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2662 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/crash [Player ID]");
2663
2664 new crashid = strval(params);
2665 if(!IsPlayerConnected(crashid)) return SendErrorMessage(playerid,"That player isn't connected");
2666
2667 PlayerPlaySound(crashid,12136,0.0,0.0,0.0);
2668
2669 return 1;
2670}
2671
2672CMD:s(playerid,params[])
2673{
2674 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2675 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/s [Sound ID]");
2676
2677 new soundid = strval(params);
2678
2679 PlayerPlaySound(playerid,soundid,0.0,0.0,0.0);
2680
2681 return 1;
2682}
2683
2684CMD:setvip(playerid, params[])
2685{
2686 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2687 new GiveID, iString[128];
2688 if(sscanf(params, "i", GiveID)) return SendUsageMessage(playerid,"/setvip [Player ID]");
2689
2690 if(!IsPlayerConnected(GiveID)) return SendErrorMessage(playerid,"That player isn't connected");
2691 if(Player[GiveID][Logged] == false) return SendErrorMessage(playerid,"That player is not logged in");
2692
2693 if(Player[GiveID][VIP] == 0)
2694 {
2695 SetPlayerArmour(GiveID, 25.0);
2696 Player[GiveID][UnlockedM4] = true;
2697 Player[GiveID][UnlockedSniper] = true;
2698 Player[GiveID][Gun3] = M4;
2699 Player[GiveID][Gun5] = SNIPER;
2700
2701 Player[GiveID][VIP] = 1;
2702 SavePlayer(GiveID);
2703
2704 format(iString,sizeof(iString),"{FFFFFF}%s (%d) {88FFBB}has enabled VIP for {FFFFFF}%s (%d)", Player[playerid][Name], playerid, Player[GiveID][Name], GiveID);
2705 SendAdminMessage(4, iString);
2706 SendClientMessage(GiveID, YELLOW_COLOR, "Your VIP status has been {00FF00}enabled {FFFF00}by an admin! You will receive all VIP perks on relogging. To avoid bugs, you must relog.");
2707 SetTimerEx("OnPlayerKicked", 500, false, "i", GiveID);
2708 }
2709 else if(Player[GiveID][VIP] == 1)
2710 {
2711 SetPlayerArmour(GiveID, 0.0);
2712 Player[GiveID][Gun3] = 0;
2713 Player[GiveID][Gun5] = 0;
2714 SetPlayerAmmo(GiveID, Player[GiveID][Gun3], 0); //ak
2715 SetPlayerAmmo(GiveID, Player[GiveID][Gun5], 0); //sniper
2716
2717 Player[GiveID][VIP] = 0;
2718 SavePlayer(GiveID);
2719
2720 format(iString,sizeof(iString),"{FFFFFF}%s (%d) {88FFBB}has disabled VIP for {FFFFFF}%s (%d)", Player[playerid][Name], playerid, Player[GiveID][Name], GiveID);
2721 SendAdminMessage(4, iString);
2722 SendClientMessage(GiveID, YELLOW_COLOR, "Your VIP status has been {FF0000}disabled {FFFF00}by an admin! To avoid bugs, you must relog.");
2723 SetTimerEx("OnPlayerKicked", 500, false, "i", GiveID);
2724 }
2725
2726 return 1;
2727}
2728
2729CMD:makemap(playerid, params[])
2730{
2731 if(Player[playerid][Level] < 4) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2732 new mapid;
2733 if(sscanf(params, "d", mapid)) return SendUsageMessage(playerid,"/makemap [Map ID]");
2734
2735 if(Player[playerid][Mapping] == true) return SendErrorMessage(playerid,"You are already creating a map. Type /ok and select '>> Finish mapping' to close that map before creating another.");
2736
2737 Player[playerid][Mapping] = true;
2738
2739 CreateMenus();
2740 CreateMap(playerid,mapid);
2741 return 1;
2742}
2743
2744CMD:ok(playerid, params[])
2745{
2746 if(Player[playerid][Level] < 4) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2747 if(Player[playerid][Mapping] == false) return SendErrorMessage(playerid,"Use /makemap command first to start creating new map");
2748
2749 TogglePlayerControllable(playerid,false);
2750 ShowMenuForPlayer(MapMenu, playerid);
2751 return 1;
2752}
2753
2754CMD:addscore(playerid, params[])
2755{
2756 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2757 switch(Player[playerid][Team])
2758 {
2759 case GREENTEAM: GKills++;
2760 case BLUETEAM: BKills++;
2761 }
2762 return 1;
2763}
2764CMD:edit1(playerid, params[])
2765{
2766 if(Player[playerid][Level] < 4) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2767 EditAttachedObject(playerid, 1);
2768 return 1;
2769}
2770/*
2771CMD:arm(playerid, params[])
2772{
2773 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2774 SetPlayerArmour(playerid, 100);
2775 return 1;
2776}
2777*/
2778/*
2779CMD:edit3(playerid, params[])
2780{
2781 if(Player[playerid][Level] < 4) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2782 EditAttachedObject(playerid, 3);
2783 return 1;
2784}
2785
2786CMD:edit4(playerid, params[])
2787{
2788 if(Player[playerid][Level] < 4) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2789 EditAttachedObject(playerid, 4);
2790 return 1;
2791}
2792
2793CMD:edit5(playerid, params[])
2794{
2795 if(Player[playerid][Level] < 4) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2796 EditAttachedObject(playerid, 5);
2797 return 1;
2798}
2799
2800CMD:edit6(playerid, params[])
2801{
2802 if(Player[playerid][Level] < 4) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2803 EditAttachedObject(playerid, 6);
2804 return 1;
2805}
2806
2807CMD:edit7(playerid, params[])
2808{
2809 if(Player[playerid][Level] < 4) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2810 EditAttachedObject(playerid, 7);
2811 return 1;
2812}
2813
2814CMD:edit8(playerid, params[])
2815{
2816 if(Player[playerid][Level] < 4) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2817 EditAttachedObject(playerid, 8);
2818 return 1;
2819}
2820*/
2821
2822CMD:vsound(playerid, params[])
2823{
2824 if(Player[playerid][VIP] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You have to be VIP to use this command");
2825 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/vsound [Sound ID]");
2826
2827 new soundid = strval(params);
2828
2829 PlayerPlaySound(playerid,soundid,0.0,0.0,0.0);
2830
2831 return 1;
2832}
2833
2834
2835
2836CMD:vsay(playerid, params[])
2837{
2838 if(Player[playerid][VIP] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You have to be VIP to use this command");
2839 if(isnull(params)) return SendUsageMessage(playerid,"/vsay [Text]");
2840
2841 new iString[160];
2842 format(iString, sizeof(iString), "{FFFFFF}* VIP: %s", params);
2843 SendClientMessageToAll(0x6688FFFF, iString);
2844
2845 format(iString, sizeof(iString), "%s (%d) has used /vsay command", Player[playerid][Name], playerid);
2846 SendAdminMessage(3, iString);
2847 return 1;
2848}
2849
2850CMD:vskin(playerid, params[])
2851{
2852 if(Player[playerid][VIP] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You have to be VIP to use this command");
2853 SetPlayerSkin(playerid, 230);
2854 SendClientMessage(playerid, GREEN_COLOR, "You have wore your VIP skin");
2855 return 1;
2856}
2857CMD:vcmds(playerid, params[])
2858{
2859 if(Player[playerid][VIP] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2860 SendClientMessage(playerid, GREEN_COLOR, "/vskin /vsay /vsound");
2861 return 1;
2862}
2863
2864
2865//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2866CMD:skin(playerid, params[])
2867{
2868 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2869 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/skin [0 - 7]");
2870
2871 new myskin;
2872 myskin = strval(params);
2873 if(myskin < 0 || myskin > 7) return SendUsageMessage(playerid,"/skin [0 - 7]");
2874
2875 switch(myskin)
2876 {
2877 case 0: SetPlayerSkin(playerid, 53);
2878 case 1: SetPlayerSkin(playerid, 250);
2879 case 2: SetPlayerSkin(playerid, 45);
2880 case 3: SetPlayerSkin(playerid, 191);
2881 case 4: SetPlayerSkin(playerid, 230);
2882 case 5: SetPlayerSkin(playerid, 177);
2883 case 6: SetPlayerSkin(playerid, 154);
2884 case 7: SetPlayerSkin(playerid, 198);
2885 }
2886 ClearAnimations(playerid);
2887
2888 new iString[64];
2889 format(iString, sizeof(iString), "Skin changed to: {FFFFFF}%d", myskin);
2890 SendClientMessage(playerid, YELLOW_COLOR, iString);
2891 return 1;
2892}
2893
2894CMD:givescore(playerid, params[])
2895{
2896 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
2897 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/givescore [Number]");
2898
2899 new sc;
2900 sc = strval(params);
2901 GiveScore(playerid, sc);
2902
2903 new iString[64];
2904 format(iString, sizeof(iString), "Score given: {FFFFFF}%d", sc);
2905 SendClientMessage(playerid, YELLOW_COLOR, iString);
2906
2907 return 1;
2908}
2909
2910
2911//////////LEVEL 3//////////////////// /banip /setlevel /v /getgun /jetpack /(un)lock
2912
2913CMD:searchban(playerid, params[])
2914{
2915 if(Player[playerid][Level] < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "SERVER: You need to be an admin!");
2916 else if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /searchban PLAYERNAME/PLAYERIP");
2917 else
2918 {
2919 new Query[240], string[180];
2920 format(Query, sizeof(Query), "SELECT * FROM `BANNED` WHERE `NAME` LIKE '%%%s%%' OR `IP` LIKE '%%%s%%' ORDER BY `DATE` DESC LIMIT 6", params, params);
2921 new DBResult:Result = db_query(bans, Query);
2922 if(db_num_rows(Result))
2923 {
2924 new BannedBy[MAX_PLAYER_NAME], BannedName[MAX_PLAYER_NAME], BannedIP[MAX_PLAYER_NAME], BannedReason[MAX_PLAYER_NAME*2];
2925 do
2926 {
2927 db_get_field_assoc(Result, "NAME", BannedName, sizeof(BannedName));
2928 db_get_field_assoc(Result, "IP", BannedIP, sizeof(BannedIP));
2929 db_get_field_assoc(Result, "ADMIN", BannedBy, sizeof(BannedBy));
2930 db_get_field_assoc(Result, "REASON", BannedReason, sizeof(BannedReason));
2931
2932 format(string, sizeof(string), "- {FC4949}%s(IP: %s) {FFFFFF}- {FC4949}banned by %s {FFFFFF}- due to %s", BannedName, BannedIP, BannedBy, BannedReason);
2933 SendClientMessage(playerid, -1, string);
2934 }
2935 while(db_next_row(Result));
2936 }
2937 else SendClientMessage(playerid, -1, "NOTE: No bans found!");
2938 db_free_result(Result);
2939 string = "\0", Query = "\0";
2940 }
2941 return 1;
2942}
2943
2944
2945CMD:offlineban(playerid, params[]) {
2946 new Query[240], string[112], pName[24], reason[48], DBResult:result, day, month, year, second, minute, hour, datestring[24], timestring[24];
2947 if(Player[playerid][Level] < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "SERVER: You need to be an admin!");
2948 if(sscanf(params, "s[24]s[48]", pName, reason)) return SendClientMessage(playerid, -1, "USAGE: /offlineban PLAYERNAME REASON");
2949
2950 format(Query, sizeof(Query), "SELECT `NAME` FROM `BANNED` WHERE `NAME` = '%s'", pName);
2951 result = db_query(bans, Query);
2952 if(!db_num_rows(result))
2953 {
2954 getdate(day, month, year), gettime(hour, minute, second);
2955 format(datestring, sizeof(datestring), "%i-%i-%i", day, month, year), format(timestring, sizeof(timestring), "%i:%i:%i", hour, minute, second);
2956
2957 format(Query, sizeof(Query), "INSERT INTO `BANNED` (`NAME`, `IP`, `REASON`, `ADMIN`, `DATE`, `TIME`) VALUES ('%s', '0', '%s', '%s', '%s', '%s')", DB_Escape(pName), reason, DB_Escape(GetName(playerid)), datestring, timestring);
2958 result = db_query(bans, Query);
2959 if(result)
2960 {
2961 format(string, sizeof(string), "BAN: %s has been offline banned by %s(%d) due to %s", pName, GetName(playerid), playerid, reason);
2962 SendClientMessageToAll(-1, string), string = "\0";
2963
2964 printf("[ban] [%s]: offlinebanned %s due to %s", GetName(playerid), pName, reason);
2965 }
2966 else
2967 {
2968 format(string, sizeof(string), "SERVER: Failed to ban '%s'..", pName), SendClientMessage(playerid, -1, string);
2969 printf("[ban] [%s]: failed to offlineban %s due to %s", GetName(playerid), pName, reason);
2970 }
2971 }
2972 else return SendClientMessage(playerid, -1, "INFO: That username is already banned!");
2973 db_free_result(result);
2974 return 1;
2975}
2976
2977CMD:unban(playerid, params[]) {
2978 new pName[24], reason[50], Query[132], DBResult:Result;
2979 new stringz[92];
2980 if(Player[playerid][Level] < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "SERVER: You need to be an level 2 admin!");
2981 if(sscanf(params, "s[24]s[50]", pName, reason)) return SendClientMessage(playerid, -1, "USAGE: /unban [Name] [Reason]");
2982
2983
2984 format(Query, sizeof(Query), "SELECT * FROM `BANNED` WHERE `NAME` = '%s'", pName);
2985 Result = db_query(bans, Query);
2986 if(db_num_rows(Result))
2987 {
2988 format(Query, sizeof(Query), "DELETE FROM `BANNED` WHERE `NAME` = '%s'", pName);
2989 Result = db_query(bans, Query);
2990 format(stringz, sizeof(stringz), "UNBAN: %s has been unbanned by %s due to: %s", GetName(playerid), pName, reason);
2991 SendClientMessageToAll(-1, stringz), stringz = "\0";
2992 }
2993 else SendClientMessage(playerid, -1, "SERVER: No bans found on that user-name!");
2994 stringz = "\0", Query = "\0", reason = "\0";
2995 db_free_result(Result);
2996 return 1;
2997}
2998
2999
3000
3001
3002CMD:ban(playerid, params[])
3003{
3004 if(Player[playerid][Level] < 2 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 2 admin to do that");
3005
3006 new pID, Reason[128], iString[128];
3007 if(sscanf(params, "ds", pID, Reason)) return SendUsageMessage(playerid,"/ban [Player ID] [Reason]");
3008
3009 if(!IsPlayerConnected(pID)) return SendErrorMessage(playerid,"That player isn't connected");
3010 if(strlen(Reason) > 128) return SendErrorMessage(playerid,"Reason is too big");
3011
3012 format(iString, sizeof(iString), "An admin banned {FFFFFF}%s (%d) {FFFF00}for: {FFFFFF}%s", Player[pID][Name], pID, Reason);
3013 SendClientMessageToAll(YELLOW_COLOR, iString);
3014
3015 format(iString, sizeof(iString), "%s - %s", Player[playerid][Name], Reason);
3016 BanEx(pID, iString);
3017
3018 return 1;
3019}
3020
3021CMD:banip(playerid,params[])
3022{
3023 if(Player[playerid][Level] < 2 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 3 admin to do that");
3024 if(isnull(params)) return SendUsageMessage(playerid,"/banip [IP or IP range]");
3025
3026 new iString[128];
3027 format(iString, sizeof(iString), "banip %s", params);
3028 SendRconCommand(iString);
3029
3030 SendRconCommand("reloadbans");
3031
3032 new iString2[128];
3033 format(iString2, sizeof(iString2), "%s (%d) has banned IP: {FFFFFF}%s", Player[playerid][Name], playerid, params);
3034 SendAdminMessage(1, iString);
3035 return 1;
3036}
3037
3038CMD:setlevel(playerid, params[])
3039{
3040 if(Player[playerid][Level] < 4 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 4 admin to do that");
3041 new GiveID, LEVEL;
3042 if(sscanf(params, "id", GiveID, LEVEL)) return SendUsageMessage(playerid,"/setlevel [Player ID] [Level]");
3043
3044 if(!IsPlayerConnected(GiveID)) return SendErrorMessage(playerid,"That player isn't connected");
3045 if(Player[GiveID][Logged] == false) return SendErrorMessage(playerid,"That player is not logged in");
3046 if(Player[GiveID][Level] > Player[playerid][Level]) return SendErrorMessage(playerid,"You can't demote the scripter. Faggot!");
3047 if(LEVEL < 0 || LEVEL > 4) return SendErrorMessage(playerid,"Invalid level");
3048 if(Player[GiveID][Level] == LEVEL) return SendErrorMessage(playerid,"That player is already this level");
3049
3050 Player[GiveID][Level] = LEVEL;
3051 SavePlayer(GiveID);
3052
3053 new iString[128];
3054 format(iString,sizeof(iString),"%s (%d) set %s (%d)'s level to: %d", Player[playerid][Name], playerid, Player[GiveID][Name], GiveID, LEVEL);
3055 SendAdminMessage(1, iString);
3056
3057 return 1;
3058}
3059
3060CMD:v(playerid, params[])
3061{
3062 if(Player[playerid][Level] < 3 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 3 admin to do that");
3063 if(Player[playerid][Specing] == true) return SendErrorMessage(playerid,"Cannot use this command while spectating");
3064 if(isnull(params)) return SendUsageMessage(playerid,"/v [Vehicle Name]");
3065 if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendErrorMessage(playerid,"Can't spawn a vehicle while you are not the driver");
3066
3067 new veh = GetVehicleModelID(params);
3068 if(veh < 400 || veh > 611) return SendErrorMessage(playerid,"Invalid vehicle name");
3069
3070 if(IsPlayerInAnyVehicle(playerid))
3071 {
3072 RemovePlayerFromVehicle(playerid);
3073 DestroyVehicle(GetPlayerVehicleID(playerid));
3074 }
3075
3076 new Float:Pos[4];
3077 GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
3078 GetPlayerFacingAngle(playerid, Pos[3]);
3079
3080 new MyVehicle = CreateVehicle(veh, Pos[0], Pos[1], Pos[2], Pos[3], -1, -1, -1);
3081 new plate[32];
3082 format(plate, sizeof(plate), "%s", Player[playerid][Name]);
3083 SetVehicleNumberPlate(MyVehicle, plate);
3084 SetVehicleToRespawn(MyVehicle);
3085 LinkVehicleToInterior(MyVehicle, GetPlayerInterior(playerid));
3086 SetVehicleVirtualWorld(MyVehicle, GetPlayerVirtualWorld(playerid));
3087 PutPlayerInVehicle(playerid, MyVehicle, 0);
3088
3089 new iString[128];
3090 format(iString, sizeof(iString), "You have spawned a(n) %s", aVehicleNames[veh-400]);
3091 SendClientMessage(playerid, -1, iString);
3092
3093 format(iString, sizeof(iString), "%s (%d) has spawned a(n) %s", Player[playerid][Name], playerid, aVehicleNames[veh-400]);
3094 SendAdminMessage(3, iString);
3095
3096 return 1;
3097}
3098
3099CMD:getgun(playerid, params[])
3100{
3101 if(Player[playerid][Level] < 3 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 3 admin to do that");
3102 if(Player[playerid][Specing] == true) return SendErrorMessage(playerid,"Cannot use this command while spectating");
3103 new Weapon[50], Ammo;
3104
3105 if(sscanf(params, "sd", Weapon, Ammo)) return SendUsageMessage(playerid,"/getgun [Weapon Name] [Ammo]");
3106
3107 if(Ammo < 0 || Ammo > 9999) return SendErrorMessage(playerid,"Invalid Ammo");
3108
3109 new WeaponID = GetWeaponID(Weapon);
3110 if(WeaponID < 1 || WeaponID > 46 || WeaponID == 19 || WeaponID == 20 || WeaponID == 21) return SendErrorMessage(playerid,"Invalid Weapon Name");
3111 if(WeaponID == 44 || WeaponID == 45) return SendErrorMessage(playerid,"We don't do this shit around here");
3112
3113 GivePlayerWeapon(playerid, WeaponID, Ammo);
3114 Player[playerid][SafeGun] = true;
3115
3116 new String[128];
3117 format(String, sizeof(String), "%s (%d) has given himself %s with %d ammo", Player[playerid][Name], playerid, Weapon, Ammo);
3118 SendAdminMessage(3, String);
3119
3120 return 1;
3121}
3122
3123CMD:jetpack(playerid,params[])
3124{
3125 if(Player[playerid][Level] < 3 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 3 admin to do that");
3126 if(Player[playerid][Specing] == true) return SendErrorMessage(playerid,"Cannot use this command while spectating");
3127 new pID = strval(params);
3128 if(isnull(params)) pID = playerid;
3129 if(!IsPlayerConnected(pID)) return SendErrorMessage(playerid,"That player isn't connected");
3130
3131 SetPlayerSpecialAction(pID, 2);
3132 Player[pID][SafeJetpack] = true;
3133
3134 new String[128];
3135 format(String, sizeof(String), "%s (%d) has given a Jetpack to %s (%d)", Player[playerid][Name], playerid, Player[pID][Name], pID);
3136 SendAdminMessage(3, String);
3137
3138 return 1;
3139}
3140
3141CMD:lock(playerid, params[])
3142{
3143 if(Player[playerid][Level] < 3 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 3 admin to do that");
3144 if(ServerLocked == true) return SendErrorMessage(playerid,"Server is already locked. Use /unlock to unlock it first.");
3145
3146 new iString[128];
3147 if(isnull(params)) return SendUsageMessage(playerid,"/lock [Password]");
3148 if(strlen(params) > 10) return SendErrorMessage(playerid,"Server password is too long");
3149
3150 new ServerPass[128];
3151 format(ServerPass, sizeof(ServerPass), "password %s", params);
3152 SendRconCommand(ServerPass);
3153
3154 ServerLocked = true;
3155
3156 format(iString, sizeof(iString), "%s (%d) has locked the server. Password: {FFFFFF}%s", Player[playerid][Name], playerid, params);
3157 SendAdminMessage(1, iString);
3158
3159 return 1;
3160}
3161
3162CMD:unlock(playerid, params[])
3163{
3164 if(Player[playerid][Level] < 3 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 3 admin to do that");
3165 if(ServerLocked == false) return SendErrorMessage(playerid,"Server is not locked");
3166
3167 SendRconCommand("password 0");
3168 ServerLocked = false;
3169
3170 new String[128];
3171 format(String, sizeof(String), "%s (%d) has unlocked the server", Player[playerid][Name], playerid);
3172 SendAdminMessage(1, String);
3173
3174 return 1;
3175}
3176
3177CMD:skipmap(playerid, params[])
3178{
3179 if(Player[playerid][Level] < 3 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 3 admin to do that");
3180 OnRoundEnd(GREENTEAM);
3181
3182 new String[128];
3183 format(String, sizeof(String), "%s (%d) has skipped the current map", Player[playerid][Name], playerid);
3184 SendAdminMessage(1, String);
3185
3186 return 1;
3187}
3188
3189
3190//////////LEVEL 2//////////////////// /ann /ban
3191
3192CMD:ann(playerid, params[])
3193{
3194 if(Player[playerid][Level] < 2 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a level 2 admin to do that");
3195 if(isnull(params)) return SendUsageMessage(playerid,"/ann [Text]");
3196 new str[128], str2[128];
3197 if(sscanf(params, "s", str)) return SendUsageMessage(playerid,"/ann [Text]");
3198 if(strlen(str) > 127) return SendErrorMessage(playerid,"Text is too long. Maximum 128 characters allowed.");
3199 if(strfind(str, "`") != -1) return SendErrorMessage(playerid,"` is not allowed");
3200
3201 format(str2, sizeof(str2), "~w~%s", str);
3202 GameTextForAll(str2, 3000, 4);
3203
3204 new String[128];
3205 format(String, sizeof(String), "%s (%d) has used /ann command", Player[playerid][Name], playerid);
3206 SendAdminMessage(2, String);
3207 return 1;
3208}
3209
3210
3211
3212//////////LEVEL 1//////////////////// /asay /admins /slap /kick /mute /unmute /spec /specoff /check
3213
3214
3215CMD:asay(playerid, params[])
3216{
3217 if(Player[playerid][Level] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be an admin to do that");
3218 if(isnull(params)) return SendUsageMessage(playerid,"/asay [Text]");
3219
3220 new iString[160];
3221 format(iString, sizeof(iString), "{6688FF}* Admin: %s", params);
3222 SendClientMessageToAll(0x6688FFFF, iString);
3223
3224 format(iString, sizeof(iString), "%s (%d) has used /asay command", Player[playerid][Name], playerid);
3225 SendAdminMessage(3, iString);
3226 return 1;
3227}
3228
3229CMD:admins(playerid, params[])
3230{
3231 if(Player[playerid][Level] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be an admin to do that");
3232 new iString[256] = '\0';
3233
3234 foreach(new i : Player)
3235 {
3236 if(Player[i][Level] > 0)
3237 {
3238 format(iString, sizeof(iString), "%s{FFFFFF}%s {FFFF00}(Level: %d){FFFFFF}\n", iString, Player[i][Name], Player[i][Level]);
3239 }
3240 }
3241
3242 if(strlen(iString) < 2) ShowPlayerDialog(playerid,DIALOG_HELPS,DIALOG_STYLE_MSGBOX,"{FFFF00}Admins Online", "No Admins online","Ok","");
3243 else ShowPlayerDialog(playerid,DIALOG_HELPS,DIALOG_STYLE_MSGBOX,"{FFFF00}Admins Online", iString,"Ok","");
3244
3245 return 1;
3246}
3247
3248CMD:slap(playerid,params[])
3249{
3250 if(Player[playerid][Level] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be an admin to do that");
3251 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/slap [Player ID]");
3252
3253 new sid = strval(params);
3254 if(!IsPlayerConnected(sid)) return SendErrorMessage(playerid,"That player isn't connected");
3255
3256 new Float:Pos[3];
3257 GetPlayerPos(sid,Pos[0],Pos[1],Pos[2]);
3258 SetPlayerPos(sid,Pos[0],Pos[1],Pos[2]+5);
3259
3260 PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
3261 PlayerPlaySound(sid,1190,0.0,0.0,0.0);
3262
3263 return 1;
3264}
3265
3266CMD:kick(playerid, params[])
3267{
3268 if(Player[playerid][Level] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be an admin to do that");
3269
3270 new pID, Reason[64], iString[128];
3271 if(sscanf(params, "ds", pID, Reason)) return SendUsageMessage(playerid,"/kick [Player ID] [Reason]");
3272
3273 if(!IsPlayerConnected(pID)) return SendErrorMessage(playerid,"That player isn't connected");
3274
3275 format(iString, sizeof(iString), "An admin kicked {FFFFFF}%s (%d) {FFFF00}for: {FFFFFF}%s", Player[pID][Name], pID, Reason);
3276 SendClientMessageToAll(YELLOW_COLOR, iString);
3277
3278 SetTimerEx("OnPlayerKicked", 500, false, "i", pID);
3279
3280 return 1;
3281}
3282
3283CMD:mute(playerid,params[])
3284{
3285 if(Player[playerid][Level] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be an admin to do that");
3286
3287 new pID, Reason[64], iString[128];
3288 if(sscanf(params, "is", pID, Reason)) return SendUsageMessage(playerid,"/mute [Player ID] [Reason]");
3289 if(!IsPlayerConnected(pID)) return SendErrorMessage(playerid,"That player isn't connected");
3290 if(Player[pID][Muted] == true) return SendErrorMessage(playerid,"That player is already muted");
3291
3292 Player[pID][Muted] = true;
3293
3294 format(iString, sizeof(iString),"An admin muted {FFFFFF}%s (%d) {FFFF00}for: {FFFFFF}%s", Player[pID][Name], pID, Reason);
3295 SendClientMessageToAll(YELLOW_COLOR,iString);
3296
3297 return 1;
3298}
3299
3300CMD:unmute(playerid, params[])
3301{
3302 if(Player[playerid][Level] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be an admin to do that");
3303 new pID = strval(params);
3304 if(isnull(params)) return SendUsageMessage(playerid,"/unmute [Player ID]");
3305 if(!IsPlayerConnected(pID)) return SendErrorMessage(playerid,"That player isn't connected");
3306 if(Player[pID][Muted] == false) return SendErrorMessage(playerid,"That player is not muted");
3307
3308 Player[pID][Muted] = false;
3309
3310 new iString[128];
3311 format(iString, sizeof(iString),"An admin unmuted {FFFFFF}%s (%d)", Player[pID][Name], pID);
3312 SendClientMessageToAll(YELLOW_COLOR,iString);
3313
3314 return 1;
3315}
3316
3317CMD:spec(playerid, params[])
3318{
3319 if(Player[playerid][Level] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be an admin to do that");
3320
3321 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/spec [Player ID]");
3322
3323 new sid = strval(params);
3324 new iString[128];
3325 if(!IsPlayerConnected(sid)) return SendErrorMessage(playerid,"That player isn't connected");
3326 if(sid == playerid) return SendErrorMessage(playerid,"You cannot spec yourself");
3327
3328 format(iString, sizeof(iString), "%s (%d) is spectating: %s (%d)", Player[playerid][Name], playerid, Player[sid][Name], sid);
3329 SendAdminMessage(1, iString);
3330
3331 TogglePlayerSpectating(playerid, true);
3332 Player[playerid][Specing] = true;
3333 Player[playerid][SpecID] = sid;
3334 PlayerSpectatePlayer(playerid, sid);
3335
3336 return 1;
3337}
3338
3339CMD:specoff(playerid, params[])
3340{
3341 if(Player[playerid][Level] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be an admin to do that");
3342 if(Player[playerid][Specing] == false) return SendErrorMessage(playerid,"You are not spectating anyone");
3343
3344 TogglePlayerSpectating(playerid, false);
3345 Player[playerid][Specing] = false;
3346
3347 return 1;
3348}
3349
3350CMD:check(playerid, params[])
3351{
3352 if(Player[playerid][Level] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be an admin to do that");
3353
3354 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/check [Player ID]");
3355
3356 new sid = strval(params);
3357 if(!IsPlayerConnected(sid)) return SendErrorMessage(playerid,"That player isn't connected");
3358
3359 Player[playerid][Checking] = true;
3360 Player[playerid][SpecID] = sid;
3361
3362 return 1;
3363}
3364
3365
3366
3367
3368//============================================================================
3369//==================================Commands==================================
3370//============================================================================
3371
3372
3373CMD:cmds(playerid, params[])
3374{
3375 new string[512];
3376
3377 string = "";
3378 strcat(string, "{FFFFFF}/weather /time /radio /guns (OR) /gunmenu /exit /pm /r /blockpm /blockpmall /changepass");
3379 strcat(string, "\n{FFFFFF}/kill /stats /wkills (OR) /wstats /rewards /sstats /vipinfo (OR) /donate /credits /updates");
3380 strcat(string, "\n{FFFFFF}/report");
3381 ShowPlayerDialog(playerid,DIALOG_HELPS,DIALOG_STYLE_MSGBOX,"{FFFF00}Public Commands", string, "OK","");
3382 return 1;
3383}
3384
3385CMD:updates(playerid, params[])
3386{
3387 new string[1024];
3388
3389 string = "";
3390 strcat(string, "{88FF88}07 May 2015 - {88FFBB}v0.96 - By TopShooter and X.");
3391 strcat(string, "\n{FFFF00}- Improved textdraws");
3392 strcat(string, "\n{FFFF00}- Updated admin commands");
3393
3394 strcat(string, "\n\n{88FF88}26 April 2015 - By TopShooter, X.K and iDragonZ");
3395 strcat(string, "\n{FFFF00}- Fixed small bugs related to cheats detection");
3396 strcat(string, "\n{FFFF00}- Added map: Sniper Heaven by iDragonZ");
3397
3398 strcat(string, "\n\n{88FF88}25 April 2015 - {88FFBB}v0.95 - By TopShooter");
3399 strcat(string, "\n{FFFF00}- Added T-bagging feature. Crouch over last killed enemy's body to refill ammo");
3400 strcat(string, "\n{FFFF00}- T-bags are now recorded in /stats");
3401 strcat(string, "\n{FFFF00}- Reduced weapon ammos to encourage T-bagging");
3402 strcat(string, "\n{FFFF00}- Fixed a bug where players could refill ammo from /guns menu");
3403 strcat(string, "\n{FFFF00}- Secret Reward 2 will now unlock on 50 T-bags instead of 50 Punch kills (/rewards for more info)");
3404 strcat(string, "\n{FFFF00}- Secret Reward 3 will now unlock on 50 grenade kills instead of 100 Grenade kills (/rewards for more info)");
3405 strcat(string, "\n{FFFF00}- Fixed a bug where players could spawn and be stuck without login or register");
3406 strcat(string, "\n{FFFF00}- Added detection of Ammo Hacks");
3407 strcat(string, "\n{FFFF00}- Removed map: Chilliad Shack");
3408
3409 strcat(string, "\n\n{88FF88}23 April 2015 - {88FFBB}v0.94 - By TopShooter and X.K");
3410 strcat(string, "\n{FFFF00}- Added detection of common cheats: Jetpack, Airbreak, Speedhack, Armor, Weapon Hacks");
3411 strcat(string, "\n{FFFF00}- Fixed cigar position on all skins");
3412 strcat(string, "\n{FFFF00}- You will not get kicked for FPS, Ping & PL now unless you spawn");
3413 strcat(string, "\n{FFFF00}- Added 1 new map: Pwnage Station by Oakz and removed 1 bad map: Bayside Marina");
3414/*
3415 strcat(string, "\n\n{88FF88}9 April 2015 - By TopShooter and X.K");
3416 strcat(string, "\n{FFFF00}- Fixed rewards messages appearing more than once");
3417 strcat(string, "\n{FFFF00}- Fixed a bug where people could sync while on end round table");
3418 strcat(string, "\n{FFFF00}- Fixed a bug where people could kill others after round end");
3419 strcat(string, "\n{FFFF00}- Added 3 new maps: Junkyard, Oil Refinery, Pilgrim");
3420
3421 strcat(string, "\n\n{88FF88}8 April 2015 - By TopShooter and X.K");
3422 strcat(string, "\n{FFFF00}- Easter Event ended");
3423 strcat(string, "\n{FFFF00}- Added FPS, Ping and PL limits: 30 FPS, 420 Ping, 1.0 PL");
3424 strcat(string, "\n{FFFF00}- Added /kill command");
3425
3426 strcat(string, "\n\n{88FF88}7 April 2015 - By TopShooter and X.K");
3427 strcat(string, "\n{FFFF00}- Last Day of Easter Event. Reward of opening Halloween Pumpkin changed.");
3428
3429 strcat(string, "\n\n{88FF88}5 April 2015 - By TopShooter and X.K");
3430 strcat(string, "\n{FFFF00}- Made more checks to ensure stats saving");
3431 strcat(string, "\n{FFFF00}- Day 2 of Easter Event. Reward of opening Halloween Pumpkin changed.");
3432
3433 strcat(string, "\n\n{88FF88}4 April 2015 - By TopShooter and X.K");
3434 strcat(string, "\n{FFFF00}- Easter Event enabled. 1 Halloween Pumpkin is placed in each map. Finder gets a nice surprise.");
3435 strcat(string, "\n{FFFF00}- Added sounds on round win and /guns menu selections");
3436 strcat(string, "\n{FFFF00}- Stats should technically never be lost now, even in case of server restart");
3437
3438 strcat(string, "\n\n{88FF88}2 April 2015 - {88FFBB}v0.93 - By TopShooter and X.K");
3439 strcat(string, "\n{FFFF00}- Weapon selection (/guns) is now in the form of decent clickable textdraws instead of menus");
3440 strcat(string, "\n{FFFF00}- Added /exit command to exit weapon selection (Helpful if you mistakenly press Esc during weapon selection)");
3441 strcat(string, "\n{FFFF00}- Textdraws for Headshot and Killing Spree are more sleek, separate and do not overlap each other now");
3442 strcat(string, "\n{FFFF00}- Removed /changename command as it was causing player stats to be lost (Contact X.K for future name changes)");
3443 strcat(string, "\n{FFFF00}- Secret reward 1 will now unlock on 50 headshots instead of 25 punch kills (/rewards for more info)");
3444 strcat(string, "\n{FFFF00}- Weapon in hand on spawn is now Fist");
3445
3446 strcat(string, "\n\n{88FF88}29 March 2015 - By TopShooter and X.K");
3447 strcat(string, "\n{FFFF00}- Fixed a bug where players were spawning half-way inside ground in interiors");
3448 strcat(string, "\n{FFFF00}- Fixed a bug where interior map start camera was not showing any objects");
3449 strcat(string, "\n{FFFF00}- Fixed a bug where VIP 3D text was appearing above non-VIP players");
3450
3451 strcat(string, "\n\n{88FF88}27 March 2015 - By TopShooter and X.K");
3452 strcat(string, "\n{FFFF00}- Fixed hit/damage and kill/death textdraws");
3453 strcat(string, "\n{FFFF00}- Added 2 new commands: /changename and /changepass");
3454
3455 strcat(string, "\n\n{88FF88}26 March 2015 - By TopShooter and X.K");
3456 strcat(string, "\n{FFFF00}- Unlocked weapons are now wearable. Type /rewards for more details");
3457
3458 strcat(string, "\n\n{88FF88}24 March 2015 - By TopShooter and X.K");
3459 strcat(string, "\n{FFFF00}- VIP system is now available. Type /vipinfo or /donate for more details");
3460
3461 strcat(string, "\n\n{88FF88}21 March 2015 - By TopShooter and X.K");
3462 strcat(string, "\n{FFFF00}- Script converted back to 1 Hit Kill system");
3463
3464 strcat(string, "\n\n{88FF88}30 January 2015 - By X.K");
3465 strcat(string, "\n{FFFF00}- Increased map time from 5 minutes to 7 minutes");
3466 strcat(string, "\n{FFFF00}- Weather/Time will now only randomize on each map start and on login");
3467 strcat(string, "\n{FFFF00}- If a player uses /weather or /time command, then his weather/time won't change each map");
3468 strcat(string, "\n{FFFF00}- Turned off auto-play radio on login");
3469 strcat(string, "\n{FFFF00}- Added 4 new maps: Chilliad Shack, Ocean Flats, Paradiso, Bayside Marina");
3470
3471 strcat(string, "\n\n{88FF88}29 January 2015 - By X.K");
3472 strcat(string, "\n{FFFF00}- Script converted from 1 Hit Kill system to full HP and Armor");
3473 strcat(string, "\n{FFFF00}- Headshot kills still exist and will stay");
3474 strcat(string, "\n{FFFF00}- Random weather/time added which will change after every minute");
3475 strcat(string, "\n{FFFF00}- Removed player AC check system since old AC doesn't exist anymore");
3476*/
3477 strcat(string, "\n\n{88FF88}Stuff still under construction:");
3478 strcat(string, "\n{FFFF00}- Helmet protection from headshots");
3479
3480 ShowPlayerDialog(playerid,DIALOG_HELPS,DIALOG_STYLE_MSGBOX,"{FFFF00}Latest Updates", string, "OK","");
3481 return 1;
3482}
3483
3484
3485//////////////////// /changepass /weather /time /radio /guns /exit /pm /r /blockpm /blockpmall
3486
3487CMD:changepass(playerid, params[])
3488{
3489 if(Player[playerid][Logged] == false) return SendErrorMessage(playerid,"You must be logged in to change password");
3490 if(isnull(params)) return SendUsageMessage(playerid,"/changepass [New Password]");
3491 if(strlen(params) < 3) return SendErrorMessage(playerid,"Password must have at least 3 characters");
3492
3493 new HashPass[140];
3494 format(HashPass, sizeof(HashPass), "%d", udb_hash(params));
3495
3496 new iString[356];
3497 format(iString, sizeof(iString), "UPDATE Players SET Password = '%s' WHERE Name = '%s'", HashPass, DB_Escape(Player[playerid][Name]));
3498 db_free_result(db_query(sqliteconnection, iString));
3499
3500 format(HashPass, sizeof(HashPass), "Your password has been changed to: {FFFFFF}%s", params);
3501 SendClientMessage(playerid, YELLOW_COLOR, HashPass);
3502
3503 return 1;
3504}
3505
3506
3507CMD:weather(playerid,params[])
3508{
3509 if(isnull(params)) return SendUsageMessage(playerid,"/weather [ID]");
3510 if(!IsNumeric(params)) return SendErrorMessage(playerid,"You need to put a number for Weather ID");
3511
3512 new myweather;
3513 myweather = strval(params);
3514 SetPlayerWeather(playerid, myweather);
3515 Player[playerid][ChangedWeather] = true;
3516
3517 new string[64];
3518 format(string, sizeof(string), "Weather changed to: {FFFFFF}%d", myweather);
3519 SendClientMessage(playerid, YELLOW_COLOR, string);
3520 return 1;
3521}
3522
3523CMD:w(playerid, params[])
3524{
3525 cmd_weather(playerid, params);
3526 return 1;
3527}
3528
3529CMD:time(playerid, params[])
3530{
3531 if(isnull(params)) return SendUsageMessage(playerid,"/time [Hour]");
3532 if(!IsNumeric(params)) return SendErrorMessage(playerid,"You need to put a number for time");
3533
3534 new mytime;
3535 mytime = strval(params);
3536 SetPlayerTime(playerid, mytime, 0);
3537 Player[playerid][ChangedWeather] = true;
3538
3539 new iString[64];
3540 format(iString, sizeof(iString), "Time changed to: {FFFFFF}%d", mytime);
3541 SendClientMessage(playerid, YELLOW_COLOR, iString);
3542 return 1;
3543}
3544
3545CMD:t(playerid, params[])
3546{
3547 cmd_time(playerid, params);
3548 return 1;
3549}
3550
3551CMD:radio(playerid, params[])
3552{
3553 if(isnull(params) || !IsNumeric(params)) return SendUsageMessage(playerid,"/radio [0 - 6]");
3554
3555 new CommandID = strval(params);
3556 if(CommandID < 0 || CommandID > 6) return SendUsageMessage(playerid,"/radio [0 - 6]");
3557
3558 switch(CommandID)
3559 {
3560 case 0:
3561 {
3562 StopAudioStreamForPlayer(playerid);
3563 SendClientMessage(playerid,-1,"{FFFFFF}Radio turned {FF5555}OFF");
3564 }
3565 case 1: PlayAudioStreamForPlayer(playerid, RADIO1);
3566 case 2: PlayAudioStreamForPlayer(playerid, RADIO2);
3567 case 3: PlayAudioStreamForPlayer(playerid, RADIO3);
3568 case 4: PlayAudioStreamForPlayer(playerid, RADIO4);
3569 case 5: PlayAudioStreamForPlayer(playerid, RADIO5);
3570 case 6: PlayAudioStreamForPlayer(playerid, RADIO6);
3571 }
3572//1=Hardcore NL, 2=ChartHits, 3=MUSIK.MAIN, 4=idobi, 5=181.FM Hiphop, 6=Indian Radio HSL
3573
3574 return 1;
3575}
3576
3577CMD:guns(playerid, params[])
3578{
3579 if(Player[playerid][Specing] == true) return SendErrorMessage(playerid,"Cannot use this command while spectating");
3580 if(Player[playerid][OnMenu] == true)
3581 {
3582 SendErrorMessage(playerid,"You are already on weapon selection menu. Type /exit to leave menu.");
3583 } else {
3584 Player[playerid][OnMenu] = true;
3585
3586 LoadGunsTDs(playerid);
3587 ShowGunsTDs(playerid);
3588 SendClientMessage(playerid, YELLOW_COLOR, "[HELP] Weapon selection menu information:");
3589 SendClientMessage(playerid, YELLOW_COLOR, "To select a weapon, click on its icon.");
3590 SendClientMessage(playerid, YELLOW_COLOR, "{00FF00}Green {FFFF00}= Selected weapon");
3591 SendClientMessage(playerid, YELLOW_COLOR, "{FF0000}Red {FFFF00}= Locked weapon");
3592 SendClientMessage(playerid, YELLOW_COLOR, "{FFFFFF}White {FFFF00}= Unlocked weapon");
3593 SendClientMessage(playerid, YELLOW_COLOR, "To leave menu, click {FFFFFF}Exit Selection {FFFF00}or type {FFFFFF}/exit");
3594 }
3595 return 1;
3596}
3597
3598CMD:gunmenu(playerid, params[])
3599{
3600 cmd_guns(playerid, params);
3601 return 1;
3602}
3603
3604CMD:exit(playerid, params[])
3605{
3606 if(Player[playerid][OnMenu] == false)
3607 {
3608 SendErrorMessage(playerid,"You are not on weapon selection menu. Type /guns to open menu.");
3609 } else {
3610 Player[playerid][OnMenu] = false;
3611 CancelSelectTextDraw(playerid);
3612 HideGunsTDs(playerid);
3613 SendClientMessage(playerid, YELLOW_COLOR, "Exited weapon selection menu");
3614 }
3615 return 1;
3616}
3617
3618CMD:pm(playerid,params[])
3619{
3620 if(Player[playerid][Muted] == true) return SendErrorMessage(playerid,"You are muted");
3621
3622 new ReceiverID, text[128];
3623
3624 if(sscanf(params,"is",ReceiverID, text)) return SendUsageMessage(playerid,"/pm [Player ID] [Text]");
3625 if(!IsPlayerConnected(ReceiverID)) return SendErrorMessage(playerid,"That player isn't connected");
3626 if(Player[ReceiverID][BlockedID] == playerid) return SendErrorMessage(playerid,"That player has blocked PMs from you");
3627 if(Player[ReceiverID][BlockedAll] == true) return SendErrorMessage(playerid,"That player has blocked PMs from everyone");
3628
3629 new String[128];
3630 format(String,sizeof(String),"{66CC00}* PM from %s (%d): %s",Player[playerid][Name], playerid, text);
3631 SendClientMessage(ReceiverID,-1,String);
3632 SendClientMessage(ReceiverID,YELLOW_COLOR,"Use {FFFFFF}/r [Message]{FFFF00} to reply");
3633
3634 Player[ReceiverID][LastMessager] = playerid;
3635
3636 format(String,sizeof(String),"{66CC00}* PM to %s (%d): %s",Player[ReceiverID][Name], ReceiverID, text);
3637 SendClientMessage(playerid,-1,String);
3638 PlayerPlaySound(ReceiverID,1054,0,0,0);
3639
3640 return 1;
3641}
3642
3643CMD:r(playerid,params[])
3644{
3645 if(Player[playerid][Muted] == true) return SendErrorMessage(playerid,"You are muted");
3646
3647 new ReplyToID, text[128];
3648 ReplyToID = Player[playerid][LastMessager];
3649
3650 if(!IsPlayerConnected(ReplyToID)) return SendErrorMessage(playerid,"That player isn't connected");
3651 if(Player[playerid][LastMessager] == -1) return SendErrorMessage(playerid,"That player isn't connected");
3652 if(Player[ReplyToID][BlockedID] == playerid) return SendErrorMessage(playerid,"That player has blocked PMs from you");
3653 if(Player[ReplyToID][BlockedAll] == true) return SendErrorMessage(playerid,"That player has blocked PMs from everyone");
3654
3655 sscanf(params, "s", text);
3656
3657 if(isnull(text)) return SendUsageMessage(playerid,"/r [Message]");
3658 if(strlen(text) > 100) return SendErrorMessage(playerid,"Message length should be less than 100 characters");
3659
3660 new String[128];
3661 format(String,sizeof(String),"{66CC00}* PM from %s (%d): %s",Player[playerid][Name], playerid, text);
3662 SendClientMessage(ReplyToID,-1,String);
3663 format(String,sizeof(String),"{66CC00}* PM to %s (%d): %s",Player[ReplyToID][Name], ReplyToID, text);
3664 SendClientMessage(playerid,-1,String);
3665
3666 Player[ReplyToID][LastMessager] = playerid;
3667 PlayerPlaySound(ReplyToID,1054,0,0,0);
3668
3669 return 1;
3670}
3671
3672CMD:blockpm(playerid, params[])
3673{
3674 if(isnull(params)) return SendUsageMessage(playerid,"/blockpm [Player ID]");
3675
3676 new pID = strval(params);
3677 if(!IsPlayerConnected(pID)) return SendErrorMessage(playerid,"That player isn't connected");
3678
3679 Player[playerid][BlockedID] = pID;
3680
3681 new String[128];
3682 format(String,sizeof(String),"You have blocked PMs from {FFFFFF}%s (%d)", Player[pID][Name], pID);
3683 SendClientMessage(playerid,YELLOW_COLOR,String);
3684
3685 return 1;
3686}
3687
3688CMD:blockpmall(playerid, params[])
3689{
3690 if(Player[playerid][BlockedAll] == true)
3691 {
3692 Player[playerid][BlockedAll] = false;
3693 SendClientMessage(playerid,YELLOW_COLOR,"You have unblocked PMs from everyone");
3694 }
3695
3696 if(Player[playerid][BlockedAll] == false)
3697 {
3698 Player[playerid][BlockedAll] = true;
3699 SendClientMessage(playerid,YELLOW_COLOR,"You have blocked PMs from everyone");
3700 }
3701 return 1;
3702}
3703
3704
3705///////////// /kill /stats /wkills /wstats /rewards /sstats /vipinfo (OR) /donate /credits /updates
3706
3707
3708CMD:kill(playerid, params[])
3709{
3710 if(Player[playerid][Specing] == true) return SendErrorMessage(playerid,"Cannot use this command while spectating");
3711 SetPlayerHealth(playerid, 0.0);
3712 SetPlayerArmour(playerid, 0.0);
3713 SendClientMessage(playerid, YELLOW_COLOR, "You committed suicide");
3714 return 1;
3715}
3716
3717CMD:stats(playerid, params[])
3718{
3719 new pid, msg[128];
3720 if(isnull(params)) pid = playerid;
3721 else
3722 {
3723 if(sscanf(params, "d", pid)) return SendUsageMessage(playerid, "/stats [Player ID]");
3724 if(!IsPlayerConnected(pid)) return SendErrorMessage(playerid, "That player isn't connected");
3725 }
3726
3727 new Float:ratio, killz = Player[pid][Kills], deathz = Player[pid][Deaths];
3728 if(killz && deathz) ratio = floatdiv(killz, deathz);
3729 else ratio = 0;
3730
3731 new vip[8] = "No";
3732 if(Player[pid][VIP] == 1) vip = "Yes";
3733
3734 format(msg, sizeof(msg), "___________________ Stats of %s (%d) ___________________", Player[pid][Name], pid);
3735 switch(Player[pid][Team])
3736 {
3737 case GREENTEAM: SendClientMessage(playerid, GREEN_COLOR, msg);
3738 case BLUETEAM: SendClientMessage(playerid, BLUE_COLOR, msg);
3739 }
3740 format(msg, sizeof(msg), "Kills: [%d] Deaths: [%d] K/D Ratio: [%.2f] Score: [%d] VIP: [%s]", Player[pid][Kills], Player[pid][Deaths], ratio, Player[pid][Score], vip);
3741 SendClientMessage(playerid, -1, msg);
3742
3743 format(msg, sizeof(msg), "Headshots: [%d] T-bags: [%d] Max Round Kills: [%d] Max Round Damage: [%.2f]", Player[pid][Headshots], Player[pid][Tbags], Player[pid][MaxRoundKills], Player[pid][MaxRoundDamage]);
3744 SendClientMessage(playerid, -1, msg);
3745
3746 return 1;
3747}
3748
3749CMD:wkills(playerid, params[])
3750{
3751 new pid, msg[128];
3752 if(isnull(params)) pid = playerid;
3753 else
3754 {
3755 if(sscanf(params, "d", pid)) return SendUsageMessage(playerid, "/wkills [Player ID]");
3756 if(!IsPlayerConnected(pid)) return SendErrorMessage(playerid, "That player isn't connected");
3757 }
3758
3759 format(msg, sizeof(msg), "_____________ Weapon Kills of %s (%d) _____________", Player[pid][Name], pid);
3760 switch(Player[pid][Team])
3761 {
3762 case GREENTEAM: SendClientMessage(playerid, GREEN_COLOR, msg);
3763 case BLUETEAM: SendClientMessage(playerid, BLUE_COLOR, msg);
3764 }
3765 format(msg, sizeof(msg), "Punch: [%d] Deagle: [%d] Shotgun: [%d] Spas: [%d] MP5: [%d]", Player[pid][PunchK], Player[pid][DeagleK], Player[pid][ShotgunK], Player[pid][SpasK], Player[pid][MP5K]);
3766 SendClientMessage(playerid, -1, msg);
3767
3768 format(msg, sizeof(msg), "AK47: [%d] M4: [%d] Rifle: [%d] Sniper: [%d] Grenade: [%d]", Player[pid][AK47K], Player[pid][M4K], Player[pid][RifleK], Player[pid][SniperK], Player[pid][GrenadeK]);
3769 SendClientMessage(playerid, -1, msg);
3770
3771 return 1;
3772}
3773
3774CMD:wstats(playerid, params[])
3775{
3776 cmd_wkills(playerid, params);
3777 return 1;
3778}
3779
3780CMD:rewards(playerid, params[])
3781{
3782 new TotalStr[1280];
3783 new statsSTR[10][128];
3784
3785 format(statsSTR[0], sizeof(statsSTR[]), "{FFFF00}Reward\t\t\t\tRequirement\t\tYour Kills\n");
3786
3787 format(statsSTR[1], sizeof(statsSTR[]), "{FFFFFF}MP5\t\t\t\t{0080FF}250 Deagle Kills\t{55FF55}%d Deagle Kills\n", Player[playerid][DeagleK]);
3788 format(statsSTR[2], sizeof(statsSTR[]), "{FFFFFF}Spas\t\t\t\t{0080FF}1000 Shotgun Kills\t{55FF55}%d Shotgun Kills\n", Player[playerid][ShotgunK]);
3789 format(statsSTR[3], sizeof(statsSTR[]), "{FFFFFF}Sniper\t\t\t\t{0080FF}250 Rifle Kills or {FFFF00}VIP\t{55FF55}%d Rifle Kills\n", Player[playerid][RifleK]);
3790
3791 format(statsSTR[4], sizeof(statsSTR[]), "{FFFFFF}AK47\t\t\t\t{0080FF}50 MP5 Kills\t\t{55FF55}%d MP5 Kills\n", Player[playerid][MP5K]);
3792 format(statsSTR[5], sizeof(statsSTR[]), "{FFFFFF}M4\t\t\t\t{0080FF}100 AK47 Kills or {FFFF00}VIP\t{55FF55}%d AK47 Kills\n", Player[playerid][AK47K]);
3793 format(statsSTR[6], sizeof(statsSTR[]), "{FFFFFF}Grenade\t\t\t{0080FF}250 M4 Kills\t\t{55FF55}%d M4 Kills\n", Player[playerid][M4K]);
3794
3795 format(statsSTR[7], sizeof(statsSTR[]), "{FF7777}Secret Reward 1\t\t{0080FF}50 Headshots\t\t{55FF55}%d Headshots\n", Player[playerid][Headshots]);
3796 format(statsSTR[8], sizeof(statsSTR[]), "{FF7777}Secret Reward 2\t\t{0080FF}50 T-bags\t\t{55FF55}%d T-bags\n", Player[playerid][Tbags]);
3797 format(statsSTR[9], sizeof(statsSTR[]), "{FF7777}Secret Reward 3\t\t{0080FF}50 Grenade Kills\t{55FF55}%d Grenade Kills", Player[playerid][GrenadeK]);
3798
3799 format(TotalStr, sizeof(TotalStr), "%s%s%s%s%s%s%s%s%s%s", statsSTR[0], statsSTR[1], statsSTR[2], statsSTR[3], statsSTR[4], statsSTR[5], statsSTR[6], statsSTR[7], statsSTR[8], statsSTR[9]);
3800
3801 ShowPlayerDialog(playerid,DIALOG_REWARDS,DIALOG_STYLE_LIST,"{FFFF00}Unlockable Rewards", TotalStr, "OK","");
3802
3803 return 1;
3804}
3805
3806CMD:sstats(playerid, params[])
3807{
3808 new stats[450];
3809 GetNetworkStats(stats, sizeof(stats));
3810 ShowPlayerDialog(playerid, DIALOG_HELPS, DIALOG_STYLE_MSGBOX, "{FFFF00}Server Network Stats", stats, "OK", "");
3811 return 1;
3812}
3813
3814CMD:vipinfo(playerid, params[])
3815{
3816 new string[512];
3817
3818 string = "";
3819 strcat(string, "{88FF88}By donating to 1 Hit Kill server, you make your favorite server stay alive and keep improving.\n\n");
3820 strcat(string, "{FFFFFF}As our way of saying 'Thank you' to our valuable donators, we offer them the following benefits:\n");
3821 strcat(string, "{88FF88}> {FFFFFF}25 armor on each spawn and wearable armor object\n");
3822 strcat(string, "{88FF88}> {FFFFFF}VIP skins\n");
3823 strcat(string, "{88FF88}> {FFFFFF}Unlocked M4\n");
3824 strcat(string, "{88FF88}> {FFFFFF}Unlocked Sniper\n");
3825 strcat(string, "{88FF88}> {FFFFFF}Double ammo for all weapons\n");
3826 strcat(string, "{88FF88}> {FFFFFF}VIP 3D text in-game and VIP rank on forum\n");
3827 strcat(string, "{88FF88}> {FFFFFF}Exclusive VIP helmets for headshot protection (Coming soon)\n\n");
3828 strcat(string, "{FFFFFF}For information on how to donate, please visit: {88FF88}Soon");
3829
3830 ShowPlayerDialog(playerid,DIALOG_HELPS,DIALOG_STYLE_MSGBOX,"{FFFF00}VIP Information", string, "OK","");
3831 return 1;
3832}
3833
3834CMD:donate(playerid, params[])
3835{
3836 cmd_vipinfo(playerid, params);
3837 return 1;
3838}
3839
3840
3841//============================ Forwards & Stocks ===============================
3842
3843forward KickTimer(playerid);
3844public KickTimer(playerid)
3845{
3846 Kick(playerid);
3847 return 1;
3848}
3849
3850forward HideScoreTD(playerid);
3851public HideScoreTD(playerid) {
3852 PlayerTextDrawHide(playerid, ScoreTD);
3853}
3854
3855forward HideAnn1TD(playerid);
3856public HideAnn1TD(playerid) {
3857 PlayerTextDrawHide(playerid, Ann1TD);
3858}
3859
3860forward HideAnn2TD(playerid);
3861public HideAnn2TD(playerid) {
3862 PlayerTextDrawHide(playerid, Ann2TD);
3863}
3864
3865forward HideAchTD(playerid);
3866public HideAchTD(playerid) {
3867 PlayerTextDrawHide(playerid, AchTD);
3868 HidePlayerProgressBar(playerid, Bar1);
3869}
3870
3871forward DeathMessage(killerid, playerid);
3872public DeathMessage(killerid, playerid) {
3873 PlayerTextDrawHide(killerid, DeathText[0]);
3874 PlayerTextDrawHide(playerid, DeathText[1]);
3875}
3876
3877forward OnPlayerKicked(playerid);
3878public OnPlayerKicked(playerid) {
3879 Player[playerid][IsKicked] = true;
3880 Kick(playerid);
3881 return 1;
3882}
3883
3884forward Float:GetPlayerPacketLoss(playerid);
3885public Float:GetPlayerPacketLoss(playerid) {
3886 return NetStats_PacketLossPercent(playerid);
3887}
3888
3889stock IsValidSound(soundid) {
3890 for(new i=0; i < sizeof(ValidSounds); ++i) {
3891 if(ValidSounds[i] == soundid) return 1;
3892 }
3893 return 0;
3894}
3895
3896stock BanWithReason(playerid = INVALID_PLAYER_ID, targetid, reason[])
3897{
3898 new Query[240], string[112], DBResult:result, day, month, year, second, minute, hour, datestring[24], timestring[24];
3899 getdate(day, month, year);
3900 gettime(hour, minute, second);
3901
3902 format(datestring, sizeof(datestring), "%i-%i-%i", day, month, year);
3903 format(timestring, sizeof(timestring), "%i:%i:%i", hour, minute, second);
3904
3905 if(playerid != INVALID_PLAYER_ID)
3906 {
3907 format(Query, sizeof(Query), "INSERT INTO `BANNED` (`NAME`, `IP`, `REASON`, `ADMIN`, `DATE`, `TIME`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s')", DB_Escape(GetName(targetid)), DB_Escape(PlayerIP(targetid)), reason, DB_Escape(GetName(playerid)), datestring, timestring);
3908 result = db_query(bans, Query);
3909 if(result)
3910 {
3911 format(string, sizeof(string), "BAN: %s(%d) has been banned by %s(%d) due to %s", GetName(targetid), targetid, GetName(playerid), playerid, reason);
3912 SendClientMessageToAll(-1, string), string = "\0";
3913 printf("[ban] [%s]: successfully added %s's ban info", GetName(playerid), GetName(targetid));
3914 }
3915 else
3916 {
3917 format(string, sizeof(string), "SERVER: failed to ban '%s'", GetName(targetid));
3918 SendClientMessageToAll(-1, string), string = "\0";
3919 printf("[ban] [%s]: failed to add %s's ban info", GetName(playerid), GetName(targetid));
3920 }
3921 }
3922 /*
3923 else
3924 {
3925 format(Query, sizeof(Query), "INSERT INTO `BANNED` (`NAME`, `IP`, `REASON`, `ADMIN`, `DATE`, `TIME`) VALUES ('%s', '%s', '%s', 'Server', '%s', '%s')", DB_Escape(GetName(targetid)), DB_Escape(PlayerIP(targetid)), reason, datestring, timestring);
3926 result = db_query(bans, Query);
3927 format(string, sizeof(string), "BAN: %s(%d) has been banned by the Server due to %s", GetName(targetid), targetid, reason);
3928 SendClientMessageToAll(COLOR_RED, string), string = "\0";
3929 }
3930 for anti-cheat purposes ^
3931 */
3932 Query = "\0", db_free_result(result);
3933 SetTimerEx("KickTimer", 100, false, "i", targetid);
3934}
3935
3936stock DB_Escape(text[])
3937{
3938 new
3939 ret[80 * 2],
3940 ch,
3941 i,
3942 j
3943 ;
3944 while ((ch = text[i++]) && j < sizeof (ret))
3945 {
3946 if (ch == '\'')
3947 {
3948 if (j < sizeof (ret) - 2)
3949 {
3950 ret[j++] = '\'';
3951 ret[j++] = '\'';
3952 }
3953 }
3954 else if (j < sizeof (ret))
3955 {
3956 ret[j++] = ch;
3957 }
3958 else
3959 {
3960 j++;
3961 }
3962 }
3963 ret[sizeof (ret) - 1] = '\0';
3964 return ret;
3965}
3966stock GetName(playerid)
3967{
3968 new pnameid[24];
3969 GetPlayerName(playerid,pnameid,sizeof(pnameid));
3970 return pnameid;
3971}
3972stock PlayerIP(playerid)
3973{
3974 new str[16];
3975 GetPlayerIp(playerid, str, sizeof(str));
3976 return str;
3977}
3978
3979stock GiveScore(playerid, number)
3980{
3981 new scorez;
3982 Player[playerid][Score] = Player[playerid][Score]+number;
3983 scorez = Player[playerid][Score];
3984 SetPlayerScore(playerid, scorez);
3985
3986 new iString[64];
3987 format(iString, sizeof(iString), "%sScore:+%d", TDColor[Player[playerid][Team]], number);
3988 PlayerTextDrawSetString(playerid, ScoreTD, iString);
3989
3990 PlayerTextDrawShow(playerid, ScoreTD);
3991
3992 SetTimerEx("HideScoreTD", 4000, false, "i", playerid);
3993}
3994
3995stock ShowAnn1(playerid, text[])
3996{
3997 PlayerTextDrawSetString(playerid, Ann1TD, text);
3998 PlayerTextDrawShow(playerid, Ann1TD);
3999 SetTimerEx("HideAnn1TD", 4000, false, "i", playerid);
4000}
4001
4002stock ShowAnn2(playerid, text[])
4003{
4004 PlayerTextDrawSetString(playerid, Ann2TD, text);
4005 PlayerTextDrawShow(playerid, Ann2TD);
4006 SetTimerEx("HideAnn2TD", 4000, false, "i", playerid);
4007}
4008
4009stock ShowAch(playerid, text[], prog, max)
4010{
4011 PlayerTextDrawSetString(playerid, AchTD, text);
4012 PlayerTextDrawShow(playerid, AchTD);
4013
4014 SetPlayerProgressBarMaxValue(playerid, Bar1, max);
4015 SetPlayerProgressBarValue(playerid, Bar1, prog);
4016
4017 SetTimerEx("HideAchTD", 7000, false, "i", playerid);
4018}
4019
4020stock GiveKill(playerid)
4021{
4022 Player[playerid][Kills]++;
4023 Player[playerid][RKills]++;
4024}
4025
4026stock GiveDeath(playerid)
4027{
4028 Player[playerid][Deaths]++;
4029 Player[playerid][RDeaths]++;
4030}
4031
4032stock GiveWKill(playerid, wep)
4033{
4034 switch(wep)
4035 {
4036 case 0: Player[playerid][PunchK]++;
4037 case 24: Player[playerid][DeagleK]++;
4038 case 25: Player[playerid][ShotgunK]++;
4039 case 27: Player[playerid][SpasK]++;
4040 case 29: Player[playerid][MP5K]++;
4041 case 30: Player[playerid][AK47K]++;
4042 case 31: Player[playerid][M4K]++;
4043 case 33: Player[playerid][RifleK]++;
4044 case 34: Player[playerid][SniperK]++;
4045 case 51: Player[playerid][GrenadeK]++;
4046 }
4047}
4048
4049stock ShowMap(playerid, time)
4050{
4051 TogglePlayerSpectating(playerid, true);
4052 SetPlayerCameraLookAt(playerid, (Min[0] + Max[0])/2, (Min[1] + Max[1])/2, GSpawn1[2]);
4053 SetPlayerCameraPos(playerid, (Min[0] + Max[0])/2, (Min[1] + Max[1])/2, GSpawn1[2]+40);
4054 switch(Player[playerid][Team])
4055 {
4056 case GREENTEAM: InterpolateCameraPos(playerid, Min[0], Min[1], GSpawn1[2]+40, Max[0], Max[1], GSpawn1[2]+40, time, CAMERA_MOVE);
4057 case BLUETEAM: InterpolateCameraPos(playerid, Max[0], Max[1], GSpawn1[2]+40, Min[0], Min[1], GSpawn1[2]+40, time, CAMERA_MOVE);
4058 }
4059 InterpolateCameraLookAt(playerid, (Min[0] + Max[0])/2, (Min[1] + Max[1])/2, GSpawn1[2], (Min[0] + Max[0])/2, (Min[1] + Max[1])/2, GSpawn1[2], time, CAMERA_MOVE);
4060}
4061
4062stock CheckRewards(playerid)
4063{
4064 if(Player[playerid][SniperK] > 499) Player[playerid][UnlockedEagleEye] = true;
4065 if(Player[playerid][DeagleK] > 249) Player[playerid][UnlockedMP5] = true;
4066 if(Player[playerid][ShotgunK] > 999) Player[playerid][UnlockedSpas] = true;
4067 if(Player[playerid][RifleK] > 249) Player[playerid][UnlockedSniper] = true;
4068 if(Player[playerid][MP5K] > 49) Player[playerid][UnlockedAK47] = true;
4069 if(Player[playerid][AK47K] > 99) Player[playerid][UnlockedM4] = true;
4070 if(Player[playerid][M4K] > 249) Player[playerid][UnlockedGrenade] = true;
4071 if(Player[playerid][Headshots] > 49) Player[playerid][UnlockedCigar] = true;
4072 if(Player[playerid][Tbags] > 49) Player[playerid][UnlockedHorns] = true;
4073 if(Player[playerid][GrenadeK] > 49) Player[playerid][UnlockedFlame] = true;
4074}
4075
4076stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy) {
4077 new Float:x, Float:y, Float:z;
4078 GetPlayerPos(playerid, x, y, z);
4079 if (x > minx && x < maxx && y > miny && y < maxy) return 1;
4080 return 0;
4081}
4082
4083stock GetPlayerFPS(playerid) {
4084 new drunk2 = GetPlayerDrunkLevel(playerid);
4085 if(drunk2 < 100){
4086 SetPlayerDrunkLevel(playerid,2000);
4087 }else{
4088 if(Player[playerid][DLlast] != drunk2){
4089 new fps = Player[playerid][DLlast] - drunk2;
4090 if((fps > 0) && (fps < 200))
4091 Player[playerid][FPS] = fps;
4092 Player[playerid][DLlast] = drunk2;
4093 }
4094 }
4095}
4096
4097stock IsNumeric(string[]){
4098 for (new i = 0, j = strlen(string); i < j; i++){
4099 if (string[i] > '9' || string[i] < '0') return 0;
4100 }
4101 return 1;
4102}
4103
4104stock GetVehicleModelID(vehiclename[])
4105{
4106 for(new i = 0; i < 211; i++){
4107 if(strfind(aVehicleNames[i], vehiclename, true) != -1)
4108 return i + 400;
4109 } return -1;
4110}
4111
4112stock GetWeaponID(weaponname[]) {
4113 for(new i = 0; i < 55; ++i) {
4114 if(strfind(WeaponNames[i], weaponname, true) != -1)
4115 return i;
4116 }
4117 return -1;
4118}
4119
4120stock SendErrorMessage(playerid, text[])
4121{
4122 new str[160];
4123 format(str,sizeof(str),"ERROR:{FFFFFF} %s",text);
4124 SendClientMessage(playerid,0xFF0000FF,str);
4125 return 1;
4126}
4127
4128stock SendUsageMessage(playerid, text[])
4129{
4130 new str[160];
4131 format(str,sizeof(str),"USAGE:{FFFFFF} %s",text);
4132 SendClientMessage(playerid,0xFFFF00FF,str);
4133 return 1;
4134}
4135
4136stock SendAdminMessage(level, text[])
4137{
4138 foreach(new i : Player)
4139 {
4140 if((Player[i][Level] >= level) && (Player[i][Logged] == true))
4141 {
4142 new str[160];
4143 format(str,sizeof(str), "[ADMIN] %s", text);
4144 SendClientMessage(i, ADMIN_COLOR, str);
4145 }
4146 }
4147 return 1;
4148}
4149
4150stock SendMessageToAdmins(message[])
4151{
4152 new pCount;
4153 for(new i = 0; i < MAX_PLAYERS; i++)
4154 {
4155 if((Player[i][Level] >= 1) || !IsPlayerAdmin(i)) continue;
4156 pCount++;
4157 SendClientMessage(i, 0x00FF00AA, message);
4158 }
4159 CallLocalFunction("OnMessageToAdminsSent", "sd", message, pCount); //<-- !!!
4160 return 1;
4161}
4162
4163stock SendACWarning(playerid, text[])
4164{
4165 foreach(new i : Player)
4166 {
4167 if((Player[i][Level] >= 0) && (Player[i][Logged] == true))
4168 {
4169 new str[160];
4170 format(str,sizeof(str), "[AC Warning] %s (%d) is cheating! [%s]", Player[playerid][Name], playerid, text);
4171 SendClientMessage(i, AC_COLOR, str);
4172 }
4173 }
4174 return 1;
4175}
4176
4177LoadNextMap()
4178{
4179 if(fexist(MAPLISTFILE))
4180 {
4181 new filename[64];
4182 new linenr;
4183 new File:maplist = fopen(MAPLISTFILE, io_read);
4184 while(fread(maplist, filename))
4185 {
4186 linenr++;
4187 if(linenr > CurrentMap)
4188 {
4189 StripNL(filename);
4190 if(filename[0])
4191 {
4192 strins(filename, "Maps/", 0, sizeof(filename));
4193 if(fexist(filename))
4194 {
4195 CurrentMap = linenr;
4196 fclose(maplist);
4197 LoadMap(filename);
4198 return 1;
4199 }
4200 }
4201 }
4202 }
4203 fclose(maplist);
4204 CurrentMap = 0;
4205 maplist = fopen(MAPLISTFILE, io_read);
4206 while(fread(maplist, filename))
4207 {
4208 CurrentMap++;
4209 StripNL(filename);
4210 if(filename[0])
4211 {
4212 strins(filename, "Maps/", 0, sizeof(filename));
4213 if(fexist(filename))
4214 {
4215 fclose(maplist);
4216 LoadMap(filename);
4217 return 1;
4218 }
4219 }
4220 }
4221 fclose(maplist);
4222 print("ERROR: Can't find any map to load!");
4223 return 0;
4224 }
4225 else
4226 {
4227 printf("ERROR: %s doesn't exist!", MAPLISTFILE);
4228 return 0;
4229 }
4230}
4231
4232LoadMap(filename[])
4233{
4234 if(!fexist(filename))
4235 {
4236 printf("ERROR: Can't load %s", filename);
4237 return 0;
4238 }
4239 new string[128];
4240 new model, Float:pos[3], Float:rot[3];
4241 new start, end;
4242 new obidx;
4243 // -- Brief Case Vars
4244 new Float:BCPos[3];
4245 new rand = random(2) + 1; // Get the random int spawn
4246 // --
4247 strcpy(MapFileName, filename);
4248 MapName[0] = 0;
4249 MapperName[0] = 0;
4250 new line[256], s, key[64];
4251 new File:handle = fopen(filename, io_read);
4252 if(!handle)
4253 {
4254 printf("ERROR: Can't load %s", filename);
4255 return 0;
4256 }
4257 while(fread(handle, line))
4258 {
4259 StripNL(line);
4260 if(!line[0]) continue;
4261 s = strfind(line, "=");
4262 if(s < 1)
4263 {
4264 if(strcmp(line, "CreateObject", false, 12) == 0)
4265 {
4266 if(obidx < sizeof(MapObjects))
4267 {
4268 start = strfind(line, "(", true);
4269 end = strfind(line, ")", true);
4270 if(start != -1 && end != -1)
4271 {
4272 strmid(line, line, start+1, end, sizeof(line));
4273 sscanf(line, "p,dffffff", model, pos[0], pos[1], pos[2], rot[0], rot[1], rot[2]);
4274 MapObjects[obidx] = CreateObject(model, pos[0], pos[1], pos[2] - 0.5, rot[0], rot[1], rot[2]);
4275 obidx++;
4276 //easter
4277
4278 EasterX = pos[0];
4279 EasterY = pos[1];
4280 EasterText = Create3DTextLabel("Press F to open", 0x00FF00FF, pos[0], pos[1], pos[2], 5.0, 0, 0);
4281
4282 }
4283 }
4284 else
4285 {
4286 print("WARNING: Can't load a map object (too many)");
4287 }
4288 }
4289 continue;
4290 }
4291 strmid(key, line, 0, s++);
4292 if(strcmp(key, "Name") == 0)
4293 {
4294 strcpy(MapName, line[s]);
4295 format(string, sizeof(string), "mapname %s", MapName);
4296 SendRconCommand(string);
4297 }
4298 else if(strcmp(key, "Mapper") == 0) strcpy(MapperName, line[s]);
4299 else if(strcmp(key, "MinXY") == 0) sscanf(line[s], "p,ff", Min[0], Min[1]);
4300 else if(strcmp(key, "MaxXY") == 0) sscanf(line[s], "p,ff", Max[0], Max[1]);
4301 else if(strcmp(key, "Interior") == 0) MapInterior = strval(line[s]);
4302 else if(strcmp(key, "GSpawn1") == 0) sscanf(line[s], "p,ffff", GSpawn1[0], GSpawn1[1], GSpawn1[2], GSpawn1[3]);
4303 else if(strcmp(key, "GSpawn2") == 0) sscanf(line[s], "p,ffff", GSpawn2[0], GSpawn2[1], GSpawn2[2], GSpawn2[3]);
4304 else if(strcmp(key, "GSpawn3") == 0) sscanf(line[s], "p,ffff", GSpawn3[0], GSpawn3[1], GSpawn3[2], GSpawn3[3]);
4305 else if(strcmp(key, "BSpawn1") == 0) sscanf(line[s], "p,ffff", BSpawn1[0], BSpawn1[1], BSpawn1[2], BSpawn1[3]);
4306 else if(strcmp(key, "BSpawn2") == 0) sscanf(line[s], "p,ffff", BSpawn2[0], BSpawn2[1], BSpawn2[2], BSpawn2[3]);
4307 else if(strcmp(key, "BSpawn3") == 0) sscanf(line[s], "p,ffff", BSpawn3[0], BSpawn3[1], BSpawn3[2], BSpawn3[3]);
4308 else if(strcmp(key, "BSpawn3") == 0) sscanf(line[s], "p,ffff", BSpawn3[0], BSpawn3[1], BSpawn3[2], BSpawn3[3]);
4309 }
4310 fclose(handle);
4311
4312 MapZone = GangZoneCreate(Min[0]-20,Min[1]-20,Max[0]+20,Max[1]+20);
4313 GangZoneShowForAll(MapZone, BLUE_COLOR);
4314 foreach(new i : Player)
4315 {
4316 if(IsPlayerConnected(i))
4317 {
4318 SetPlayerInterior(i, MapInterior);
4319 SetPlayerVirtualWorld(i, 0);
4320 }
4321 }
4322 BCID = CreatePickup(BC_MODEL,19,BCPos[0], BCPos[1], BCPos[2],0);
4323 EndTime = 425;
4324 GKills = 0;
4325 BKills = 0;
4326
4327 printf("Map %s loaded", filename);
4328 return 1;
4329}
4330
4331UnloadMap()
4332{
4333 GangZoneDestroy(MapZone);
4334
4335 for(new i=0; i < sizeof(MapObjects); i++)
4336 {
4337 if(MapObjects[i])
4338 {
4339 DestroyObject(MapObjects[i]);
4340 MapObjects[i] = 0;
4341 if(BCID != -1)
4342 {
4343 DestroyPickup(BCID);
4344 // -- Put some message here :)
4345
4346 }
4347 //easter
4348
4349 EasterX = 0.0;
4350 EasterY = 0.0;
4351 EggFound = false;
4352 Delete3DTextLabel(EasterText);
4353
4354 }
4355 }
4356}
4357
4358SendNextMapMessage()
4359{
4360 new string[128];
4361 format(string, sizeof(string), "~g~~h~~h~%s", MapName);
4362 if(MapperName[0])
4363 {
4364 strcat(string, "~n~~w~By: ");
4365 strcat(string, MapperName);
4366 }
4367 GameTextForAll(string, 1000, 1);
4368}
4369
4370forward GetCurrentMap();
4371public GetCurrentMap()
4372{
4373 return CurrentMap;
4374}
4375
4376forward SetCurrentMap(mapid);
4377public SetCurrentMap(mapid)
4378{
4379 CurrentMap = mapid;
4380}
4381
4382OnRoundEnd(winner)
4383{
4384 SetTimer("ExitMap", 5000, false);
4385 foreach(new i : Player)
4386 {
4387 if(IsPlayerConnected(i) && Player[i][Spawned] == true)
4388 {
4389 TogglePlayerControllable(i, false);
4390 SetPlayerVirtualWorld(i, i);
4391 }
4392 }
4393
4394 switch(winner)
4395 {
4396 case GREENTEAM:
4397 {
4398 foreach(new i : Player)
4399 {
4400 if(IsPlayerConnected(i) && Player[i][Spawned] == true && Player[i][Team] == GREENTEAM)
4401 {
4402 GiveScore(i, 5);
4403 GivePlayerMoney(i, 5000);
4404 SendClientMessage(i, GREEN_COLOR, "Your team have won the round , 5000$ and 5 score");
4405 PlayerPlaySound(i, 1097, 0.0, 0.0, 0.0);
4406 }
4407 }
4408 }
4409 case BLUETEAM:
4410 {
4411 foreach(new i : Player)
4412 {
4413 if(IsPlayerConnected(i) && Player[i][Spawned] == true && Player[i][Team] == BLUETEAM)
4414 {
4415 GiveScore(i, 5);
4416 SendClientMessage(i, BLUE_COLOR, "+5 Score for winning the round!");
4417 PlayerPlaySound(i, 1097, 0.0, 0.0, 0.0);
4418 }
4419 }
4420 }
4421 }
4422}
4423
4424
4425forward ExitMap();
4426public ExitMap()
4427{
4428 UpdateScoreTable();
4429 UnloadMap();
4430 AllowEnter = 0;
4431 SetTimer("SetAllowEnter", 5000, false);
4432 foreach(new i : Player)
4433 {
4434 if(IsPlayerConnected(i))
4435 {
4436 if(Player[i][RKills] > Player[i][MaxRoundKills])
4437 {
4438 Player[i][MaxRoundKills] = Player[i][RKills];
4439 SavePlayer(i);
4440 }
4441 if(Player[i][RDamage] > Player[i][MaxRoundDamage])
4442 {
4443 Player[i][MaxRoundDamage] = Player[i][RDamage];
4444 SavePlayer(i);
4445 }
4446 ClearAnimations(i);
4447 Player[i][RKills] = 0;
4448 Player[i][RDeaths] = 0;
4449 Player[i][RDamage] = 0;
4450 if(Player[i][Spawned] == true)
4451 {
4452 for(new t=0; t < sizeof(ScoreTableTD); t++)
4453 {
4454 TextDrawShowForPlayer(i, ScoreTableTD[t]);
4455 }
4456 Player[i][TableOnScreen] = true;
4457 TextDrawHideForPlayer(i, RoundStatsTD);
4458 }
4459 }
4460 }
4461 LoadNextMap();
4462 SendNextMapMessage();
4463
4464 foreach(new i : Player)
4465 {
4466 if(IsPlayerConnected(i))
4467 {
4468 ShowMap(i, 7000);
4469 SetPlayerSpawn(i);
4470 }
4471 }
4472 GKills = 0;
4473 BKills = 0;
4474}
4475
4476SetPlayerSpawn(playerid)
4477{
4478 new Float:Pos[4];
4479 switch(Player[playerid][Team])
4480 {
4481 case GREENTEAM:
4482 {
4483 new randomspawn = random(3);
4484 switch(randomspawn)
4485 {
4486 case 0: Pos = GSpawn1;
4487 case 1: Pos = GSpawn2;
4488 case 2: Pos = GSpawn3;
4489 }
4490 }
4491 case BLUETEAM:
4492 {
4493 new randomspawn = random(3);
4494 switch(randomspawn)
4495 {
4496 case 0: Pos = BSpawn1;
4497 case 1: Pos = BSpawn2;
4498 case 2: Pos = BSpawn3;
4499 }
4500 }
4501 }
4502 SetSpawnInfo(playerid, GetPlayerTeam(playerid), GetPlayerSkin(playerid), Pos[0]+RandomRange(-1, 1), Pos[1]+RandomRange(-1, 1), Pos[2]+1, Pos[3], 0, 0, 0, 0, 0, 0);
4503}
4504
4505CloseTable(playerid)
4506{
4507 if(Player[playerid][TableOnScreen] == true)
4508 {
4509 if(AllowEnter == 1)
4510 {
4511 for(new t=0; t < sizeof(ScoreTableTD); t++)
4512 {
4513 TextDrawHideForPlayer(playerid, ScoreTableTD[t]);
4514 }
4515 Player[playerid][TableOnScreen] = false;
4516 SetPlayerSpawn(playerid);
4517 TogglePlayerSpectating(playerid, false);
4518 PlayerPlaySound(playerid, 1098, 0, 0, 0);
4519 }
4520 }
4521}
4522
4523forward SetAllowEnter();
4524public SetAllowEnter()
4525{
4526 AllowEnter = 1;
4527 foreach(new i : Player)
4528 {
4529 GameTextForPlayer(i, "~w~Click to ~n~spawn", 1000, 1);
4530 }
4531}
4532
4533stock strcpy(dest[], const source[], maxlength=sizeof dest)
4534{
4535 return strmid(dest, source, 0, maxlength, maxlength);
4536}
4537
4538stock StripNL(str[])
4539{
4540 new
4541 i = strlen(str);
4542 while (i-- && str[i] <= ' ') str[i] = '\0';
4543}
4544
4545GetTeamBalance(teamid)
4546{
4547 new count;
4548 foreach(new i : Player)
4549 {
4550 if(IsPlayerConnected(i))
4551 {
4552 if(Player[i][Team] == teamid && Player[i][Spawned] == true)
4553 {
4554 count++;
4555 }
4556 }
4557 }
4558 return count;
4559}
4560
4561UpdateAInfo(playerid)
4562{
4563 new sid = Player[playerid][SpecID];
4564 new ip[24];
4565 GetPlayerIp(sid, ip, sizeof(ip));
4566 new Float:health, Float:armor;
4567 new Float:pPacket = GetPlayerPacketLoss(sid);
4568
4569 new FPSstr[16];
4570 if(Player[sid][FPS] < 30) format(FPSstr, sizeof(FPSstr), "~r~~h~%d~l~", Player[sid][FPS]);
4571 if(Player[sid][FPS] >= 30) format(FPSstr, sizeof(FPSstr), "%d", Player[sid][FPS]);
4572
4573 new Pingstr[16];
4574 if(GetPlayerPing(sid) >= 420) format(Pingstr, sizeof(Pingstr), "~r~~h~%d~l~", GetPlayerPing(sid));
4575 if(GetPlayerPing(sid) < 420) format(Pingstr, sizeof(Pingstr), "%d", GetPlayerPing(sid));
4576
4577 new PLstr[16];
4578 if(pPacket >= 2) format(PLstr, sizeof(PLstr), "~r~~h~%.2f~l~", pPacket);
4579 if(pPacket < 2) format(PLstr, sizeof(PLstr), "%.1f%%", pPacket);
4580
4581 GetPlayerHealth(sid, health);
4582 GetPlayerArmour(sid, armor);
4583 new msg[128], info[512];
4584 format(msg, sizeof(msg), "%s%s [%d] %s~n~", TDColor[Player[sid][Team]], Player[sid][Name], sid, ip);
4585 strcat(info, msg, sizeof(info));
4586 format(msg, sizeof(msg), "Health: [%.2f] Armor: [%.2f]~n~", health, armor);
4587 strcat(info, msg, sizeof(info));
4588 format(msg, sizeof(msg), "FPS: [%s] Ping: [%s] PL: [%s]", FPSstr, Pingstr, PLstr);
4589 strcat(info, msg);
4590 new count, weaponname[24];
4591 new weaponid, ammo;
4592 for(new s=1; s < 12; s++)
4593 {
4594 GetPlayerWeaponData(sid, s, weaponid, ammo);
4595 if(ammo)
4596 {
4597 GetWeaponName(weaponid, weaponname, sizeof(weaponname));
4598 if(!count)
4599 {
4600 format(msg, sizeof(msg), "%s: [%d]", weaponname, ammo);
4601 }
4602 else
4603 {
4604 format(msg, sizeof(msg), "%s %s: [%d]", msg, weaponname, ammo);
4605 }
4606 count++;
4607 if(count >= 2)
4608 {
4609 strcat(info, "~n~");
4610 strcat(info, msg);
4611 count = 0;
4612 }
4613 }
4614 }
4615 if(count)
4616 {
4617 strcat(info, "~n~");
4618 strcat(info, msg);
4619 }
4620 PlayerTextDrawSetString(playerid, AInfoTD, info);
4621}
4622
4623UpdateScoreTable()
4624{
4625 new
4626 Players[MAX_PLAYERS],
4627 Kills1[MAX_PLAYERS],
4628 Deaths1[MAX_PLAYERS],
4629 Float:Damage1[MAX_PLAYERS];
4630
4631 new count;
4632 for(new i=0; i < MAX_PLAYERS; i++)
4633 {
4634 if(IsPlayerConnected(i))
4635 {
4636 Players[count] = i;
4637 Kills1[count] = Player[i][RKills];
4638 Deaths1[count] = Player[i][RDeaths];
4639 Damage1[count] = Player[i][RDamage];
4640 count++;
4641 }
4642 }
4643 new m, temp, Float:temp2;
4644 for(new i=0; i < 15; i++)
4645 {
4646 m = i;
4647 for(new j=i+1; j < count; j++)
4648 if((Kills1[m] < Kills1[j]) || (Kills1[m] == Kills1[j] && Deaths1[m] > Deaths1[j]))
4649 m = j;
4650
4651 temp = Players[i];
4652 Players[i] = Players[m];
4653 Players[m] = temp;
4654 temp = Kills1[i];
4655 Kills1[i] = Kills1[m];
4656 Kills1[m] = temp;
4657 temp = Deaths1[i];
4658 Deaths1[i] = Deaths1[m];
4659 Deaths1[m] = temp;
4660 temp2 = Damage1[i];
4661 Damage1[i] = Damage1[m];
4662 Damage1[m] = temp2;
4663 }
4664 new string[1024];
4665 string = "~g~~h~~h~Name~n~";
4666 for(new i=0; i < 15; i++)
4667 {
4668 strcat(string, "~n~", sizeof(string));
4669 if(i < count)
4670 {
4671 strcat(string, Player[Players[i]][Name], sizeof(string));
4672 }
4673 else
4674 {
4675 strcat(string, " ", sizeof(string));
4676 }
4677 if(i == 14)
4678 {
4679 TextDrawSetString(ScoreTableTD[2], string);
4680 string = "~g~~h~~h~Name~n~";
4681 }
4682 }
4683
4684 string = "~g~~h~~h~Kills~n~";
4685 for(new i=0; i < 15; i++)
4686 {
4687 strcat(string, "~n~", sizeof(string));
4688 if(i < count)
4689 {
4690 format(string, sizeof(string), "%s%d", string, Kills1[i]);
4691 }
4692 else
4693 {
4694 strcat(string, " ", sizeof(string));
4695 }
4696 if(i == 14)
4697 {
4698 TextDrawSetString(ScoreTableTD[3], string);
4699 string = "~g~~h~~h~Kills~n~";
4700 }
4701 }
4702
4703 string = "~g~~h~~h~Deaths~n~";
4704 for(new i=0; i < 15; i++)
4705 {
4706 strcat(string, "~n~", sizeof(string));
4707 if(i < count)
4708 {
4709 format(string, sizeof(string), "%s%d", string, Deaths1[i]);
4710 }
4711 else
4712 {
4713 strcat(string, " ", sizeof(string));
4714 }
4715 if(i == 14)
4716 {
4717 TextDrawSetString(ScoreTableTD[4], string);
4718 string = "~g~~h~~h~Deaths~n~";
4719 }
4720 }
4721
4722 string = "~g~~h~~h~Damage~n~";
4723 for(new i=0; i < 15; i++)
4724 {
4725 strcat(string, "~n~", sizeof(string));
4726 if(i < count)
4727 {
4728 format(string, sizeof(string), "%s%.2f", string, Damage1[i]);
4729 }
4730 else
4731 {
4732 strcat(string, " ", sizeof(string));
4733 }
4734 if(i == 14)
4735 {
4736 TextDrawSetString(ScoreTableTD[5], string);
4737 string = "~g~~h~~h~Damage~n~";
4738 }
4739 }
4740}
4741
4742stock RandomRange(min, max)
4743{
4744 return (random((max + 1) - min) + min);
4745}
4746
4747SyncPlayer(playerid)
4748{
4749 new Weapon[13], Ammo[13];
4750 for(new k = 0; k < 13; k++) GetPlayerWeaponData(playerid, k, Weapon[k], Ammo[k]);
4751
4752 if(IsPlayerInAnyVehicle(playerid)) return 1;
4753 if(Player[playerid][Syncing] == true) return 1;
4754 if(Player[playerid][TableOnScreen] == true) return 1;
4755 if(EndTime < 1) return 1;
4756
4757 Player[playerid][Syncing] = true;
4758 SetTimerEx("SyncInProgress", 1000, false, "i", playerid);
4759
4760 new Float:HP[2], Float:Pos[4], Int, VirtualWorld, CurrWep;
4761 GetPlayerHealth(playerid, HP[0]);
4762 GetPlayerArmour(playerid, HP[1]);
4763
4764 CurrWep = GetPlayerWeapon(playerid);
4765
4766 GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
4767 GetPlayerFacingAngle(playerid, Pos[3]);
4768
4769 Int = GetPlayerInterior(playerid);
4770 VirtualWorld = GetPlayerVirtualWorld(playerid);
4771
4772 ClearAnimations(playerid);
4773
4774 SetSpawnInfo(playerid, GetPlayerTeam(playerid), GetPlayerSkin(playerid), Pos[0], Pos[1], Pos[2]-0.4, Pos[3], 0, 0, 0, 0, 0, 0);
4775
4776 SpawnPlayerEx(playerid);
4777
4778 SetPlayerHealth(playerid, HP[0]);
4779 SetPlayerArmour(playerid, HP[1]);
4780
4781 SetPlayerInterior(playerid, Int);
4782 SetPlayerVirtualWorld(playerid, VirtualWorld);
4783
4784// SetPlayerSpawn(playerid);
4785
4786 SetPlayerAmmo(playerid, DEAGLE, Ammo[2]); //deagle
4787 SetPlayerAmmo(playerid, Player[playerid][Gun2], Ammo[3]); //shotgun
4788 SetPlayerAmmo(playerid, Player[playerid][Gun3], Ammo[4]); //ak
4789 SetPlayerAmmo(playerid, Player[playerid][Gun4], Ammo[5]); //mp5
4790 SetPlayerAmmo(playerid, Player[playerid][Gun5], Ammo[6]); //sniper
4791 SetPlayerAmmo(playerid, Player[playerid][Gun6], Ammo[8]); //grenade
4792
4793 SetPlayerArmedWeapon(playerid, CurrWep);
4794
4795 return 1;
4796}
4797
4798forward SyncInProgress(playerid);
4799public SyncInProgress(playerid) {
4800 Player[playerid][Syncing] = false;
4801}
4802
4803
4804UpdateTDs(playerid)
4805{
4806 HideGunsTDs(playerid);
4807
4808 if(Player[playerid][Gun2] == SHOTGUN)
4809 {
4810 PlayerTextDrawBackgroundColor(playerid, G2TD, 0x00FF0022);
4811 } else {
4812 PlayerTextDrawBackgroundColor(playerid, G2TD, 0xFFFFFF22);
4813 }
4814
4815 if(Player[playerid][Gun2] == SPAS)
4816 {
4817 PlayerTextDrawBackgroundColor(playerid, G2bTD, 0x00FF0022);
4818 } else {
4819 if(Player[playerid][UnlockedSpas] == true)
4820 {
4821 PlayerTextDrawBackgroundColor(playerid, G2bTD, 0xFFFFFF22);
4822 } else {
4823 PlayerTextDrawBackgroundColor(playerid, G2bTD, 0xFF000022);
4824 }
4825 }
4826
4827 if(Player[playerid][Gun3] == 0)
4828 {
4829 PlayerTextDrawBackgroundColor(playerid, G30TD, 0x00FF0022);
4830 } else {
4831 PlayerTextDrawBackgroundColor(playerid, G30TD, 0xFFFFFF22);
4832 }
4833
4834 if(Player[playerid][Gun3] == AK47)
4835 {
4836 PlayerTextDrawBackgroundColor(playerid, G3TD, 0x00FF0022);
4837 } else {
4838 if(Player[playerid][UnlockedAK47] == true)
4839 {
4840 PlayerTextDrawBackgroundColor(playerid, G3TD, 0xFFFFFF22);
4841 } else {
4842 PlayerTextDrawBackgroundColor(playerid, G3TD, 0xFF000022);
4843 }
4844 }
4845
4846 if(Player[playerid][Gun3] == M4)
4847 {
4848 PlayerTextDrawBackgroundColor(playerid, G3bTD, 0x00FF0022);
4849 } else {
4850 if(Player[playerid][UnlockedM4] == true)
4851 {
4852 PlayerTextDrawBackgroundColor(playerid, G3bTD, 0xFFFFFF22);
4853 } else {
4854 PlayerTextDrawBackgroundColor(playerid, G3bTD, 0xFF000022);
4855 }
4856 }
4857
4858 if(Player[playerid][Gun4] == 0)
4859 {
4860 PlayerTextDrawBackgroundColor(playerid, G40TD, 0x00FF0022);
4861 } else {
4862 PlayerTextDrawBackgroundColor(playerid, G40TD, 0xFFFFFF22);
4863 }
4864
4865 if(Player[playerid][Gun4] == MP5)
4866 {
4867 PlayerTextDrawBackgroundColor(playerid, G4TD, 0x00FF0022);
4868 } else {
4869 if(Player[playerid][UnlockedMP5] == true)
4870 {
4871 PlayerTextDrawBackgroundColor(playerid, G4TD, 0xFFFFFF22);
4872 } else {
4873 PlayerTextDrawBackgroundColor(playerid, G4TD, 0xFF000022);
4874 }
4875 }
4876
4877 if(Player[playerid][Gun5] == RIFLE)
4878 {
4879 PlayerTextDrawBackgroundColor(playerid, G5TD, 0x00FF0022);
4880 } else {
4881 PlayerTextDrawBackgroundColor(playerid, G5TD, 0xFFFFFF22);
4882 }
4883
4884 if(Player[playerid][Gun5] == SNIPER)
4885 {
4886 PlayerTextDrawBackgroundColor(playerid, G5bTD, 0x00FF0022);
4887 } else {
4888 if(Player[playerid][UnlockedSniper] == true)
4889 {
4890 PlayerTextDrawBackgroundColor(playerid, G5bTD, 0xFFFFFF22);
4891 } else {
4892 PlayerTextDrawBackgroundColor(playerid, G5bTD, 0xFF000022);
4893 }
4894 }
4895
4896 if(Player[playerid][Gun6] == 0)
4897 {
4898 PlayerTextDrawBackgroundColor(playerid, G60TD, 0x00FF0022);
4899 } else {
4900 PlayerTextDrawBackgroundColor(playerid, G60TD, 0xFFFFFF22);
4901 }
4902
4903 if(Player[playerid][Gun6] == GRENADE)
4904 {
4905 PlayerTextDrawBackgroundColor(playerid, G6TD, 0x00FF0022);
4906 } else {
4907 if(Player[playerid][UnlockedGrenade] == true)
4908 {
4909 PlayerTextDrawBackgroundColor(playerid, G6TD, 0xFFFFFF22);
4910 } else {
4911 PlayerTextDrawBackgroundColor(playerid, G6TD, 0xFF000022);
4912 }
4913 }
4914
4915 ShowGunsTDs(playerid);
4916}
4917
4918LoadGunsTDs(playerid)
4919{
4920 SelectTextDraw(playerid, 0xFFFFFFFF);
4921
4922 GboxTD = CreatePlayerTextDraw(playerid, 330.0000000, 90.000000, "Guns_Selection_Menu~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~");
4923 PlayerTextDrawAlignment(playerid, GboxTD, 2);
4924 PlayerTextDrawBackgroundColor(playerid, GboxTD, 255);
4925 PlayerTextDrawFont(playerid, GboxTD, 2);
4926 PlayerTextDrawLetterSize(playerid, GboxTD, 0.500000, 1.800000);
4927 PlayerTextDrawColor(playerid, GboxTD, 8454143);
4928 PlayerTextDrawSetOutline(playerid, GboxTD, 0);
4929 PlayerTextDrawSetProportional(playerid, GboxTD, 1);
4930 PlayerTextDrawSetShadow(playerid, GboxTD, 1);
4931 PlayerTextDrawUseBox(playerid, GboxTD, 1);
4932 PlayerTextDrawBoxColor(playerid, GboxTD, 8453896);
4933 PlayerTextDrawTextSize(playerid, GboxTD, 0.000000, -390.000000);
4934
4935
4936 G1TD = CreatePlayerTextDraw(playerid, 370, 126.0, "_");
4937 PlayerTextDrawFont(playerid, G1TD, 5);
4938 PlayerTextDrawTextSize(playerid, G1TD, 70.0, 45.0);
4939 PlayerTextDrawUseBox(playerid, G1TD, 1);
4940 PlayerTextDrawBackgroundColor(playerid, G1TD, 0x00FF0022);
4941 PlayerTextDrawSetPreviewRot(playerid, G1TD, 0.0, 30.0, 225.0, 0.7);
4942 PlayerTextDrawSetPreviewModel(playerid, G1TD, 348); //deagle
4943 PlayerTextDrawSetSelectable(playerid, PlayerText:G1TD, 1);
4944
4945
4946 G2TD = CreatePlayerTextDraw(playerid, 370, 174.0, "_");
4947 PlayerTextDrawFont(playerid, G2TD, 5);
4948 PlayerTextDrawTextSize(playerid, G2TD, 70.0, 45.0);
4949 PlayerTextDrawUseBox(playerid, G2TD, 1);
4950 if(Player[playerid][Gun2] == SHOTGUN)
4951 {
4952 PlayerTextDrawBackgroundColor(playerid, G2TD, 0x00FF0022);
4953 } else {
4954 PlayerTextDrawBackgroundColor(playerid, G2TD, 0xFFFFFF22);
4955 }
4956 PlayerTextDrawSetPreviewRot(playerid, G2TD, 0.0, 30.0, 225.0, 0.9);
4957 PlayerTextDrawSetPreviewModel(playerid, G2TD, 349); //shotgun
4958 PlayerTextDrawSetSelectable(playerid, PlayerText:G2TD, 1);
4959
4960
4961 G2bTD = CreatePlayerTextDraw(playerid, 370.0 + 74.0, 174.0, "_");
4962 PlayerTextDrawFont(playerid, G2bTD, 5);
4963 PlayerTextDrawTextSize(playerid, G2bTD, 70.0, 45.0);
4964 PlayerTextDrawUseBox(playerid, G2bTD, 1);
4965 if(Player[playerid][Gun2] == SPAS)
4966 {
4967 PlayerTextDrawBackgroundColor(playerid, G2bTD, 0x00FF0022);
4968 } else {
4969 if(Player[playerid][UnlockedSpas] == true)
4970 {
4971 PlayerTextDrawBackgroundColor(playerid, G2bTD, 0xFFFFFF22);
4972 } else {
4973 PlayerTextDrawBackgroundColor(playerid, G2bTD, 0xFF000022);
4974 }
4975 }
4976 PlayerTextDrawSetPreviewRot(playerid, G2bTD, 0.0, 30.0, 225.0, 0.9);
4977 PlayerTextDrawSetPreviewModel(playerid, G2bTD, 351); //spas
4978 PlayerTextDrawSetSelectable(playerid, PlayerText:G2bTD, 1);
4979
4980
4981 G30TD = CreatePlayerTextDraw(playerid, 370 - 74.0, 222.0, "_");
4982 PlayerTextDrawFont(playerid, G30TD, 5);
4983 PlayerTextDrawTextSize(playerid, G30TD, 70.0, 45.0);
4984 PlayerTextDrawUseBox(playerid, G30TD, 1);
4985 if(Player[playerid][Gun3] == 0)
4986 {
4987 PlayerTextDrawBackgroundColor(playerid, G30TD, 0x00FF0022);
4988 } else {
4989 PlayerTextDrawBackgroundColor(playerid, G30TD, 0xFFFFFF22);
4990 }
4991 PlayerTextDrawSetPreviewRot(playerid, G30TD, 0.0, 30.0, 225.0, 20.0);
4992 PlayerTextDrawSetPreviewModel(playerid, G30TD, 331); //aknone
4993 PlayerTextDrawSetSelectable(playerid, PlayerText:G30TD, 1);
4994
4995
4996 G3TD = CreatePlayerTextDraw(playerid, 370, 222.0, "_");
4997 PlayerTextDrawFont(playerid, G3TD, 5);
4998 PlayerTextDrawTextSize(playerid, G3TD, 70.0, 45.0);
4999 PlayerTextDrawUseBox(playerid, G3TD, 1);
5000 if(Player[playerid][Gun3] == AK47)
5001 {
5002 PlayerTextDrawBackgroundColor(playerid, G3TD, 0x00FF0022);
5003 } else {
5004 if(Player[playerid][UnlockedAK47] == true)
5005 {
5006 PlayerTextDrawBackgroundColor(playerid, G3TD, 0xFFFFFF22);
5007 } else {
5008 PlayerTextDrawBackgroundColor(playerid, G3TD, 0xFF000022);
5009 }
5010 }
5011 PlayerTextDrawSetPreviewRot(playerid, G3TD, 0.0, 30.0, 225.0, 1.0);
5012 PlayerTextDrawSetPreviewModel(playerid, G3TD, 355); //ak
5013 PlayerTextDrawSetSelectable(playerid, PlayerText:G3TD, 1);
5014
5015
5016 G3bTD = CreatePlayerTextDraw(playerid, 370.0 + 74.0, 222.0, "_");
5017 PlayerTextDrawFont(playerid, G3bTD, 5);
5018 PlayerTextDrawTextSize(playerid, G3bTD, 70.0, 45.0);
5019 PlayerTextDrawUseBox(playerid, G3bTD, 1);
5020 if(Player[playerid][Gun3] == M4)
5021 {
5022 PlayerTextDrawBackgroundColor(playerid, G3bTD, 0x00FF0022);
5023 } else {
5024 if(Player[playerid][UnlockedM4] == true)
5025 {
5026 PlayerTextDrawBackgroundColor(playerid, G3bTD, 0xFFFFFF22);
5027 } else {
5028 PlayerTextDrawBackgroundColor(playerid, G3bTD, 0xFF000022);
5029 }
5030 }
5031 PlayerTextDrawSetPreviewRot(playerid, G3bTD, 0.0, 30.0, 225.0, 1.0);
5032 PlayerTextDrawSetPreviewModel(playerid, G3bTD, 356); //m4
5033 PlayerTextDrawSetSelectable(playerid, PlayerText:G3bTD, 1);
5034
5035
5036 G40TD = CreatePlayerTextDraw(playerid, 370 - 74.0, 270.0, "_");
5037 PlayerTextDrawFont(playerid, G40TD, 5);
5038 PlayerTextDrawTextSize(playerid, G40TD, 70.0, 45.0);
5039 PlayerTextDrawUseBox(playerid, G40TD, 1);
5040 if(Player[playerid][Gun4] == 0)
5041 {
5042 PlayerTextDrawBackgroundColor(playerid, G40TD, 0x00FF0022);
5043 } else {
5044 PlayerTextDrawBackgroundColor(playerid, G40TD, 0xFFFFFF22);
5045 }
5046 PlayerTextDrawSetPreviewRot(playerid, G40TD, 0.0, 30.0, 225.0, 20.0);
5047 PlayerTextDrawSetPreviewModel(playerid, G40TD, 331); //mp5none
5048 PlayerTextDrawSetSelectable(playerid, PlayerText:G40TD, 1);
5049
5050
5051 G4TD = CreatePlayerTextDraw(playerid, 370, 270.0, "_");
5052 PlayerTextDrawFont(playerid, G4TD, 5);
5053 PlayerTextDrawTextSize(playerid, G4TD, 70.0, 45.0);
5054 PlayerTextDrawUseBox(playerid, G4TD, 1);
5055 if(Player[playerid][Gun4] == MP5)
5056 {
5057 PlayerTextDrawBackgroundColor(playerid, G4TD, 0x00FF0022);
5058 } else {
5059 if(Player[playerid][UnlockedMP5] == true)
5060 {
5061 PlayerTextDrawBackgroundColor(playerid, G4TD, 0xFFFFFF22);
5062 } else {
5063 PlayerTextDrawBackgroundColor(playerid, G4TD, 0xFF000022);
5064 }
5065 }
5066 PlayerTextDrawSetPreviewRot(playerid, G4TD, 0.0, 30.0, 225.0, 0.9);
5067 PlayerTextDrawSetPreviewModel(playerid, G4TD, 353); //mp5
5068 PlayerTextDrawSetSelectable(playerid, PlayerText:G4TD, 1);
5069
5070
5071 G5TD = CreatePlayerTextDraw(playerid, 370, 318.0, "_");
5072 PlayerTextDrawFont(playerid, G5TD, 5);
5073 PlayerTextDrawTextSize(playerid, G5TD, 70.0, 45.0);
5074 PlayerTextDrawUseBox(playerid, G5TD, 1);
5075 if(Player[playerid][Gun5] == RIFLE)
5076 {
5077 PlayerTextDrawBackgroundColor(playerid, G5TD, 0x00FF0022);
5078 } else {
5079 PlayerTextDrawBackgroundColor(playerid, G5TD, 0xFFFFFF22);
5080 }
5081 PlayerTextDrawSetPreviewRot(playerid, G5TD, 0.0, 30.0, 225.0, 1.0);
5082 PlayerTextDrawSetPreviewModel(playerid, G5TD, 357); //rifle
5083 PlayerTextDrawSetSelectable(playerid, PlayerText:G5TD, 1);
5084
5085
5086 G5bTD = CreatePlayerTextDraw(playerid, 370.0 + 74.0, 318.0, "_");
5087 PlayerTextDrawFont(playerid, G5bTD, 5);
5088 PlayerTextDrawTextSize(playerid, G5bTD, 70.0, 45.0);
5089 PlayerTextDrawUseBox(playerid, G5bTD, 1);
5090 if(Player[playerid][Gun5] == SNIPER)
5091 {
5092 PlayerTextDrawBackgroundColor(playerid, G5bTD, 0x00FF0022);
5093 } else {
5094 if(Player[playerid][UnlockedSniper] == true)
5095 {
5096 PlayerTextDrawBackgroundColor(playerid, G5bTD, 0xFFFFFF22);
5097 } else {
5098 PlayerTextDrawBackgroundColor(playerid, G5bTD, 0xFF000022);
5099 }
5100 }
5101 PlayerTextDrawSetPreviewRot(playerid, G5bTD, 0.0, 30.0, 225.0, 1.0);
5102 PlayerTextDrawSetPreviewModel(playerid, G5bTD, 358); //sniper
5103 PlayerTextDrawSetSelectable(playerid, PlayerText:G5bTD, 1);
5104
5105
5106 G60TD = CreatePlayerTextDraw(playerid, 370 - 74.0, 366.0, "_");
5107 PlayerTextDrawFont(playerid, G60TD, 5);
5108 PlayerTextDrawTextSize(playerid, G60TD, 70.0, 45.0);
5109 PlayerTextDrawUseBox(playerid, G60TD, 1);
5110 if(Player[playerid][Gun6] == 0)
5111 {
5112 PlayerTextDrawBackgroundColor(playerid, G60TD, 0x00FF0022);
5113 } else {
5114 PlayerTextDrawBackgroundColor(playerid, G60TD, 0xFFFFFF22);
5115 }
5116 PlayerTextDrawSetPreviewRot(playerid, G60TD, 0.0, 30.0, 225.0, 20.0);
5117 PlayerTextDrawSetPreviewModel(playerid, G60TD, 331); //grenadenone
5118 PlayerTextDrawSetSelectable(playerid, PlayerText:G60TD, 1);
5119
5120
5121 G6TD = CreatePlayerTextDraw(playerid, 370, 366.0, "_");
5122 PlayerTextDrawFont(playerid, G6TD, 5);
5123 PlayerTextDrawTextSize(playerid, G6TD, 70.0, 45.0);
5124 PlayerTextDrawUseBox(playerid, G6TD, 1);
5125 if(Player[playerid][Gun6] == GRENADE)
5126 {
5127 PlayerTextDrawBackgroundColor(playerid, G6TD, 0x00FF0022);
5128 } else {
5129 if(Player[playerid][UnlockedGrenade] == true)
5130 {
5131 PlayerTextDrawBackgroundColor(playerid, G6TD, 0xFFFFFF22);
5132 } else {
5133 PlayerTextDrawBackgroundColor(playerid, G6TD, 0xFF000022);
5134 }
5135 }
5136 PlayerTextDrawSetPreviewRot(playerid, G6TD, 0.0, 30.0, 225.0, 0.9);
5137 PlayerTextDrawSetPreviewModel(playerid, G6TD, 342); //grenade
5138 PlayerTextDrawSetSelectable(playerid, PlayerText:G6TD, 1);
5139
5140
5141
5142 GunTypes = CreatePlayerTextDraw(playerid, 167.000000 - 20, 153.000000, "Primary~n~~n~~n~Secondary~n~~n~~n~Tertiary~n~~n~~n~Short-Range~n~~n~~n~Long-Range~n~~n~~n~Throwable");
5143 PlayerTextDrawBackgroundColor(playerid, GunTypes, 255);
5144 PlayerTextDrawFont(playerid, GunTypes, 2);
5145 PlayerTextDrawLetterSize(playerid, GunTypes, 0.400000, 1.800000);
5146 PlayerTextDrawColor(playerid, GunTypes, -1);
5147 PlayerTextDrawSetOutline(playerid, GunTypes, 0);
5148 PlayerTextDrawSetProportional(playerid, GunTypes, 1);
5149 PlayerTextDrawSetShadow(playerid, GunTypes, 1);
5150
5151 GunNames1 = CreatePlayerTextDraw(playerid, 385.000000 + 20, 153.000000, "Deagle~n~~n~~n~Shotgun~n~~n~~n~AK47~n~~n~~n~MP5~n~~n~~n~Rifle~n~~n~~n~Grenade");
5152 PlayerTextDrawAlignment(playerid, GunNames1, 2);
5153 PlayerTextDrawBackgroundColor(playerid, GunNames1, 255);
5154 PlayerTextDrawFont(playerid, GunNames1, 1);
5155 PlayerTextDrawLetterSize(playerid, GunNames1, 0.400000, 1.800000);
5156 PlayerTextDrawColor(playerid, GunNames1, -1);
5157 PlayerTextDrawSetOutline(playerid, GunNames1, 0);
5158 PlayerTextDrawSetProportional(playerid, GunNames1, 1);
5159 PlayerTextDrawSetShadow(playerid, GunNames1, 1);
5160
5161 GunNames2 = CreatePlayerTextDraw(playerid, 459.000000 + 20, 202.000000, "Spas~n~~n~~n~M4~n~~n~~n~~n~~n~~n~Sniper");
5162 PlayerTextDrawAlignment(playerid, GunNames2, 2);
5163 PlayerTextDrawBackgroundColor(playerid, GunNames2, 255);
5164 PlayerTextDrawFont(playerid, GunNames2, 1);
5165 PlayerTextDrawLetterSize(playerid, GunNames2, 0.400000, 1.800000);
5166 PlayerTextDrawColor(playerid, GunNames2, -1);
5167 PlayerTextDrawSetOutline(playerid, GunNames2, 0);
5168 PlayerTextDrawSetProportional(playerid, GunNames2, 1);
5169 PlayerTextDrawSetShadow(playerid, GunNames2, 1);
5170
5171 GunNames3 = CreatePlayerTextDraw(playerid, 311.000000 + 20, 250.000000, "None~n~~n~~n~None~n~~n~~n~~n~~n~~n~None");
5172 PlayerTextDrawAlignment(playerid, GunNames3, 2);
5173 PlayerTextDrawBackgroundColor(playerid, GunNames3, 255);
5174 PlayerTextDrawFont(playerid, GunNames3, 1);
5175 PlayerTextDrawLetterSize(playerid, GunNames3, 0.400000, 1.800000);
5176 PlayerTextDrawColor(playerid, GunNames3, -1);
5177 PlayerTextDrawSetOutline(playerid, GunNames3, 0);
5178 PlayerTextDrawSetProportional(playerid, GunNames3, 1);
5179 PlayerTextDrawSetShadow(playerid, GunNames3, 1);
5180
5181 ExitTD = CreatePlayerTextDraw(playerid, 581.000000, 371.000000, "Exit Selection");
5182 PlayerTextDrawAlignment(playerid, ExitTD, 2);
5183 PlayerTextDrawBackgroundColor(playerid, ExitTD, 255);
5184 PlayerTextDrawFont(playerid, ExitTD, 2);
5185 PlayerTextDrawLetterSize(playerid, ExitTD, 0.450000, 2.000000);
5186 PlayerTextDrawColor(playerid, ExitTD, -1);
5187 PlayerTextDrawSetOutline(playerid, ExitTD, 0);
5188 PlayerTextDrawSetProportional(playerid, ExitTD, 1);
5189 PlayerTextDrawSetShadow(playerid, ExitTD, 1);
5190 PlayerTextDrawUseBox(playerid, ExitTD, 1);
5191 PlayerTextDrawBoxColor(playerid, ExitTD, 0x0080FF22);
5192 PlayerTextDrawBackgroundColor(playerid, ExitTD, 0x0080FF22);
5193 PlayerTextDrawTextSize(playerid, ExitTD, 70.000000, 105.000000);
5194 PlayerTextDrawSetSelectable(playerid, PlayerText:ExitTD, 1);
5195
5196}
5197
5198
5199
5200HideGunsTDs(playerid)
5201{
5202 PlayerTextDrawHide(playerid, GboxTD);
5203 PlayerTextDrawHide(playerid, GunTypes);
5204 PlayerTextDrawHide(playerid, GunNames1);
5205 PlayerTextDrawHide(playerid, GunNames2);
5206 PlayerTextDrawHide(playerid, GunNames3);
5207 PlayerTextDrawHide(playerid, ExitTD);
5208 PlayerTextDrawHide(playerid, G1TD);
5209 PlayerTextDrawHide(playerid, G2TD);
5210 PlayerTextDrawHide(playerid, G2bTD);
5211 PlayerTextDrawHide(playerid, G30TD);
5212 PlayerTextDrawHide(playerid, G3TD);
5213 PlayerTextDrawHide(playerid, G3bTD);
5214 PlayerTextDrawHide(playerid, G40TD);
5215 PlayerTextDrawHide(playerid, G4TD);
5216 PlayerTextDrawHide(playerid, G5TD);
5217 PlayerTextDrawHide(playerid, G5bTD);
5218 PlayerTextDrawHide(playerid, G60TD);
5219 PlayerTextDrawHide(playerid, G6TD);
5220}
5221
5222ShowGunsTDs(playerid)
5223{
5224 PlayerTextDrawShow(playerid, GboxTD);
5225 PlayerTextDrawShow(playerid, GunTypes);
5226 PlayerTextDrawShow(playerid, GunNames1);
5227 PlayerTextDrawShow(playerid, GunNames2);
5228 PlayerTextDrawShow(playerid, GunNames3);
5229 PlayerTextDrawShow(playerid, ExitTD);
5230 PlayerTextDrawShow(playerid, G1TD);
5231 PlayerTextDrawShow(playerid, G2TD);
5232 PlayerTextDrawShow(playerid, G2bTD);
5233 PlayerTextDrawShow(playerid, G30TD);
5234 PlayerTextDrawShow(playerid, G3TD);
5235 PlayerTextDrawShow(playerid, G3bTD);
5236 PlayerTextDrawShow(playerid, G40TD);
5237 PlayerTextDrawShow(playerid, G4TD);
5238 PlayerTextDrawShow(playerid, G5TD);
5239 PlayerTextDrawShow(playerid, G5bTD);
5240 PlayerTextDrawShow(playerid, G60TD);
5241 PlayerTextDrawShow(playerid, G6TD);
5242}
5243
5244stock SpawnPlayerEx(playerid)
5245{
5246 if(Player[playerid][Spawned] == true)
5247 {
5248 if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
5249 SetPlayerPos(playerid, 0, 0, 0);
5250 SpawnPlayer(playerid);
5251 }
5252 return 1;
5253}
5254
5255stock sscanf(string[], format[], {Float,_}:...)
5256{
5257 #if defined isnull
5258 if (isnull(string))
5259 #else
5260 if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
5261 #endif
5262 {
5263 return format[0];
5264 }
5265 #pragma tabsize 4
5266 new
5267 formatPos = 0,
5268 stringPos = 0,
5269 paramPos = 2,
5270 paramCount = numargs(),
5271 delim = ' ';
5272 while (string[stringPos] && string[stringPos] <= ' ')
5273 {
5274 stringPos++;
5275 }
5276 while (paramPos < paramCount && string[stringPos])
5277 {
5278 switch (format[formatPos++])
5279 {
5280 case '\0':
5281 {
5282 return 0;
5283 }
5284 case 'i', 'd':
5285 {
5286 new
5287 neg = 1,
5288 num = 0,
5289 ch = string[stringPos];
5290 if (ch == '-')
5291 {
5292 neg = -1;
5293 ch = string[++stringPos];
5294 }
5295 do
5296 {
5297 stringPos++;
5298 if ('0' <= ch <= '9')
5299 {
5300 num = (num * 10) + (ch - '0');
5301 }
5302 else
5303 {
5304 return -1;
5305 }
5306 }
5307 while ((ch = string[stringPos]) > ' ' && ch != delim);
5308 setarg(paramPos, 0, num * neg);
5309 }
5310 case 'h', 'x':
5311 {
5312 new
5313 num = 0,
5314 ch = string[stringPos];
5315 do
5316 {
5317 stringPos++;
5318 switch (ch)
5319 {
5320 case 'x', 'X':
5321 {
5322 num = 0;
5323 continue;
5324 }
5325 case '0' .. '9':
5326 {
5327 num = (num << 4) | (ch - '0');
5328 }
5329 case 'a' .. 'f':
5330 {
5331 num = (num << 4) | (ch - ('a' - 10));
5332 }
5333 case 'A' .. 'F':
5334 {
5335 num = (num << 4) | (ch - ('A' - 10));
5336 }
5337 default:
5338 {
5339 return -1;
5340 }
5341 }
5342 }
5343 while ((ch = string[stringPos]) > ' ' && ch != delim);
5344 setarg(paramPos, 0, num);
5345 }
5346 case 'c':
5347 {
5348 setarg(paramPos, 0, string[stringPos++]);
5349 }
5350 case 'f':
5351 {
5352
5353 new changestr[256], changepos = 0, strpos = stringPos;
5354 while(changepos < 16 && string[strpos] && string[strpos] != delim)
5355 {
5356 changestr[changepos++] = string[strpos++];
5357 }
5358 changestr[changepos] = '\0';
5359 setarg(paramPos,0,_:floatstr(changestr));
5360 }
5361 case 'p':
5362 {
5363 delim = format[formatPos++];
5364 continue;
5365 }
5366 case '\'':
5367 {
5368 new
5369 end = formatPos - 1,
5370 ch;
5371 while ((ch = format[++end]) && ch != '\'') {}
5372 if (!ch)
5373 {
5374 return -1;
5375 }
5376 format[end] = '\0';
5377 if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
5378 {
5379 if (format[end + 1])
5380 {
5381 return -1;
5382 }
5383 return 0;
5384 }
5385 format[end] = '\'';
5386 stringPos = ch + (end - formatPos);
5387 formatPos = end + 1;
5388 }
5389 case 'u':
5390 {
5391 new
5392 end = stringPos - 1,
5393 id = 0,
5394 bool:num = true,
5395 ch;
5396 while ((ch = string[++end]) && ch != delim)
5397 {
5398 if (num)
5399 {
5400 if ('0' <= ch <= '9')
5401 {
5402 id = (id * 10) + (ch - '0');
5403 }
5404 else
5405 {
5406 num = false;
5407 }
5408 }
5409 }
5410 if (num && IsPlayerConnected(id))
5411 {
5412 setarg(paramPos, 0, id);
5413 }
5414 else
5415 {
5416 #if !defined foreach
5417 #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
5418 #define __SSCANF_FOREACH__
5419 #endif
5420 string[end] = '\0';
5421 num = false;
5422 new
5423 name[MAX_PLAYER_NAME];
5424 id = end - stringPos;
5425 foreach (Player, playerid)
5426 {
5427 GetPlayerName(playerid, name, sizeof (name));
5428 if (!strcmp(name, string[stringPos], true, id))
5429 {
5430 setarg(paramPos, 0, playerid);
5431 num = true;
5432 break;
5433 }
5434 }
5435 if (!num)
5436 {
5437 setarg(paramPos, 0, INVALID_PLAYER_ID);
5438 }
5439 string[end] = ch;
5440 #if defined __SSCANF_FOREACH__
5441 #undef foreach
5442 #undef __SSCANF_FOREACH__
5443 #endif
5444 }
5445 stringPos = end;
5446 }
5447 case 's', 'z':
5448 {
5449 new
5450 i = 0,
5451 ch;
5452 if (format[formatPos])
5453 {
5454 while ((ch = string[stringPos++]) && ch != delim)
5455 {
5456 setarg(paramPos, i++, ch);
5457 }
5458 if (!i)
5459 {
5460 return -1;
5461 }
5462 }
5463 else
5464 {
5465 while ((ch = string[stringPos++]))
5466 {
5467 setarg(paramPos, i++, ch);
5468 }
5469 }
5470 stringPos--;
5471 setarg(paramPos, i, '\0');
5472 }
5473 default:
5474 {
5475 continue;
5476 }
5477 }
5478 while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
5479 {
5480 stringPos++;
5481 }
5482 while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
5483 {
5484 stringPos++;
5485 }
5486 paramPos++;
5487 }
5488 do
5489 {
5490 if ((delim = format[formatPos++]) > ' ')
5491 {
5492 if (delim == '\'')
5493 {
5494 while ((delim = format[formatPos++]) && delim != '\'') {}
5495 }
5496 else if (delim != 'z')
5497 {
5498 return delim;
5499 }
5500 }
5501 }
5502 while (delim > ' ');
5503 return 0;
5504}
5505
5506stock GetPlayerAKA(playerid)
5507{
5508 new IP[MAX_PLAYER_NAME];
5509 GetPlayerIp(playerid, IP, sizeof(IP));
5510 new string[128];
5511 format(string, sizeof(string), "SELECT `Names` FROM `AKAs` WHERE `IP` = '%s'", IP);
5512 new DBResult:dbres = db_query(sqliteconnection, string);
5513
5514 AKAString = "";
5515 if(db_num_rows(dbres) > 0) {
5516 db_get_field_assoc(dbres, "Names", AKAString, sizeof(AKAString));
5517 } else {
5518 format(string, sizeof(string), "INSERT INTO `AKAs` (`IP`, `Names`) VALUES ('%s', '%s')", IP, "");
5519 db_free_result(db_query(sqliteconnection, string));
5520 }
5521
5522 db_free_result(dbres);
5523 return AKAString;
5524}
5525
5526
5527stock MatchAKA(playerid)
5528{
5529 AKAString = "";
5530 AKAString = GetPlayerAKA(playerid);
5531
5532 new idx;
5533 do {
5534 idx = strfind(AKAString, ",", true, idx == 0 ? 0 : idx+1);
5535 new compare[MAX_PLAYER_NAME];
5536 new idx2 = strfind(AKAString, ",", true, idx+1);
5537 strmid(compare, AKAString, idx+1, (idx2 == -1 ? strlen(AKAString) : idx2) );
5538
5539 if(!strcmp(compare, Player[playerid][Name], true) && strlen(Player[playerid][Name]) > 0 && strlen(compare) > 0) {
5540 return 1;
5541 }
5542
5543 } while(idx != -1);
5544 return 0;
5545}
5546
5547stock udb_hash(buf[]) {
5548 new length=strlen(buf);
5549 new s1 = 1;
5550 new s2 = 0;
5551 new n;
5552 for (n=0; n<length; n++)
5553 {
5554 s1 = (s1 + buf[n]) % 65521;
5555 s2 = (s2 + s1) % 65521;
5556 }
5557 return (s2 << 16) + s1;
5558}
5559
5560
5561//================================= Textdraws ==================================
5562
5563
5564LoadMainTextDraws()
5565{
5566 WebTextTD = TextDrawCreate(86.000000, 325.000000, "~y~~h~~h~Enjoy your stay");
5567 TextDrawFont(WebTextTD, 2);
5568 TextDrawLetterSize(WebTextTD, 0.240000, 1.300000);
5569 TextDrawBackgroundColor(WebTextTD, 8453905);
5570 TextDrawColor(WebTextTD, 0x000000FF);
5571 TextDrawSetOutline(WebTextTD, 1);
5572 TextDrawSetShadow(WebTextTD, 0);
5573 TextDrawSetProportional(WebTextTD, 1);
5574 TextDrawAlignment(WebTextTD, 2);
5575
5576 RoundStatsTD = TextDrawCreate(315.0, 428.0, "_");
5577 TextDrawFont(RoundStatsTD, 2);
5578 TextDrawLetterSize(RoundStatsTD, 0.36 + 0.04, 1.70);
5579 TextDrawBackgroundColor(RoundStatsTD,0x00444433);
5580 TextDrawColor(RoundStatsTD,0x000000FF);
5581 TextDrawSetOutline(RoundStatsTD,1);
5582 TextDrawSetShadow(RoundStatsTD,0);
5583 TextDrawAlignment(RoundStatsTD,2);
5584 TextDrawSetProportional(RoundStatsTD, 1);
5585
5586 BalanceTD = TextDrawCreate(575.000000, 28.000000, "_");
5587 TextDrawAlignment(BalanceTD, 2);
5588 TextDrawFont(BalanceTD, 2);
5589 TextDrawLetterSize(BalanceTD, 0.260000, 1.400000);
5590 TextDrawColor(BalanceTD,-65281);
5591// TextDrawBackgroundColor(BalanceTD,0x00000044);
5592 TextDrawBackgroundColor(BalanceTD,0x00444433);
5593 TextDrawSetOutline(BalanceTD, 1);
5594 TextDrawSetShadow(BalanceTD, 0);
5595
5596 ScoreTableTD[0] = TextDrawCreate(171.000000 - 20.00, 135.000000 + 30.00, "LD_POKE:cd9s");
5597 TextDrawLetterSize(ScoreTableTD[0], 0.000000, 0.000000);
5598 TextDrawTextSize(ScoreTableTD[0], 270.000000, 230.000000);
5599 TextDrawAlignment(ScoreTableTD[0], 1);
5600 TextDrawColor(ScoreTableTD[0], 0x00000099);
5601 TextDrawSetShadow(ScoreTableTD[0], 0);
5602 TextDrawSetOutline(ScoreTableTD[0], 0);
5603 TextDrawFont(ScoreTableTD[0], 4);
5604
5605 ScoreTableTD[1] = TextDrawCreate(180.000000 - 20.00, 140.000000 + 30.00, "~g~~h~~h~#~n~~n~01~n~02~n~03~n~04~n~05~n~06~n~07~n~08~n~09~n~10~n~11~n~12~n~13~n~14~n~15");
5606 ScoreTableTD[2] = TextDrawCreate(200.000000 - 20.00, 140.000000 + 30.00, "~g~~h~~h~Name~n~");
5607 ScoreTableTD[3] = TextDrawCreate(310.000000 - 20.00, 140.000000 + 30.00, "~g~~h~~h~Kills~n~");
5608 ScoreTableTD[4] = TextDrawCreate(340.000000 - 20.00, 140.000000 + 30.00, "~g~~h~~h~Deaths~n~");
5609 ScoreTableTD[5] = TextDrawCreate(390.000000 - 20.00, 140.000000 + 30.00, "~g~~h~~h~Damage~n~");
5610 for(new t=1; t < sizeof(ScoreTableTD); t++)
5611 {
5612 TextDrawFont(ScoreTableTD[t], 1);
5613 TextDrawLetterSize(ScoreTableTD[t], 0.300000, 1.40000);
5614 TextDrawSetShadow(ScoreTableTD[t], 0);
5615 }
5616
5617}
5618
5619
5620LoadPlayerTextDraws(playerid)
5621{
5622/*
5623 AchTD = CreatePlayerTextDraw(playerid, 620, 350, "_");
5624 PlayerTextDrawBackgroundColor(playerid, AchTD, 0x00AAAA33);
5625 PlayerTextDrawFont(playerid, AchTD, 1);
5626 PlayerTextDrawLetterSize(playerid, AchTD, 0.250000, 1.100000);
5627 PlayerTextDrawColor(playerid, AchTD, 0x000000FF);
5628 PlayerTextDrawSetOutline(playerid, AchTD, 1);
5629 PlayerTextDrawAlignment(playerid, AchTD, 3);
5630*/
5631
5632 Bar1 = CreatePlayerProgressBar(playerid, 497, 376, 140.500000, 1.700000, 0x00FFFF99, 250, BAR_DIRECTION_RIGHT);
5633
5634 AchTD = CreatePlayerTextDraw(playerid, 495, 360, "_");
5635 PlayerTextDrawBackgroundColor(playerid, AchTD, 0x00AAAA33);
5636 PlayerTextDrawFont(playerid, AchTD, 1);
5637 PlayerTextDrawLetterSize(playerid, AchTD, 0.25, 1.2);
5638 PlayerTextDrawColor(playerid, AchTD, 0x000000FF);
5639 PlayerTextDrawSetOutline(playerid, AchTD, 1);
5640 PlayerTextDrawUseBox(playerid, AchTD, 1);
5641 PlayerTextDrawTextSize(playerid, AchTD, 635, 0);
5642 PlayerTextDrawBoxColor(playerid, AchTD, 0x00000022);
5643
5644 AInfoTD = CreatePlayerTextDraw(playerid, 12, 200, "_");
5645// PlayerTextDrawBackgroundColor(playerid, AInfoTD, 8453905);
5646 PlayerTextDrawBackgroundColor(playerid, AInfoTD, 0x0080FF22);
5647 PlayerTextDrawFont(playerid, AInfoTD, 1);
5648 PlayerTextDrawLetterSize(playerid, AInfoTD, 0.250000, 1.100000);
5649 PlayerTextDrawColor(playerid, AInfoTD, 0x000000FF);
5650 PlayerTextDrawSetOutline(playerid, AInfoTD, 1);
5651
5652 HideTD = CreatePlayerTextDraw(playerid, 12, 280, "~l~Press ~g~~h~~h~~k~~VEHICLE_ENTER_EXIT~ ~l~to hide this info");
5653 PlayerTextDrawBackgroundColor(playerid, HideTD, 0x0080FF22);
5654 PlayerTextDrawFont(playerid, HideTD, 1);
5655 PlayerTextDrawLetterSize(playerid, HideTD, 0.250000, 1.100000);
5656 PlayerTextDrawColor(playerid, HideTD, 0x000000FF);
5657 PlayerTextDrawSetOutline(playerid, HideTD, 1);
5658
5659 FPSPingPacket = CreatePlayerTextDraw(playerid,630, 1.4, "_");
5660 PlayerTextDrawBackgroundColor(playerid, FPSPingPacket, 0x00666644);
5661 PlayerTextDrawFont(playerid, FPSPingPacket, 2);
5662 PlayerTextDrawLetterSize(playerid, FPSPingPacket, 0.190000, 1.2000);
5663 PlayerTextDrawColor(playerid, FPSPingPacket, 0x000000FF);
5664 PlayerTextDrawSetOutline(playerid, FPSPingPacket, 1);
5665 PlayerTextDrawSetProportional(playerid, FPSPingPacket, 1);
5666 PlayerTextDrawSetShadow(playerid, FPSPingPacket,0);
5667 PlayerTextDrawAlignment(playerid, FPSPingPacket, 3);
5668
5669 DoingDamage[0] = CreatePlayerTextDraw(playerid,140.0,372.0,"_");
5670 PlayerTextDrawFont(playerid, DoingDamage[0], 1);
5671 PlayerTextDrawLetterSize(playerid, DoingDamage[0], 0.18000, 0.9);
5672 PlayerTextDrawBackgroundColor(playerid, DoingDamage[0],0x00000044);
5673 PlayerTextDrawColor(playerid, DoingDamage[0], 16727295);
5674 PlayerTextDrawSetProportional(playerid, DoingDamage[0], 1);
5675 PlayerTextDrawSetOutline(playerid, DoingDamage[0],1);
5676 PlayerTextDrawSetShadow(playerid, DoingDamage[0],0);
5677
5678 DoingDamage[1] = CreatePlayerTextDraw(playerid,140.0,382.0,"_");
5679 PlayerTextDrawFont(playerid, DoingDamage[1], 1);
5680 PlayerTextDrawLetterSize(playerid, DoingDamage[1], 0.18000, 0.9);
5681 PlayerTextDrawBackgroundColor(playerid, DoingDamage[1],0x00000044);
5682 PlayerTextDrawColor(playerid, DoingDamage[1], 16727295);
5683 PlayerTextDrawSetProportional(playerid, DoingDamage[1], 1);
5684 PlayerTextDrawSetOutline(playerid, DoingDamage[1],1);
5685 PlayerTextDrawSetShadow(playerid, DoingDamage[1],0);
5686
5687 DoingDamage[2] = CreatePlayerTextDraw(playerid,140.0,392.0,"_");
5688 PlayerTextDrawFont(playerid, DoingDamage[2], 1);
5689 PlayerTextDrawLetterSize(playerid, DoingDamage[2], 0.18000, 0.9);
5690 PlayerTextDrawBackgroundColor(playerid, DoingDamage[2],0x00000044);
5691 PlayerTextDrawColor(playerid, DoingDamage[2], 16727295);
5692 PlayerTextDrawSetProportional(playerid, DoingDamage[2], 1);
5693 PlayerTextDrawSetOutline(playerid, DoingDamage[2],1);
5694 PlayerTextDrawSetShadow(playerid, DoingDamage[2],0);
5695
5696 GettingDamaged[0] = CreatePlayerTextDraw(playerid,380.0,372.0,"_");
5697 PlayerTextDrawFont(playerid, GettingDamaged[0], 1);
5698 PlayerTextDrawLetterSize(playerid, GettingDamaged[0], 0.18000, 0.9);
5699 PlayerTextDrawBackgroundColor(playerid, GettingDamaged[0],0x00000044);
5700 PlayerTextDrawColor(playerid, GettingDamaged[0], 16727295);
5701 PlayerTextDrawSetProportional(playerid, GettingDamaged[0], 1);
5702 PlayerTextDrawSetOutline(playerid, GettingDamaged[0],1);
5703 PlayerTextDrawSetShadow(playerid, GettingDamaged[0],0);
5704
5705 GettingDamaged[1] = CreatePlayerTextDraw(playerid,380.0,382.0,"_");
5706 PlayerTextDrawFont(playerid, GettingDamaged[1], 1);
5707 PlayerTextDrawLetterSize(playerid, GettingDamaged[1], 0.18000, 0.9);
5708 PlayerTextDrawBackgroundColor(playerid, GettingDamaged[1],0x00000044);
5709 PlayerTextDrawColor(playerid, GettingDamaged[1], 16727295);
5710 PlayerTextDrawSetProportional(playerid, GettingDamaged[1], 1);
5711 PlayerTextDrawSetOutline(playerid, GettingDamaged[1],1);
5712 PlayerTextDrawSetShadow(playerid, GettingDamaged[1],0);
5713
5714 GettingDamaged[2] = CreatePlayerTextDraw(playerid,380.0,392.0,"_");
5715 PlayerTextDrawFont(playerid, GettingDamaged[2], 1);
5716 PlayerTextDrawLetterSize(playerid, GettingDamaged[2], 0.18000, 0.9);
5717 PlayerTextDrawBackgroundColor(playerid, GettingDamaged[2],0x00000044);
5718 PlayerTextDrawColor(playerid, GettingDamaged[2], 16727295);
5719 PlayerTextDrawSetProportional(playerid, GettingDamaged[2], 1);
5720 PlayerTextDrawSetOutline(playerid, GettingDamaged[2],1);
5721 PlayerTextDrawSetShadow(playerid, GettingDamaged[2],0);
5722
5723 DeathText[0] = CreatePlayerTextDraw(playerid,322.000000, 346.000000, "_");
5724 PlayerTextDrawBackgroundColor(playerid, DeathText[0], 0x00000044);
5725 PlayerTextDrawFont(playerid, DeathText[0], 1);
5726 PlayerTextDrawLetterSize(playerid, DeathText[0], 0.250000, 1.2000);
5727 PlayerTextDrawColor(playerid, DeathText[0], 16711935);
5728 PlayerTextDrawSetOutline(playerid, DeathText[0], 1);
5729 PlayerTextDrawSetProportional(playerid, DeathText[0], 1);
5730 PlayerTextDrawSetShadow(playerid, DeathText[0], 0);
5731 PlayerTextDrawAlignment(playerid, DeathText[0], 2);
5732
5733 DeathText[1] = CreatePlayerTextDraw(playerid,322, 356.000000, "_");
5734 PlayerTextDrawBackgroundColor(playerid, DeathText[1], 0x00000044);
5735 PlayerTextDrawFont(playerid, DeathText[1], 1);
5736 PlayerTextDrawLetterSize(playerid, DeathText[1], 0.250000, 1.2000);
5737 PlayerTextDrawColor(playerid, DeathText[1], 16711935);
5738 PlayerTextDrawSetOutline(playerid, DeathText[1], 1);
5739 PlayerTextDrawSetProportional(playerid, DeathText[1], 1);
5740 PlayerTextDrawSetShadow(playerid, DeathText[1], 0);
5741 PlayerTextDrawAlignment(playerid, DeathText[1], 2);
5742
5743 ScoreTD = CreatePlayerTextDraw(playerid, 550.000000, 100.000000, "_");
5744 PlayerTextDrawAlignment(playerid, ScoreTD, 2);
5745 PlayerTextDrawFont(playerid, ScoreTD, 3);
5746 PlayerTextDrawLetterSize(playerid, ScoreTD, 0.700000, 1.900000);
5747 PlayerTextDrawColor(playerid, ScoreTD,-65281);
5748 PlayerTextDrawBackgroundColor(playerid, ScoreTD,0x00000044);
5749 PlayerTextDrawSetOutline(playerid, ScoreTD, 1);
5750 PlayerTextDrawSetShadow(playerid, ScoreTD, 0);
5751
5752 Ann1TD = CreatePlayerTextDraw(playerid, 320.0, 100.0, "_");
5753 PlayerTextDrawAlignment(playerid, Ann1TD, 2);
5754 PlayerTextDrawFont(playerid, Ann1TD, 2);
5755 PlayerTextDrawLetterSize(playerid, Ann1TD, 0.6, 2.0);
5756 PlayerTextDrawColor(playerid, Ann1TD, -16776961);
5757 PlayerTextDrawBackgroundColor(playerid, Ann1TD, 255);
5758 PlayerTextDrawSetOutline(playerid, Ann1TD, 0);
5759 PlayerTextDrawSetShadow(playerid, Ann1TD, 1);
5760
5761 Ann2TD = CreatePlayerTextDraw(playerid, 320.0, 118.0, "_");
5762 PlayerTextDrawAlignment(playerid, Ann2TD, 2);
5763 PlayerTextDrawFont(playerid, Ann2TD, 2);
5764 PlayerTextDrawLetterSize(playerid, Ann2TD, 0.5, 2.0);
5765 PlayerTextDrawColor(playerid, Ann2TD, -16777063);
5766 PlayerTextDrawBackgroundColor(playerid, Ann2TD, 255);
5767 PlayerTextDrawSetOutline(playerid, Ann2TD, 0);
5768 PlayerTextDrawSetShadow(playerid, Ann2TD, 1);
5769}
5770
5771
5772ACChecks()
5773{
5774 new iString[160];
5775 foreach(new i : Player)
5776 {
5777 if(IsPlayerConnected(i) && Player[i][Spawned] == true)
5778 {
5779/*
5780 //animation
5781
5782 new animlib[32];
5783 new animname[32];
5784 GetAnimationName(GetPlayerAnimationIndex(i),animlib,32,animname,32);
5785 format(iString, sizeof(iString), "Animation: %s %s --- %d", animlib, animname, GetPlayerAnimationIndex(i));
5786 SendACWarning(i, iString);
5787*/
5788
5789 //jetpack
5790 if(Player[i][SafeJetpack] == false && GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK)
5791 {
5792 SendACWarning(i, "Jetpack");
5793 PlayerPlaySound(i,12136,0.0,0.0,0.0);
5794 }
5795
5796
5797 //weaponhacks
5798 new weaponid = GetPlayerWeapon(i);
5799 if(Player[i][SafeGun] == false && weaponid != 0 && weaponid != DEAGLE && weaponid != SHOTGUN && weaponid != SPAS && weaponid != MP5 && weaponid != AK47 && weaponid != M4 && weaponid != RIFLE && weaponid != SNIPER && weaponid != GRENADE)
5800 {
5801 format(iString, sizeof(iString), "Weapon Hack: %s", WeaponNames[weaponid]);
5802 SendACWarning(i, iString);
5803 PlayerPlaySound(i,12136,0.0,0.0,0.0);
5804 }
5805
5806
5807 //ammohack
5808 new Weapon[13], Ammo[13];
5809 for(new k = 0; k < 13; k++) GetPlayerWeaponData(i, k, Weapon[k], Ammo[k]);
5810
5811 if(Player[i][VIP] == 1 && Player[i][SafeGun] == false)
5812 {
5813 if(Ammo[2] > 200 || Ammo[3] > 200 || Ammo[4] > 200 || Ammo[5] > 400 || Ammo[6] > 200 || Ammo[8] > 2)
5814 {
5815 SendACWarning(i, "Ammo Hack");
5816 PlayerPlaySound(i,12136,0.0,0.0,0.0);
5817 }
5818 }
5819 else if(Player[i][VIP] == 0 && Player[i][SafeGun] == false)
5820 {
5821 if(Ammo[2] > 100 || Ammo[3] > 100 || Ammo[4] > 100 || Ammo[5] > 200 || Ammo[6] > 100 || Ammo[8] > 1)
5822 {
5823 SendACWarning(i, "Ammo Hack");
5824 PlayerPlaySound(i,12136,0.0,0.0,0.0);
5825 }
5826 }
5827
5828
5829 //armorhack
5830 new Float:AP;
5831 GetPlayerArmour(i, AP);
5832 if(AP > 25)
5833 {
5834 SendACWarning(i, "Armour Hack");
5835 PlayerPlaySound(i,12136,0.0,0.0,0.0);
5836 }
5837
5838
5839 //airbreak
5840 if(GetPlayerAnimationIndex(i) == 958 || GetPlayerAnimationIndex(i) == 959 || GetPlayerAnimationIndex(i) == 961 || GetPlayerAnimationIndex(i) == 962)
5841 {
5842 SendACWarning(i, "Airbreak");
5843 PlayerPlaySound(i,12136,0.0,0.0,0.0);
5844 }
5845
5846
5847 //speedhack
5848 new Float:V[3], Float:SumV;
5849 GetPlayerVelocity(i, V[0], V[1], V[2]);
5850 if(V[0] > 0 && V[1] > 0) SumV = V[0] + V[1];
5851 if(V[0] < 0 && V[1] < 0) SumV = V[0] + V[1];
5852 if(V[0] > 0 && V[1] < 0) SumV = V[0] - V[1];
5853 if(V[0] < 0 && V[1] > 0) SumV = V[1] - V[0];
5854 if(SumV > 0.44 || SumV < -0.44)
5855 {
5856 format(iString, sizeof(iString), "Speedhack/Macros/Slidebug -- Speed: %.5f", SumV);
5857 SendACWarning(i, iString);
5858 PlayerPlaySound(i,12136,0.0,0.0,0.0);
5859 }
5860 }
5861 }
5862}
5863
5864public OnPlayerPickUpPickup(playerid, pickupid){
5865 if(pickupid == BCID){
5866 // -- I didn't configured any message for this.
5867 GivePlayerScore(playerid, 50);
5868 GivePlayerMoney(playerid, 100);
5869
5870 BCID = -1;
5871 }
5872}