Advertisement
Guest User

Roleplay by Shock

a guest
Feb 14th, 2013
10,757
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 358.75 KB | None | 0 0
  1. /*
  2.  
  3. Scripted by:
  4.  
  5. ^^^^^^^^^^^  ^^     ^^  ^^^^^^^^^^^^ ^^^^^^^^^^^  ^^   ^^
  6. ^         ^  ^^     ^^  ^ ^^^^^^^^ ^ ^ ^^^^^^^^^  ^^  ^^
  7. ^  ^^^^^^^^  ^^     ^^  ^ ^      ^ ^ ^ ^          ^^ ^^
  8. ^         ^  ^^^^^^^^^  ^ ^      ^ ^ ^ ^          ^^^^
  9. ^^^^^^^^  ^  ^^^^^^^^^  ^ ^      ^ ^ ^ ^          ^^^^
  10. ^         ^  ^^     ^^  ^ ^^^^^^^^ ^ ^ ^^^^^^^^^  ^^ ^^
  11. ^^^^^^^^^^^  ^^     ^^  ^^^^^^^^^^^^ ^^^^^^^^^^^  ^^   ^^
  12.  
  13. Scripted by
  14. Christian Hammer aka Alex Shock
  15.  
  16. Thanks to:
  17. Tony Mongool
  18. Jayden Mongool
  19. Lewis Cat
  20. Stony Shock (Petter Olsen)
  21. Tyrone Shock (Joachim Iversen)
  22. Ryder Shock (Marius Sunnset)
  23. Cody Gonzalez
  24. for helping with the testing!
  25.  
  26. */
  27.  
  28. // Includes
  29. #include <a_samp>
  30. #include <YSI\y_ini>
  31. #include <foreach>
  32. #include <streamer>
  33. #include <ZCMD>
  34. #include <YSI/y_timers>
  35. #include <yom_buttons>
  36. #include <sscanf2>
  37. #include <time>
  38. #include <a_zones>
  39.  
  40. // Version
  41. #define version "RP v1.0.0(b)"
  42. //
  43.  
  44. // Defines
  45.  
  46.     // .. Misc
  47.     #define MAX_DDOORS 1000
  48.     #define PATH "/Users/%s.ini"
  49.     #define DOORLOCK (5000)
  50.     #define MAX_BARRICADES 20
  51.     #define MAX_SPIKESTRIPS 200
  52.     #define MAX_CONES 30
  53.     #define MAX_PLAYER_VEHICLES 5
  54.     // .. Dialogs
  55.     #define DIALOG_REGISTER 1
  56.     #define DIALOG_LOGIN 2
  57.     #define DIALOG_SUCCESS_1 3
  58.     #define DIALOG_SUCCESS_2 4
  59.     #define DIALOG_SKIN 5
  60.     #define DIALOG_ADS 6
  61.     #define DIALOG_NAME 7
  62.     #define DIALOG_LSPD 8
  63.     #define DIALOG_LSPD2 9
  64.     #define DIALOG_LSPD3 10
  65.     #define DIALOG_FBI 11
  66.     #define DIALOG_FBI2 12
  67.     #define DIALOG_FBI3 13
  68.     #define DIALOG_CHANGENAME 14
  69.     #define DIALOG_UNINVITESKIN 15
  70.     #define DIALOG_QUIZ 16
  71.     #define DIALOG_QUIZ2 17
  72.     #define DIALOG_QUIZ3 18
  73.     #define DIALOG_QUIZ4 19
  74.     #define DIALOG_QUIZ5 20
  75.     #define DIALOG_QUIZ6 21
  76.     #define DIALOG_QUIZ7 22
  77.     #define DIALOG_QUIZ8 23
  78.     #define DIALOG_BUYSKIN 24
  79.     #define DIALOG_247 25
  80.     #define DIALOG_BUYCAR 26
  81.     #define DIALOG_BAR 27
  82.     // .. Shops
  83.     #define NOT_IN_SHOP 0
  84.     #define SHOP_BINCO 1
  85.     #define SHOP_247 2
  86.     // .. Colors
  87.     #define COL_WHITE "{FFFFFF}"
  88.     #define COL_RED "{F81414}"
  89.     #define COL_GREEN "{00FF22}"
  90.     #define COL_LIGHTBLUE "{00CED1}"
  91.     #define COLOR_GRAD1 0xB4B5B7FF
  92.     #define COLOR_GRAD2 0xBFC0C2FF
  93.     #define COLOR_GRAD3 0xCBCCCEFF
  94.     #define COLOR_GRAD4 0xD8D8D8FF
  95.     #define COLOR_GRAD5 0xE3E3E3FF
  96.     #define COLOR_GRAD6 0xF0F0F0FF
  97.     #define COLOR_GREY 0xAFAFAFAA
  98.     #define COLOR_RED 0xAA3333AA
  99.     #define COLOR_ORANGE 0xFF8000FF
  100.     #define COLOR_YELLOW 0xFFFF00AA
  101.     #define COLOR_GREEN 0x33AA33AA
  102.     #define COLOR_LIGHTGREEN 0x9ACD32AA
  103.     #define COLOR_CYAN 0x40FFFFFF
  104.     #define COLOR_PURPLE 0xC2A2DAAA
  105.     #define COLOR_BLACK 0x000000AA
  106.     #define COLOR_WHITE 0xFFFFFFAA
  107.     #define COLOR_FADE1 0xE6E6E6E6
  108.     #define COLOR_FADE2 0xC8C8C8C8
  109.     #define COLOR_FADE3 0xAAAAAAAA
  110.     #define COLOR_FADE4 0x8C8C8C8C
  111.     #define COLOR_FADE5 0x6E6E6E6E
  112.     #define COLOR_LIGHTRED 0xFF6347AA
  113.     #define COLOR_NEWS 0xFFA500AA
  114.     #define COLOR_TWWHITE 0xFFFFFFAA
  115.     #define TEAM_NEWS_COLOR 0x049C7100
  116.     #define RADIOLSFMD 0xFFBDFAAA
  117.     #define COLOR_TWYELLOW 0xFFFF00AA
  118.     #define COLOR_TWPINK 0xE75480AA
  119.     #define COLOR_TWRED 0xFF0000AA
  120.     #define COLOR_TWBROWN 0x654321AA
  121.     #define COLOR_TWGRAY 0x808080AA
  122.     #define COLOR_TWOLIVE 0x808000AA
  123.     #define COLOR_TWPURPLE 0x800080AA
  124.     #define COLOR_TWTAN 0xD2B48CAA
  125.     #define COLOR_TWAQUA 0x00FFFFAA
  126.     #define COLOR_TWORANGE 0xFF8C00AA
  127.     #define COLOR_TWAZURE 0x007FFFAA
  128.     #define COLOR_TWGREEN 0x008000AA
  129.     #define COLOR_TWBLUE 0x0000FFAA
  130.     #define COLOR_TWBLACK 0x000000AA
  131.     #define COLOR_LIGHTBLUE 0x33CCFFAA
  132.     #define TEAM_CYAN_COLOR 0xFF8282AA
  133.     #define DEPTRADIO 0xFFD7004A
  134.     #define RADIO 0x8D8DFFFF
  135.     #define COLOR_NEWBIE 0x7DAEFFFF
  136.     #define COLOR_PINK 0xFF66FFAA
  137.     #define COLOR_OOC 0xE0FFFFAA
  138.     #define WANTED_COLOR 0xFF0000FF
  139.     //
  140. //
  141.  
  142. /*
  143.     Enums
  144. */
  145.     enum pInfo
  146.     {
  147.     pPass,
  148.     pCash,
  149.     pAdmin,
  150.     pKills,
  151.     pDeaths,
  152.     pFaction,
  153.     pFacRank,
  154.     pFacLeader,
  155.     pFacDiv,
  156.     pSkin,
  157.     Float:pX,
  158.     Float:pY,
  159.     Float:pZ,
  160.     pLevel,
  161.     pBank,
  162.     pJob,
  163.     pTruckerSkill,
  164.     pWDealerSkill,
  165.     pBanned,
  166.     pHours,
  167.     pVW,
  168.     pInt,
  169.     pIp[26],
  170.     pGuns[20],
  171.     Float:pHealth,
  172.     Float:pArmor,
  173.     pMaterials,
  174.     pWanted,
  175.     pW1[24],
  176.     pW2[24],
  177.     pW3[24],
  178.     pW4[24],
  179.     pW5[24],
  180.     pW6[24],
  181.     pTotWanted,
  182.     pJail,
  183.     pBail,
  184.     pAName[24],
  185.     pName[70],
  186.     Float:pAx,
  187.     Float:pAy,
  188.     Float:pAz,
  189.     pTotDel,
  190.     pHelper,
  191.     pPhone,
  192.     pSpraycan,
  193.     pNewbMute,
  194.     Float: pVehiclePosX[5],
  195.     Float: pVehiclePosY[5],
  196.     Float: pVehiclePosZ[5],
  197.     Float: pVehicleRot[5],
  198.     pVehicleCol1[5],
  199.     pVehicleCol2[5],
  200.     pVehicle[5],
  201.     pVehicleSpawned[5],
  202.     pVehicleSpawnedID[5],
  203.     pContracted,
  204.     pContractReason[126],
  205.     pContractAmount,
  206.     pContractedBy[126],
  207.     pSuccess,
  208.     pFailed
  209.     };
  210.  
  211.     enum sInfo
  212.     {
  213.         sCreated,
  214.         Float:sX,
  215.         Float:sY,
  216.         Float:sZ,
  217.         sObject,
  218.     };
  219.  
  220.     enum cInfo
  221.     {
  222.         sCreated,
  223.         Float:sX,
  224.         Float:sY,
  225.         Float:sZ,
  226.         sObject,
  227.     };
  228.  
  229.     enum bInfo
  230.     {
  231.         sCreated,
  232.         Float:sX,
  233.         Float:sY,
  234.         Float:sZ,
  235.         sObject,
  236.     };
  237.    
  238.     enum eInfo
  239.     {
  240.     eStarted,
  241.     eLocked,
  242.     eAnnounced,
  243.     eBegun,
  244.     Float:eHealth,
  245.     Float:eArmor,
  246.     eSkin,
  247.     Float:eX,
  248.     Float:eY,
  249.     Float:eZ,
  250.     eVW,
  251.     eINT,
  252.     eGun1,
  253.     eGun2,
  254.     eGun3,
  255.     }
  256.  
  257.     enum ddInfo
  258.     {
  259.     ddName[128],
  260.     ddPickupID,
  261.     Text3D: ddTextID,
  262.     ddCustomInterior,
  263.     ddExteriorVW,
  264.     ddExteriorInt,
  265.     ddInteriorVW,
  266.     ddInteriorInt,
  267.     Float: ddExteriorX,
  268.     Float: ddExteriorY,
  269.     Float: ddExteriorZ,
  270.     Float: ddExteriorA,
  271.     Float: ddInteriorX,
  272.     Float: ddInteriorY,
  273.     Float: ddInteriorZ,
  274.     Float: ddInteriorA,
  275.     ddCustomExterior,
  276.     ddFaction,
  277.     ddAdmin,
  278.     ddWanted,
  279.     ddVehicleAble,
  280.     ddColor,
  281.     ddPickupModel,
  282.     ddPass[24],
  283.     ddLocked,
  284.     ddNotEditable,
  285.     };
  286.  
  287. new DoorInfo[MAX_DDOORS][ddInfo];
  288. new PlayerInfo[MAX_PLAYERS + 1][pInfo];
  289. new SpikeInfo[MAX_SPIKESTRIPS][sInfo];
  290. new ConeInfo[MAX_CONES][cInfo];
  291. new CadeInfo[MAX_BARRICADES][bInfo];
  292. new EventInfo[eInfo];
  293.  
  294. /*
  295.     News
  296. */
  297.  
  298. // Old stats
  299. new Float:oX[MAX_PLAYERS];
  300. new Float:oY[MAX_PLAYERS];
  301. new Float:oZ[MAX_PLAYERS];
  302. new oVW[MAX_PLAYERS];
  303. new oINT[MAX_PLAYERS];
  304. new Float:oHP[MAX_PLAYERS];
  305. new Float:oA[MAX_PLAYERS];
  306. new oSkin[MAX_PLAYERS];
  307. //
  308. new reports = 0;
  309. new reported[MAX_PLAYERS] = 0;
  310. new reportid[MAX_PLAYERS] = 0;
  311. new reporttext[MAX_PLAYERS][156];
  312. new carsentered[MAX_PLAYERS] = 0;
  313. new dontcheck[MAX_PLAYERS] = 0;
  314. new mute[MAX_PLAYERS] = -1;
  315. new AntiSpam[MAX_PLAYERS] = -1;
  316. new OnCall[MAX_PLAYERS] = -1;
  317. new LSPDGateStatus = 0;
  318. new LSPDBarrierStatus = 0;
  319. new LSPDDoorStatus;
  320. new Text:Clock;
  321. new Text:WeekDayg;
  322. new LSPDGate;
  323. new LSPDBarrier;
  324. new LSPDDoor1;
  325. new LSPDDoor2;
  326. new quizwrong[MAX_PLAYERS];
  327. new pass[MAX_PLAYERS] = -1;
  328. new spec[MAX_PLAYERS] = -1;
  329. new medicCP[MAX_PLAYERS] = -1;
  330. new CPT[MAX_PLAYERS];
  331. new truckloadedon[MAX_PLAYERS];
  332. new truckloaded[MAX_PLAYERS];
  333. new Text:ObjectsLoadingTD[7];
  334. new AdminDutyCash[MAX_PLAYERS];
  335. new Float:AdminDutyHealth[MAX_PLAYERS];
  336. new Float:AdminDutyArmor[MAX_PLAYERS];
  337. new LSFMDVeh[40];
  338. new LSPDVeh[40];
  339. new DSV[40];
  340. new level1Trucks[30];
  341. new level2Trucks[30];
  342. new level3Trucks[30];
  343. new level5Trucks[30];
  344. new rtimer[MAX_PLAYERS];
  345. new itimer[MAX_PLAYERS];
  346. new iitimer[MAX_PLAYERS];
  347. new Float:iX[MAX_PLAYERS], Float:iY[MAX_PLAYERS], Float:iZ[MAX_PLAYERS];
  348. new trailers[30];
  349. new Connected[MAX_PLAYERS] = 0;
  350. new AdminDuty[MAX_PLAYERS] = 0;
  351. new togdr[MAX_PLAYERS] = 0;
  352. new tazer[MAX_PLAYERS] = 0;
  353. new weaponbeingoffered[MAX_PLAYERS] = 0;
  354. new beingofferedby[MAX_PLAYERS] = -1;
  355. new tazerreplace[MAX_PLAYERS] = 0;
  356. new waitcheck[MAX_PLAYERS] = 0;
  357. new badge[MAX_PLAYERS] = 0;
  358. new cardetain[MAX_PLAYERS] = -1;
  359. new as[MAX_PLAYERS] = 0;
  360. new beingdragged[MAX_PLAYERS] = -1;
  361. new togo[MAX_PLAYERS] = 0;
  362. new skipacheck[MAX_PLAYERS] = 0;
  363. new invitedby[MAX_PLAYERS] = -1;
  364. new invitedto[MAX_PLAYERS] = 0;
  365. new tognewbie[MAX_PLAYERS] = 0;
  366. new NoNewb[MAX_PLAYERS] = 0;
  367. new AutoTPban[MAX_PLAYERS] = 0;
  368. new Float:Destinations[5][3] = {
  369.  
  370.     { 2401.7175,-1506.1350,23.5402 },
  371.     { 1191.0847,-888.5489,42.7969 },
  372.     { -69.6424,-1162.2354,1.5007 },
  373.     { 334.1184,-1340.1366,14.2125 },
  374.     { 481.7301,-1533.2468,19.6644 }
  375. };
  376. new Float:MDestinations[5][3] = {
  377.  
  378.     { 1976.59, -1234.12, 20.05 },
  379.     { 2338.0, -1247.0, 22.50 },
  380.     { 2530.99, -1712.53, 13.46 },
  381.     { 2446.40, -1975.78, 13.55 },
  382.     { 2173.0, -2265.0, 13.37 }
  383. };
  384.  
  385.  
  386.  
  387. /*
  388.     Stocks
  389. */
  390.  
  391. stock AddPh(oldph, newph)
  392. {
  393.     new File: file2 = fopen("tmpPhone.cfg", io_write);
  394.     new number;
  395.     new string[32];
  396.     new Phone[32];
  397.     format(string, sizeof(string), "%d\r\n", newph);
  398.     fwrite(file2, string);
  399.     fclose(file2);
  400.     file2 = fopen("tmpPhone.cfg", io_append);
  401.     new File: file = fopen("Phone.cfg", io_read);
  402.     while(fread(file, string))
  403.     {
  404.         strmid(Phone, string, 0, strlen(string)-1, 255);
  405.         number = strval(Phone);
  406.         if(number != oldph)
  407.         {
  408.             format(string, sizeof(string), "%d\r\n", number);
  409.             fwrite(file2, string);
  410.         }
  411.     }
  412.     fclose(file);
  413.     fclose(file2);
  414.     file2 = fopen("phone.cfg", io_write);
  415.     file = fopen("tmpPhone.cfg", io_read);
  416.     while(fread(file, string))
  417.     {
  418.         strmid(Phone, string, 0, strlen(string)-1, 255);
  419.         number = strval(Phone);
  420.         if(number != oldph)
  421.         {
  422.             format(string, sizeof(string), "%d\r\n", number);
  423.             fwrite(file2, string);
  424.         }
  425.     }
  426.     fclose(file);
  427.     fclose(file2);
  428.     fremove("tmpPhone.cfg");
  429.     return 1;
  430. }
  431.  
  432. stock isNearBar(playerid)
  433. {
  434.     if(IsPlayerInRangeOfPoint(playerid, 10, 499.9664,-20.6501,1000.6797)) return 1;
  435.     return 0;
  436. }
  437.  
  438. stock Shop(playerid)
  439. {
  440.     if(!IsPlayerConnected(playerid)) return NOT_IN_SHOP;
  441.     if(IsPlayerInRangeOfPoint(playerid, 30, 207.48, -101.49, 1005.26)) return SHOP_BINCO;
  442.     if(IsPlayerInRangeOfPoint(playerid, 50, -27.69, -89.42, 1003.55)) return SHOP_247;
  443.     return NOT_IN_SHOP;
  444. }
  445.  
  446. stock PreloadAnims(playerid) {
  447.     ApplyAnimation(playerid, "AIRPORT", "null", 0.0, 0, 0, 0, 0, 0);
  448.     ApplyAnimation(playerid, "Attractors", "null", 0.0, 0, 0, 0, 0, 0);
  449.     ApplyAnimation(playerid, "BAR", "null", 0.0, 0, 0, 0, 0, 0);
  450.     ApplyAnimation(playerid, "BASEBALL", "null", 0.0, 0, 0, 0, 0, 0);
  451.     ApplyAnimation(playerid, "BD_FIRE", "null", 0.0, 0, 0, 0, 0, 0);
  452.     ApplyAnimation(playerid, "BEACH", "null", 0.0, 0, 0, 0, 0, 0);
  453.     ApplyAnimation(playerid, "benchpress", "null", 0.0, 0, 0, 0, 0, 0);
  454.     ApplyAnimation(playerid, "BF_injection", "null", 0.0, 0, 0, 0, 0, 0);
  455.     ApplyAnimation(playerid, "BIKED", "null", 0.0, 0, 0, 0, 0, 0);
  456.     ApplyAnimation(playerid, "BIKEH", "null", 0.0, 0, 0, 0, 0, 0);
  457.     ApplyAnimation(playerid, "BIKELEAP", "null", 0.0, 0, 0, 0, 0, 0);
  458.     ApplyAnimation(playerid, "BIKES", "null", 0.0, 0, 0, 0, 0, 0);
  459.     ApplyAnimation(playerid, "BIKEV", "null", 0.0, 0, 0, 0, 0, 0);
  460.     ApplyAnimation(playerid, "BIKE_DBZ", "null", 0.0, 0, 0, 0, 0, 0);
  461.     ApplyAnimation(playerid, "BMX", "null", 0.0, 0, 0, 0, 0, 0);
  462.     ApplyAnimation(playerid, "BOMBER", "null", 0.0, 0, 0, 0, 0, 0);
  463.     ApplyAnimation(playerid, "BOX", "null", 0.0, 0, 0, 0, 0, 0);
  464.     ApplyAnimation(playerid, "BSKTBALL", "null", 0.0, 0, 0, 0, 0, 0);
  465.     ApplyAnimation(playerid, "BUDDY", "null", 0.0, 0, 0, 0, 0, 0);
  466.     ApplyAnimation(playerid, "BUS", "null", 0.0, 0, 0, 0, 0, 0);
  467.     ApplyAnimation(playerid, "CAMERA", "null", 0.0, 0, 0, 0, 0, 0);
  468.     ApplyAnimation(playerid, "CAR", "null", 0.0, 0, 0, 0, 0, 0);
  469.     ApplyAnimation(playerid, "CARRY", "null", 0.0, 0, 0, 0, 0, 0);
  470.     ApplyAnimation(playerid, "CAR_CHAT", "null", 0.0, 0, 0, 0, 0, 0);
  471.     ApplyAnimation(playerid, "CASINO", "null", 0.0, 0, 0, 0, 0, 0);
  472.     ApplyAnimation(playerid, "CHAINSAW", "null", 0.0, 0, 0, 0, 0, 0);
  473.     ApplyAnimation(playerid, "CHOPPA", "null", 0.0, 0, 0, 0, 0, 0);
  474.     ApplyAnimation(playerid, "CLOTHES", "null", 0.0, 0, 0, 0, 0, 0);
  475.     ApplyAnimation(playerid, "COACH", "null", 0.0, 0, 0, 0, 0, 0);
  476.     ApplyAnimation(playerid, "COLT45", "null", 0.0, 0, 0, 0, 0, 0);
  477.     ApplyAnimation(playerid, "COP_AMBIENT", "null", 0.0, 0, 0, 0, 0, 0);
  478.     ApplyAnimation(playerid, "COP_DVBYZ", "null", 0.0, 0, 0, 0, 0, 0);
  479.     ApplyAnimation(playerid, "CRACK", "null", 0.0, 0, 0, 0, 0, 0);
  480.     ApplyAnimation(playerid, "CRIB", "null", 0.0, 0, 0, 0, 0, 0);
  481.     ApplyAnimation(playerid, "DAM_JUMP", "null", 0.0, 0, 0, 0, 0, 0);
  482.     ApplyAnimation(playerid, "DANCING", "null", 0.0, 0, 0, 0, 0, 0);
  483.     ApplyAnimation(playerid, "DEALER", "null", 0.0, 0, 0, 0, 0, 0);
  484.     ApplyAnimation(playerid, "DILDO", "null", 0.0, 0, 0, 0, 0, 0);
  485.     ApplyAnimation(playerid, "DODGE", "null", 0.0, 0, 0, 0, 0, 0);
  486.     ApplyAnimation(playerid, "DOZER", "null", 0.0, 0, 0, 0, 0, 0);
  487.     ApplyAnimation(playerid, "DRIVEBYS", "null", 0.0, 0, 0, 0, 0, 0);
  488.     ApplyAnimation(playerid, "FAT", "null", 0.0, 0, 0, 0, 0, 0);
  489.     ApplyAnimation(playerid, "FIGHT_B", "null", 0.0, 0, 0, 0, 0, 0);
  490.     ApplyAnimation(playerid, "FIGHT_C", "null", 0.0, 0, 0, 0, 0, 0);
  491.     ApplyAnimation(playerid, "FIGHT_D", "null", 0.0, 0, 0, 0, 0, 0);
  492.     ApplyAnimation(playerid, "FIGHT_E", "null", 0.0, 0, 0, 0, 0, 0);
  493.     ApplyAnimation(playerid, "FINALE", "null", 0.0, 0, 0, 0, 0, 0);
  494.     ApplyAnimation(playerid, "FINALE2", "null", 0.0, 0, 0, 0, 0, 0);
  495.     ApplyAnimation(playerid, "FLAME", "null", 0.0, 0, 0, 0, 0, 0);
  496.     ApplyAnimation(playerid, "Flowers", "null", 0.0, 0, 0, 0, 0, 0);
  497.     ApplyAnimation(playerid, "FOOD", "null", 0.0, 0, 0, 0, 0, 0);
  498.     ApplyAnimation(playerid, "Freeweights", "null", 0.0, 0, 0, 0, 0, 0);
  499.     ApplyAnimation(playerid, "GANGS", "null", 0.0, 0, 0, 0, 0, 0);
  500.     ApplyAnimation(playerid, "GHANDS", "null", 0.0, 0, 0, 0, 0, 0);
  501.     ApplyAnimation(playerid, "GHETTO_DB", "null", 0.0, 0, 0, 0, 0, 0);
  502.     ApplyAnimation(playerid, "goggles", "null", 0.0, 0, 0, 0, 0, 0);
  503.     ApplyAnimation(playerid, "GRAFFITI", "null", 0.0, 0, 0, 0, 0, 0);
  504.     ApplyAnimation(playerid, "GRAVEYARD", "null", 0.0, 0, 0, 0, 0, 0);
  505.     ApplyAnimation(playerid, "GRENADE", "null", 0.0, 0, 0, 0, 0, 0);
  506.     ApplyAnimation(playerid, "GYMNASIUM", "null", 0.0, 0, 0, 0, 0, 0);
  507.     ApplyAnimation(playerid, "HAIRCUTS", "null", 0.0, 0, 0, 0, 0, 0);
  508.     ApplyAnimation(playerid, "HEIST9", "null", 0.0, 0, 0, 0, 0, 0);
  509.     ApplyAnimation(playerid, "INT_HOUSE", "null", 0.0, 0, 0, 0, 0, 0);
  510.     ApplyAnimation(playerid, "INT_OFFICE", "null", 0.0, 0, 0, 0, 0, 0);
  511.     ApplyAnimation(playerid, "INT_SHOP", "null", 0.0, 0, 0, 0, 0, 0);
  512.     ApplyAnimation(playerid, "JST_BUISNESS", "null", 0.0, 0, 0, 0, 0, 0);
  513.     ApplyAnimation(playerid, "KART", "null", 0.0, 0, 0, 0, 0, 0);
  514.     ApplyAnimation(playerid, "KISSING", "null", 0.0, 0, 0, 0, 0, 0);
  515.     ApplyAnimation(playerid, "KNIFE", "null", 0.0, 0, 0, 0, 0, 0);
  516.     ApplyAnimation(playerid, "LAPDAN1", "null", 0.0, 0, 0, 0, 0, 0);
  517.     ApplyAnimation(playerid, "LAPDAN2", "null", 0.0, 0, 0, 0, 0, 0);
  518.     ApplyAnimation(playerid, "LAPDAN3", "null", 0.0, 0, 0, 0, 0, 0);
  519.     ApplyAnimation(playerid, "LOWRIDER", "null", 0.0, 0, 0, 0, 0, 0);
  520.     ApplyAnimation(playerid, "MD_CHASE", "null", 0.0, 0, 0, 0, 0, 0);
  521.     ApplyAnimation(playerid, "MD_END", "null", 0.0, 0, 0, 0, 0, 0);
  522.     ApplyAnimation(playerid, "MEDIC", "null", 0.0, 0, 0, 0, 0, 0);
  523.     ApplyAnimation(playerid, "MISC", "null", 0.0, 0, 0, 0, 0, 0);
  524.     ApplyAnimation(playerid, "MTB", "null", 0.0, 0, 0, 0, 0, 0);
  525.     ApplyAnimation(playerid, "MUSCULAR", "null", 0.0, 0, 0, 0, 0, 0);
  526.     ApplyAnimation(playerid, "NEVADA", "null", 0.0, 0, 0, 0, 0, 0);
  527.     ApplyAnimation(playerid, "ON_LOOKERS", "null", 0.0, 0, 0, 0, 0, 0);
  528.     ApplyAnimation(playerid, "OTB", "null", 0.0, 0, 0, 0, 0, 0);
  529.     ApplyAnimation(playerid, "PARACHUTE", "null", 0.0, 0, 0, 0, 0, 0);
  530.     ApplyAnimation(playerid, "PARK", "null", 0.0, 0, 0, 0, 0, 0);
  531.     ApplyAnimation(playerid, "PAULNMAC", "null", 0.0, 0, 0, 0, 0, 0);
  532.     ApplyAnimation(playerid, "ped", "null", 0.0, 0, 0, 0, 0, 0);
  533.     ApplyAnimation(playerid, "PLAYER_DVBYS", "null", 0.0, 0, 0, 0, 0, 0);
  534.     ApplyAnimation(playerid, "PLAYIDLES", "null", 0.0, 0, 0, 0, 0, 0);
  535.     ApplyAnimation(playerid, "POLICE", "null", 0.0, 0, 0, 0, 0, 0);
  536.     ApplyAnimation(playerid, "POOL", "null", 0.0, 0, 0, 0, 0, 0);
  537.     ApplyAnimation(playerid, "POOR", "null", 0.0, 0, 0, 0, 0, 0);
  538.     ApplyAnimation(playerid, "PYTHON", "null", 0.0, 0, 0, 0, 0, 0);
  539.     ApplyAnimation(playerid, "QUAD", "null", 0.0, 0, 0, 0, 0, 0);
  540.     ApplyAnimation(playerid, "QUAD_DBZ", "null", 0.0, 0, 0, 0, 0, 0);
  541.     ApplyAnimation(playerid, "RAPPING", "null", 0.0, 0, 0, 0, 0, 0);
  542.     ApplyAnimation(playerid, "RIFLE", "null", 0.0, 0, 0, 0, 0, 0);
  543.     ApplyAnimation(playerid, "RIOT", "null", 0.0, 0, 0, 0, 0, 0);
  544.     ApplyAnimation(playerid, "ROB_BANK", "null", 0.0, 0, 0, 0, 0, 0);
  545.     ApplyAnimation(playerid, "RUSTLER", "null", 0.0, 0, 0, 0, 0, 0);
  546.     ApplyAnimation(playerid, "RYDER", "null", 0.0, 0, 0, 0, 0, 0);
  547.     ApplyAnimation(playerid, "SCRATCHING", "null", 0.0, 0, 0, 0, 0, 0);
  548.     ApplyAnimation(playerid, "SHAMAL", "null", 0.0, 0, 0, 0, 0, 0);
  549.     ApplyAnimation(playerid, "SHOP", "null", 0.0, 0, 0, 0, 0, 0);
  550.     ApplyAnimation(playerid, "SHOTGUN", "null", 0.0, 0, 0, 0, 0, 0);
  551.     ApplyAnimation(playerid, "SILENCED", "null", 0.0, 0, 0, 0, 0, 0);
  552.     ApplyAnimation(playerid, "SKATE", "null", 0.0, 0, 0, 0, 0, 0);
  553.     ApplyAnimation(playerid, "SMOKING", "null", 0.0, 0, 0, 0, 0, 0);
  554.     ApplyAnimation(playerid, "SNIPER", "null", 0.0, 0, 0, 0, 0, 0);
  555.     ApplyAnimation(playerid, "SPRAYCAN", "null", 0.0, 0, 0, 0, 0, 0);
  556.     ApplyAnimation(playerid, "STRIP", "null", 0.0, 0, 0, 0, 0, 0);
  557.     ApplyAnimation(playerid, "SUNBATHE", "null", 0.0, 0, 0, 0, 0, 0);
  558.     ApplyAnimation(playerid, "SWAT", "null", 0.0, 0, 0, 0, 0, 0);
  559.     ApplyAnimation(playerid, "SWEET", "null", 0.0, 0, 0, 0, 0, 0);
  560.     ApplyAnimation(playerid, "SWIM", "null", 0.0, 0, 0, 0, 0, 0);
  561.     ApplyAnimation(playerid, "SWORD", "null", 0.0, 0, 0, 0, 0, 0);
  562.     ApplyAnimation(playerid, "TANK", "null", 0.0, 0, 0, 0, 0, 0);
  563.     ApplyAnimation(playerid, "TATTOOS", "null", 0.0, 0, 0, 0, 0, 0);
  564.     ApplyAnimation(playerid, "TEC", "null", 0.0, 0, 0, 0, 0, 0);
  565.     ApplyAnimation(playerid, "TRAIN", "null", 0.0, 0, 0, 0, 0, 0);
  566.     ApplyAnimation(playerid, "TRUCK", "null", 0.0, 0, 0, 0, 0, 0);
  567.     ApplyAnimation(playerid, "UZI", "null", 0.0, 0, 0, 0, 0, 0);
  568.     ApplyAnimation(playerid, "VAN", "null", 0.0, 0, 0, 0, 0, 0);
  569.     ApplyAnimation(playerid, "VENDING", "null", 0.0, 0, 0, 0, 0, 0);
  570.     ApplyAnimation(playerid, "VORTEX", "null", 0.0, 0, 0, 0, 0, 0);
  571.     ApplyAnimation(playerid, "WAYFARER", "null", 0.0, 0, 0, 0, 0, 0);
  572.     ApplyAnimation(playerid, "WEAPONS", "null", 0.0, 0, 0, 0, 0, 0);
  573.     ApplyAnimation(playerid, "WUZI", "null", 0.0, 0, 0, 0, 0, 0);
  574.  
  575.     return 1;
  576. }
  577.  
  578. stock AddBan(ip[])
  579. {
  580.     if(CheckBan(ip) == 0)
  581.     {
  582.         new File: file = fopen("ban.cfg", io_append);
  583.         new string[20];
  584.         format(string, sizeof(string), "\n%s", ip);
  585.         fwrite(file, string);
  586.         fclose(file);
  587.         foreach(Player, playerid)
  588.         {
  589.             new playerIP[16];
  590.             GetPlayerIp(playerid, playerIP, sizeof(playerIP));
  591.             if(strcmp(playerIP, ip) == 0)
  592.             {
  593.                 SendClientMessage(playerid, COLOR_NEWS, "Your IP is banned from the server.");
  594.                 Kick(playerid);
  595.             }
  596.         }
  597.         return 1;
  598.     }
  599.     return 0;
  600. }
  601.  
  602. stock fcreate(filename[])
  603. {
  604.     if(fexist(filename)) return false;
  605.     new File:fhnd;
  606.     fhnd=fopen(filename,io_write);
  607.     if(fhnd) {
  608.         fclose(fhnd);
  609.         return true;
  610.     }
  611.     return false;
  612. }
  613.  
  614. stock RemoveBan(ip[])
  615. {
  616.     if(CheckBan(ip) == 1)
  617.     {
  618.         new string[20];
  619.         new File: file = fopen("ban.cfg", io_read);
  620.         fcreate("tempBan.cfg");
  621.         new File: file2 = fopen("tempBan.cfg", io_append);
  622.         while(fread(file, string))
  623.         {
  624.             if(strcmp(ip, string, true, strlen(ip)) != 0 && strcmp("\n", string) != 0)
  625.             {
  626.                 fwrite(file2, string);
  627.             }
  628.         }
  629.         fclose(file);
  630.         fclose(file2);
  631.         file = fopen("ban.cfg", io_write);
  632.         file2 = fopen("tempBan.cfg", io_read);
  633.         while(fread(file2, string))
  634.         {
  635.             fwrite(file, string);
  636.         }
  637.         fclose(file);
  638.         fclose(file2);
  639.         fremove("tempBan.cfg");
  640.         return 1;
  641.     }
  642.     return 0;
  643. }
  644.  
  645. stock RemovePh(nmbr[])
  646. {
  647.     new string[20];
  648.     new File: file = fopen("phone.cfg", io_read);
  649.     fcreate("tempPh.cfg");
  650.     new File: file2 = fopen("tempPh.cfg", io_append);
  651.     while(fread(file, string))
  652.     {
  653.         if(strcmp(nmbr, string, true, strlen(nmbr)) != 0 && strcmp("\n", string) != 0)
  654.         {
  655.             fwrite(file2, string);
  656.         }
  657.         fclose(file);
  658.         fclose(file2);
  659.         file = fopen("phone.cfg", io_write);
  660.         file2 = fopen("tempPh.cfg", io_read);
  661.         while(fread(file2, string))
  662.         {
  663.             fwrite(file, string);
  664.         }
  665.         fclose(file);
  666.         fclose(file2);
  667.         fremove("tempPh.cfg");
  668.         return 1;
  669.     }
  670.     return 1;
  671. }
  672.  
  673. stock CheckPh(nmbr)
  674. {
  675.     new string[20];
  676.     new File: file = fopen("phone.cfg", io_read);
  677.     if(!fexist("phone.cfg")) { print("Couldn't find phone.cfg, created file."); fcreate("phone.cfg"); return 0; }
  678.     while(fread(file, string))
  679.     {
  680.         if(strval(string) == nmbr)
  681.         {
  682.             fclose(file);
  683.             return 1;
  684.         }
  685.     }
  686.     fclose(file);
  687.     return 0;
  688. }
  689.  
  690. stock CheckBan(ip[])
  691. {
  692.     new string[20];
  693.     new File: file = fopen("ban.cfg", io_read);
  694.     if(!fexist("ban.cfg")) { print("Couldn't find ban.cfg, created file."); fcreate("ban.cfg"); return 0; }
  695.     while(fread(file, string))
  696.     {
  697.         if(strcmp(ip, string, true, strlen(ip)) == 0)
  698.         {
  699.             fclose(file);
  700.             return 1;
  701.         }
  702.     }
  703.     fclose(file);
  704.     return 0;
  705. }
  706.  
  707. stock doesAccountExist(account_name[])
  708. {
  709.     new account[MAX_PLAYER_NAME + 12], File:f_Handle;
  710.  
  711.     format(account, sizeof(account), "users/%s.ini", account_name);
  712.     if(fexist(account)) {
  713.  
  714.         if(!(f_Handle = fopen(account, io_read))) {
  715.             return 1;
  716.         }
  717.  
  718.         if(flength(f_Handle) > 0) {
  719.             fclose(f_Handle);
  720.             return 1;
  721.         }
  722.         fclose(f_Handle);
  723.     }
  724.     return 0;
  725. }
  726.  
  727.  
  728. stock Float:GetDistance(Float: x1, Float: y1, Float: z1, Float: x2, Float: y2, Float: z2)
  729. {
  730.     new Float:d;
  731.     d += floatpower(x1-x2, 2.0);
  732.     d += floatpower(y1-y2, 2.0);
  733.     d += floatpower(z1-z2, 2.0);
  734.     d = floatsqroot(d);
  735.     return d;
  736. }
  737.  
  738. stock CreateStrip(Float:x,Float:y,Float:z,Float:Angle)
  739. {
  740.     for(new i = 0; i < sizeof(SpikeInfo); i++)
  741.     {
  742.         if(SpikeInfo[i][sCreated] == 0)
  743.         {
  744.             SpikeInfo[i][sCreated]=1;
  745.             SpikeInfo[i][sX]=x;
  746.             SpikeInfo[i][sY]=y;
  747.             SpikeInfo[i][sZ]=z-0.7;
  748.             SpikeInfo[i][sObject] = CreateObject(2899, x, y, z-0.9, 0, 0, Angle-90);
  749.             return 1;
  750.         }
  751.     }
  752.     return 0;
  753. }
  754.  
  755. stock CreateCone(Float:x,Float:y,Float:z,Float:Angle)
  756. {
  757.     for(new i = 0; i < sizeof(ConeInfo); i++)
  758.     {
  759.         if(ConeInfo[i][sCreated] == 0)
  760.         {
  761.             ConeInfo[i][sCreated]=1;
  762.             ConeInfo[i][sX]=x;
  763.             ConeInfo[i][sY]=y;
  764.             ConeInfo[i][sZ]=z-1;
  765.             ConeInfo[i][sObject] = CreateObject(1238, x, y, z-0.7, 0, 0, Angle);
  766.             return 1;
  767.         }
  768.     }
  769.     return 0;
  770. }
  771.  
  772. stock CreateCade(Float:x,Float:y,Float:z,Float:Angle)
  773. {
  774.     for(new i = 0; i < sizeof(CadeInfo); i++)
  775.     {
  776.         if(CadeInfo[i][sCreated] == 0)
  777.         {
  778.             CadeInfo[i][sCreated]=1;
  779.             CadeInfo[i][sX]=x;
  780.             CadeInfo[i][sY]=y;
  781.             CadeInfo[i][sZ]=z;
  782.             CadeInfo[i][sObject] = CreateObject(981, x, y, z, 0, 0, Angle);
  783.             return 1;
  784.         }
  785.     }
  786.     return 0;
  787. }
  788.  
  789. stock CreateCade2(Float:x,Float:y,Float:z,Float:Angle)
  790. {
  791.     for(new i = 0; i < sizeof(CadeInfo); i++)
  792.     {
  793.         if(CadeInfo[i][sCreated] == 0)
  794.         {
  795.             CadeInfo[i][sCreated]=1;
  796.             CadeInfo[i][sX]=x;
  797.             CadeInfo[i][sY]=y;
  798.             CadeInfo[i][sZ]=z;
  799.             CadeInfo[i][sObject] = CreateObject(978, x, y, z, 0, 0, Angle);
  800.             return 1;
  801.         }
  802.     }
  803.     return 0;
  804. }
  805.  
  806. stock DeleteAllStrip()
  807. {
  808.     for(new i = 0; i < sizeof(SpikeInfo); i++)
  809.     {
  810.         if(SpikeInfo[i][sCreated] == 1)
  811.         {
  812.             SpikeInfo[i][sCreated]=0;
  813.             SpikeInfo[i][sX]=0.0;
  814.             SpikeInfo[i][sY]=0.0;
  815.             SpikeInfo[i][sZ]=0.0;
  816.             DestroyObject(SpikeInfo[i][sObject]);
  817.         }
  818.     }
  819.     return 0;
  820. }
  821.  
  822. stock DeleteAllCade()
  823. {
  824.     for(new i = 0; i < sizeof(CadeInfo); i++)
  825.     {
  826.         if(CadeInfo[i][sCreated] == 1)
  827.         {
  828.             CadeInfo[i][sCreated]=0;
  829.             CadeInfo[i][sX]=0.0;
  830.             CadeInfo[i][sY]=0.0;
  831.             CadeInfo[i][sZ]=0.0;
  832.             DestroyObject(CadeInfo[i][sObject]);
  833.         }
  834.     }
  835.     return 0;
  836. }
  837.  
  838. stock DeleteAllCone()
  839. {
  840.     for(new i = 0; i < sizeof(ConeInfo); i++)
  841.     {
  842.         if(ConeInfo[i][sCreated] == 1)
  843.         {
  844.             ConeInfo[i][sCreated]=0;
  845.             ConeInfo[i][sX]=0.0;
  846.             ConeInfo[i][sY]=0.0;
  847.             ConeInfo[i][sZ]=0.0;
  848.             DestroyObject(ConeInfo[i][sObject]);
  849.         }
  850.     }
  851.     return 0;
  852. }
  853.  
  854. stock DeleteClosestStrip(playerid)
  855. {
  856.     for(new i = 0; i < sizeof(SpikeInfo); i++)
  857.     {
  858.         if(IsPlayerInRangeOfPoint(playerid, 4.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
  859.         {
  860.             if(SpikeInfo[i][sCreated] == 1)
  861.             {
  862.                 SpikeInfo[i][sCreated]=0;
  863.                 SpikeInfo[i][sX]=0.0;
  864.                 SpikeInfo[i][sY]=0.0;
  865.                 SpikeInfo[i][sZ]=0.0;
  866.                 DestroyObject(SpikeInfo[i][sObject]);
  867.                 new str[176], zone[64];
  868.                 GetPlayer3DZone(playerid, zone, sizeof(zone));
  869.                 format(str, sizeof(str), "* %s %s has picked up a spike strip at %s", GetRankName(playerid), GetName(playerid), zone);
  870.                 SendClientMessageToLSPD(RADIO, str);
  871.                 SendClientMessageToFBI(RADIO, str);
  872.                 return 1;
  873.             }
  874.         }
  875.     }
  876.     return 0;
  877. }
  878.  
  879. stock DeleteClosestCade(playerid)
  880. {
  881.     for(new i = 0; i < sizeof(CadeInfo); i++)
  882.     {
  883.         if(IsPlayerInRangeOfPoint(playerid, 4.0, CadeInfo[i][sX], CadeInfo[i][sY], CadeInfo[i][sZ]))
  884.         {
  885.             if(CadeInfo[i][sCreated] == 1)
  886.             {
  887.                 CadeInfo[i][sCreated]=0;
  888.                 CadeInfo[i][sX]=0.0;
  889.                 CadeInfo[i][sY]=0.0;
  890.                 CadeInfo[i][sZ]=0.0;
  891.                 DestroyObject(CadeInfo[i][sObject]);
  892.                 new str[176], zone[64];
  893.                 GetPlayer3DZone(playerid, zone, sizeof(zone));
  894.                 format(str, sizeof(str), "* %s %s has picked up a barricade at %s", GetRankName(playerid), GetName(playerid), zone);
  895.                 SendClientMessageToLSPD(RADIO, str);
  896.                 SendClientMessageToFBI(RADIO, str);
  897.                 return 1;
  898.             }
  899.         }
  900.     }
  901.     return 0;
  902. }
  903.  
  904. stock DeleteClosestCone(playerid)
  905. {
  906.     for(new i = 0; i < sizeof(ConeInfo); i++)
  907.     {
  908.         if(IsPlayerInRangeOfPoint(playerid, 4.0, ConeInfo[i][sX], ConeInfo[i][sY], ConeInfo[i][sZ]))
  909.         {
  910.             if(ConeInfo[i][sCreated] == 1)
  911.             {
  912.                 ConeInfo[i][sCreated]=0;
  913.                 ConeInfo[i][sX]=0.0;
  914.                 ConeInfo[i][sY]=0.0;
  915.                 ConeInfo[i][sZ]=0.0;
  916.                 DestroyObject(ConeInfo[i][sObject]);
  917.                 return 1;
  918.             }
  919.         }
  920.     }
  921.     return 0;
  922. }
  923.  
  924. encode_tires(tires1, tires2, tires3, tires4) {
  925.  
  926.     return tires1 | (tires2 << 1) | (tires3 << 2) | (tires4 << 3);
  927.  
  928. }
  929.  
  930. getrem(a,b) //get remnant of division
  931. {
  932.     new div = a/b;
  933.     new left = a-b*div;
  934.     return left;
  935. }
  936.  
  937. stock SetPlayerMoney(playerid)
  938. {
  939.     GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]-GetPlayerMoney(playerid));
  940.     return 1;
  941. }
  942.  
  943. stock strreplace(string[], find, replace)
  944. {
  945.     for(new i=0; string[i]; i++)
  946.     {
  947.         if(string[i] == find)
  948.         {
  949.             string[i] = replace;
  950.         }
  951.     }
  952. }
  953.  
  954. stock GetName(playerid)
  955. {
  956.     new
  957.         name[24];
  958.     GetPlayerName(playerid, name, sizeof(name));
  959.     strreplace(name, '_', ' ');
  960.     return name;
  961. }
  962.  
  963. stock ProxDetector(Float:radi, playerid, string[],color)
  964. {
  965.     new Float:x,Float:y,Float:z;
  966.     GetPlayerPos(playerid,x,y,z);
  967.     foreach(Player,i)
  968.     {
  969.         if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
  970.         {
  971.             SendClientMessage(i,color,string);
  972.         }
  973.     }
  974. }
  975.  
  976. stock GetRankName(playerid)
  977. {
  978.     new string[56];
  979.     new faction;
  980.     new rank;
  981.     faction = PlayerInfo[playerid][pFaction];
  982.     rank = PlayerInfo[playerid][pFacRank];
  983.  
  984.     if(faction == 1 && rank == 0)
  985.     {
  986.         string = "Cadet";
  987.     }
  988.     if(faction == 1 && rank == 1)
  989.     {
  990.         string = "Officer";
  991.     }
  992.     if(faction == 1 && rank == 2)
  993.     {
  994.         string = "Corporal";
  995.     }
  996.     if(faction == 1 && rank == 3)
  997.     {
  998.         string = "Sergeant";
  999.     }
  1000.     if(faction == 1 && rank == 4)
  1001.     {
  1002.         string = "Lieutenant";
  1003.     }
  1004.     if(faction == 1 && rank == 5)
  1005.     {
  1006.         string = "Captain";
  1007.     }
  1008.     if(faction == 1 && rank == 6)
  1009.     {
  1010.         string = "Chief";
  1011.     }
  1012.  
  1013.     if(faction == 2 && rank == 0)
  1014.     {
  1015.         string = "Intern";
  1016.     }
  1017.     if(faction == 2 && rank == 1)
  1018.     {
  1019.         string = "Agent";
  1020.     }
  1021.     if(faction == 2 && rank == 2)
  1022.     {
  1023.         string = "Senior Agent";
  1024.     }
  1025.     if(faction == 2 && rank == 3)
  1026.     {
  1027.         string = "Special Agent";
  1028.     }
  1029.     if(faction == 2 && rank == 4)
  1030.     {
  1031.         string = "Supervisory Agent";
  1032.     }
  1033.     if(faction == 2 && rank == 5)
  1034.     {
  1035.         string = "Assistant Director";
  1036.     }
  1037.     if(faction == 2 && rank == 6)
  1038.     {
  1039.         string = "Director";
  1040.     }
  1041.  
  1042.     if(faction == 3 && rank == 0)
  1043.     {
  1044.         string = "Probationary";
  1045.     }
  1046.     if(faction == 3 && rank == 1)
  1047.     {
  1048.         string = "EMT Intermediate";
  1049.     }
  1050.     if(faction == 3 && rank == 2)
  1051.     {
  1052.         string = "EMT Paramedic";
  1053.     }
  1054.     if(faction == 3 && rank == 3)
  1055.     {
  1056.         string = "Lieutenant";
  1057.     }
  1058.     if(faction == 3 && rank == 4)
  1059.     {
  1060.         string = "Captain";
  1061.     }
  1062.     if(faction == 3 && rank == 5)
  1063.     {
  1064.         string = "Deputy Chief";
  1065.     }
  1066.     if(faction == 3 && rank == 6)
  1067.     {
  1068.         string = "Chief";
  1069.     }
  1070.     if(faction == 4 && rank == 0)
  1071.     {
  1072.         string = "Freelancer";
  1073.     }
  1074.     if(faction == 4 && rank == 1)
  1075.     {
  1076.         string = "Freelancer";
  1077.     }
  1078.     if(faction == 4 && rank == 2)
  1079.     {
  1080.         string = "Marksman";
  1081.     }
  1082.     if(faction == 4 && rank == 3)
  1083.     {
  1084.         string = "Agent";
  1085.     }
  1086.     if(faction == 4 && rank == 4)
  1087.     {
  1088.         string = "Special Agent";
  1089.     }
  1090.     if(faction == 4 && rank == 5)
  1091.     {
  1092.         string = "Vice Director";
  1093.     }
  1094.     if(faction == 4 && rank == 6)
  1095.     {
  1096.         string = "Director";
  1097.     }
  1098.     if(faction == 0)
  1099.     {
  1100.         string = "None";
  1101.     }
  1102.     return string;
  1103. }
  1104.  
  1105. stock GetFactionNameEx(amount)
  1106. {
  1107.     new string[56];
  1108.     if(amount == 1)
  1109.     {
  1110.         string = "Los Santos Police Department";
  1111.     }
  1112.     if(amount == 2)
  1113.     {
  1114.         string = "Federal Bureau of Investigation";
  1115.     }
  1116.     if(amount == 3)
  1117.     {
  1118.         string = "Los Santos Fire and Medical Department";
  1119.     }
  1120.     if(amount == 4)
  1121.     {
  1122.         string = "Hitman Agency";
  1123.     }
  1124.     if(amount == 5)
  1125.     {
  1126.         string = "Government";
  1127.         return string;
  1128.     }
  1129.     if(amount == 6)
  1130.     {
  1131.         string = "SA News";
  1132.     }
  1133.     return string;
  1134. }
  1135. stock GetFactionName(playerid)
  1136. {
  1137.     new string[56];
  1138.     if(PlayerInfo[playerid][pFaction] == 1)
  1139.     {
  1140.         string = "Los Santos Police Department";
  1141.     }
  1142.     if(PlayerInfo[playerid][pFaction] == 2)
  1143.     {
  1144.         string = "Federal Bureau of Investigation";
  1145.     }
  1146.     if(PlayerInfo[playerid][pFaction] == 3)
  1147.     {
  1148.         string = "Los Santos Fire and Medical Department";
  1149.     }
  1150.     if(PlayerInfo[playerid][pFaction] == 4)
  1151.     {
  1152.         string = "Hitman";
  1153.     }
  1154.     if(PlayerInfo[playerid][pFaction] == 5)
  1155.     {
  1156.         string = "Government";
  1157.         return string;
  1158.     }
  1159.     if(PlayerInfo[playerid][pFaction] == 6)
  1160.     {
  1161.         string = "SA News";
  1162.     }
  1163.     return string;
  1164. }
  1165.  
  1166. stock GetDivisionName(playerid)
  1167. {
  1168.     new string[56];
  1169.     if(PlayerInfo[playerid][pFaction] == 1)
  1170.     {
  1171.         switch(PlayerInfo[playerid][pFacDiv])
  1172.         {
  1173.             case 1:
  1174.             string = "SWAT";
  1175.             case 2:
  1176.             string = "TE";
  1177.             case 3:
  1178.             string = "FTO";
  1179.             case 4:
  1180.             string = "IA";
  1181.             default:
  1182.             string = "None";
  1183.         }
  1184.     }
  1185.  
  1186.     if(PlayerInfo[playerid][pFaction] == 2)
  1187.     {
  1188.         switch(PlayerInfo[playerid][pFacDiv])
  1189.         {
  1190.             case 1:
  1191.             string = "FAN";
  1192.             case 2:
  1193.             string = "GU";
  1194.             case 3:
  1195.             string = "IA";
  1196.             default:
  1197.             string = "None";
  1198.         }
  1199.     }
  1200.  
  1201.     if(PlayerInfo[playerid][pFaction] == 3)
  1202.     {
  1203.         switch(PlayerInfo[playerid][pFacDiv])
  1204.         {
  1205.             case 1:
  1206.             string = "Human Resources";
  1207.             case 2:
  1208.             string = "Life Flight";
  1209.             default:
  1210.             string = "None";
  1211.         }
  1212.     }
  1213.  
  1214.     if(PlayerInfo[playerid][pFaction] == 4)
  1215.     {
  1216.         switch(PlayerInfo[playerid][pFacDiv])
  1217.         {
  1218.             default:
  1219.             string = "None";
  1220.         }
  1221.     }
  1222.  
  1223.     if(PlayerInfo[playerid][pFaction] == 5)
  1224.     {
  1225.         switch(PlayerInfo[playerid][pFacDiv])
  1226.         {
  1227.             case 1:
  1228.             string = "Legislative Branch";
  1229.             case 2:
  1230.             string = "Executive Branch";
  1231.             case 3:
  1232.             string = "Secret Service";
  1233.             case 4:
  1234.             string = "Judicial";
  1235.             default:
  1236.             string = "None";
  1237.         }
  1238.     }
  1239.  
  1240.     if(PlayerInfo[playerid][pFaction] == 6)
  1241.     {
  1242.         switch(PlayerInfo[playerid][pFacDiv])
  1243.         {
  1244.             default:
  1245.             string = "None";
  1246.         }
  1247.     }
  1248.     return string;
  1249. }
  1250.  
  1251. stock ShowStats(playerid,targetid)
  1252. {
  1253.     new string[128];
  1254.     format(string, sizeof(string), "~~Stats of %s~~", GetName(targetid));
  1255.     SendClientMessage(playerid, COLOR_RED, string);
  1256.     new hTime = PlayerInfo[targetid][pHours]/60/60;
  1257.     format(string, sizeof(string), "Level: %i - Playing Hours: %i - Job: %s - Materials: %i", PlayerInfo[targetid][pLevel], hTime, GetJobName(targetid), PlayerInfo[targetid][pMaterials]);
  1258.     SendClientMessage(playerid, COLOR_GREEN, string);
  1259.     format(string, sizeof(string), "Total Wealth: $%i - Money: $%i - Bank: $%i - Total Wanted: %i", PlayerInfo[targetid][pCash]+PlayerInfo[targetid][pBank], PlayerInfo[targetid][pCash], PlayerInfo[targetid][pBank], PlayerInfo[targetid][pTotWanted]);
  1260.     SendClientMessage(playerid, COLOR_GREEN, string);
  1261.     format(string, sizeof(string), "Spraycans: %i - Number: %i", PlayerInfo[targetid][pSpraycan], PlayerInfo[targetid][pPhone]);
  1262.     SendClientMessage(playerid, COLOR_GREEN, string);
  1263.     if(PlayerInfo[targetid][pFaction] != 0)
  1264.     {
  1265.         format(string, sizeof(string), "Faction: %s - Rank: %s - Division: %s", GetFactionName(targetid), GetRankName(targetid), GetDivisionName(targetid));
  1266.         SendClientMessage(playerid, COLOR_GREEN, string);
  1267.     }
  1268.     else
  1269.     {
  1270.         SendClientMessage(playerid, COLOR_GREEN, "Faction: None - Rank: 0 - Division: None");
  1271.     }
  1272. }
  1273.  
  1274. stock GetJobName(playerid)
  1275. {
  1276.     new jobname[26];
  1277.     switch(PlayerInfo[playerid][pJob])
  1278.     {
  1279.         case 0:
  1280.         jobname = "None";
  1281.         case 1:
  1282.         jobname = "Trucker";
  1283.         case 2:
  1284.         jobname = "Bodyguard";
  1285.         case 3:
  1286.         jobname = "Weapon Dealer";
  1287.         default:
  1288.         jobname = "None";
  1289.     }
  1290.     return jobname;
  1291. }
  1292.  
  1293.  
  1294. stock UserPath(playerid)
  1295. {
  1296.     new string[128],playername[MAX_PLAYER_NAME];
  1297.     GetPlayerName(playerid,playername,sizeof(playername));
  1298.     format(string,sizeof(string),PATH,playername);
  1299.     return string;
  1300. }
  1301.  
  1302. stock udb_hash(buf[]) {
  1303.     new length=strlen(buf);
  1304.     new s1 = 1;
  1305.     new s2 = 0;
  1306.     new n;
  1307.     for (n=0; n<length; n++)
  1308.     {
  1309.        s1 = (s1 + buf[n]) % 65521;
  1310.        s2 = (s2 + s1)     % 65521;
  1311.     }
  1312.     return (s2 << 16) + s1;
  1313. }
  1314.  
  1315. stock IsACopCar(carid)
  1316. {
  1317.     for(new v = 0; v < sizeof(LSPDVeh); v++) {
  1318.         if(carid == LSPDVeh[v]) return 1;
  1319.     }
  1320.     return 0;
  1321. }
  1322.  
  1323. stock IsAnAmbulance(carid)
  1324. {
  1325.     for(new v = 0; v < sizeof(LSFMDVeh); v++) {
  1326.         if(carid == LSFMDVeh[v]) return 1;
  1327.     }
  1328.     return 0;
  1329. }
  1330.  
  1331. stock IsADSV(carid)
  1332. {
  1333.     for(new v = 0; v < sizeof(DSV); v++) {
  1334.         if(carid == DSV[v]) return 1;
  1335.     }
  1336.     return 0;
  1337. }
  1338.  
  1339. stock IsA1Truck(carid)
  1340. {
  1341.     for(new v = 0; v < sizeof(level1Trucks); v++) {
  1342.         if(carid == level1Trucks[v]) return 1;
  1343.     }
  1344.     return 0;
  1345. }
  1346.  
  1347. stock IsA2Truck(carid)
  1348. {
  1349.     for(new v = 0; v < sizeof(level2Trucks); v++) {
  1350.         if(carid == level2Trucks[v]) return 1;
  1351.     }
  1352.     return 0;
  1353. }
  1354.  
  1355.  
  1356. stock IsA3Truck(carid)
  1357. {
  1358.     for(new v = 0; v < sizeof(level3Trucks); v++) {
  1359.         if(carid == level3Trucks[v]) return 1;
  1360.     }
  1361.     return 0;
  1362. }
  1363.  
  1364. stock IsA5Truck(carid)
  1365. {
  1366.     for(new v = 0; v < sizeof(level5Trucks); v++) {
  1367.         if(carid == level5Trucks[v]) return 1;
  1368.     }
  1369.     return 0;
  1370. }
  1371.  
  1372. stock IsATrailer(carid)
  1373. {
  1374.     for(new v = 0; v < sizeof(trailers); v++)
  1375.     {
  1376.         if(carid == trailers[v]) return 1;
  1377.     }
  1378.     return 0;
  1379. }
  1380. stock IsATruck(carid)
  1381. {
  1382.     for(new v = 0; v < sizeof(level3Trucks); v++) {
  1383.         if(carid == level5Trucks[v]) return 1;
  1384.         if(carid == level3Trucks[v]) return 1;
  1385.         if(carid == level1Trucks[v]) return 1;
  1386.         if(carid == level2Trucks[v]) return 1;
  1387.     }
  1388.     return 0;
  1389. }
  1390.  
  1391. stock IsVehicleOccupied(vehicleid)
  1392. {
  1393.     for(new i; i < GetMaxPlayers(); i++)
  1394.     {
  1395.         if(IsPlayerConnected(i)) continue;
  1396.         if(GetPlayerVehicleID(i) == vehicleid) return 1;
  1397.     }
  1398.     return 0;
  1399. }
  1400.  
  1401. stock IsNearAGate(playerid)
  1402. {
  1403.     if(IsPlayerInRangeOfPoint(playerid, 6, 1544.79, -1627.07, 13.37)) return 1;
  1404.     if(IsPlayerInRangeOfPoint(playerid, 6, 1544.8, -1627.0, 13.38)) return 1;
  1405.     return 0;
  1406. }
  1407.  
  1408. stock UnloadChar(playerid)
  1409. {
  1410.      OnCall[playerid] = -1;
  1411.      medicCP[playerid] = -1;
  1412.      CPT[playerid] = 0;
  1413.      truckloadedon[playerid] = -1;
  1414.      truckloaded[playerid] = 0;
  1415.      KillTimer(rtimer[playerid]);
  1416.      KillTimer(itimer[playerid]);
  1417.      KillTimer(iitimer[playerid]);
  1418.      Connected[playerid] = 0;
  1419.      AdminDuty[playerid] = 0;
  1420.      togdr[playerid] = 0;
  1421.      tazer[playerid] = 0;
  1422.      weaponbeingoffered[playerid] = 0;
  1423.      beingofferedby[playerid] = -1;
  1424.      tazerreplace[playerid] = 0;
  1425.      waitcheck[playerid] = 0;
  1426.      badge[playerid] = 0;
  1427.      cardetain[playerid] = -1;
  1428.      as[playerid] = 0;
  1429.      beingdragged[playerid] = -1;
  1430.      togo[playerid] = 0;
  1431.      skipacheck[playerid] = 0;
  1432.      invitedby[playerid] = -1;
  1433.      invitedto[playerid] = 0;
  1434.      tognewbie[playerid] = 0;
  1435.      NoNewb[playerid] = 0;
  1436.      return 1;
  1437. }
  1438.  
  1439. //
  1440.  
  1441. forward LoadUser_data(playerid,name[],value[]);
  1442. public LoadUser_data(playerid,name[],value[])
  1443. {
  1444.     INI_Int("Password",PlayerInfo[playerid][pPass]);
  1445.     INI_Int("Cash",PlayerInfo[playerid][pCash]);
  1446.     INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  1447.     INI_Int("Kills",PlayerInfo[playerid][pKills]);
  1448.     INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  1449.     INI_Int("Faction",PlayerInfo[playerid][pFaction]);
  1450.     INI_Int("FactionRank",PlayerInfo[playerid][pFacRank]);
  1451.     INI_Int("FactionDivision",PlayerInfo[playerid][pFacDiv]);
  1452.     INI_Int("FactionLeader",PlayerInfo[playerid][pFacLeader]);
  1453.     INI_Int("Skin",PlayerInfo[playerid][pSkin]);
  1454.     INI_Float("PosX",PlayerInfo[playerid][pX]);
  1455.     INI_Float("PosY",PlayerInfo[playerid][pY]);
  1456.     INI_Float("PosZ",PlayerInfo[playerid][pZ]);
  1457.     INI_Int("Level",PlayerInfo[playerid][pLevel]);
  1458.     INI_Int("Bank",PlayerInfo[playerid][pBank]);
  1459.     INI_Int("Job",PlayerInfo[playerid][pJob]);
  1460.     INI_Int("TruckerSkill",PlayerInfo[playerid][pTruckerSkill]);
  1461.     INI_Int("WeaponDealerSkill",PlayerInfo[playerid][pWDealerSkill]);
  1462.     INI_Int("Banned",PlayerInfo[playerid][pBanned]);
  1463.     INI_Int("PlayingHours",PlayerInfo[playerid][pHours]);
  1464.     INI_Int("Interior",PlayerInfo[playerid][pInt]);
  1465.     INI_Int("VirtualWorld",PlayerInfo[playerid][pVW]);
  1466.     INI_Int("IP",PlayerInfo[playerid][pIp]);
  1467.     INI_Float("Health",PlayerInfo[playerid][pHealth]);
  1468.     INI_Float("Armor",PlayerInfo[playerid][pArmor]);
  1469.     INI_Int("Gun1",PlayerInfo[playerid][pGuns][0]);
  1470.     INI_Int("Gun2",PlayerInfo[playerid][pGuns][1]);
  1471.     INI_Int("Gun3",PlayerInfo[playerid][pGuns][2]);
  1472.     INI_Int("Gun4",PlayerInfo[playerid][pGuns][3]);
  1473.     INI_Int("Gun5",PlayerInfo[playerid][pGuns][4]);
  1474.     INI_Int("Gun6",PlayerInfo[playerid][pGuns][5]);
  1475.     INI_Int("Gun7",PlayerInfo[playerid][pGuns][6]);
  1476.     INI_Int("Gun8",PlayerInfo[playerid][pGuns][7]);
  1477.     INI_Int("Gun9",PlayerInfo[playerid][pGuns][8]);
  1478.     INI_Int("Gun10",PlayerInfo[playerid][pGuns][9]);
  1479.     INI_Int("Gun11",PlayerInfo[playerid][pGuns][10]);
  1480.     INI_Int("Gun12",PlayerInfo[playerid][pGuns][11]);
  1481.     INI_Int("Materials",PlayerInfo[playerid][pMaterials]);
  1482.     INI_Int("Wanted",PlayerInfo[playerid][pWanted]);
  1483.     INI_String("WantedReason1",PlayerInfo[playerid][pW1], 24);
  1484.     INI_String("WantedReason2",PlayerInfo[playerid][pW2], 24);
  1485.     INI_String("WantedReason3",PlayerInfo[playerid][pW3], 24);
  1486.     INI_String("WantedReason4",PlayerInfo[playerid][pW4], 24);
  1487.     INI_String("WantedReason5",PlayerInfo[playerid][pW5], 24);
  1488.     INI_String("WantedReason6",PlayerInfo[playerid][pW6], 24);
  1489.     INI_Int("TotalWanted",PlayerInfo[playerid][pTotWanted]);
  1490.     INI_Int("Jail",PlayerInfo[playerid][pJail]);
  1491.     INI_String("AdminName",PlayerInfo[playerid][pAName], 24);
  1492.     INI_String("Name",PlayerInfo[playerid][pName], 70);
  1493.     INI_Int("Bail",PlayerInfo[playerid][pBail]);
  1494.     INI_Int("TotalDeliveries",PlayerInfo[playerid][pTotDel]);
  1495.     INI_Int("Helper",PlayerInfo[playerid][pHelper]);
  1496.     INI_Int("Phone",PlayerInfo[playerid][pPhone]);
  1497.     INI_Int("Spraycan",PlayerInfo[playerid][pSpraycan]);
  1498.     INI_Int("NewbMute",PlayerInfo[playerid][pNewbMute]);
  1499.     INI_Int("Vehicle1",PlayerInfo[playerid][pVehicle][0]);
  1500.     INI_Int("Vehicle2",PlayerInfo[playerid][pVehicle][1]);
  1501.     INI_Int("Vehicle3",PlayerInfo[playerid][pVehicle][2]);
  1502.     INI_Int("Vehicle4",PlayerInfo[playerid][pVehicle][3]);
  1503.     INI_Int("Vehicle5",PlayerInfo[playerid][pVehicle][4]);
  1504.     INI_Float("Vehicle1PosX", PlayerInfo[playerid][pVehiclePosX][0]);
  1505.     INI_Float("Vehicle1PosY", PlayerInfo[playerid][pVehiclePosY][0]);
  1506.     INI_Float("Vehicle1PosZ", PlayerInfo[playerid][pVehiclePosZ][0]);
  1507.     INI_Float("Vehicle1Rot", PlayerInfo[playerid][pVehicleRot][0]);
  1508.     INI_Int("Vehicle1Col1", PlayerInfo[playerid][pVehicleCol1][0]);
  1509.     INI_Int("Vehicle1Col2", PlayerInfo[playerid][pVehicleCol1][0]);
  1510.     INI_Float("Vehicle2PosX", PlayerInfo[playerid][pVehiclePosX][1]);
  1511.     INI_Float("Vehicle2PosY", PlayerInfo[playerid][pVehiclePosY][1]);
  1512.     INI_Float("Vehicle2PosZ", PlayerInfo[playerid][pVehiclePosZ][1]);
  1513.     INI_Float("Vehicle2Rot", PlayerInfo[playerid][pVehicleRot][1]);
  1514.     INI_Int("Vehicle2Col1", PlayerInfo[playerid][pVehicleCol2][1]);
  1515.     INI_Int("Vehicle2Col2", PlayerInfo[playerid][pVehicleCol2][1]);
  1516.     INI_Float("Vehicle3PosX", PlayerInfo[playerid][pVehiclePosX][2]);
  1517.     INI_Float("Vehicle3PosY", PlayerInfo[playerid][pVehiclePosY][2]);
  1518.     INI_Float("Vehicle3PosZ", PlayerInfo[playerid][pVehiclePosZ][2]);
  1519.     INI_Float("Vehicle3Rot", PlayerInfo[playerid][pVehicleRot][2]);
  1520.     INI_Int("Vehicle3Col1", PlayerInfo[playerid][pVehicleCol2][2]);
  1521.     INI_Int("Vehicle3Col2", PlayerInfo[playerid][pVehicleCol2][2]);
  1522.     INI_Float("Vehicle4PosX", PlayerInfo[playerid][pVehiclePosX][3]);
  1523.     INI_Float("Vehicle4PosY", PlayerInfo[playerid][pVehiclePosY][3]);
  1524.     INI_Float("Vehicle4PosZ", PlayerInfo[playerid][pVehiclePosZ][3]);
  1525.     INI_Float("Vehicle4Rot", PlayerInfo[playerid][pVehicleRot][3]);
  1526.     INI_Int("Vehicle4Col1", PlayerInfo[playerid][pVehicleCol2][3]);
  1527.     INI_Int("Vehicle4Col2", PlayerInfo[playerid][pVehicleCol2][3]);
  1528.     INI_Float("Vehicle5PosX", PlayerInfo[playerid][pVehiclePosX][4]);
  1529.     INI_Float("Vehicle5PosY", PlayerInfo[playerid][pVehiclePosY][4]);
  1530.     INI_Float("Vehicle5PosZ", PlayerInfo[playerid][pVehiclePosZ][4]);
  1531.     INI_Float("Vehicle5Rot", PlayerInfo[playerid][pVehicleRot][4]);
  1532.     INI_Int("Vehicle5Col1", PlayerInfo[playerid][pVehicleCol1][4]);
  1533.     INI_Int("Vehicle5Col2", PlayerInfo[playerid][pVehicleCol2][4]);
  1534.     INI_Int("Contracted", PlayerInfo[playerid][pContracted]);
  1535.     INI_String("ContractReason", PlayerInfo[playerid][pContractReason], 124);
  1536.     INI_Int("ContractAmount", PlayerInfo[playerid][pContractAmount]);
  1537.     INI_String("ContractedBy", PlayerInfo[playerid][pContractedBy], 124);
  1538.     INI_Int("Success", PlayerInfo[playerid][pSuccess]);
  1539.     INI_Int("Failed", PlayerInfo[playerid][pFailed]);
  1540.     return 1;
  1541. }
  1542.  
  1543. forward SkipACheck(playerid);
  1544. public SkipACheck(playerid)
  1545. {
  1546.     skipacheck[playerid] = 2;
  1547.     return 1;
  1548. }
  1549.  
  1550. forward SkipWepCheck(playerid);
  1551. public SkipWepCheck(playerid)
  1552. {
  1553.     waitcheck[playerid] = 2;
  1554.     return 1;
  1555. }
  1556.  
  1557. forward arrestrelease(playerid);
  1558. public arrestrelease(playerid)
  1559. {
  1560.     if(PlayerInfo[playerid][pJail] == 0)
  1561.     {
  1562.         KillTimer(rtimer[playerid]);
  1563.         return 1;
  1564.     }
  1565.     if(PlayerInfo[playerid][pJail] > 1)
  1566.     {
  1567.         PlayerInfo[playerid][pJail] -= 1;
  1568.         return 1;
  1569.     }
  1570.     if(PlayerInfo[playerid][pJail] <= 1)
  1571.     {
  1572.         SetPlayerPos(playerid, 247.37, 67.92, 1003.64);
  1573.         SetPlayerInterior(playerid, 6);
  1574.         SetPlayerVirtualWorld(playerid, 1337);
  1575.         PlayerInfo[playerid][pJail] = 0;
  1576.         PlayerInfo[playerid][pVW] = 1337;
  1577.         PlayerInfo[playerid][pInt] = 6;
  1578.         GameTextForPlayer(playerid, "Released. Try to be good now.", 5000, 3);
  1579.         SendClientMessage(playerid, COLOR_CYAN, "You have finished your jail sentence.");
  1580.         SetPlayerColor(playerid, 0xFFFFFF00);
  1581.         KillTimer(rtimer[playerid]);
  1582.     }
  1583.     return 1;
  1584. }
  1585.  
  1586. forward SaveChar(playerid);
  1587. public SaveChar(playerid)
  1588. {
  1589.     if(!IsPlayerConnected(playerid)) return 1;
  1590.     if(GetPVarInt(playerid, "prelogin") == 1) return print("Did not save, not logged in.");
  1591.     if(GetPVarInt(playerid, "Quiz") == 1) return print("Did not save, in quiz.");
  1592.     if(Connected[playerid] != 1) return print("Did not save, not logged in.");
  1593.     if(AdminDuty[playerid] == 1) return print("Did not save, admin duty.");
  1594.     GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
  1595.     new INI:File = INI_Open(UserPath(playerid));
  1596.     new Float:hp;
  1597.     GetPlayerIp(playerid, PlayerInfo[playerid][pIp], 50);
  1598.     GetPlayerHealth(playerid, hp);
  1599.     GetPlayerName(playerid, PlayerInfo[playerid][pName], 70);
  1600.     INI_SetTag(File,"data");
  1601.     if(pass[playerid] != -1 && GetPVarInt(playerid, "RecentlyChangedName") == 1)
  1602.     {
  1603.     INI_WriteInt(File,"Password",pass[playerid]);
  1604.     }
  1605.     INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
  1606.     INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  1607.     INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  1608.     INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  1609.     INI_WriteInt(File,"Faction",PlayerInfo[playerid][pFaction]);
  1610.     INI_WriteInt(File,"FactionRank",PlayerInfo[playerid][pFacRank]);
  1611.     INI_WriteInt(File,"FactionDivision",PlayerInfo[playerid][pFacDiv]);
  1612.     INI_WriteInt(File,"FactionLeader",PlayerInfo[playerid][pFacLeader]);
  1613.     INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
  1614.     INI_WriteFloat(File,"PosX",PlayerInfo[playerid][pX]);
  1615.     INI_WriteFloat(File,"PosY",PlayerInfo[playerid][pY]);
  1616.     INI_WriteFloat(File,"PosZ",PlayerInfo[playerid][pZ]);
  1617.     INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
  1618.     INI_WriteInt(File,"Bank",PlayerInfo[playerid][pBank]);
  1619.     INI_WriteInt(File,"Job",PlayerInfo[playerid][pJob]);
  1620.     INI_WriteInt(File,"TruckerSkill",PlayerInfo[playerid][pTruckerSkill]);
  1621.     INI_WriteInt(File,"WeaponDealerSkill",PlayerInfo[playerid][pWDealerSkill]);
  1622.     INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
  1623.     INI_WriteInt(File,"PlayingHours",PlayerInfo[playerid][pHours]);
  1624.     INI_WriteInt(File,"Interior",GetPlayerInterior(playerid));
  1625.     INI_WriteInt(File,"VirtualWorld",GetPlayerVirtualWorld(playerid));
  1626.     INI_WriteInt(File,"Gun1",PlayerInfo[playerid][pGuns][0]);
  1627.     INI_WriteInt(File,"Gun2",PlayerInfo[playerid][pGuns][1]);
  1628.     INI_WriteInt(File,"Gun3",PlayerInfo[playerid][pGuns][2]);
  1629.     INI_WriteInt(File,"Gun4",PlayerInfo[playerid][pGuns][3]);
  1630.     INI_WriteInt(File,"Gun5",PlayerInfo[playerid][pGuns][4]);
  1631.     INI_WriteInt(File,"Gun6",PlayerInfo[playerid][pGuns][5]);
  1632.     INI_WriteInt(File,"Gun7",PlayerInfo[playerid][pGuns][6]);
  1633.     INI_WriteInt(File,"Gun8",PlayerInfo[playerid][pGuns][7]);
  1634.     INI_WriteInt(File,"Gun9",PlayerInfo[playerid][pGuns][8]);
  1635.     INI_WriteInt(File,"Gun10",PlayerInfo[playerid][pGuns][9]);
  1636.     INI_WriteInt(File,"Gun11",PlayerInfo[playerid][pGuns][10]);
  1637.     INI_WriteInt(File,"Gun12",PlayerInfo[playerid][pGuns][11]);
  1638.     INI_WriteInt(File,"Materials",PlayerInfo[playerid][pMaterials]);
  1639.     INI_WriteInt(File,"Wanted",PlayerInfo[playerid][pWanted]);
  1640.     INI_WriteString(File,"WantedReason1",PlayerInfo[playerid][pW1]);
  1641.     INI_WriteString(File,"WantedReason2",PlayerInfo[playerid][pW2]);
  1642.     INI_WriteString(File,"WantedReason3",PlayerInfo[playerid][pW3]);
  1643.     INI_WriteString(File,"WantedReason4",PlayerInfo[playerid][pW4]);
  1644.     INI_WriteString(File,"WantedReason5",PlayerInfo[playerid][pW5]);
  1645.     INI_WriteString(File,"WantedReason6",PlayerInfo[playerid][pW6]);
  1646.     INI_WriteInt(File,"TotalWanted",PlayerInfo[playerid][pTotWanted]);
  1647.     INI_WriteInt(File,"Jail",PlayerInfo[playerid][pJail]);
  1648.     INI_WriteInt(File,"Bail",PlayerInfo[playerid][pBail]);
  1649.     INI_WriteString(File,"AdminName",PlayerInfo[playerid][pAName]);
  1650.     INI_WriteString(File,"Name",PlayerInfo[playerid][pName]);
  1651.     INI_WriteFloat(File,"Health",hp);
  1652.     if(GetPVarInt(playerid, "Injured") == 1 || GetPVarInt(playerid, "Recovering") == 1)
  1653.     {
  1654.     INI_WriteFloat(File,"Health",-1337);
  1655.     }
  1656.     INI_WriteFloat(File,"Armor",PlayerInfo[playerid][pArmor]);
  1657.     INI_WriteString(File,"IP",PlayerInfo[playerid][pIp]);
  1658.     INI_WriteInt(File,"TotalDeliveries",PlayerInfo[playerid][pTotDel]);
  1659.     INI_WriteInt(File,"Helper",PlayerInfo[playerid][pHelper]);
  1660.     INI_WriteInt(File,"Phone",PlayerInfo[playerid][pPhone]);
  1661.     INI_WriteInt(File,"Spraycan",PlayerInfo[playerid][pSpraycan]);
  1662.     INI_WriteInt(File,"NewbMute",PlayerInfo[playerid][pNewbMute]);
  1663.     INI_WriteInt(File,"Vehicle1",PlayerInfo[playerid][pVehicle][0]);
  1664.     INI_WriteInt(File,"Vehicle2",PlayerInfo[playerid][pVehicle][1]);
  1665.     INI_WriteInt(File,"Vehicle3",PlayerInfo[playerid][pVehicle][2]);
  1666.     INI_WriteInt(File,"Vehicle4",PlayerInfo[playerid][pVehicle][3]);
  1667.     INI_WriteInt(File,"Vehicle5",PlayerInfo[playerid][pVehicle][4]);
  1668.     INI_WriteFloat(File,"Vehicle1PosX",PlayerInfo[playerid][pVehiclePosX][0]);
  1669.     INI_WriteFloat(File,"Vehicle1PosY",PlayerInfo[playerid][pVehiclePosY][0]);
  1670.     INI_WriteFloat(File,"Vehicle1PosZ",PlayerInfo[playerid][pVehiclePosZ][0]);
  1671.     INI_WriteFloat(File,"Vehicle1Rot",PlayerInfo[playerid][pVehicleRot][0]);
  1672.     INI_WriteInt(File,"Vehicle1Col1",PlayerInfo[playerid][pVehicleCol1][0]);
  1673.     INI_WriteInt(File,"Vehicle1Col2",PlayerInfo[playerid][pVehicleCol2][0]);
  1674.     INI_WriteFloat(File,"Vehicle2PosX",PlayerInfo[playerid][pVehiclePosX][1]);
  1675.     INI_WriteFloat(File,"Vehicle2PosY",PlayerInfo[playerid][pVehiclePosY][1]);
  1676.     INI_WriteFloat(File,"Vehicle2PosZ",PlayerInfo[playerid][pVehiclePosZ][1]);
  1677.     INI_WriteFloat(File,"Vehicle2Rot",PlayerInfo[playerid][pVehicleRot][1]);
  1678.     INI_WriteInt(File,"Vehicle2Col1",PlayerInfo[playerid][pVehicleCol1][1]);
  1679.     INI_WriteInt(File,"Vehicle2Col2",PlayerInfo[playerid][pVehicleCol2][1]);
  1680.     INI_WriteFloat(File,"Vehicle3PosX",PlayerInfo[playerid][pVehiclePosX][2]);
  1681.     INI_WriteFloat(File,"Vehicle3PosY",PlayerInfo[playerid][pVehiclePosY][2]);
  1682.     INI_WriteFloat(File,"Vehicle3PosZ",PlayerInfo[playerid][pVehiclePosZ][2]);
  1683.     INI_WriteFloat(File,"Vehicle3Rot",PlayerInfo[playerid][pVehicleRot][2]);
  1684.     INI_WriteInt(File,"Vehicle3Col1",PlayerInfo[playerid][pVehicleCol1][2]);
  1685.     INI_WriteInt(File,"Vehicle3Col2",PlayerInfo[playerid][pVehicleCol2][2]);
  1686.     INI_WriteFloat(File,"Vehicle4PosX",PlayerInfo[playerid][pVehiclePosX][3]);
  1687.     INI_WriteFloat(File,"Vehicle4PosY",PlayerInfo[playerid][pVehiclePosY][3]);
  1688.     INI_WriteFloat(File,"Vehicle4PosZ",PlayerInfo[playerid][pVehiclePosZ][3]);
  1689.     INI_WriteFloat(File,"Vehicle4Rot",PlayerInfo[playerid][pVehicleRot][3]);
  1690.     INI_WriteInt(File,"Vehicle4Col1",PlayerInfo[playerid][pVehicleCol1][3]);
  1691.     INI_WriteInt(File,"Vehicle4Col2",PlayerInfo[playerid][pVehicleCol2][3]);
  1692.     INI_WriteFloat(File,"Vehicle5PosX",PlayerInfo[playerid][pVehiclePosX][4]);
  1693.     INI_WriteFloat(File,"Vehicle5PosY",PlayerInfo[playerid][pVehiclePosY][4]);
  1694.     INI_WriteFloat(File,"Vehicle5PosZ",PlayerInfo[playerid][pVehiclePosZ][4]);
  1695.     INI_WriteFloat(File,"Vehicle5Rot",PlayerInfo[playerid][pVehicleRot][4]);
  1696.     INI_WriteInt(File,"Vehicle5Col1",PlayerInfo[playerid][pVehicleCol1][4]);
  1697.     INI_WriteInt(File,"Vehicle5Col2",PlayerInfo[playerid][pVehicleCol2][4]);
  1698.     INI_WriteInt(File,"Contracted",PlayerInfo[playerid][pContracted]);
  1699.     INI_WriteString(File,"ContractReason", PlayerInfo[playerid][pContractReason]);
  1700.     INI_WriteInt(File,"ContractAmount",PlayerInfo[playerid][pContractAmount]);
  1701.     INI_WriteString(File,"ContractedBy", PlayerInfo[playerid][pContractedBy]);
  1702.     INI_WriteInt(File,"Success", PlayerInfo[playerid][pSuccess]);
  1703.     INI_WriteInt(File,"Failed", PlayerInfo[playerid][pFailed]);
  1704.     INI_Close(File);
  1705.     new string[100];
  1706.     format(string, 100, "%s's character has saved successfully.", GetName(playerid));
  1707.     print(string);
  1708.     return 1;
  1709. }
  1710.  
  1711. main()
  1712. {
  1713.     print("\n----------------------------------");
  1714.     print(" <SHOCK> Roleplay by Alex Shock");
  1715.     print("----------------------------------\n");
  1716. }
  1717.  
  1718. /*
  1719. C
  1720. O
  1721. M
  1722. M
  1723. A
  1724. N
  1725. D
  1726. S
  1727. */
  1728.  
  1729. forward AbleNewb(playerid);
  1730. public AbleNewb(playerid)
  1731. {
  1732.     NoNewb[playerid] = 0;
  1733.     return 1;
  1734. }
  1735.  
  1736. CMD:gmx(playerid, params[])
  1737. {
  1738.     if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to do this.");
  1739.     SendRconCommand("gmx");
  1740.     return 1;
  1741. }
  1742.  
  1743. CMD:makeleader(playerid, params[])
  1744. {
  1745.     new giveplayerid, fac, str[126];
  1746.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to do this.");
  1747.     if(sscanf(params, "ui", giveplayerid, fac)) return SendClientMessage(playerid, -1, "USAGE: /makeleader [playerid/partofname] [faction]");
  1748.     if(fac < 1 || fac > 5) return SendClientMessage(playerid, -1, "Valid faction number is 1-5");
  1749.     PlayerInfo[playerid][pFacLeader] = fac;
  1750.     PlayerInfo[playerid][pFaction] = fac;
  1751.     PlayerInfo[playerid][pFacRank] = 6;
  1752.     format(str, sizeof(str), "You have been give leadership powers over %s by %s.", GetFactionName(giveplayerid), GetName(playerid));
  1753.     SendClientMessage(giveplayerid, COLOR_CYAN, str);
  1754.     format(str, sizeof(str), "You have give %s leadership powers over %s.", GetFactionName(giveplayerid), GetName(playerid));
  1755.     SendClientMessage(playerid, -1, str);
  1756.     return 1;
  1757. }
  1758.  
  1759. CMD:quitevent(playerid, params[])
  1760. {
  1761.     if(GetPVarInt(playerid, "InEvent") == 1)
  1762.     {
  1763.         ResetPlayerWeapons(playerid);
  1764.         SkipWepCheck(playerid);
  1765.         SkipACheck(playerid);
  1766.         SetPVarInt(playerid, "InEvent", 0);
  1767.         SetPlayerInterior(playerid, oINT[playerid]);
  1768.         SetPlayerVirtualWorld(playerid, oVW[playerid]);
  1769.         SetPlayerPos(playerid, oX[playerid], oY[playerid], oZ[playerid]);
  1770.         SetPlayerHealth(playerid, oHP[playerid]);
  1771.         PlayerInfo[playerid][pArmor] = oA[playerid];
  1772.         SetPlayerArmour(playerid, oA[playerid]);
  1773.         SetPlayerSkin(playerid, oSkin[playerid]);
  1774.         SetPlayerWeaponsEx(playerid);
  1775.         SendClientMessage(playerid, -1, "You left the event.");
  1776.     }
  1777.     return 1;
  1778. }
  1779.  
  1780. CMD:debug(playerid, params[])
  1781. {
  1782.     new str[126];
  1783.     SendClientMessage(playerid, -1, "|________Spawned Vehicles________|");
  1784.     for(new y;y<MAX_PLAYER_VEHICLES;y++)
  1785.     {
  1786.         if(PlayerInfo[playerid][pVehicleSpawned][y] == 1)
  1787.         {
  1788.             format(str, sizeof(str), "pVehicleSpawned[%i] == %i", y, PlayerInfo[playerid][pVehicleSpawned][y]);
  1789.             SendClientMessage(playerid, -1, str);
  1790.             format(str, sizeof(str), "pVehicleSpawnedID[%i] == %i", y, PlayerInfo[playerid][pVehicleSpawnedID][y]);
  1791.             SendClientMessage(playerid, -1, str);
  1792.         }
  1793.     }
  1794.     SendClientMessage(playerid, -1, "|________________________________|");
  1795.     return 1;
  1796. }
  1797.  
  1798. CMD:buydrink(playerid, params[])
  1799. {
  1800.     if(!isNearBar(playerid)) return SendClientMessage(playerid, -1, "You are not at a bar counter.");
  1801.     ShowPlayerDialog(playerid, DIALOG_BAR, DIALOG_STYLE_LIST, "Bar", "Beer ($2)\nWine ($5)\nCocktail ($4)\nPiñacolada ($4)\nMojito ($4)\nCider ($3)\nSprunk ($1)", "Buy", "Close");
  1802.     return 1;
  1803. }
  1804.    
  1805.  
  1806. CMD:hstats(playerid, params[])
  1807. {
  1808.     if(PlayerInfo[playerid][pFaction] != 4 && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "You are not in the Hitman Agency.");
  1809.     for(new x;x<MAX_PLAYERS;x++)
  1810.     {
  1811.         if(PlayerInfo[x][pFaction] == 4)
  1812.         {
  1813.             new str[126];
  1814.             format(str, sizeof(str), "%s - Successfull hits: %i - Failed hits: %i", GetName(x), PlayerInfo[x][pSuccess], PlayerInfo[x][pFailed]);
  1815.             SendClientMessage(playerid, COLOR_GRAD1, str);
  1816.         }
  1817.     }
  1818.     return 1;
  1819. }
  1820.  
  1821. CMD:contract(playerid, params[])
  1822. {
  1823.     new giveplayerid, name[MAX_PLAYER_NAME], amount, reason[126], str[200];
  1824.     if(sscanf(params, "uis[126]", giveplayerid, amount, reason)) return SendClientMessage(playerid, -1, "USAGE: /contract [playerid/partofname] [amount] [reason]");
  1825.     if(giveplayerid == playerid) return SendClientMessage(playerid, -1, "You can not contract yourself.");
  1826.     if(PlayerInfo[playerid][pCash] < amount) return SendClientMessage(playerid, -1, "You don't have enough money.");
  1827.     if(AdminDuty[giveplayerid] == 1) return SendClientMessage(playerid, -1, "The specified player is on admin-duty.");
  1828.     if(amount < 2000 || amount > 100000) return SendClientMessage(playerid, -1, "Valid contract amounts are from 2000 to 100,000.");
  1829.     PlayerInfo[playerid][pCash] -= amount;
  1830.     GetPlayerName(playerid, name, sizeof(name));
  1831.     PlayerInfo[giveplayerid][pContracted] = 1;
  1832.     format(PlayerInfo[giveplayerid][pContractReason], 164, "%s", reason);
  1833.     format(PlayerInfo[giveplayerid][pContractedBy], MAX_PLAYER_NAME, "%s", name);
  1834.     PlayerInfo[giveplayerid][pContractAmount] += amount;
  1835.     format(str, sizeof(str), "%s has placed a contract on %s for $%i, reason: %s", GetName(playerid), GetName(giveplayerid), amount, reason);
  1836.     if(PlayerInfo[playerid][pFaction] != 4)
  1837.     {
  1838.     SendClientMessageToAdmins(COLOR_YELLOW, str, 4);
  1839.     }
  1840.     SendClientMessageToHA(COLOR_YELLOW, str);
  1841.     return 1;
  1842. }
  1843.  
  1844. CMD:contracts(playerid, params[])
  1845. {
  1846.     new str[126];
  1847.     if(PlayerInfo[playerid][pFaction] != 4 || PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, -1, "You are not in the Hitman Agency.");
  1848.     SendClientMessage(playerid, -1, "|___________________Contracts___________________|");
  1849.     for(new x;x<MAX_PLAYERS;x++)
  1850.     {
  1851.         if(PlayerInfo[x][pContracted] == 1)
  1852.         {
  1853.             format(str, sizeof(str), "Name: %s - Amount: %i - Reason: %s - Contracted by: %s", GetName(x), PlayerInfo[x][pContractAmount], PlayerInfo[x][pContractReason], PlayerInfo[x][pContractedBy]);
  1854.             SendClientMessage(playerid, -1, str);
  1855.         }
  1856.     }
  1857.     SendClientMessage(playerid, -1, "|_______________________________________________|");
  1858.     return 1;
  1859. }
  1860.  
  1861. CMD:givemehit(playerid, params[])
  1862. {
  1863.     new str[126], giveplayerid;
  1864.     if(PlayerInfo[playerid][pFaction] != 4) return SendClientMessage(playerid, -1, "You are not in the Hitman Agency.");
  1865.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /givemehit [playerid/partofname]");
  1866.     if(PlayerInfo[giveplayerid][pContracted] != 1) return SendClientMessage(playerid, -1, "Player does not have a contract on his head.");
  1867.     if(AdminDuty[giveplayerid] == 1) return SendClientMessage(playerid, -1, "Specified player is on admin duty.");
  1868.     SetPVarInt(playerid, "givemehit", giveplayerid);
  1869.     format(str, sizeof(str), "Hitman %s is now after the contracted %s.", GetName(playerid), GetName(giveplayerid));
  1870.     SendClientMessageToHA(COLOR_YELLOW, str);
  1871.     SendClientMessage(playerid, -1, "You have given yourself the mission to kill the contracted. To accept the hit, /accept hit.");
  1872.     SendClientMessageToAll(-1, str);
  1873.     return 1;
  1874. }
  1875.  
  1876.  
  1877. CMD:seteventpos(playerid, params[])
  1878. {
  1879.     new str[126];
  1880.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  1881.     new Float:x, Float:y, Float:z;
  1882.     GetPlayerPos(playerid, x, y, z);
  1883.     EventInfo[eX] = x;
  1884.     EventInfo[eY] = y;
  1885.     EventInfo[eZ] = z;
  1886.     EventInfo[eVW] = GetPlayerVirtualWorld(playerid);
  1887.     EventInfo[eINT] = GetPlayerInterior(playerid);
  1888.     EventInfo[eSkin] = -1;
  1889.     format(str, sizeof(str), "AdmCmd: %s has started an event.", GetName(playerid));
  1890.     SendClientMessageToAdmins(COLOR_YELLOW, str, 1);
  1891.     return 1;
  1892. }
  1893.  
  1894. CMD:editevent(playerid, params[])
  1895. {
  1896.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  1897.     new choice[126], value[126], wep[67], str[126];
  1898.     if(sscanf(params, "s[126]s[126]", choice, value))
  1899.     {
  1900.         SendClientMessage(playerid, -1, "USAGE: /editevent [choice] [value]");
  1901.         SendClientMessage(playerid, -1, "Health, Amor, Skin, Gun1, Gun2, Gun3");
  1902.         return 1;
  1903.     }
  1904.     if(strcmp(choice, "health", true) == 0)
  1905.     {
  1906.         EventInfo[eHealth] = strval(value);
  1907.         format(str, sizeof(str), "Event health set to: %i", strval(value));
  1908.         SendClientMessage(playerid, COLOR_GREY, str);
  1909.         return 1;
  1910.     }
  1911.     if(strcmp(choice, "armor", true) == 0)
  1912.     {
  1913.         EventInfo[eArmor] = strval(value);
  1914.         format(str, sizeof(str), "Event armor set to: %i", strval(value));
  1915.         SendClientMessage(playerid, COLOR_GREY, str);
  1916.         return 1;
  1917.     }
  1918.     if(strcmp(choice, "skin", true) == 0)
  1919.     {
  1920.         EventInfo[eSkin] = strval(value);
  1921.         format(str, sizeof(str), "Event skin set to: %i", strval(value));
  1922.         SendClientMessage(playerid, COLOR_GREY, str);
  1923.         return 1;
  1924.     }
  1925.     if(strcmp(choice, "gun1", true) == 0)
  1926.     {
  1927.         GetWeaponName(strval(value), wep, sizeof(wep));
  1928.         EventInfo[eGun1] = strval(value);
  1929.         format(str, sizeof(str), "Event gun1 set to: %s", wep);
  1930.         SendClientMessage(playerid, COLOR_GREY, str);
  1931.         return 1;
  1932.     }
  1933.     if(strcmp(choice, "gun2", true) == 0)
  1934.     {
  1935.         GetWeaponName(strval(value), wep, sizeof(wep));
  1936.         EventInfo[eGun2] = strval(value);
  1937.         format(str, sizeof(str), "Event gun2 set to: %s", wep);
  1938.         SendClientMessage(playerid, COLOR_GREY, str);
  1939.         return 1;
  1940.     }
  1941.     if(strcmp(choice, "gun3", true) == 0)
  1942.     {
  1943.         GetWeaponName(strval(value), wep, sizeof(wep));
  1944.         EventInfo[eGun3] = strval(value);
  1945.         format(str, sizeof(str), "Event gun3 set to: %s", wep);
  1946.         SendClientMessage(playerid, COLOR_GREY, str);
  1947.         return 1;
  1948.     }
  1949.     return 1;
  1950. }
  1951.  
  1952. CMD:startevent(playerid, params[])
  1953. {
  1954.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  1955.     if(EventInfo[eHealth] < 1) return SendClientMessage(playerid, -1, "Please set the health above 1.");
  1956.     if(EventInfo[eArmor] < 0) return SendClientMessage(playerid, -1, "Please don't set the armour to a negative number.");
  1957.     EventInfo[eStarted] = 1;
  1958.     SendClientMessage(playerid, COLOR_GREY, "The event is now ready. /announceevent to start it.");
  1959.     return 1;
  1960. }
  1961.  
  1962. CMD:announceevent(playerid, params[])
  1963. {
  1964.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  1965.     new str[126];
  1966.     if(EventInfo[eAnnounced] == 1) return SendClientMessage(playerid, COLOR_GREY, "The event has already been announced.");
  1967.     if(EventInfo[eStarted] != 1) return SendClientMessage(playerid, -1, "Maybe it's wise to start an event before announcing it.");
  1968.     format(str, sizeof(str), "An event has been announced by Admin %s, type /joinevent to participate.", GetName(playerid));
  1969.     SendClientMessageToAll(COLOR_CYAN, str);
  1970.     EventInfo[eAnnounced] = 1;
  1971.     return 1;
  1972. }
  1973.  
  1974. CMD:joinevent(playerid, params[])
  1975. {
  1976.     if(EventInfo[eAnnounced] != 1) return SendClientMessage(playerid, -1, "No events have been announced.");
  1977.     if(EventInfo[eLocked] == 1) return SendClientMessage(playerid, -1, "The event is locked.");
  1978.     GetPlayerPos(playerid, oX[playerid], oY[playerid], oZ[playerid]);
  1979.     oINT[playerid] = GetPlayerInterior(playerid);
  1980.     oVW[playerid] = GetPlayerVirtualWorld(playerid);
  1981.     GetPlayerHealth(playerid, oHP[playerid]);
  1982.     oA[playerid] = PlayerInfo[playerid][pArmor];
  1983.     SetPlayerPos(playerid, EventInfo[eX], EventInfo[eY], EventInfo[eZ]);
  1984.     SetPlayerInterior(playerid, EventInfo[eINT]);
  1985.     SetPlayerVirtualWorld(playerid, EventInfo[eVW]);
  1986.     oSkin[playerid] = GetPlayerSkin(playerid);
  1987.     SetPVarInt(playerid, "InEvent", 1);
  1988.     SendClientMessage(playerid, -1, "You have joined the event.");
  1989.     ResetPlayerWeapons(playerid);
  1990.     if(EventInfo[eSkin] != -1)
  1991.     {
  1992.         SetPlayerSkin(playerid, EventInfo[eSkin]);
  1993.     }
  1994.     return 1;
  1995. }
  1996.  
  1997. CMD:lockevent(playerid, params[])
  1998. {
  1999.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2000.     if(EventInfo[eAnnounced] != 1) return SendClientMessage(playerid, -1, "No events have been announced.");
  2001.     if(EventInfo[eLocked] == 1) return SendClientMessage(playerid, -1, "The event is already locked.");
  2002.     EventInfo[eLocked] = 1;
  2003.     SendClientMessageToAll(COLOR_CYAN, "The event has been locked.");
  2004.     SendClientMessage(playerid, -1, "Use /beginevent to begin it.");
  2005.     return 1;
  2006. }
  2007.  
  2008. CMD:beginevent(playerid, params[])
  2009. {
  2010.     if(EventInfo[eAnnounced] != 1) return SendClientMessage(playerid, -1, "No events have been announced.");
  2011.     EventInfo[eBegun] = 1;
  2012.     SendClientMessageToAll(COLOR_CYAN, "The event has now started!");
  2013.     for(new x;x<MAX_PLAYERS;x++)
  2014.     {
  2015.         if(GetPVarInt(x, "InEvent") == 1)
  2016.         {
  2017.             SkipWepCheck(x);
  2018.             SkipACheck(x);
  2019.             PlayerInfo[x][pArmor] = EventInfo[eArmor];
  2020.             GivePlayerWeapon(x, EventInfo[eGun1], 9999);
  2021.             GivePlayerWeapon(x, EventInfo[eGun2], 9999);
  2022.             GivePlayerWeapon(x, EventInfo[eGun3], 9999);
  2023.             SetPlayerHealth(x, EventInfo[eHealth]);
  2024.             SetPlayerArmour(x, EventInfo[eArmor]);
  2025.  
  2026.         }
  2027.     }
  2028.     return 1;
  2029. }
  2030.  
  2031. CMD:endevent(playerid, params[])
  2032. {
  2033.     EventInfo[eStarted] = 0;
  2034.     EventInfo[eLocked] = 0;
  2035.     EventInfo[eAnnounced] = 0;
  2036.     EventInfo[eBegun] = 0;
  2037.     EventInfo[eHealth] = 0;
  2038.     EventInfo[eArmor] = 0;
  2039.     EventInfo[eSkin] = 0;
  2040.     EventInfo[eX] = 0;
  2041.     EventInfo[eY] = 0;
  2042.     EventInfo[eZ] = 0;
  2043.     EventInfo[eVW] = 0;
  2044.     EventInfo[eINT] = 0;
  2045.     EventInfo[eGun1] = 0;
  2046.     EventInfo[eGun2] = 0;
  2047.     EventInfo[eGun3] = 0;
  2048.     SendClientMessageToAll(COLOR_CYAN, "The event has ended.");
  2049.     for(new x;x<MAX_PLAYERS;x++)
  2050.     {
  2051.         if(GetPVarInt(x, "InEvent") == 1)
  2052.         {
  2053.             ResetPlayerWeapons(x);
  2054.             SkipWepCheck(x);
  2055.             SkipACheck(x);
  2056.             SetPVarInt(x, "InEvent", 0);
  2057.             SetPlayerInterior(x, oINT[x]);
  2058.             SetPlayerVirtualWorld(x, oVW[x]);
  2059.             SetPlayerPos(x, oX[x], oY[x], oZ[x]);
  2060.             SetPlayerHealth(x, oHP[x]);
  2061.             PlayerInfo[x][pArmor] = oA[x];
  2062.             SetPlayerArmour(x, oA[x]);
  2063.             SetPlayerSkin(x, oSkin[x]);
  2064.             SetPlayerWeaponsEx(x);
  2065.         }
  2066.     }
  2067.     return 1;
  2068. }
  2069.  
  2070.  
  2071. CMD:fs(playerid, params[])
  2072. {
  2073.     new say[126], c;
  2074.     if(sscanf(params, "is[126]", c, say)) return SendClientMessage(playerid, -1, "/fs color (1: yellow 2: lightred 3: cyan 4: white) say");
  2075.     if(c == 1) return SendClientMessageToAll(COLOR_YELLOW, say);
  2076.     if(c == 2) return SendClientMessageToAll(COLOR_LIGHTRED, say);
  2077.     if(c == 3) return SendClientMessageToAll(COLOR_CYAN, say);
  2078.     if(c == 4) return SendClientMessageToAll(-1, say);
  2079.     return 1;
  2080. }
  2081.  
  2082. CMD:report(playerid, params[])
  2083. {
  2084.     new report[168], str[168];
  2085.     if(sscanf(params, "s[168]", report)) return SendClientMessage(playerid, -1, "USAGE: /report [text]");
  2086.     if(reported[playerid] == 1) return SendClientMessage(playerid, -1, "You already have an active report.");
  2087.     if(reports > 999) reports = 0;
  2088.     reports++;
  2089.     reported[playerid] = 1;
  2090.     reportid[playerid] = reports;
  2091.     format(reporttext[playerid], sizeof(reporttext), "%s [ID: %i] [Report ID: %i]: %s", GetName(playerid), playerid, reports, report);
  2092.     format(str, sizeof(str), "Report from %s [ID: %i] [Report ID: %i]: %s", GetName(playerid), playerid, reports, report);
  2093.     Log("/logs/reports.txt", reporttext[playerid]);
  2094.     SendClientMessageToAdmins(COLOR_CYAN, str, 1);
  2095.     return 1;
  2096. }
  2097.  
  2098. CMD:reports(playerid, params[])
  2099. {
  2100.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2101.     SendClientMessage(playerid, COLOR_GREEN, "|____________________Reports________________________|");
  2102.     for(new x; x<MAX_PLAYERS; x++)
  2103.     {
  2104.         if(reported[x] == 1)
  2105.         {
  2106.             SendClientMessage(playerid, COLOR_LIGHTRED, reporttext[x]);
  2107.         }
  2108.     }
  2109.     SendClientMessage(playerid, COLOR_GREEN, "|___________________________________________________|");
  2110.     return 1;
  2111. }
  2112.    
  2113. CMD:ar(playerid, params[])
  2114. {
  2115.     new rid, str[126];
  2116.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2117.     if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  2118.     if(sscanf(params, "i", rid)) return SendClientMessage(playerid, -1, "USAGE: /ar [RID]");
  2119.     if(rid == 0) return SendClientMessage(playerid, -1, "Invalid Report ID. Use the report ID - Not the playerid / name.");
  2120.     new success = 0;
  2121.     for(new p;p<MAX_PLAYERS;p++)
  2122.     {
  2123.         if(reportid[p] == rid)
  2124.         {
  2125.             reported[p] = 0;
  2126.             reportid[p] = 0;
  2127.             format(reporttext[p], sizeof(reporttext), "InvalidReport");
  2128.             format(str, sizeof(str), "** %s has accepted the report from %s (ID: %i) - (RID: %i)", GetName(playerid), GetName(p), p, rid);
  2129.             SendClientMessageToAdmins(COLOR_ORANGE, str, 1);
  2130.             format(str, sizeof(str), "** %s has accepted your report. Use /pm to reply to the admin if needed.", GetName(playerid));
  2131.             SendClientMessage(p, COLOR_CYAN, str);
  2132.             Log("logs/reports.txt", str);
  2133.             success = 1;
  2134.             break;
  2135.         }
  2136.     }
  2137.     if(success == 0) SendClientMessage(playerid, -1, "Invalid Report ID. Use the report ID - Not the playerid / name.");
  2138.     return 1;
  2139. }
  2140.  
  2141. CMD:tr(playerid, params[])
  2142. {
  2143.     new rid, str[126];
  2144.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2145.     if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  2146.     if(sscanf(params, "i", rid)) return SendClientMessage(playerid, -1, "USAGE: /tr [RID]");
  2147.     if(rid == 0) return SendClientMessage(playerid, -1, "Invalid Report ID. Use the report ID - Not the playerid / name.");
  2148.     new success = 0;
  2149.     for(new p;p<MAX_PLAYERS;p++)
  2150.     {
  2151.         if(reportid[p] == rid)
  2152.         {
  2153.             reported[p] = 0;
  2154.             reportid[p] = 0;
  2155.             format(reporttext[p], sizeof(reporttext), "InvalidReport");
  2156.             format(str, sizeof(str), "** %s has trashed the report from %s (ID: %i) - (RID: %i)", GetName(playerid), GetName(p), p, rid);
  2157.             SendClientMessageToAdmins(COLOR_ORANGE, str, 1);
  2158.             format(str, sizeof(str), "** %s has trashed your report.", GetName(playerid));
  2159.             SendClientMessage(p, COLOR_CYAN, str);
  2160.             Log("logs/reports.txt", str);
  2161.             success = 1;
  2162.             break;
  2163.         }
  2164.     }
  2165.     if(success == 0) SendClientMessage(playerid, -1, "Invalid Report ID. Use the report ID - Not the playerid / name.");
  2166.     return 1;
  2167. }
  2168.  
  2169. CMD:checkip(playerid, params[])
  2170. {
  2171.     new giveplayerid;
  2172.     if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this commands.");
  2173.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /checkip [playerid/partofname]");
  2174.     new playerIP[16], str[126];
  2175.     GetPlayerIp(giveplayerid, playerIP, sizeof(playerIP));
  2176.     format(str, sizeof(str), "%s - IP: %s", GetName(giveplayerid), playerIP);
  2177.     SendClientMessage(playerid, -1, str);
  2178.     return 1;
  2179. }
  2180.    
  2181.    
  2182. CMD:nrn(playerid, params[])
  2183. {
  2184.     new giveplayerid;
  2185.     if(PlayerInfo[playerid][pHelper] < 2 && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2186.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /nrn [playerid/partofname]");
  2187.     if(PlayerInfo[giveplayerid][pHelper] > 0 && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "You can't use this command on a helper as a helper.");
  2188.     if(PlayerInfo[giveplayerid][pLevel] > 1 && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "You can't use this command on players higher than level 1 as a helper");
  2189.     if(PlayerInfo[giveplayerid][pAdmin] > 0) return SendClientMessage(playerid, -1, "You can not use this command on an admin");
  2190.     ShowPlayerDialog(giveplayerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT,""COL_WHITE"Name Change",""COL_WHITE"A helper or admin thinks your name is non-rp and you have to change it.","Change","No!");
  2191.     new str[126];
  2192.     format(str, sizeof(str), "AdmWarn: %s has forced %s to change his name due to it being non-rp.", GetName(playerid), GetName(giveplayerid));
  2193.     SendClientMessageToAdmins(COLOR_YELLOW, str, 1);
  2194.     format(str, sizeof(str), "HelpWarn: %s has forced %s to change his name due to it being non-rp.", GetName(playerid), GetName(giveplayerid));
  2195.     SendClientMessageToHelpers(COLOR_YELLOW, str);
  2196.     return 1;
  2197. }
  2198.    
  2199. CMD:vspawn(playerid, params[])
  2200. {
  2201.     new choice, vehicle;
  2202.     if(sscanf(params, "i", choice)) { SendClientMessage(playerid, -1, "USAGE: /vspawn [1-5]"); return cmd_vlist(playerid, params); }
  2203.     new vslot = choice-1, str[164], zone[60];
  2204.     if(choice < 1 || choice > 5 ) return SendClientMessage(playerid, -1, "Valid slot numbers are 1-5.");
  2205.     if(PlayerInfo[playerid][pVehicle][vslot] == 0) return SendClientMessage(playerid, -1, "You don't have a vehicle in that slot.");
  2206.     if(PlayerInfo[playerid][pVehicleSpawned][vslot] == 1) return SendClientMessage(playerid, -1, "You have already spawned this vehicle.");
  2207.     vehicle = CreateVehicle(PlayerInfo[playerid][pVehicle][vslot], PlayerInfo[playerid][pVehiclePosX][vslot], PlayerInfo[playerid][pVehiclePosY][vslot], PlayerInfo[playerid][pVehiclePosZ][vslot], PlayerInfo[playerid][pVehicleRot][vslot], PlayerInfo[playerid][pVehicleCol1][vslot],PlayerInfo[playerid][pVehicleCol2][vslot], 0);
  2208.     GetVehicle2DZone(vehicle, zone, sizeof(zone));
  2209.     format(str, sizeof(str), "You have spawned your vehicle at %s.", zone);
  2210.     PlayerInfo[playerid][pVehicleSpawned][vslot] = 1;
  2211.     PlayerInfo[playerid][pVehicleSpawnedID][vslot] = vehicle;
  2212.     SendClientMessage(playerid, COLOR_GRAD1, str);
  2213.     new plate[126];
  2214.     format(plate, sizeof(plate), "LS%i", vehicle);
  2215.     SetVehicleNumberPlate(vehicle, plate);
  2216.     return 1;
  2217. }
  2218.  
  2219. CMD:vtrack(playerid, params[])
  2220. {
  2221.     new choice, Float:vx, Float:vy, Float:vz;
  2222.     if(sscanf(params, "i", choice)) return SendClientMessage(playerid, -1, "USAGE: /vtrack [1-5]");
  2223.     new vslot = choice-1, str[164], zone[60];
  2224.     if(CPT[playerid] != 0) return SendClientMessage(playerid, -1, "You can't use this command while you have an active checkpoint, use /destroycheckpoint.");
  2225.     if(choice < 1 || choice > 5 ) return SendClientMessage(playerid, -1, "Valid slot numbers are 1-5.");
  2226.     if(PlayerInfo[playerid][pVehicle][vslot] == 0) return SendClientMessage(playerid, -1, "You don't have a vehicle in that slot.");
  2227.     if(PlayerInfo[playerid][pVehicleSpawned][vslot] == 0) return SendClientMessage(playerid, -1, "You don't have a vehicle spawned in that slot.");
  2228.     GetVehicle2DZone(PlayerInfo[playerid][pVehicleSpawnedID][vslot], zone, sizeof(zone));
  2229.     GetVehiclePos(PlayerInfo[playerid][pVehicleSpawnedID][vslot], vx, vy, vz);
  2230.     SetPlayerCheckpoint(playerid, vx, vy, vz, 10.0);
  2231.     format(str, sizeof(str), "Your vehicle is at %s.", zone);
  2232.     SendClientMessage(playerid, COLOR_GRAD1, str);
  2233.     return 1;
  2234. }
  2235.  
  2236. CMD:vdelete(playerid, params[])
  2237. {
  2238.     new str[126], rand;
  2239.     new car = GetPlayerVehicleID(playerid);
  2240.     if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1, "You need to be in the vehicle you are deleting.");
  2241.     for(new v;v<MAX_PLAYER_VEHICLES;v++)
  2242.     {
  2243.         if(GetVehicleModel(car) == PlayerInfo[playerid][pVehicle][v])
  2244.         {
  2245.             if(PlayerInfo[playerid][pVehicleSpawnedID][v] == car)
  2246.             {
  2247.                 rand = random(99999999);
  2248.                 format(str, sizeof(str), "Deleted vehicle %i (Model: %i) - [ID: %i]", v+1, PlayerInfo[playerid][pVehicle][v], rand);
  2249.                 SendClientMessage(playerid, -1, str);
  2250.                 SendClientMessage(playerid, COLOR_FADE1, "Take a note of the ID in case you would need your vehicle back.");
  2251.                 format(str, sizeof(str), "%s - Deleted vehicle slot %i (Model: %i) - [ID: %i]", GetName(playerid), v+1, PlayerInfo[playerid][pVehicle][v], rand);
  2252.                 Log("/logs/deletedvehicles.txt", str);
  2253.                 PlayerInfo[playerid][pVehicle][v] = 0;
  2254.                 PlayerInfo[playerid][pVehicleSpawnedID][v] = 0;
  2255.                 PlayerInfo[playerid][pVehicleSpawned][v] = 0;
  2256.                 DestroyVehicle(car);
  2257.                 break;
  2258.             }
  2259.         }
  2260.     }
  2261.     return 1;
  2262. }
  2263.  
  2264. CMD:vlist(playerid, params[])
  2265. {
  2266.     SendClientMessage(playerid, -1, "Your vehicles:");
  2267.     new str[126];
  2268.     format(str, sizeof(str), "Vehicle 1: Model-ID: %i", PlayerInfo[playerid][pVehicle][0]);
  2269.     SendClientMessage(playerid, -1, str);
  2270.     format(str, sizeof(str), "Vehicle 2: Model-ID: %i", PlayerInfo[playerid][pVehicle][1]);
  2271.     SendClientMessage(playerid, -1, str);
  2272.     format(str, sizeof(str), "Vehicle 3: Model-ID: %i", PlayerInfo[playerid][pVehicle][2]);
  2273.     SendClientMessage(playerid, -1, str);
  2274.     format(str, sizeof(str), "Vehicle 4: Model-ID: %i", PlayerInfo[playerid][pVehicle][3]);
  2275.     SendClientMessage(playerid, -1, str);
  2276.     format(str, sizeof(str), "Vehicle 5: Model-ID: %i", PlayerInfo[playerid][pVehicle][4]);
  2277.     SendClientMessage(playerid, -1, str);
  2278.     return 1;
  2279. }
  2280.  
  2281.  
  2282. CMD:vdespawn(playerid, params[])
  2283. {
  2284.     new choice;
  2285.     if(sscanf(params, "i", choice)) { SendClientMessage(playerid, -1, "USAGE: /vdespawn [1-5]"); return cmd_vlist(playerid, params); }
  2286.     new vslot = choice-1;
  2287.     if(choice < 1 || choice > 5 ) return SendClientMessage(playerid, -1, "Valid slot numbers are 1-5.");
  2288.     if(PlayerInfo[playerid][pVehicle][vslot] == 0) return SendClientMessage(playerid, -1, "You don't have a vehicle in that slot.");
  2289.     if(PlayerInfo[playerid][pVehicleSpawned][vslot] != 1) return SendClientMessage(playerid, -1, "This vehicle isn't spawned.");
  2290.     DestroyVehicle(PlayerInfo[playerid][pVehicleSpawned][vslot]);
  2291.     SendClientMessage(playerid, COLOR_GRAD1, "You have despawned your vehicle.");
  2292.     PlayerInfo[playerid][pVehicleSpawned][vslot] = 0;
  2293.     PlayerInfo[playerid][pVehicleSpawnedID][vslot] = 0;
  2294.     return 1;
  2295. }
  2296.  
  2297. CMD:p(playerid, params[])
  2298. {
  2299.     new string[128];
  2300.     if(OnCall[playerid] != -1)
  2301.     {
  2302.         SendClientMessage(playerid, COLOR_GREY, "You are already on a call.");
  2303.         return 1;
  2304.     }
  2305.     if(GetPVarInt(playerid, "Injured") != 0 || GetPVarInt(playerid, "Recovering") != 0 || GetPVarInt(playerid, "Cuffed") != 0)
  2306.     {
  2307.         SendClientMessage (playerid, COLOR_GREY, "You can't use your cellphone right now.");
  2308.         return 1;
  2309.     }
  2310.     foreach(Player, i)
  2311.     {
  2312.         if(OnCall[i] == playerid)
  2313.         {
  2314.             OnCall[playerid] = i;
  2315.             SendClientMessage(i,  COLOR_GREY, "They picked up the call.");
  2316.             format(string, sizeof(string), "* %s answers their cellphone.", GetPlayerNameEx(playerid));
  2317.             ProxDetector(30.0, playerid, string, COLOR_PURPLE);
  2318.             SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
  2319.             SetPlayerAttachedObject(playerid, 9, 330, 6);
  2320.         }
  2321.     }
  2322.     return 1;
  2323. }
  2324.  
  2325. CMD:h(playerid,params[])
  2326. {
  2327.     new string[128];
  2328.  
  2329.     if(GetPVarInt(playerid, "Injured") != 0 || GetPVarInt(playerid, "Recovering") != 0 || GetPVarInt(playerid, "Cuffed") != 0)
  2330.     {
  2331.         SendClientMessage (playerid, COLOR_GRAD2, "You can't do this at this time.");
  2332.         return 1;
  2333.     }
  2334.     if((IsPlayerConnected(OnCall[playerid]) && OnCall[playerid] != INVALID_PLAYER_ID) || OnCall[playerid] == 911)
  2335.     {
  2336.         SendClientMessage(playerid,  COLOR_GREY, "You hung up.");
  2337.         format(string, sizeof(string), "* %s puts their cellphone in their pocket.", GetPlayerNameEx(playerid));
  2338.         ProxDetector(30.0, playerid, string, COLOR_PURPLE);
  2339.         OnCall[playerid] = -1;
  2340.         SetPlayerSpecialAction(OnCall[playerid], SPECIAL_ACTION_STOPUSECELLPHONE);
  2341.         RemovePlayerAttachedObject(OnCall[playerid], 9);
  2342.         SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  2343.         RemovePlayerAttachedObject(playerid, 9);
  2344.         return 1;
  2345.     }
  2346.     return 1;
  2347. }
  2348.  
  2349. CMD:call(playerid, params[])
  2350. {
  2351.     new string[128], phonenumb;
  2352.     if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /call [phonenumber]");
  2353.     phonenumb = strval(params);
  2354.     if(PlayerInfo[playerid][pJail] > 0) return SendClientMessage(playerid,COLOR_GREY,"You can't use your phone while in jail.");
  2355.     if(GetPVarInt(playerid, "Injured") != 0 || GetPVarInt(playerid, "Recovering") != 0 || GetPVarInt(playerid, "Cuffed") != 0) return SendClientMessage(playerid,COLOR_GREY,"You can't use your phone right now.");
  2356.     if(PlayerInfo[playerid][pPhone] == 0) return SendClientMessage(playerid, COLOR_GRAD2, "You don't have a cell phone.");
  2357.     format(string, sizeof(string), "* %s takes out a cellphone as he dials a number.", GetPlayerNameEx(playerid));
  2358.     ProxDetector(30.0, playerid, string, COLOR_PURPLE);
  2359.     if(phonenumb == 911)
  2360.     {
  2361.         new zone[126], str[126];
  2362.         GetPlayer3DZone(playerid, zone, 126);
  2363.         SendClientMessage(playerid, COLOR_YELLOW, "(cellphone) LSPD: Hello. Your call has been sent to our operators - please wait for a response.");
  2364.         format(str, sizeof(str), "* [911]: Call from number %i, %s from location %s.", PlayerInfo[playerid][pPhone], GetName(playerid), zone);
  2365.         SendClientMessageToLSPD(COLOR_TWBLUE, str);
  2366.         format(str, sizeof(str), "* /acceptcall %i to speak with the caller.", playerid);
  2367.         SendClientMessageToLSPD(COLOR_TWBLUE, str);
  2368.         OnCall[playerid] = 911;
  2369.         return 1;
  2370.     }
  2371.     if(phonenumb == PlayerInfo[playerid][pPhone])
  2372.     {
  2373.         SendClientMessage(playerid, COLOR_GRAD2, "  You can't call yourself.");
  2374.         return 1;
  2375.     }
  2376.     if(OnCall[playerid] != -1)
  2377.     {
  2378.         SendClientMessage(playerid, COLOR_GRAD2, "You're already in a call...");
  2379.         return 1;
  2380.     }
  2381.     foreach(Player, i)
  2382.     {
  2383.         if(PlayerInfo[i][pPhone] == phonenumb && phonenumb != 0)
  2384.         {
  2385.             printf("debug - calling %s (number %i)", GetName(i), PlayerInfo[i][pPhone]);
  2386.             new giveplayerid = i;
  2387.             OnCall[playerid] = giveplayerid;
  2388.             if(IsPlayerConnected(giveplayerid))
  2389.             {
  2390.                 if(giveplayerid == INVALID_PLAYER_ID) { SendClientMessage(playerid, COLOR_GREY, "* Unable to connect to the number specified."); return 1; }
  2391.                 {
  2392.                     format(string, sizeof(string), "Incomming call from number %i.. (Caller Name: %s) - /p to answer the call.", PlayerInfo[playerid][pPhone], GetName(playerid));
  2393.                     SendClientMessage(giveplayerid, COLOR_YELLOW, string);
  2394.                     format(string, sizeof(string), "* %s's phone starts ringing.", GetPlayerNameEx(i));
  2395.                     ProxDetector(30.0, i, string, COLOR_PURPLE);
  2396.                     SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
  2397.                     SetPlayerAttachedObject(playerid, 9, 330, 6);
  2398.                     return 1;
  2399.                 }
  2400.             }
  2401.         }
  2402.     }  
  2403.     return 1;
  2404. }
  2405.  
  2406. CMD:givemoney(playerid, params[])
  2407. {
  2408.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this commands.");
  2409.     if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  2410.     {
  2411.         SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  2412.         return 1;
  2413.     }
  2414.     new giveplayerid, cash, str[126];
  2415.     if(sscanf(params, "ui", giveplayerid, cash)) return SendClientMessage(playerid, -1, "USAGE: /givemoney [playerid/partofname] [amount]");
  2416.     PlayerInfo[giveplayerid][pCash] += cash;
  2417.     format(str, sizeof(str), "You have given %s $%i", GetName(giveplayerid), cash);
  2418.     SendClientMessage(playerid, -1, str);
  2419.     format(str, sizeof(str), "You have been given $%i from Admin %s", cash, GetName(playerid));
  2420.     SendClientMessage(giveplayerid, -1, str);
  2421.     format(str, sizeof(str), "%s has given %s $%i.", GetName(playerid), GetName(giveplayerid), cash);
  2422.     Log("/logs/givemoney.txt", str);
  2423.     return 1;
  2424. }
  2425.  
  2426. CMD:fine(playerid, params[])
  2427. {
  2428.     if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this commands.");
  2429.     if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  2430.     {
  2431.         SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  2432.         return 1;
  2433.     }
  2434.     new giveplayerid, cash, str[126], reason[70];
  2435.     if(sscanf(params, "uis[70]", giveplayerid, cash, reason)) return SendClientMessage(playerid, -1, "USAGE: /fine [playerid/partofname] [amount] [reason]");
  2436.     if(cash < 1) return SendClientMessage(playerid, COLOR_GREY, "Fine amount must be above 1.");
  2437.     PlayerInfo[giveplayerid][pCash] -= cash;
  2438.     format(str, sizeof(str), "AdmCmd: %s has fined %s $%i, Reason: %s", GetName(playerid), GetName(giveplayerid), cash, reason);
  2439.     SendClientMessageToAll(COLOR_LIGHTRED, str);
  2440.     format(str, sizeof(str), "AdmCmd: %s has fined %s $%i, Reason: %s", GetName(playerid), GetName(giveplayerid), cash, reason);
  2441.     Log("/logs/fine.txt", str);
  2442.     return 1;
  2443. }
  2444.  
  2445. CMD:buy(playerid, params[])
  2446. {
  2447.     if(Shop(playerid) == NOT_IN_SHOP) return SendClientMessage(playerid, COLOR_GREY, "You are not in any shop.");
  2448.     if(Shop(playerid) == SHOP_BINCO)
  2449.     {
  2450.         ShowPlayerDialog(playerid, DIALOG_BUYSKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Buy clothes",""COL_WHITE"Select a skin to use. Valid skin IDs are 0 to 299.\nA skin change costs $300.","Buy","No");
  2451.         ProxDetector(50.0, playerid, "Shop Clerk says: Welcome, hope you find something fitting you.", COLOR_GRAD1);
  2452.         return 1;
  2453.     }
  2454.     if(Shop(playerid) == SHOP_247)
  2455.     {
  2456.         ShowPlayerDialog(playerid, DIALOG_247, DIALOG_STYLE_LIST, "24/7", "Cell Phone ($600)\nSpray Can ($300)\nItem 3\nItem 4\nItem 5\nItem 6", "Ok", "Close");
  2457.     }
  2458.     return 1;
  2459. }
  2460.  
  2461. CMD:deployspike(playerid, params[])
  2462. {
  2463.     new str[126], zone[126];
  2464.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "You are not a Law Enforcement Officer.");
  2465.     new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  2466.     GetPlayerPos(playerid, plocx, plocy, plocz);
  2467.     GetPlayerFacingAngle(playerid,ploca);
  2468.     CreateStrip(plocx,plocy,plocz,ploca);
  2469.     GetPlayer3DZone(playerid, zone, sizeof(zone));
  2470.     format(str, sizeof(str), "* %s %s has deployed a spike strip at %s.", GetRankName(playerid), GetName(playerid), zone);
  2471.     SendClientMessageToLSPD(RADIO, str);
  2472.     SendClientMessageToFBI(RADIO, str);
  2473.     return 1;
  2474. }
  2475. CMD:destroyspike(playerid, params[])
  2476. {
  2477.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "You are not a Law Enforcement Officer.");
  2478.     DeleteClosestStrip(playerid);
  2479.     return 1;
  2480. }
  2481. CMD:destroyspikes(playerid, params[])
  2482. {
  2483.     new str[126];
  2484.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "You are not a Law Enforcement Officer.");
  2485.     format(str, sizeof(str), "* %s %s has picked up all spike strips.", GetRankName(playerid), GetName(playerid));
  2486.     SendClientMessageToLSPD(RADIO, str);
  2487.     SendClientMessageToFBI(RADIO, str);
  2488.     DeleteAllStrip();
  2489.     return 1;
  2490. }
  2491. CMD:deploycade(playerid, params[])
  2492. {
  2493.     new str[126], zone[126];
  2494.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "You are not a Law Enforcement Officer.");
  2495.     new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  2496.     GetPlayerPos(playerid, plocx, plocy, plocz);
  2497.     GetPlayerFacingAngle(playerid,ploca);
  2498.     CreateCade(plocx-0.8,plocy-0.8,plocz,ploca);
  2499.     GetPlayer3DZone(playerid, zone, sizeof(zone));
  2500.     format(str, sizeof(str), "* %s %s has deployed a barricade at %s.", GetRankName(playerid), GetName(playerid), zone);
  2501.     SendClientMessageToLSPD(RADIO, str);
  2502.     SendClientMessageToFBI(RADIO, str);
  2503.     return 1;
  2504. }
  2505. CMD:deploycade2(playerid, params[])
  2506. {
  2507.     new str[126], zone[126];
  2508.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "You are not a Law Enforcement Officer.");
  2509.     new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  2510.     GetPlayerPos(playerid, plocx, plocy, plocz);
  2511.     GetPlayerFacingAngle(playerid,ploca);
  2512.     CreateCade2(plocx-0.8,plocy-0.8,plocz,ploca);
  2513.     GetPlayer3DZone(playerid, zone, sizeof(zone));
  2514.     format(str, sizeof(str), "* %s %s has deployed a barricade at %s.", GetRankName(playerid), GetName(playerid), zone);
  2515.     SendClientMessageToLSPD(RADIO, str);
  2516.     SendClientMessageToFBI(RADIO, str);
  2517.     return 1;
  2518. }
  2519. CMD:deploycone(playerid, params[])
  2520. {
  2521.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "You are not a Law Enforcement Officer.");
  2522.     new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  2523.     GetPlayerPos(playerid, plocx, plocy, plocz);
  2524.     GetPlayerFacingAngle(playerid,ploca);
  2525.     CreateCone(plocx-0.8,plocy-0.8,plocz,ploca);
  2526.     return 1;
  2527. }
  2528. CMD:destroycone(playerid, params[])
  2529. {
  2530.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "You are not a Law Enforcement Officer.");
  2531.     DeleteClosestCone(playerid);
  2532.     return 1;
  2533. }
  2534. CMD:destroycones(playerid, params[])
  2535. {
  2536.     new str[126];
  2537.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "You are not a Law Enforcement Officer.");
  2538.     format(str, sizeof(str), "* %s %s has picked up all cones.", GetRankName(playerid), GetName(playerid));
  2539.     SendClientMessageToLSPD(RADIO, str);
  2540.     SendClientMessageToFBI(RADIO, str);
  2541.     DeleteAllCone();
  2542.     return 1;
  2543. }
  2544. CMD:destroycade(playerid, params[])
  2545. {
  2546.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "You are not a Law Enforcement Officer.");
  2547.     DeleteClosestCade(playerid);
  2548.     return 1;
  2549. }
  2550. CMD:destroycades(playerid, params[])
  2551. {
  2552.     new str[126];
  2553.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "You are not a Law Enforcement Officer.");
  2554.     format(str, sizeof(str), "* %s %s has picked up all barricades.", GetRankName(playerid), GetName(playerid));
  2555.     SendClientMessageToLSPD(RADIO, str);
  2556.     SendClientMessageToFBI(RADIO, str);
  2557.     DeleteAllCade();
  2558.     return 1;
  2559. }
  2560.  
  2561. CMD:spec(playerid, params[])
  2562. {
  2563.     new giveplayerid, Float:x, Float:y, Float:z;
  2564.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2565.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /spec [playerid/partofname/off]");
  2566.     if(strcmp(params, "off", true) == 0)
  2567.     {
  2568.         SetPVarInt(playerid, "SpecOff", 1);
  2569.         TogglePlayerSpectating(playerid, false);
  2570.         SetCameraBehindPlayer(playerid);
  2571.         SetPlayerPos(playerid, x, y, z);
  2572.         spec[playerid] = -1;
  2573.         return 1;
  2574.     }
  2575.     if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
  2576.     if(IsPlayerInAnyVehicle(giveplayerid))
  2577.     {
  2578.         GetPlayerPos(playerid, x, y, z);
  2579.         TogglePlayerSpectating(playerid, true);
  2580.         new carid = GetPlayerVehicleID(giveplayerid);
  2581.         PlayerSpectateVehicle(playerid, carid);
  2582.         SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  2583.         SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  2584.         spec[playerid] = giveplayerid;
  2585.     }
  2586.         else
  2587.     {
  2588.         GetPlayerPos(playerid, x, y, z);
  2589.         TogglePlayerSpectating(playerid, true);
  2590.         PlayerSpectatePlayer(playerid, giveplayerid);
  2591.         SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  2592.         SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  2593.         spec[playerid] = giveplayerid;
  2594.     }
  2595.     return 1;
  2596. }
  2597.  
  2598. CMD:sendtols(playerid, params[])
  2599. {
  2600.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2601.     if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  2602.     {
  2603.         SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  2604.         return 1;
  2605.     }
  2606.     new giveplayerid;
  2607.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "Usage: /sendtols [playerid/partofname]");
  2608.     SetPlayerPos(giveplayerid, 1529.58, -1687, 13.37);
  2609.     SendClientMessage(giveplayerid, -1, "You have been teleported.");
  2610.     PlayerInfo[giveplayerid][pVW] = 0;
  2611.     PlayerInfo[giveplayerid][pInt] = 0;
  2612.     SetPlayerInterior(giveplayerid, 0);
  2613.     SetPlayerVirtualWorld(giveplayerid, 0);
  2614.     return 1;
  2615. }
  2616.  
  2617. CMD:makehelper(playerid, params[])
  2618. {
  2619.     new giveplayerid, level, str[126];
  2620.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2621.     if(sscanf(params, "ui", giveplayerid, level)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /makehelper [playerid/partofname] [level 1-2]");
  2622.     if(PlayerInfo[giveplayerid][pAdmin] > 0 && PlayerInfo[giveplayerid][pHelper] < 1) return SendClientMessage(playerid, COLOR_GREY, "You can't make an admin helper.");
  2623.     format(str, sizeof(str), "You have been made a level %i helper by Admin %s", level, GetName(playerid));
  2624.     SendClientMessage(giveplayerid, -1, str);
  2625.     format(str, sizeof(str), "You have made %s a level %i helper.", GetName(giveplayerid), level);
  2626.     SendClientMessage(playerid, -1, str);
  2627.     PlayerInfo[giveplayerid][pHelper] = level;
  2628.     return 1;
  2629.  }
  2630.  
  2631. CMD:n(playerid, params[]) return cmd_newb(playerid, params);
  2632.  
  2633. CMD:nmute(playerid, params[])
  2634. {
  2635.     new giveplayerid, str[126];
  2636.     if(PlayerInfo[playerid][pHelper] < 2 && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2637.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /nmute [playerid/partofname]");
  2638.     if(PlayerInfo[giveplayerid][pAdmin] > 0) return SendClientMessage(playerid, -1, "You can not mute an admin.");
  2639.     if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[giveplayerid][pHelper] > 0) return SendClientMessage(playerid, -1, "You can not mute a helper as a helper.");
  2640.     PlayerInfo[giveplayerid][pNewbMute] = 1;
  2641.     format(str, sizeof(str), "You have muted %s from the newbie channel.", GetName(giveplayerid));
  2642.     SendClientMessage(playerid, -1, str);
  2643.     format(str, sizeof(str), "AdmCmd: %s was muted from the newbie channel by %s.", GetName(giveplayerid), GetName(playerid));
  2644.     SendClientMessageToAdmins(COLOR_LIGHTRED, str, 1);
  2645.     format(str, sizeof(str), "HelpCmd: %s was muted from the newbie channel by %s.", GetName(giveplayerid), GetName(playerid));
  2646.     SendClientMessageToHelpers(COLOR_CYAN, str);
  2647.     format(str, sizeof(str), "You were muted from the newbie channel by %s.", GetName(playerid));
  2648.     SendClientMessage(giveplayerid, COLOR_LIGHTRED, str);
  2649.     return 1;
  2650. }
  2651.  
  2652. CMD:nunmute(playerid, params[])
  2653. {
  2654.     new giveplayerid, str[126];
  2655.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2656.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /nunmute [playerid/partofname]");
  2657.     PlayerInfo[giveplayerid][pNewbMute] = 0;
  2658.     format(str, sizeof(str), "You have unmuted %s from the newbie channel.", GetName(giveplayerid));
  2659.     SendClientMessage(playerid, -1, str);
  2660.     format(str, sizeof(str), "AdmCmd: %s was unmuted from the newbie channel by %s.", GetName(giveplayerid), GetName(playerid));
  2661.     SendClientMessageToAdmins(COLOR_LIGHTRED, str, 1);
  2662.     format(str, sizeof(str), "HelpCmd: %s was unmuted from the newbie channel by %s.", GetName(giveplayerid), GetName(playerid));
  2663.     SendClientMessageToHelpers(COLOR_CYAN, str);
  2664.     format(str, sizeof(str), "You were unmuted from the newbie channel by %s.", GetName(playerid));
  2665.     SendClientMessage(giveplayerid, COLOR_LIGHTRED, str);
  2666.     return 1;
  2667. }
  2668.  
  2669. CMD:spraycar(playerid, params[])
  2670. {
  2671.     new col1, col2, car = GetPlayerVehicleID(playerid);
  2672.     if(PlayerInfo[playerid][pSpraycan] < 1) return SendClientMessage(playerid, COLOR_GREY, "You don't have a spraycan.");
  2673.     if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_GREY, "You need to be inside the vehicle you want to spray.");
  2674.     if(sscanf(params, "ii", col1, col2)) return SendClientMessage(playerid, -1, "USAGE: /spraycar [col1] [col2]");
  2675.     if(col1 < 0 || col1 > 256) return SendClientMessage(playerid, COLOR_GREY, "Color number can't be below 0 or above 256.");
  2676.     for(new x; x<MAX_PLAYERS; x++)
  2677.     {
  2678.         for(new y;y<MAX_PLAYER_VEHICLES;y++)
  2679.         {
  2680.             if(PlayerInfo[x][pVehicleSpawnedID][y] == car && x != playerid)
  2681.             {
  2682.                 SendClientMessage(playerid, COLOR_GREY, "You can not spray a owned car that is not yours.");
  2683.                 break;
  2684.             }
  2685.             if(PlayerInfo[playerid][pVehicleSpawnedID][y] == car)
  2686.             {
  2687.                 PlayerInfo[playerid][pVehicleCol1][y] = col1;
  2688.                 PlayerInfo[playerid][pVehicleCol2][y] = col2;
  2689.                 break;
  2690.             }
  2691.         }
  2692.     }
  2693.     ChangeVehicleColor(GetPlayerVehicleID(playerid), col1, col2);
  2694.     PlayerInfo[playerid][pSpraycan] -= 1;
  2695.     return 1;
  2696. }
  2697.  
  2698. CMD:sellvest(playerid, params[])
  2699. {
  2700.     new giveplayerid, price, str[126];
  2701.     if(PlayerInfo[playerid][pJob] != 3) return SendClientMessage(playerid, COLOR_GREY, "You are not a bodyguard.");
  2702.     if(sscanf(params, "ui", giveplayerid, price)) return SendClientMessage(playerid, -1, "USAGE: /sellvest [playerid/partofname] [price]");
  2703.     if(price < 300 || price > 1000) return SendClientMessage(playerid, COLOR_GREY, "ERROR: You may only sell for $300 - $1000.");
  2704.     SetPVarInt(giveplayerid, "OfferedBy", playerid);
  2705.     SetPVarInt(giveplayerid, "VestPrice", price);
  2706.     format(str, sizeof(str), "%s has offered you a vest for $%i. Type /accept vest to accept the offer.", GetName(playerid), price);
  2707.     SendClientMessage(giveplayerid, COLOR_NEWS, str);
  2708.     format(str, sizeof(str), "You have offered %s a vest for $%i.", GetName(giveplayerid), price);
  2709.     SendClientMessage(playerid, COLOR_NEWS, str);
  2710.     return 1;
  2711. }
  2712.    
  2713. CMD:newb(playerid, params[])
  2714. {
  2715.     new say[156], str[156];
  2716.     if(PlayerInfo[playerid][pNewbMute] == 1) return SendClientMessage(playerid, COLOR_GREY, "Your are muted from newbie chat.");
  2717.     if(tognewbie[playerid] == 1) return SendClientMessage(playerid, COLOR_CYAN, "Your newbie chat is disabled, use /tognewb to enable.");
  2718.     if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /newb [text]");
  2719.     if(sscanf(params, "s[100]", say)) return SendClientMessage(playerid, -1, "USAGE: /newb [text]");
  2720.     if(PlayerInfo[playerid][pAdmin] > 1)
  2721.     {
  2722.         format(str, 126, "Admin %s: %s", GetName(playerid), say);
  2723.         Newbie(str);
  2724.         return 1;
  2725.     }
  2726.     if(PlayerInfo[playerid][pHelper] == 2)
  2727.     {
  2728.         format(str, 126, "Super Helper %s: %s", GetName(playerid), say);
  2729.         Newbie(str);
  2730.         return 1;
  2731.     }
  2732.     if(PlayerInfo[playerid][pHelper] == 1)
  2733.     {
  2734.         format(str, 126, "Helper %s: %s", GetName(playerid), say);
  2735.         Newbie(str);
  2736.         return 1;
  2737.     }
  2738.     if(NoNewb[playerid] == 1) return SendClientMessage(playerid, -1, "You have to wait 30 seconds between each usage.");
  2739.     else
  2740.     {
  2741.         format(str, 126, "Newbie %s: %s", GetName(playerid), say);
  2742.         Newbie(str);
  2743.         NoNewb[playerid] = 1;
  2744.         SetTimerEx("AbleNewb", 30000, false, "i", playerid);
  2745.     }
  2746.     return 1;
  2747. }
  2748.  
  2749. CMD:enter(playerid, params[])
  2750. {
  2751.     new string[128];
  2752.     for(new i = 0; i < sizeof(DoorInfo); i++)
  2753.     {
  2754.         if(IsPlayerInRangeOfPoint(playerid,3.0,DoorInfo[i][ddExteriorX], DoorInfo[i][ddExteriorY], DoorInfo[i][ddExteriorZ]) && PlayerInfo[playerid][pVW] == DoorInfo[i][ddExteriorVW])
  2755.         {
  2756.             format(string, sizeof(string), "* %s entered %s.", GetPlayerNameEx(playerid), DoorInfo[i][ddName]);
  2757.             ProxDetector(25.0, playerid, string, COLOR_PURPLE);
  2758.             SetPlayerInterior(playerid,DoorInfo[i][ddInteriorInt]);
  2759.             PlayerInfo[playerid][pInt] = DoorInfo[i][ddInteriorInt];
  2760.             PlayerInfo[playerid][pVW] = DoorInfo[i][ddInteriorVW];
  2761.             SetPlayerVirtualWorld(playerid, DoorInfo[i][ddInteriorVW]);
  2762.             if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER){
  2763.             SetPlayerPos(playerid,DoorInfo[i][ddInteriorX],DoorInfo[i][ddInteriorY],DoorInfo[i][ddInteriorZ]);
  2764.             }
  2765.             SetPlayerFacingAngle(playerid, DoorInfo[i][ddInteriorA]);
  2766.             SetCameraBehindPlayer(playerid);
  2767.             if(DoorInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  2768.             {
  2769.                 new car;
  2770.                 car = GetPlayerVehicleID(playerid);
  2771.                 SetVehiclePos(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorX],DoorInfo[i][ddInteriorY],DoorInfo[i][ddInteriorZ]);
  2772.                 SetVehicleZAngle(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorA]);
  2773.                 SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorVW]);
  2774.                 PutPlayerInVehicle(playerid, car, 0);
  2775.                 LinkVehicleToInterior(GetPlayerVehicleID(playerid), DoorInfo[i][ddInteriorInt]);
  2776.                 return 1;
  2777.             }
  2778.         }
  2779.         if(IsPlayerInRangeOfPoint(playerid,3,DoorInfo[i][ddInteriorX], DoorInfo[i][ddInteriorY], DoorInfo[i][ddInteriorZ]) && PlayerInfo[playerid][pVW] == DoorInfo[i][ddInteriorVW])
  2780.         {
  2781.             if(DoorInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  2782.             {
  2783.                 new car;
  2784.                 car = GetPlayerVehicleID(playerid);
  2785.                 SetVehiclePos(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorX],DoorInfo[i][ddExteriorY],DoorInfo[i][ddExteriorZ]);
  2786.                 SetVehicleZAngle(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorA]);
  2787.                 SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorVW]);
  2788.                 PutPlayerInVehicle(playerid, car, 0);
  2789.                 LinkVehicleToInterior(GetPlayerVehicleID(playerid), DoorInfo[i][ddExteriorInt]);
  2790.             }
  2791.             format(string, sizeof(string), "* %s exited %s.", GetPlayerNameEx(playerid), DoorInfo[i][ddName]);
  2792.             ProxDetector(25.0, playerid, string, COLOR_PURPLE);
  2793.             SetPlayerInterior(playerid,DoorInfo[i][ddExteriorInt]);
  2794.             PlayerInfo[playerid][pInt] = DoorInfo[i][ddExteriorInt];
  2795.             SetPlayerVirtualWorld(playerid, DoorInfo[i][ddExteriorVW]);
  2796.             PlayerInfo[playerid][pVW] = DoorInfo[i][ddExteriorVW];
  2797.             if(DoorInfo[i][ddCustomExterior])
  2798.             {
  2799.                 LoadObjectsForPlayer(playerid);
  2800.             }
  2801.             if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER){
  2802.             SetPlayerPos(playerid,DoorInfo[i][ddExteriorX],DoorInfo[i][ddExteriorY],DoorInfo[i][ddExteriorZ]);
  2803.             SetPlayerFacingAngle(playerid, DoorInfo[i][ddExteriorA]);
  2804.             SetCameraBehindPlayer(playerid);
  2805.             }
  2806.         }
  2807.     }
  2808.     return 1;
  2809. }
  2810.  
  2811. CMD:exit(playerid, params[]) return cmd_enter(playerid, params);
  2812.  
  2813. CMD:zone(playerid, params[])
  2814. {
  2815.     new zone[28];
  2816.     GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
  2817.     SendClientMessage(playerid, -1, zone);
  2818.     return 1;
  2819. }
  2820.  
  2821. CMD:lockers(playerid, params[])
  2822. {
  2823.     new faction = PlayerInfo[playerid][pFaction];
  2824.     if(faction != 1 && faction != 2 && faction != 3) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction with lockers.");
  2825.     if(faction == 1 && !IsPlayerInRangeOfPoint(playerid, 20, 264.73, 77.07, 1003.64)) return SendClientMessage(playerid, COLOR_GREY, "You are not near your lockers.");
  2826.  
  2827.     if(PlayerInfo[playerid][pFaction] == 1)
  2828.     {
  2829.         ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_LIST, "Locker", "Duty\nEquipment\nUniform\nSelect Skin", "Ok", "Close");
  2830.         return 1;
  2831.     }
  2832.     if(PlayerInfo[playerid][pFaction] == 2)
  2833.     {
  2834.         ShowPlayerDialog(playerid, DIALOG_FBI, DIALOG_STYLE_LIST, "Locker", "Duty\nEquipment\nUniform\nSelect Skin\nChange Name", "Ok", "Close");
  2835.         return 1;
  2836.     }
  2837.     if(PlayerInfo[playerid][pFaction] == 3)
  2838.     {
  2839.         return 1;
  2840.     }
  2841.     return 1;
  2842. }
  2843.  
  2844. CMD:load(playerid, params[])
  2845. {
  2846.     new giveplayerid, seat, Float:x, Float:y, Float:z, str[126];
  2847.     if(PlayerInfo[playerid][pFaction] != 3) return SendClientMessage(playerid, COLOR_GREY, "You are not a paramedic.");
  2848.     if(sscanf(params, "ui", giveplayerid, seat)) return SendClientMessage(playerid, -1, "USAGE: /load [playerid/partofname] [seat]");
  2849.     if(GetPVarInt(giveplayerid, "Injured") != 1) return SendClientMessage(playerid, COLOR_GREY, "Player is not injured.");
  2850.     GetPlayerPos(giveplayerid, x, y, z);
  2851.     if(seat == 0) return SendClientMessage(playerid, -1, "You can not load a patient in the driver seat.");
  2852.     if(cardetain[playerid] == -1) return SendClientMessage(playerid, COLOR_GREY, "Invalid detain vehicle.");
  2853.     if(!IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) return SendClientMessage(playerid, COLOR_GREY, "You are not close enough to the patient.");
  2854.     KillTimer(itimer[giveplayerid]);
  2855.     SendClientMessage(giveplayerid, -1, "You have been loaded..");
  2856.     format(str, sizeof(str), "You have loaded %s. Go to the hospital loading point and type /deliver", GetName(giveplayerid));
  2857.     TogglePlayerControllable(giveplayerid, 0);
  2858.     SendClientMessage(playerid, -1, str);
  2859.     PutPlayerInVehicle(giveplayerid, cardetain[playerid], seat);
  2860.     return 1;
  2861. }
  2862.  
  2863. CMD:deliver(playerid, params[])
  2864. {
  2865.     new giveplayerid, Float:x, Float:y, Float:z, str[126];
  2866.     if(PlayerInfo[playerid][pFaction] != 3) return SendClientMessage(playerid, COLOR_GREY, "You are not a paramedic.");
  2867.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /deliver [playerid/partofname]");
  2868.     if(GetPVarInt(giveplayerid, "Injured") != 1) return SendClientMessage(playerid, COLOR_GREY, "Player is not injured.");
  2869.     GetPlayerPos(giveplayerid, x, y, z);
  2870.     if(!IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) return SendClientMessage(playerid, COLOR_GREY, "You are not close enough to the patient.");
  2871.     if(!IsNearLoadingPoint(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not close enough to a delivery point.");
  2872.     format(str, sizeof(str), "* %s %s has delivered patient %s at the hospital in %s.", GetRankName(playerid), GetName(playerid), GetName(giveplayerid), GetZone(playerid));
  2873.     SendClientMessageToLSFMD(RADIOLSFMD, str);
  2874.     PlayerInfo[playerid][pTotDel] += 1;
  2875.     format(str, sizeof(str), "You have recieved $200 for delivering the patient. You have delivered %i patients.", PlayerInfo[playerid][pTotDel]);
  2876.     SendClientMessage(playerid, COLOR_CYAN, str);
  2877.     PlayerInfo[playerid][pCash] += 200;
  2878.     TogglePlayerControllable(giveplayerid, 1);
  2879.     SendClientMessage(giveplayerid, COLOR_LIGHTRED, "HOSPITAL: You have been delivered to the hospital and the health care costed you $100.");
  2880.     if(IsPlayerInRangeOfPoint(playerid, 50, 2016.95, -1413.74, 16.99))
  2881.     {
  2882.     SetPlayerPos(giveplayerid, 2030.08, -1425, 17);
  2883.     }
  2884.     if(IsPlayerInRangeOfPoint(playerid, 50, 1140.90, -1326, 13.64))
  2885.     {
  2886.     SetPlayerPos(giveplayerid, 1181.34, -1323.80, 13.58);
  2887.     }
  2888.     SetPlayerHealth(giveplayerid, 80);
  2889.     KillTimer(iitimer[giveplayerid]);
  2890.     KillTimer(itimer[giveplayerid]);
  2891.     SetPVarInt(giveplayerid, "Injured", 0);
  2892.     return 1;
  2893. }
  2894.  
  2895.  
  2896. new AES[MAX_PLAYERS];
  2897. forward antiemsspam(playerid);
  2898. public antiemsspam(playerid)
  2899. {
  2900. AES[playerid] = 0;
  2901. return 1;
  2902. }
  2903.  
  2904. CMD:acceptcall(playerid, params[])
  2905. {
  2906.     new str[126], giveplayerid, Float:xx, Float:yy, Float:zz;
  2907.     if(PlayerInfo[playerid][pFaction] != 3 && PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, COLOR_GREY, "You are not a paramedic or in the LSPD.");
  2908.     if(sscanf(params, "i", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /acceptcall [playerid/partofname]");
  2909.     /* LSFMD ACCEPT CALL */
  2910.     if(PlayerInfo[playerid][pFaction] == 3)
  2911.     {
  2912.         if(GetPVarInt(giveplayerid, "Injured") != 1) return SendClientMessage(playerid, COLOR_GREY, "That player is not injured.");
  2913.         format(str, sizeof(str), "You have accepted the call from %s (ID %i) who is located in %s.", GetName(giveplayerid), giveplayerid, GetZone(giveplayerid));
  2914.         SendClientMessage(playerid, -1, str);
  2915.         format(str, sizeof(str), "%s has accepted the call from %s (ID %i).", GetName(playerid), GetName(giveplayerid), giveplayerid);
  2916.         SendClientMessageToLSFMD(RADIOLSFMD, str);
  2917.         GetPlayerPos(giveplayerid, xx, yy, zz);
  2918.         medicCP[playerid] = giveplayerid;
  2919.         SetPlayerCheckpoint(playerid, xx, yy, zz, 5);
  2920.         format(str, sizeof(str), "%s has accepted your EMS call, and will be there shortly.", GetName(playerid));
  2921.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  2922.         return 1;
  2923.     }
  2924.     /* LSPD ACCEPT CALL */
  2925.     if(PlayerInfo[playerid][pFaction] == 1)
  2926.     {
  2927.         if(OnCall[giveplayerid] != 911) return SendClientMessage(playerid, COLOR_GREY, "The specified person have either hung up or have not called 911.");
  2928.         format(str, sizeof(str), "LSPD %s %s has accepted your 911 call and will speak with you shortly", GetRankName(playerid), GetName(playerid));
  2929.         SendClientMessage(giveplayerid, -1, str);
  2930.         format(str, sizeof(str), "You have accepted %s's 911 call.", GetName(giveplayerid));
  2931.         SendClientMessage(playerid, -1, str);
  2932.         format(str, sizeof(str), "* %s %s has accepted the 911-call from %s.", GetRankName(playerid), GetName(playerid), GetName(giveplayerid));
  2933.         SendClientMessageToLSPD(RADIO, str);
  2934.         OnCall[giveplayerid] = playerid;
  2935.         OnCall[playerid] = giveplayerid;
  2936.         return 1;
  2937.     }
  2938.     return 1;
  2939. }
  2940.  
  2941.  
  2942. CMD:ems(playerid, params[])
  2943. {
  2944.     new zone[34], str[126];
  2945.     if(GetPVarInt(playerid, "Injured") != 1) return SendClientMessage(playerid, COLOR_GREY, "You are not injured.");
  2946.     if(AES[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You have already called for EMS the last 30 seconds.");
  2947.     GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
  2948.     format(str, sizeof(str), "ALL UNITS: %s (ID %i) has been reported wounded at %s.", GetName(playerid), playerid, zone);
  2949.     SendClientMessageToLSFMD(RADIOLSFMD, str);
  2950.     SendClientMessage(playerid, COLOR_CYAN, "You have called for EMS. Please wait for a paramedic to arrive.");
  2951.     AES[playerid] = 1;
  2952.     SetTimerEx("antiemsspam", 30000, false, "i", playerid);
  2953.     return 1;
  2954. }
  2955. CMD:setadminname(playerid, params[])
  2956. {
  2957.     new giveplayerid, name[56], str[126];
  2958.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  2959.     if(sscanf(params, "us[56]", giveplayerid, name)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /setadminname [playerid/partofname] [name]");
  2960.     if(PlayerInfo[giveplayerid][pAdmin] < 1)
  2961.     {
  2962.         SendClientMessage(playerid, COLOR_WHITE, "The player is not an admin.");
  2963.         return 1;
  2964.     }
  2965.     if(AdminDuty[giveplayerid] == 1)
  2966.     {
  2967.         SendClientMessage(playerid, COLOR_WHITE, "That admin is currently on-duty. They must go off-duty in order for you to set their admin name.");
  2968.         return 1;
  2969.     }
  2970.  
  2971.     new length = strlen(name);
  2972.     if(length < 3 || length > 20)
  2973.     {
  2974.         SendClientMessage(playerid, COLOR_WHITE, "The name can't less than 3 characters or more than 20 characters.");
  2975.         return 1;
  2976.     }
  2977.  
  2978.     if(strfind(name, "_", true) != -1)
  2979.     {
  2980.         SendClientMessage(playerid, COLOR_WHITE, "The admin name must be one name. There can't be an underscore in the name.");
  2981.         return 1;
  2982.     }
  2983.     if(strcmp(name, "Shock", true) == 0 && PlayerInfo[playerid][pAdmin] < 6)
  2984.     {
  2985.         SendClientMessage(playerid, COLOR_WHITE, "kan u stop! i am shock");
  2986.         return 1;
  2987.     }
  2988.     format(str, 126, "AdmCmd: %s has set %s's admin-name to %s.", GetName(playerid), GetName(giveplayerid), name);
  2989.     SendClientMessageToAdmins(COLOR_LIGHTRED, str, 1);
  2990.     format(PlayerInfo[giveplayerid][pAName], 56, name);
  2991.     return 1;
  2992. }
  2993.  
  2994. CMD:gotoid(playerid, params[])
  2995. {
  2996.     new giveplayerid;
  2997.     if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this commad.");
  2998.     if(AdminDuty[playerid] == 0 && PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1, "You are not on duty as an admin");
  2999.     if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player specifed.");
  3000.     new Float:gotoX, Float:gotoY, Float:gotoZ;
  3001.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /gotoid [playerid/partofname]");
  3002.     GetPlayerPos(giveplayerid, gotoX, gotoY, gotoZ);
  3003.     SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  3004.     PlayerInfo[playerid][pVW] = GetPlayerVirtualWorld(giveplayerid);
  3005.     PlayerInfo[playerid][pInt] = GetPlayerInterior(giveplayerid);
  3006.     SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  3007.     SetPlayerPos(playerid, gotoX, gotoY, gotoZ);
  3008.     SendClientMessage(playerid, -1, "You have been teleported.");
  3009.     return 1;
  3010. }
  3011.  
  3012. CMD:gethere(playerid, params[])
  3013. {
  3014.     new giveplayerid;
  3015.     if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this commad.");
  3016.     if(AdminDuty[playerid] == 0 && PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1, "You are not on duty as an admin");
  3017.     if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, -1, "You can't do this on a higher level administrator.");
  3018.     new Float:gotoX, Float:gotoY, Float:gotoZ;
  3019.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /gethere [playerid/partofname]");
  3020.     if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, -1, "You can't do this on a higher level administrator.");
  3021.     GetPlayerPos(playerid, gotoX, gotoY, gotoZ);
  3022.     SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
  3023.     SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
  3024.     PlayerInfo[giveplayerid][pVW] = GetPlayerVirtualWorld(playerid);
  3025.     PlayerInfo[giveplayerid][pInt] = GetPlayerInterior(playerid);
  3026.     SetPlayerPos(giveplayerid, gotoX, gotoY, gotoZ);
  3027.     SendClientMessage(giveplayerid, -1, "You have been teleported.");
  3028.     return 1;
  3029. }
  3030.  
  3031.  
  3032.  
  3033. CMD:gotox(playerid, params[])
  3034. {
  3035.     new Float:tpx, Float:tpy, Float:tpz, int;
  3036.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  3037.     if(AdminDuty[playerid] == 0 && PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1, "You are not on duty as an admin");
  3038.     if(sscanf(params, "fffi", tpx, tpy, tpz, int)) return SendClientMessage(playerid, -1, "USAGE: /gotox [coord x] [coord y] [coord z] [int]");
  3039.     if(!isnull(params))
  3040.     {
  3041.         SetPlayerPos(playerid, tpx, tpy, tpz);
  3042.         SetPlayerInterior(playerid, int);
  3043.         SendClientMessage(playerid, -1, "You have been teleported.");
  3044.         return 1;
  3045.     }
  3046.     return 1;
  3047. }
  3048.    
  3049.  
  3050. CMD:goto(playerid, params[])
  3051. {
  3052.     new choice[32];
  3053.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  3054.     if(sscanf(params, "s[32]", choice))
  3055.     {
  3056.         SendClientMessage(playerid, COLOR_WHITE, "USAGE: /goto [choice]");
  3057.         SendClientMessage(playerid, -1, "Choices: LS, LV, SF, Allsaints, Gym, Trucker");
  3058.         return 1;
  3059.     }
  3060.     if(strcmp(choice, "ls", true) == 0)
  3061.     {
  3062.         SetPlayerPos(playerid, 1529.58, -1687, 13.37);
  3063.         SendClientMessage(playerid, -1, "You have been teleported.");
  3064.         PlayerInfo[playerid][pVW] = 0;
  3065.         PlayerInfo[playerid][pInt] = 0;
  3066.         SetPlayerInterior(playerid, 0);
  3067.         SetPlayerVirtualWorld(playerid, 0);
  3068.     }
  3069.     if(strcmp(choice, "lv", true) == 0)
  3070.     {
  3071.         SetPlayerPos(playerid, 1692.95, 1442.26, 10.76);
  3072.         SendClientMessage(playerid, -1, "You have been teleported.");
  3073.         PlayerInfo[playerid][pVW] = 0;
  3074.         PlayerInfo[playerid][pInt] = 0;
  3075.         SetPlayerInterior(playerid, 0);
  3076.         SetPlayerVirtualWorld(playerid, 0);
  3077.     }
  3078.     if(strcmp(choice, "sf", true) == 0)
  3079.     {
  3080.         SetPlayerPos(playerid, -1410.49, -315.44, 14);
  3081.         SendClientMessage(playerid, -1, "You have been teleported.");
  3082.         PlayerInfo[playerid][pVW] = 0;
  3083.         PlayerInfo[playerid][pInt] = 0;
  3084.         SetPlayerInterior(playerid, 0);
  3085.         SetPlayerVirtualWorld(playerid, 0);
  3086.     }
  3087.     if(strcmp(choice, "allsaints", true) == 0)
  3088.     {
  3089.         SetPlayerPos(playerid, 1187.06, -1318.26, 13.57);
  3090.         SendClientMessage(playerid, -1, "You have been teleported.");
  3091.         PlayerInfo[playerid][pVW] = 0;
  3092.         PlayerInfo[playerid][pInt] = 0;
  3093.         SetPlayerInterior(playerid, 0);
  3094.         SetPlayerVirtualWorld(playerid, 0);
  3095.     }
  3096.     if(strcmp(choice, "gym", true) == 0)
  3097.     {
  3098.         SetPlayerInterior(playerid, 0);
  3099.         SetPlayerVirtualWorld(playerid, 0);
  3100.         SetPlayerPos(playerid, 2223.96, -1717.37, 13.51);
  3101.         SendClientMessage(playerid, -1, "You have been teleported.");
  3102.         SetPlayerInterior(playerid, 0);
  3103.         SetPlayerVirtualWorld(playerid, 0);
  3104.     }
  3105.     if(strcmp(choice, "trucker", true) == 0)
  3106.     {
  3107.         SetPlayerInterior(playerid, 0);
  3108.         SetPlayerVirtualWorld(playerid, 0);
  3109.         SetPlayerPos(playerid, 2233, -2637, 14);
  3110.         SendClientMessage(playerid, -1, "You have been teleported.");
  3111.         SetPlayerInterior(playerid, 0);
  3112.         SetPlayerVirtualWorld(playerid, 0);
  3113.     }
  3114.     return 1;
  3115. }
  3116.  
  3117. CMD:aduty(playerid, params[])
  3118. {
  3119.     new str[126];
  3120.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  3121.     if(GetPVarInt(playerid, "Injured") == 1) return SendClientMessage(playerid, COLOR_GREY, "You may not go on duty while injured, /giveup if emergency.");
  3122.     if(AdminDuty[playerid] != 1)
  3123.     {
  3124.         AdminDutyCash[playerid] = PlayerInfo[playerid][pCash];
  3125.         GetPlayerHealth(playerid, AdminDutyHealth[playerid]);
  3126.         AdminDutyArmor[playerid] = PlayerInfo[playerid][pArmor];
  3127.         if(isnull(PlayerInfo[playerid][pAName])) return SendClientMessage(playerid, -1, "You don't have an admin name.");
  3128.         AdminDuty[playerid] = 1;
  3129.         format(str, sizeof(str), "%s (ID %i - %s) is now on duty as a level %i admin.", PlayerInfo[playerid][pAName], playerid, GetName(playerid), PlayerInfo[playerid][pAdmin]);
  3130.         SendClientMessageToAdmins(-1, str, 1);
  3131.         SetPlayerName(playerid, PlayerInfo[playerid][pAName]);
  3132.         SendClientMessage(playerid, -1, "You are now on duty as an admin, you do now have access to all of your commands.");
  3133.         GetPlayerPos(playerid, PlayerInfo[playerid][pAx], PlayerInfo[playerid][pAy], PlayerInfo[playerid][pAz]);
  3134.     }
  3135.     else
  3136.     {
  3137.         waitcheck[playerid] = 2;
  3138.         SetPVarInt(playerid, "SpecOff", 1);
  3139.         TogglePlayerSpectating(playerid, false);
  3140.         SetCameraBehindPlayer(playerid);
  3141.         AdminDuty[playerid] = 0;
  3142.         SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ], 0, 0, 0, 0, 0, 0, 0);
  3143.         SpawnPlayer(playerid);
  3144.         SetPlayerWeapons(playerid);
  3145.         SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
  3146.         SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
  3147.         SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  3148.         SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
  3149.         SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
  3150.         SetPlayerName(playerid, PlayerInfo[playerid][pName]);
  3151.         new backup[126];
  3152.         format(backup, 126, "%s Old cash: %i - New cash: %i", GetName(playerid), PlayerInfo[playerid][pCash], AdminDutyCash[playerid]);
  3153.         Log("/logs/backup.txt", backup);
  3154.         PlayerInfo[playerid][pCash] = AdminDutyCash[playerid];
  3155.         SetPlayerPos(playerid, PlayerInfo[playerid][pAx], PlayerInfo[playerid][pAy], PlayerInfo[playerid][pAz]);
  3156.         format(str, sizeof(str), "%s (ID %i - %s) is now off admin duty.", PlayerInfo[playerid][pAName], playerid, GetName(playerid));
  3157.         SendClientMessageToAdmins(-1, str, 1);
  3158.         SendClientMessage(playerid, -1, "You are now off duty as an admin and have only a limited access to your commands.");
  3159.         spec[playerid] = -1;
  3160.         SetPlayerWeaponsEx(playerid);
  3161.     }
  3162.     return 1;
  3163. }
  3164.  
  3165. CMD:badge(playerid, params[])
  3166. {
  3167.     if(PlayerInfo[playerid][pFaction] == 1)
  3168.     {
  3169.         if(badge[playerid] == 1)
  3170.         {
  3171.             SetPlayerColor(playerid, 0xFFFFFF00);
  3172.             SendClientMessage(playerid, -1, "You have taken away your badge.");
  3173.             badge[playerid] = 0;
  3174.             return 1;
  3175.         }
  3176.         if(badge[playerid] == 0)
  3177.         {
  3178.         SetPlayerColor(playerid, 0x0800FF00);
  3179.         SendClientMessage(playerid, -1, "You have made your badge visible.");
  3180.         badge[playerid] = 1;
  3181.         return 1;
  3182.         }
  3183.     }
  3184.     return 1;
  3185. }
  3186.  
  3187. CMD:skill(playerid, params[])
  3188. {
  3189.     new skill, str[128];
  3190.     if(sscanf(params, "i", skill)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /skill 1 [Trucker] | 2 [Weapon Dealer]");
  3191.     if(skill == 1)
  3192.     {
  3193.         new tl;
  3194.  
  3195.         if(PlayerInfo[playerid][pTruckerSkill] < 100)
  3196.         {
  3197.         tl = 1;
  3198.         }
  3199.         if(PlayerInfo[playerid][pTruckerSkill] > 99)
  3200.         {
  3201.         tl = (PlayerInfo[playerid][pTruckerSkill] / 100)+1;
  3202.         }
  3203.         if(PlayerInfo[playerid][pTruckerSkill] > 400)
  3204.         {
  3205.         tl = 5;
  3206.         }
  3207.         SendClientMessage(playerid, COLOR_YELLOW, "Trucker Skill:");
  3208.         format(str, sizeof(str), "You are a level %i trucker. You have done %i trucking deliveries. You level up every 100 deliveries.",tl, PlayerInfo[playerid][pTruckerSkill]);
  3209.         SendClientMessage(playerid, COLOR_YELLOW, str);
  3210.     }
  3211.     if(skill == 2)
  3212.     {
  3213.         new wdl;
  3214.         wdl = (PlayerInfo[playerid][pWDealerSkill] / 100);
  3215.         if(PlayerInfo[playerid][pWDealerSkill] < 100)
  3216.         {
  3217.         wdl = 1;
  3218.         }
  3219.         if(PlayerInfo[playerid][pWDealerSkill] > 99)
  3220.         {
  3221.         wdl = (PlayerInfo[playerid][pWDealerSkill] / 100)+1;
  3222.         }
  3223.         if(PlayerInfo[playerid][pWDealerSkill] > 400)
  3224.         {
  3225.         wdl = 5;
  3226.         }
  3227.         SendClientMessage(playerid, COLOR_YELLOW, "Weapon Dealer Skill:");
  3228.         format(str, sizeof(str), "You are a level %i Weapon Dealer. You have done %i gun sales. You level up every 100 sales.",wdl, PlayerInfo[playerid][pWDealerSkill]);
  3229.         SendClientMessage(playerid, COLOR_YELLOW, str);
  3230.     }
  3231.     return 1;
  3232. }
  3233.  
  3234. CMD:ok(playerid, params[])
  3235. {
  3236.         if(PlayerInfo[playerid][pAdmin] < 5) return 0;
  3237.         AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
  3238.         return 1;
  3239. }
  3240.  
  3241. CMD:slap(playerid, params[])
  3242. {
  3243.     if(PlayerInfo[playerid][pAdmin] >= 1)
  3244.     {
  3245.         if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  3246.         {
  3247.             SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  3248.             return 1;
  3249.         }
  3250.         new giveplayerid;
  3251.         new string[128];
  3252.         if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, -1, "You can't do this on a higher level administrator.");
  3253.         if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /slap [playerid/partofname]");
  3254.         if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
  3255.         if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
  3256.         GetPlayerPos(giveplayerid, PlayerInfo[giveplayerid][pX], PlayerInfo[giveplayerid][pY], PlayerInfo[giveplayerid][pZ]);
  3257.         SetPlayerPos(giveplayerid, PlayerInfo[giveplayerid][pX], PlayerInfo[giveplayerid][pY], PlayerInfo[giveplayerid][pZ]+2);
  3258.         format(string, sizeof(string), "AdmCmd: %s was slapped by %s", GetName(giveplayerid), GetName(playerid));
  3259.         new ip[28];
  3260.         GetPlayerIp(giveplayerid, ip, sizeof(ip));
  3261.         SendClientMessageToAdmins(COLOR_LIGHTRED, string, 1);
  3262.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was slapped by %s", GetName(giveplayerid), ip, GetName(playerid));
  3263.         Log("/logs/slap.txt", string);
  3264.         return 1;
  3265.     }
  3266.     return 1;
  3267. }
  3268.  
  3269. CMD:kiick(playerid, params[])
  3270. {
  3271.     if(PlayerInfo[playerid][pAdmin] >= 1)
  3272.     {
  3273.         new giveplayerid;
  3274.         if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kiick [playerid/partofname]");
  3275.         if(IsPlayerConnected(giveplayerid))
  3276.         {
  3277.             Kick(giveplayerid);
  3278.         }
  3279.     }
  3280.     else
  3281.     {
  3282.         SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
  3283.     }
  3284.     return 1;
  3285. }
  3286.  
  3287. CMD:kick(playerid, params[])
  3288. {
  3289.     if(PlayerInfo[playerid][pAdmin] >= 1)
  3290.     {
  3291.         new string[128], giveplayerid, reason[56];
  3292.         if(sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid/partofname] [reason]");
  3293.         if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, -1, "You can't do this on a higher level administrator.");
  3294.         if(IsPlayerConnected(giveplayerid))
  3295.         {
  3296.             format(string, sizeof(string), "AdmCmd: %s was kicked by %s, Reason: %s", GetName(giveplayerid), GetName(playerid), reason);
  3297.             new ip[28];
  3298.             GetPlayerIp(giveplayerid, ip, sizeof(ip));
  3299.             SendClientMessageToAll(COLOR_LIGHTRED, string);
  3300.             format(string, sizeof(string), "AdmCmd: %s (IP: %s) was kicked by %s, Reason: %s", GetName(giveplayerid), ip, GetName(playerid), reason);
  3301.             Log("/logs/kick.txt", string);
  3302.             Kick(giveplayerid);
  3303.         }
  3304.     }
  3305.     else
  3306.     {
  3307.         SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
  3308.     }
  3309.     return 1;
  3310. }
  3311.  
  3312. CMD:time(playerid, params[])
  3313. {
  3314. new str[126];
  3315. if(PlayerInfo[playerid][pJail] < 1) return SendClientMessage(playerid, -1, "You are not in prison.");
  3316. format(str, 128, "You have %i minutes left of prison.", PlayerInfo[playerid][pJail]);
  3317. GameTextForPlayer(playerid, str, 2000, 3);
  3318. SendClientMessage(playerid, COLOR_CYAN, str);
  3319. return 1;
  3320. }
  3321.  
  3322. CMD:release(playerid,params[])
  3323. {
  3324.     if(PlayerInfo[playerid][pAdmin] >= 3)
  3325.     {
  3326.         new giveplayerid, reason[126], str[126];
  3327.         if(sscanf(params, "us[126]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /release [playerid/partofname] [reason]");
  3328.         if(PlayerInfo[giveplayerid][pJail] < 1) return SendClientMessage(playerid, COLOR_GREY, "The specified player is not in jail.");
  3329.         SetPlayerPos(giveplayerid, 247.37, 67.92, 1003.64);
  3330.         SetPlayerInterior(giveplayerid, 6);
  3331.         SetPVarInt(giveplayerid, "Cuffed", 0);
  3332.         SetPlayerVirtualWorld(giveplayerid, 1337);
  3333.         PlayerInfo[giveplayerid][pInt] = 6;
  3334.         PlayerInfo[giveplayerid][pVW] = 1337;
  3335.         PlayerInfo[giveplayerid][pJail] = 0;
  3336.         ResetPlayerWeapons(giveplayerid);
  3337.         ResetPlayerWeaponsEx(giveplayerid);
  3338.         GameTextForPlayer(giveplayerid, "Released.", 5000, 3);
  3339.         KillTimer(rtimer[giveplayerid]);
  3340.         SendClientMessage(giveplayerid, COLOR_CYAN, "You have been released from prison by an admin.");
  3341.         format(str, 126, "AdmCmd: %s was released from prison by %s. Reason: %s.", GetName(giveplayerid), GetName(playerid), reason);
  3342.         SendClientMessageToAll(COLOR_LIGHTRED, str);
  3343.         SetPlayerColor(giveplayerid, 0xFFFFFF00);
  3344.         Log("/logs/prison.txt", str);
  3345.     }
  3346.     return 1;
  3347. }
  3348.  
  3349. CMD:park(playerid, params[])
  3350. {
  3351.     new currveh = GetPlayerVehicleID(playerid);
  3352.     new succeed = 0;
  3353.     if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_GREY, "You are not the driver of the vehicle.");
  3354.     for(new y;y<MAX_PLAYER_VEHICLES;y++)
  3355.     {
  3356.         if(PlayerInfo[playerid][pVehicleSpawnedID][y] == currveh) { succeed = 1; }
  3357.     }
  3358.     if(succeed == 0) return SendClientMessage(playerid, -1, "This is not your vehicle.");
  3359.     for(new v; v<MAX_PLAYER_VEHICLES; v++)
  3360.     {
  3361.         if(PlayerInfo[playerid][pVehicleSpawnedID][v] == currveh)
  3362.         {
  3363.             new Float:vh;
  3364.             GetVehicleHealth(GetPlayerVehicleID(playerid), vh);
  3365.             if(vh < 700) { SendClientMessage(playerid, -1, "The car is too damaged to be parked."); break; }
  3366.             new Float:x, Float:y, Float:z, Float:a;
  3367.             GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
  3368.             GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  3369.             PlayerInfo[playerid][pVehiclePosX][v] = x;
  3370.             PlayerInfo[playerid][pVehiclePosY][v] = y;
  3371.             PlayerInfo[playerid][pVehiclePosZ][v] = z;
  3372.             PlayerInfo[playerid][pVehicleRot][v] = a;
  3373.             new str[126];
  3374.             format(str, sizeof(str), "* %s has parked his vehicle.", GetName(playerid));
  3375.             ProxDetector(50.0, playerid, str, COLOR_PURPLE);
  3376.             break;
  3377.         }
  3378.     }
  3379.     return 1;
  3380. }
  3381.  
  3382. CMD:prison(playerid,params[])
  3383. {
  3384.     if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command");
  3385.     {
  3386.         new giveplayerid, str[128], time, reason[56];
  3387.         if(sscanf(params, "uis[56]", giveplayerid, time, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /prison [playerid/partofname] [time] [reason]");
  3388.         if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, -1, "You can't do this on a higher level administrator.");
  3389.         PlayerInfo[giveplayerid][pJail] = time;
  3390.         PlayerInfo[giveplayerid][pBail] = 0;
  3391.         beingdragged[giveplayerid] = -1;
  3392.         SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
  3393.         ClearAnimations(giveplayerid);
  3394.         SetPlayerSkin(giveplayerid, GetPlayerSkin(giveplayerid));
  3395.         SetPVarInt(giveplayerid, "Dragged", 0);
  3396.         SetPVarInt(giveplayerid, "Cuffed", 0);
  3397.         TogglePlayerControllable(giveplayerid, 1);
  3398.         ResetPlayerWeapons(giveplayerid);
  3399.         ResetPlayerWeaponsEx(giveplayerid);
  3400.         PlayerInfo[giveplayerid][pInt] = 6;
  3401.         PlayerInfo[giveplayerid][pVW] = 1337;
  3402.         SetPlayerInterior(giveplayerid, 6);
  3403.         SetPlayerVirtualWorld(giveplayerid, 1337);
  3404.         SetPlayerPos(giveplayerid, 264.67, 77.79, 1001.04);
  3405.         format(str, 126, "AdmCmd: %s was prisoned by %s. Reason: %s.", GetName(giveplayerid), GetName(playerid), reason);
  3406.         SendClientMessageToAll(COLOR_LIGHTRED, str);
  3407.         Log("/logs/prison.txt", str);
  3408.         SetPlayerColor(giveplayerid, 0x65432100);
  3409.         rtimer[giveplayerid] = SetTimerEx("arrestrelease", 60000, true, "i", giveplayerid);
  3410.     }
  3411.     return 1;
  3412. }
  3413.  
  3414. CMD:jail(playerid,params[])
  3415. {
  3416.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command");
  3417.     {
  3418.         new giveplayerid, str[128], reason[56];
  3419.         if(sscanf(params, "us[56]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [playerid/partofname] [reason]");
  3420.         if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, -1, "You can't do this on a higher level administrator.");
  3421.         PlayerInfo[giveplayerid][pJail] = 20;
  3422.         PlayerInfo[giveplayerid][pBail] = 0;
  3423.         beingdragged[giveplayerid] = -1;
  3424.         SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
  3425.         ClearAnimations(giveplayerid);
  3426.         SetPlayerSkin(giveplayerid, GetPlayerSkin(giveplayerid));
  3427.         SetPVarInt(giveplayerid, "Dragged", 0);
  3428.         SetPVarInt(giveplayerid, "Cuffed", 0);
  3429.         TogglePlayerControllable(giveplayerid, 1);
  3430.         ResetPlayerWeapons(giveplayerid);
  3431.         ResetPlayerWeaponsEx(giveplayerid);
  3432.         PlayerInfo[giveplayerid][pInt] = 6;
  3433.         PlayerInfo[giveplayerid][pVW] = 1337;
  3434.         SetPlayerInterior(giveplayerid, 6);
  3435.         SetPlayerVirtualWorld(giveplayerid, 1337);
  3436.         SetPlayerPos(giveplayerid, 264.67, 77.79, 1001.04);
  3437.         format(str, 126, "AdmCmd: %s was jailed by %s. Reason: %s.", GetName(giveplayerid), GetName(playerid), reason);
  3438.         SendClientMessageToAll(COLOR_LIGHTRED, str);
  3439.         Log("/logs/prison.txt", str);
  3440.         SetPlayerColor(giveplayerid, 0x65432100);
  3441.         rtimer[playerid] = SetTimerEx("arrestrelease", 60000, true, "i", giveplayerid);
  3442.     }
  3443.     return 1;
  3444. }
  3445.  
  3446.  
  3447. CMD:arrest(playerid, params[])
  3448. {
  3449.     new string[128];
  3450.     new giveplayerid, time, fine, bail;
  3451.     if(PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, -1, "You are not in the LSPD.");
  3452.     if(!IsPlayerInRangeOfPoint(playerid, 10, 1526, -1676, 5.89)) return SendClientMessage(playerid, -1, "You are not at the arrest point.");
  3453.     if(sscanf(params, "uiii", giveplayerid, time, fine, bail)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /arrest [playerid/partofname] [time (1-20 min)] [fine (0-500)] [bail (0-1000)]");
  3454.     GetPlayerPos(giveplayerid, PlayerInfo[giveplayerid][pX], PlayerInfo[giveplayerid][pY], PlayerInfo[giveplayerid][pZ]);
  3455.     if(!IsPlayerInRangeOfPoint(playerid, 10, PlayerInfo[giveplayerid][pX], PlayerInfo[giveplayerid][pY], PlayerInfo[giveplayerid][pZ])) return SendClientMessage(playerid, -1, "You are not near the suspect.");
  3456.     if(PlayerInfo[giveplayerid][pWanted] < 1) return SendClientMessage(playerid, -1, "Player is not wanted.");
  3457.     if(time > 20 || time < 1) return SendClientMessage(playerid, -1, "Valid arrest time is between 1 and 20");
  3458.     if(fine > 500 || fine < 0) return SendClientMessage(playerid, -1, "Valid fine is between 0 and 500");
  3459.     if(bail > 1000 || bail < 0) return SendClientMessage(playerid, -1, "Valid bail is between 0 and 100");
  3460.     if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Invalid player specified.");
  3461.     if(giveplayerid == playerid) return SendClientMessage(playerid, -1, "You can not arrest yourself.");
  3462.     PlayerInfo[giveplayerid][pJail] = time;
  3463.     PlayerInfo[giveplayerid][pBail] = bail;
  3464.     PlayerInfo[giveplayerid][pCash] -= fine;
  3465.     PlayerInfo[giveplayerid][pWanted] = 0;
  3466.     PlayerInfo[giveplayerid][pInt] = 6;
  3467.     PlayerInfo[giveplayerid][pVW] = 1337;
  3468.     PlayerInfo[giveplayerid][pW1] = 0; PlayerInfo[giveplayerid][pW2] = 0; PlayerInfo[giveplayerid][pW3] = 0; PlayerInfo[giveplayerid][pW4] = 0; PlayerInfo[giveplayerid][pW5] = 0;  PlayerInfo[giveplayerid][pW6] = 0;
  3469.     SetPlayerColor(giveplayerid, 0xFF8C0000);
  3470.     beingdragged[giveplayerid] = -1;
  3471.     SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
  3472.     ClearAnimations(giveplayerid);
  3473.     SetPlayerSkin(giveplayerid, GetPlayerSkin(giveplayerid));
  3474.     SetPVarInt(giveplayerid, "Dragged", 0);
  3475.     TogglePlayerControllable(giveplayerid, 1);
  3476.     SetPlayerInterior(giveplayerid, 6);
  3477.     ResetPlayerWeapons(giveplayerid);
  3478.     ResetPlayerWeaponsEx(giveplayerid);
  3479.     SetPlayerVirtualWorld(giveplayerid, 1337);
  3480.     SetPVarInt(giveplayerid, "Cuffed", 0);
  3481.     SetPlayerPos(giveplayerid, 264.67, 77.79, 1001.04);
  3482.     format(string, sizeof(string), "You have been arrested by Officer %s for %i minutes and have been fined $%i.", GetName(playerid), time, fine);
  3483.     SendClientMessage(giveplayerid, COLOR_CYAN, string);
  3484.     format(string, sizeof(string), "You have arrested %s for %i minutes, fined $%i and set the bail to %i.", GetName(giveplayerid), time, fine, bail);
  3485.     SendClientMessage(playerid, COLOR_CYAN, string);
  3486.     format(string, sizeof(string), "[LSPD JAIL] %s has arrested %s for %i minutes, fined $%i and set the bail to %i.", GetName(playerid), GetName(giveplayerid), time, fine, bail);
  3487.     Log("/logs/prison.txt", string);
  3488.     format(string, sizeof(string), "ALL UNITS: %s has arrested %s for %i minutes and fined $%i.", GetName(playerid), GetName(giveplayerid), time, fine);
  3489.     SendClientMessageToLSPD(RADIO, string);
  3490.     if(PlayerInfo[giveplayerid][pBail] > 0)
  3491.     {
  3492.     format(string, sizeof(string), "Your bail is: %i.", bail);
  3493.     }
  3494.     SendClientMessage(giveplayerid, COLOR_CYAN, string);
  3495.     rtimer[giveplayerid] = SetTimerEx("arrestrelease", 60000, true, "i", giveplayerid);
  3496.     return 1;
  3497. }
  3498.  
  3499. CMD:bail(playerid, params[])
  3500. {
  3501.     if(PlayerInfo[playerid][pJail] < 1) return SendClientMessage(playerid, -1, "You are not in jail.");
  3502.     if(PlayerInfo[playerid][pBail] < 1) return SendClientMessage(playerid, -1, "You don't have a bail.");
  3503.     if(PlayerInfo[playerid][pBail] > PlayerInfo[playerid][pCash]) return SendClientMessage(playerid, -1, "You don't have enough money to bail out.");
  3504.     SetPlayerPos(playerid, 247.37, 67.92, 1003.64);
  3505.     SetPlayerInterior(playerid, 6);
  3506.     SetPlayerVirtualWorld(playerid, 1337);
  3507.     PlayerInfo[playerid][pJail] = -1;
  3508.     SetPlayerColor(playerid, 0xFFFFF00);
  3509.     KillTimer(rtimer[playerid]);
  3510.     PlayerInfo[playerid][pCash] -= PlayerInfo[playerid][pBail];
  3511.     GameTextForPlayer(playerid, "Released. Try to be good now.", 5000, 3);
  3512.     SendClientMessage(playerid, COLOR_CYAN, "You have bailed out of jail.");
  3513.     return 1;
  3514. }
  3515.  
  3516. CMD:check(playerid,params[])
  3517. {
  3518.     if(PlayerInfo[playerid][pAdmin] >= 2)
  3519.     {
  3520.         new giveplayerid;
  3521.         if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /check [playerid/partofname]");
  3522.         ShowStats(playerid, giveplayerid);
  3523.     }
  3524.     return 1;
  3525. }
  3526.  
  3527.  
  3528. CMD:ban(playerid, params[])
  3529. {
  3530.     if(PlayerInfo[playerid][pAdmin] >= 2)
  3531.     {
  3532.         new string[128], giveplayerid, reason[56];
  3533.         if(sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [playerid/partofname] [reason]");
  3534.         if(IsPlayerConnected(giveplayerid))
  3535.         {
  3536.             if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, -1, "You can't do this on a higher level administrator.");
  3537.             format(string, sizeof(string), "AdmCmd: %s was banned by %s, Reason: %s", GetName(giveplayerid), GetName(playerid), reason);
  3538.             PlayerInfo[giveplayerid][pBanned] =  1;
  3539.             new ip[28];
  3540.             GetPlayerIp(giveplayerid, ip, sizeof(ip));
  3541.             SendClientMessageToAll(COLOR_LIGHTRED, string);
  3542.             format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned by %s, Reason: %s", GetName(giveplayerid), ip, GetName(playerid), reason);
  3543.             Log("/logs/ban.txt", string);
  3544.             AddBan(ip);
  3545.             Kick(giveplayerid);
  3546.         }
  3547.     }
  3548.     else
  3549.     {
  3550.         SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
  3551.     }
  3552.     return 1;
  3553. }
  3554.  
  3555. CMD:drag(playerid, params[])
  3556. {
  3557.     new string[128], giveplayerid, Float:x, Float:y, Float:z;
  3558.     if(PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, -1, "You are not in the LSPD.");
  3559.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /drag [playerid/partofname]");
  3560.     GetPlayerPos(giveplayerid, x, y, z);
  3561.     if(!IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) return SendClientMessage(playerid, COLOR_GREY, "You are not close enough to the player.");
  3562.     if(giveplayerid == playerid) return SendClientMessage(playerid, -1, "You can not drag yourself");
  3563.     if(GetPVarInt(giveplayerid, "Cuffed") == 0) return SendClientMessage(playerid, -1, "Player is not cuffed.");
  3564.     //
  3565.     if(GetPVarInt(giveplayerid, "Dragged") == 1)
  3566.     {
  3567.         beingdragged[giveplayerid] = -1;
  3568.         format(string, sizeof(string), "* %s has stopped dragging %s.", GetName(playerid), GetName(giveplayerid));
  3569.         ProxDetector(30, playerid, string, COLOR_PURPLE);
  3570.         SetPVarInt(giveplayerid, "Dragged", 0);
  3571.         return 1;
  3572.     }
  3573.     beingdragged[giveplayerid] = playerid;
  3574.     SetPVarInt(giveplayerid, "Dragged", 1);
  3575.     format(string, sizeof(string), "* %s is dragging %s.", GetName(playerid), GetName(giveplayerid));
  3576.     ProxDetector(30, playerid, string, COLOR_PURPLE);
  3577.     return 1;
  3578. }
  3579.  
  3580. CMD:dragged(playerid, params[])
  3581. {
  3582.     new str[128];
  3583.     format(str, 128, "Dragged = %i", beingdragged[playerid]);
  3584.     SendClientMessage(playerid, COLOR_CYAN, str);
  3585.     return 1;
  3586. }
  3587. CMD:cuff(playerid, params[])
  3588. {
  3589.     if(PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, -1, "You are not in the LSPD.");
  3590.     new string[128], giveplayerid;
  3591.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [playerid/partofname]");
  3592.     if(giveplayerid == playerid) return SendClientMessage(playerid, -1, "You can't cuff yourself");
  3593.     if(GetPVarInt(giveplayerid, "Restrained") == 0) return SendClientMessage(playerid, -1, "Player is not restrained.");
  3594.     SetPVarInt(giveplayerid, "Cuffed", 1);
  3595.     SetPlayerSkin(giveplayerid, GetPlayerSkin(giveplayerid));
  3596.     ClearAnimations(giveplayerid);
  3597.     TogglePlayerControllable(giveplayerid, 0);
  3598.     format(string, sizeof(string), "* %s has cuffed %s.", GetName(playerid), GetName(giveplayerid));
  3599.     ProxDetector(30, playerid, string, COLOR_PURPLE);
  3600.     SendClientMessage(giveplayerid, COLOR_CYAN, "You are cuffed.");
  3601.     SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
  3602.  
  3603.     return 1;
  3604. }
  3605.  
  3606. CMD:uncuff(playerid, params[])
  3607. {
  3608.     if(PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, -1, "You are not in the LSPD.");
  3609.     new string[128], giveplayerid;
  3610.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /uncuff [playerid/partofname]");
  3611.     if(giveplayerid == playerid) return SendClientMessage(playerid, -1, "You can't uncuff yourself");
  3612.     if(GetPVarInt(giveplayerid, "Cuffed") == 0) return SendClientMessage(playerid, -1, "That player is not cuffed.");
  3613.     SetPVarInt(giveplayerid, "Cuffed", 0);
  3614.     SetPVarInt(giveplayerid, "Restrained", 0);
  3615.     TogglePlayerControllable(giveplayerid, 1);
  3616.     format(string, sizeof(string), "* %s has uncuffed %s.", GetName(playerid), GetName(giveplayerid));
  3617.     ProxDetector(30, playerid, string, COLOR_PURPLE);
  3618.     SendClientMessage(giveplayerid, COLOR_CYAN, "You have been uncuffed.");
  3619.     SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_NONE);
  3620.     ClearAnimations(giveplayerid);
  3621.     SetPlayerSkin(giveplayerid, GetPlayerSkin(giveplayerid));
  3622.     beingdragged[giveplayerid] = -1;
  3623.     SetPVarInt(giveplayerid, "Dragged", 0);
  3624.     return 1;
  3625. }
  3626.  
  3627. CMD:detain(playerid, params[])
  3628. {
  3629.     if(PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, -1, "You are not in the LSPD.");
  3630.     new str[128];
  3631.     new giveplayerid, seat;
  3632.     if(sscanf(params, "ui", giveplayerid, seat)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /detain [playerid/partofname] [seat 1-3]");
  3633.     if(GetPVarInt(giveplayerid, "Cuffed") == 0) return SendClientMessage(playerid, -1, "That player is not cuffed.");
  3634.     if(cardetain[playerid] == -1) return SendClientMessage(playerid, -1, "You have not entered any car to detain the player in.");
  3635.     if(seat == 0) return SendClientMessage(playerid, -1, "You can not detain someone in the driver seat.");
  3636.     if(seat > 3) return SendClientMessage(playerid, -1, "Valid seat ids are 1-3.");
  3637.     SetPVarInt(giveplayerid, "Dragged", 0);
  3638.     beingdragged[giveplayerid] = -1;
  3639.     RemovePlayerFromVehicle(giveplayerid);
  3640.     GetPlayerPos(giveplayerid, PlayerInfo[giveplayerid][pX], PlayerInfo[giveplayerid][pY], PlayerInfo[giveplayerid][pZ]);
  3641.     SetPlayerPos(giveplayerid, PlayerInfo[giveplayerid][pX], PlayerInfo[giveplayerid][pX], PlayerInfo[giveplayerid][pY]+1);
  3642.     ClearAnimations(giveplayerid);
  3643.     SetPlayerSkin(giveplayerid, GetPlayerSkin(giveplayerid));
  3644.     PutPlayerInVehicle(giveplayerid, cardetain[playerid], seat);
  3645.     format(str, sizeof(str), "* %s has detained %s.", GetName(playerid), GetName(giveplayerid));
  3646.     ProxDetector(30, playerid, str, COLOR_PURPLE);
  3647.     return 1;
  3648. }
  3649.  
  3650.  
  3651. CMD:su(playerid, params[])
  3652. {
  3653.     new string[128], crime[128], giveplayerid;
  3654.     if(PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, -1, "You are not in the LSPD.");
  3655.     if(sscanf(params, "us[128]", giveplayerid, crime)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /su [playerid/partofname] [crime]");
  3656.     if(PlayerInfo[giveplayerid][pWanted] > 5) return SendClientMessage(playerid, -1, "The suspect is already most wanted.");
  3657.     //if(giveplayerid == playerid) return SendClientMessage(playerid, -1, "You can not do that on yourself.");
  3658.     format(string, sizeof(string), "ALL UNITS: Officer %s has placed a charge on %s. Crime: %s.", GetName(playerid), GetName(giveplayerid), crime);
  3659.     SendClientMessageToLSPD(RADIO, string);
  3660.     format(string, sizeof(string), "You have recieved a charge from officer %s, crime: %s.", GetName(playerid), crime);
  3661.     SendClientMessage(giveplayerid, COLOR_CYAN, string);
  3662.     if(PlayerInfo[giveplayerid][pWanted] == 0)
  3663.     {
  3664.         format(PlayerInfo[giveplayerid][pW1], sizeof(PlayerInfo), "%s", crime);
  3665.     }
  3666.     if(PlayerInfo[giveplayerid][pWanted] == 1)
  3667.     {
  3668.         format(PlayerInfo[giveplayerid][pW2], sizeof(PlayerInfo), "%s", crime);
  3669.     }
  3670.     if(PlayerInfo[giveplayerid][pWanted] == 2)
  3671.     {
  3672.         format(PlayerInfo[giveplayerid][pW3], sizeof(PlayerInfo), "%s", crime);
  3673.     }
  3674.     if(PlayerInfo[giveplayerid][pWanted] == 3)
  3675.     {
  3676.         format(PlayerInfo[giveplayerid][pW4], sizeof(PlayerInfo), "%s", crime);
  3677.     }
  3678.     if(PlayerInfo[giveplayerid][pWanted] == 4)
  3679.     {
  3680.        format(PlayerInfo[giveplayerid][pW5], sizeof(PlayerInfo), "%s", crime);
  3681.     }
  3682.     if(PlayerInfo[giveplayerid][pWanted] == 5)
  3683.     {
  3684.         format(PlayerInfo[giveplayerid][pW6], sizeof(PlayerInfo), "%s", crime);
  3685.     }
  3686.     PlayerInfo[giveplayerid][pWanted] += 1;
  3687.     PlayerInfo[giveplayerid][pTotWanted] += 1;
  3688.     return 1;
  3689. }
  3690.  
  3691. CMD:clearwanted(playerid, params[])
  3692. {
  3693.     new giveplayerid, str[128];
  3694.     if(PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, -1, "You are not in the LSPD.");
  3695.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /clearwanted [playerid/partofname]");
  3696.     PlayerInfo[giveplayerid][pWanted] = 0;
  3697.     new ok[56] = "None";
  3698.     PlayerInfo[giveplayerid][pW1] = ok[50];
  3699.     PlayerInfo[giveplayerid][pW2] = ok[50];
  3700.     PlayerInfo[giveplayerid][pW3] = ok[50];
  3701.     PlayerInfo[giveplayerid][pW4] = ok[50];
  3702.     PlayerInfo[giveplayerid][pW5] = ok[50];
  3703.     PlayerInfo[giveplayerid][pW6] = ok[50];
  3704.     format(str, 128, "Your wanted record have been cleared by officer %s.", GetName(playerid));
  3705.     SendClientMessage(giveplayerid, COLOR_CYAN, str);
  3706.     format(str, 128, "You have cleared %s's wanted record", GetName(giveplayerid));
  3707.     SendClientMessage(giveplayerid, COLOR_CYAN, str);
  3708.     format(str, 128, "%s have cleared %s's wanted record", GetName(playerid), GetName(giveplayerid));
  3709.     SendClientMessageToLSPD(RADIO, str);
  3710.     return 1;
  3711. }
  3712.  
  3713. CMD:tazer(playerid, params[])
  3714. {
  3715.     new string[128];
  3716.     if(PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, COLOR_GRAD1, "You are not a Law Enforcement Officer.");
  3717.     if(tazer[playerid] == 0)
  3718.     {
  3719.             waitcheck[playerid] = 1;
  3720.             if(waitcheck[playerid] == 2)
  3721.             {
  3722.                 waitcheck[playerid] = 0;
  3723.             }
  3724.             tazerreplace[playerid] = PlayerInfo[playerid][pGuns][2];
  3725.             if(PlayerInfo[playerid][pGuns][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pGuns][2]);
  3726.             format(string, sizeof(string), "* %s unholsters their tazer.", GetPlayerNameEx(playerid));
  3727.             ProxDetector(30, playerid, string, COLOR_PURPLE);
  3728.             GivePlayerValidWeapon(playerid, 23, 60000);
  3729.             Log("/logs/weapon.txt", string);
  3730.             tazer[playerid] = 1;
  3731.         } else {
  3732.             waitcheck[playerid] = 1;
  3733.             if(waitcheck[playerid] == 2)
  3734.             {
  3735.                 waitcheck[playerid] = 0;
  3736.             }
  3737.             RemovePlayerWeapon(playerid, 23);
  3738.             GivePlayerValidWeapon(playerid, tazerreplace[playerid], 60000);
  3739.             format(string, sizeof(string), "* %s holsters their tazer.", GetPlayerNameEx(playerid));
  3740.             ProxDetector(30, playerid, string, COLOR_PURPLE);
  3741.             tazer[playerid] = 0;
  3742.             Log("/logs/weapon.txt", string);
  3743.             return 1;
  3744.     }
  3745.     return 1;
  3746. }
  3747.  
  3748. CMD:mole(playerid, params[])
  3749. {
  3750.     if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  3751.     if(AdminDuty[playerid] == 0 && PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1, "You are not on duty as an admin");
  3752.     new say[126];
  3753.     if(sscanf(params, "s[126]", say)) return SendClientMessage(playerid, -1, "USAGE: /mole [text]");
  3754.     new str[126];
  3755.     format(str, sizeof(str), "SMS: %s, Sender: Mole (555)", say);
  3756.     SendClientMessageToAll(COLOR_YELLOW, str);
  3757.     return 1;
  3758. }
  3759.  
  3760.  
  3761. CMD:unban(playerid, params[])
  3762. {
  3763.     if(PlayerInfo[playerid][pAdmin] >= 4)
  3764.     {
  3765.         new string[128], giveplayername[MAX_PLAYER_NAME];
  3766.         if(sscanf(params, "s[128]", giveplayername)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [exact name]");
  3767.         format(string,sizeof(string),PATH,giveplayername);
  3768.         if(!fexist(string)) return SendClientMessage(playerid, COLOR_GREY, "Account does not exist.");
  3769.         new INI:File = INI_Open(string);
  3770.         INI_SetTag(File,"data");
  3771.         INI_WriteInt(File,"Banned",0);
  3772.         INI_Close(File);
  3773.         new amsg[56];
  3774.         format(amsg, 56, "AdmCmd: %s has unbanned %s.", GetName(playerid), params);
  3775.         SendClientMessageToAdmins(COLOR_LIGHTRED, amsg, 1);
  3776.         Log("logs/ban.txt", amsg);
  3777.         return 1;
  3778.     }
  3779.     return 1;
  3780. }
  3781.  
  3782. CMD:setvw(playerid, params[])
  3783. {
  3784.     if(PlayerInfo[playerid][pAdmin] >= 2)
  3785.     {
  3786.         if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  3787.         {
  3788.             SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  3789.             return 1;
  3790.         }
  3791.         new string[128], giveplayerid, vw;
  3792.         if(sscanf(params, "ud", giveplayerid, vw)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setvw [playerid/partofname] [virtual world]");
  3793.  
  3794.         if(IsPlayerConnected(giveplayerid))
  3795.         {
  3796.             PlayerInfo[giveplayerid][pVW] =  vw;
  3797.             SetPlayerVirtualWorld(giveplayerid,  vw);
  3798.             format(string, sizeof(string), "You have set %s's virtual world to %d.", GetPlayerNameEx(giveplayerid),  vw);
  3799.             SendClientMessage(playerid, COLOR_GRAD2, string);
  3800.         }
  3801.     }
  3802.     else
  3803.     {
  3804.         SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
  3805.     }
  3806.     return 1;
  3807. }
  3808.  
  3809. CMD:setint(playerid, params[])
  3810. {
  3811.     if(PlayerInfo[playerid][pAdmin] >= 2)
  3812.     {
  3813.         if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  3814.         {
  3815.             SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  3816.             return 1;
  3817.         }
  3818.  
  3819.         new string[128], giveplayerid, int;
  3820.         if(sscanf(params, "ud", giveplayerid, int)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setint [playerid/partofname] [interiorid]");
  3821.  
  3822.         if(IsPlayerConnected(giveplayerid))
  3823.         {
  3824.             if(PlayerInfo[giveplayerid][pAdmin] <= PlayerInfo[playerid][pAdmin]) {
  3825.                 PlayerInfo[giveplayerid][pInt] = int;
  3826.                 SetPlayerInterior(giveplayerid, int);
  3827.                 format(string, sizeof(string), "You have set %s's interior to %d.", GetPlayerNameEx(giveplayerid), int);
  3828.                 SendClientMessage(playerid, COLOR_GRAD2, string);
  3829.             } else return SendClientMessage(playerid, COLOR_GRAD1, "You can't execute this command on equal or higher level admins.");
  3830.         }
  3831.     }
  3832.     else
  3833.     {
  3834.         SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
  3835.     }
  3836.     return 1;
  3837. }
  3838.  
  3839. CMD:doornear(playerid, params[])
  3840. {
  3841.     if(PlayerInfo[playerid][pAdmin] >= 4)
  3842.     {
  3843.         if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  3844.         {
  3845.             SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  3846.             return 1;
  3847.         }
  3848.         new Float:X, Float:Y, Float:Z;
  3849.         GetPlayerPos(playerid, X, Y, Z);
  3850.         for(new i;i<MAX_DDOORS;i++)
  3851.         {
  3852.              if(IsPlayerInRangeOfPoint(playerid, 15, DoorInfo[i][ddExteriorX], DoorInfo[i][ddExteriorY], DoorInfo[i][ddExteriorZ]))
  3853.             {
  3854.                 if(DoorInfo[i][ddName] != 0)
  3855.                 {
  3856.                     new string[128];
  3857.                     format(string, sizeof(string), "Door ID %d | %f from you", i, GetDistance(DoorInfo[i][ddExteriorX], DoorInfo[i][ddExteriorY], DoorInfo[i][ddExteriorZ], X, Y, Z));
  3858.                     SendClientMessage(playerid, COLOR_WHITE, string);
  3859.                 }
  3860.             }
  3861.         }
  3862.     }
  3863.     else
  3864.     {
  3865.         SendClientMessage(playerid, COLOR_GRAD2, "You're not authorized to use that command!");
  3866.     }
  3867.     return 1;
  3868. }
  3869.  
  3870. CMD:doornext(playerid, params[])
  3871. {
  3872.     if(PlayerInfo[playerid][pAdmin] >= 4)
  3873.     {
  3874.         if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  3875.         {
  3876.             SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  3877.             return 1;
  3878.         }
  3879.         for(new x;x<MAX_DDOORS;x++)
  3880.         {
  3881.             if(DoorInfo[x][ddName] == 0 && DoorInfo[x][ddInteriorX] == 0 && DoorInfo[x][ddInteriorY] == 0 && DoorInfo[x][ddInteriorZ] == 0)
  3882.             {
  3883.                 new string[128];
  3884.                 format(string, sizeof(string), "Next dynamic door: %d", x);
  3885.                 SendClientMessage(playerid, COLOR_WHITE, string);
  3886.                 break;
  3887.             }
  3888.         }
  3889.     }
  3890.     else
  3891.     {
  3892.         SendClientMessage(playerid, COLOR_GRAD2, "You're not authorized to use that command!");
  3893.         return 1;
  3894.     }
  3895.     return 1;
  3896. }
  3897.  
  3898. CMD:doorname(playerid, params[])
  3899. {
  3900.     if(PlayerInfo[playerid][pAdmin] < 4)
  3901.     {
  3902.         SendClientMessage(playerid, COLOR_GRAD2, "You're not authorized to use that command!");
  3903.         return 1;
  3904.     }
  3905.     if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  3906.     {
  3907.         SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  3908.         return 1;
  3909.     }
  3910.  
  3911.     new string[128], doorid, doorname[128];
  3912.  
  3913.     if(sscanf(params, "ds[128]", doorid, doorname)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /doorname [doorid] [name]");
  3914.  
  3915.     if(DoorInfo[doorid][ddNotEditable] == 1)
  3916.     {
  3917.         SendClientMessage(playerid, COLOR_WHITE, "This door has been set to non-editable by a Level 6 Admin, contact them if you wish to make any changes.");
  3918.         return 1;
  3919.     }
  3920.  
  3921.     format(DoorInfo[doorid][ddName], 128, "%s", doorname);
  3922.     SendClientMessage(playerid, COLOR_WHITE, "You have changed the name of the door!");
  3923.     //if(IsValidDynamicPickup(DoorInfo[doorid][ddPickupID])) DestroyPickup(DoorInfo[doorid][ddPickupID]);
  3924.     DestroyPickup(DoorInfo[doorid][ddPickupID]);
  3925.     if(IsValidDynamic3DTextLabel(DoorInfo[doorid][ddTextID])) DestroyDynamic3DTextLabel(DoorInfo[doorid][ddTextID]);
  3926.     CreateDynamicDoor(doorid);
  3927.     SaveDynamicDoors();
  3928.  
  3929.     format(string, sizeof(string), "%s has edited DoorID %d's Name to %s.", GetPlayerNameEx(playerid), doorid, doorname);
  3930.     return 1;
  3931. }
  3932.  
  3933. CMD:lockdoor(playerid, params[])
  3934. {
  3935.     for(new i = 0; i < sizeof(DoorInfo); i++) {
  3936.         if(IsPlayerInRangeOfPoint(playerid,3.0,DoorInfo[i][ddExteriorX], DoorInfo[i][ddExteriorY], DoorInfo[i][ddExteriorZ]) && PlayerInfo[playerid][pVW] == DoorInfo[i][ddExteriorVW] || IsPlayerInRangeOfPoint(playerid,3.0,DoorInfo[i][ddInteriorX], DoorInfo[i][ddInteriorY], DoorInfo[i][ddInteriorZ]) && PlayerInfo[playerid][pVW] == DoorInfo[i][ddInteriorVW]) {
  3937.             if(DoorInfo[i][ddPass] < 1)
  3938.                 return SendClientMessage(playerid, COLOR_GREY, "This door isn't allowed to be locked");
  3939.             if(strcmp(DoorInfo[i][ddPass], "None", true) == 0)
  3940.                 return SendClientMessage(playerid, COLOR_GREY, "This door isn't allowed to be locked");
  3941.  
  3942.             ShowPlayerDialogEx(playerid, DOORLOCK, DIALOG_STYLE_INPUT, "Door Security","Enter the password for this door","Login","Cancel");
  3943.             SetPVarInt(playerid, "Door", i);
  3944.         }
  3945.     }
  3946.     return 1;
  3947. }
  3948.  
  3949. CMD:switchfac(playerid, params[])
  3950. {
  3951.     if(PlayerInfo[playerid][pAdmin] > 2)
  3952.     {
  3953.             if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  3954.             {
  3955.                 SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  3956.                 return 1;
  3957.             }
  3958.             new fac, str[126];
  3959.             if(sscanf(params, "i", fac)) return SendClientMessage(playerid, -1, "USAGE: /switchfac [faction id]");
  3960.             PlayerInfo[playerid][pFaction] = fac;
  3961.             format(str, sizeof(str), "You have switched faction to: %s.", GetFactionName(playerid));
  3962.             SendClientMessage(playerid, COLOR_CYAN, str);
  3963.     }
  3964.     return 1;
  3965. }
  3966. CMD:switchrank(playerid, params[])
  3967. {
  3968.     if(PlayerInfo[playerid][pAdmin] > 2)
  3969.     {
  3970.             if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  3971.             {
  3972.                 SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  3973.                 return 1;
  3974.             }
  3975.             new rank, str[126];
  3976.             if(sscanf(params, "i", rank)) return SendClientMessage(playerid, -1, "USAGE: /switchrank [rank]");
  3977.             format(str, sizeof(str), "You have switched rank to: %i.", rank);
  3978.             SendClientMessage(playerid, COLOR_CYAN, str);
  3979.             PlayerInfo[playerid][pFacRank] = rank;
  3980.     }
  3981.     return 1;
  3982. }
  3983.  
  3984. CMD:a(playerid, params[])
  3985. {
  3986.     if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /a [text]");
  3987.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  3988.     new str[128], str2[128];
  3989.     if(sscanf(params, "s[128]", str)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /a [text]");
  3990.     format(str2, sizeof(str2), "Level %i Admin %s: %s", PlayerInfo[playerid][pAdmin], GetName(playerid), str);
  3991.     SendClientMessageToAdmins(COLOR_YELLOW, str2, 1);
  3992.     Log("logs/achat.txt", str2);
  3993.     return 1;
  3994. }
  3995. CMD:c(playerid, params[])
  3996. {
  3997.     if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /c [text]");
  3998.     if(PlayerInfo[playerid][pHelper] < 2 && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  3999.     new str[128], str2[128];
  4000.     if(sscanf(params, "s[128]", str)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /c [text]");
  4001.     if(PlayerInfo[playerid][pHelper] > 1)
  4002.     {
  4003.         format(str2, sizeof(str2), "Super Helper %s: %s", GetName(playerid), str);
  4004.         SendClientMessageToHelpersEx(COLOR_CYAN, str2, 1);
  4005.     }
  4006.     if(PlayerInfo[playerid][pAdmin] > 1)
  4007.     {
  4008.         format(str2, sizeof(str2), "Level %i Admin %s: %s", PlayerInfo[playerid][pAdmin], GetName(playerid), str);
  4009.         SendClientMessageToHelpersEx(COLOR_CYAN, str2, 1);
  4010.     }
  4011.     Log("logs/helperchat.txt", str2);
  4012.     return 1;
  4013. }
  4014. CMD:revive(playerid, params[])
  4015. {
  4016.     new giveplayerid;
  4017.     if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  4018.     if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  4019.     {
  4020.         SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  4021.         return 1;
  4022.     }
  4023.     if(sscanf(params, "u", giveplayerid)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /revive [playerid/partofname]");
  4024.     if(isnull(params)) return 1;
  4025.     if(GetPVarInt(giveplayerid, "Injured") == 0) return SendClientMessage(playerid, COLOR_GREY, "Player is not injured.");
  4026.     SetPVarInt(giveplayerid, "Injured", 0);
  4027.     ClearAnimations(giveplayerid, 1);
  4028.     SetPlayerHealth(giveplayerid, 100);
  4029.     KillTimer(itimer[giveplayerid]);
  4030.     KillTimer(iitimer[giveplayerid]);
  4031.     SendClientMessage(giveplayerid, -1, "You were revived by an admin.");
  4032.     return 1;
  4033. }
  4034.  
  4035. CMD:sethp(playerid, params[])
  4036. {
  4037.     new giveplayerid, Float:HP, str[126];
  4038.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  4039.     if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  4040.     {
  4041.         SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  4042.         return 1;
  4043.     }
  4044.     if(sscanf(params, "uf", giveplayerid, HP)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethp [playerid/partofname] [hp]");
  4045.     SetPlayerHealth(giveplayerid, HP);
  4046.     format(str, 126, "You have set %s's health to %.2f", GetName(giveplayerid), HP);
  4047.     SendClientMessage(playerid, -1, str);
  4048.     return 1;
  4049. }
  4050.  
  4051. CMD:setarmor(playerid, params[])
  4052. {
  4053.     new giveplayerid, Float:HP, str[126];
  4054.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  4055.     if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  4056.     {
  4057.         SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  4058.         return 1;
  4059.     }
  4060.     if(sscanf(params, "uf", giveplayerid, HP)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setarmor [playerid/partofname] [armor]");
  4061.     skipacheck[playerid] = 2;
  4062.     PlayerInfo[giveplayerid][pArmor] = HP;
  4063.     SetPlayerArmour(giveplayerid, HP);
  4064.     format(str, 126, "You have set %s's armor to %.2f", GetName(giveplayerid), HP);
  4065.     SendClientMessage(playerid, -1, str);
  4066.     return 1;
  4067. }
  4068.  
  4069. CMD:makeadmin(playerid, params[])
  4070. {
  4071.     if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GRAD1, "Stop!");
  4072.     new giveid, admlvl, str[128];
  4073.     if(sscanf(params, "ui", giveid, admlvl)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid/partofname] [1-6]");
  4074.     if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid/partofname] [1-6]");
  4075.     PlayerInfo[giveid][pAdmin] = admlvl;
  4076.     format(str, sizeof(str), "%s has been made a level %i admin by %s.", GetName(giveid), PlayerInfo[giveid][pAdmin], GetName(playerid));
  4077.     SendClientMessageToAdmins(COLOR_LIGHTRED, str, 1);
  4078.     Log("logs/makeadmin.txt", str);
  4079.     return 1;
  4080. }
  4081.  
  4082. CMD:respawnvehicles(playerid, params[])
  4083. {
  4084.     SendClientMessageToAll(-1, "Respawning all cars in 10 seconds.");
  4085.     SetTimer("respawncars", 10000, false);
  4086.     return 1;
  4087. }
  4088.  
  4089. forward respawncars();
  4090. public respawncars()
  4091. {
  4092.     for(new i; i < MAX_VEHICLES; i++) if(!IsVehicleOccupied(i)) SetVehicleToRespawn(i);
  4093.     return 1;
  4094. }
  4095.  
  4096. CMD:ah(playerid, params[])
  4097. {
  4098.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "You are not an admin.");
  4099.     SendClientMessage(playerid, COLOR_GREY, "* = Not scripted yet");
  4100.     if(PlayerInfo[playerid][pAdmin] >= 1)
  4101.     SendClientMessage(playerid, COLOR_GREY, "ADMIN LEVEL 1: /a /spec /jail /kick /aduty /slap /ao /nrn /gotox /ar /tr");
  4102.     if(PlayerInfo[playerid][pAdmin] >= 2)
  4103.     SendClientMessage(playerid, COLOR_GREY, "ADMIN LEVEL 2: /ban /check /prison /mole");
  4104.     if(PlayerInfo[playerid][pAdmin] >= 3)
  4105.     SendClientMessage(playerid, COLOR_GREY, "ADMIN LEVEL 3: /switchfac /switchrank /revive /release /gotoid /gethere /fine");
  4106.     if(PlayerInfo[playerid][pAdmin] >= 4)
  4107.     SendClientMessage(playerid, COLOR_GREY, "ADMIN LEVEL 4: /dooredit /doornext /doorname /doornear /unban /sethp /setarmor /makehelper /unbanip /banip");
  4108.     SendClientMessage(playerid, COLOR_GREY, "ADMIN LEVEL 4: /givemoney /givegun /seteventpos /editevent /startevent /beginevent /announceevent /lockevent");
  4109.     if(PlayerInfo[playerid][pAdmin] >= 5)
  4110.     SendClientMessage(playerid, COLOR_GREY, "ADMIN LEVEL 5: /setadminname /respawnvehicles");
  4111.     if(PlayerInfo[playerid][pAdmin] >= 6)
  4112.     SendClientMessage(playerid, COLOR_GREY, "ADMIN LEVEL 6: /makeadmin");
  4113.     return 1;
  4114. }
  4115. CMD:drop(playerid, params[])
  4116. {
  4117.     new choice[56];
  4118.     if(sscanf(params, "s", choice)) { SendClientMessage(playerid, -1, "USAGE: /drop [choice]"); SendClientMessage(playerid, -1, "Choices: materials, weapons"); return 1; }
  4119.     if(strcmp(choice, "materials", true) == 0)
  4120.     {
  4121.         new str[126];
  4122.         format(str, sizeof(str), "%s has dropped their materials.", GetName(playerid));
  4123.         ProxDetector(30, playerid, str, COLOR_PURPLE);
  4124.         format(str, sizeof(str), "You have dropped %i materials.", PlayerInfo[playerid][pMaterials]);
  4125.         SendClientMessage(playerid, -1, str);
  4126.         PlayerInfo[playerid][pMaterials] = 0;
  4127.         return 1;
  4128.     }
  4129.     if(strcmp(choice, "weapons", true) == 0)
  4130.     {
  4131.         new str[126];
  4132.         format(str, sizeof(str), "%s has dropped their weapons.", GetName(playerid));
  4133.         ProxDetector(30, playerid, str, COLOR_PURPLE);
  4134.         SendClientMessage(playerid, -1, "You have dropped your weapons.");
  4135.         ResetPlayerWeapons(playerid);
  4136.         ResetPlayerWeaponsEx(playerid);
  4137.         return 1;
  4138.     }
  4139.     return 1;
  4140. }
  4141. CMD:help(playerid, params[])
  4142. {
  4143.     SendClientMessage(playerid, COLOR_GREY, "GENERAL: /me /do /s /help /join /quitjob /kill /bail /time /findboatmatrun");
  4144.     SendClientMessage(playerid, COLOR_GREY, "GENERAL: /togooc /drop weapons /tognewb /togooc /pm /contract");
  4145.     SendClientMessage(playerid, COLOR_GREY, "VEHICLE: /park /v(de)spawn /vlist /vdelete /spraycar");
  4146.     SendClientMessage(playerid, COLOR_GREY, "HELP: /n(ewb) /report");
  4147.     if(PlayerInfo[playerid][pHelper] > 1) { SendClientMessage(playerid, COLOR_GREY, "LEVEL 2 HELPER: /nmute /nrn"); }
  4148.     if(PlayerInfo[playerid][pFaction] == 1)
  4149.     {
  4150.         SendClientMessage(playerid, COLOR_GREY, "LSPD: /m /cuff /detain /arrest /tazer /drag /su /quitfaction");
  4151.         SendClientMessage(playerid, COLOR_GREY, "LSPD: /clearwanted /r /d /badge /deploycade(2) /deployspike /destroycade(s) /destroyspike(s)");
  4152.         if(PlayerInfo[playerid][pFacRank] >= 4)
  4153.         {
  4154.             SendClientMessage(playerid, COLOR_GREY, "LSPD: /div");
  4155.         }
  4156.         if(PlayerInfo[playerid][pFacRank] >= 5)
  4157.         {
  4158.             SendClientMessage(playerid, COLOR_GREY, "LSPD: /giverank /invite");
  4159.  
  4160.         }
  4161.     }
  4162.     if(PlayerInfo[playerid][pFaction] == 3)
  4163.     {
  4164.         SendClientMessage(playerid, COLOR_GREY, "LSFMD: /acceptcall /load /deliver");
  4165.         {
  4166.             if(PlayerInfo[playerid][pFacRank] >= 4)
  4167.             {
  4168.                 SendClientMessage(playerid, COLOR_GREY, "LSFMD: /div");
  4169.             }
  4170.         }
  4171.     }
  4172.     if(PlayerInfo[playerid][pFaction] == 4)
  4173.     {
  4174.     SendClientMessage(playerid, COLOR_GREY, "HITMAN: /togdr /givemehit /accept hit /contracts /hstats");
  4175.     }
  4176.     if(PlayerInfo[playerid][pJob] == 1)
  4177.     SendClientMessage(playerid, COLOR_GREY, "JOB: /loadtruck /canceltruck");
  4178.     if(PlayerInfo[playerid][pJob] == 2)
  4179.     SendClientMessage(playerid, COLOR_GREY, "JOB: /guard*");
  4180.     if(PlayerInfo[playerid][pJob] == 3)
  4181.     SendClientMessage(playerid, COLOR_GREY, "JOB: /getmats /sellgun");
  4182.     if(PlayerInfo[playerid][pAdmin] >= 1)
  4183.     SendClientMessage(playerid, COLOR_GREY, "ADMIN: /ah");
  4184.     if(PlayerInfo[playerid][pHelper] >= 2)
  4185.     SendClientMessage(playerid, COLOR_GREY, "HELPER: /c /nrn");
  4186.     return 1;
  4187. }
  4188.  
  4189. CMD:ao(playerid, params[])
  4190. {
  4191.     new say[256];
  4192.     if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  4193.     if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /ao [text]");
  4194.     if(sscanf(params, "s[256]", say))
  4195.     {
  4196.     SendClientMessage(playerid, -1, "USAGE: /ao [text]");
  4197.     }
  4198.     new str[256];
  4199.     format(str, 256, "(( Administrator [OOC] %s says: %s ))", GetName(playerid), say);
  4200.     SendClientMessageToAll(COLOR_LIGHTRED, str);
  4201.     return 1;
  4202. }
  4203.  
  4204. CMD:o(playerid, params[])
  4205. {
  4206.     new say[256];
  4207.     if(togo[playerid] == 0) return SendClientMessage(playerid, COLOR_CYAN, "You have not enabled OOC chat. Type /togooc if you wish to toggle it.");
  4208.     if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /o [text]");
  4209.     if(sscanf(params, "s[256]", say))
  4210.     {
  4211.     SendClientMessage(playerid, -1, "USAGE: /o [text]");
  4212.     }
  4213.     new str[256];
  4214.     format(str, 256, "(( [OOC] %s says: %s ))", GetName(playerid), say);
  4215.     SCMTO(str);
  4216.     return 1;
  4217. }
  4218. CMD:togooc(playerid, params[])
  4219. {
  4220.     if(togo[playerid] == 0)
  4221.     {
  4222.     togo[playerid] = 1;
  4223.     SendClientMessage(playerid, COLOR_CYAN, "You have enabled OOC chat. (Type /o to chat.)");
  4224.     return 1;
  4225.     }
  4226.     if(togo[playerid] == 1)
  4227.     {
  4228.     togo[playerid] = 0;
  4229.     SendClientMessage(playerid, COLOR_CYAN, "You have disabled OOC chat. (Type /o to chat.)");
  4230.     return 1;
  4231.     }
  4232.     return 1;
  4233. }
  4234.  
  4235. CMD:tognewb(playerid, params[])
  4236. {
  4237.     if(tognewbie[playerid] == 0)
  4238.     {
  4239.     tognewbie[playerid] = 1;
  4240.     SendClientMessage(playerid, COLOR_GREY, "You have disabled newbie chat.");
  4241.     return 1;
  4242.     }
  4243.     if(tognewbie[playerid] == 1)
  4244.     {
  4245.     tognewbie[playerid] = 0;
  4246.     SendClientMessage(playerid, COLOR_GREY, "You have enabled newbie chat.");
  4247.     return 1;
  4248.     }
  4249.     return 1;
  4250. }
  4251.  
  4252. CMD:togdr(playerid, params[])
  4253. {
  4254.     if(PlayerInfo[playerid][pFaction] != 4) return SendClientMessage(playerid, -1, "You are not a hitman.");
  4255.     if(togdr[playerid] == 1)
  4256.     {
  4257.     togdr[playerid] = 0;
  4258.     SendClientMessage(playerid, COLOR_CYAN, "You have disabled department radio.");
  4259.     return 1;
  4260.     }
  4261.     if(togdr[playerid] == 0)
  4262.     {
  4263.     togdr[playerid] = 1;
  4264.     SendClientMessage(playerid, COLOR_CYAN, "You have enabled department radio.");
  4265.     return 1;
  4266.     }
  4267.     return 1;
  4268. }
  4269.  
  4270. CMD:m(playerid, params[])
  4271. {
  4272.     new
  4273.         string[128],
  4274.         action[100];
  4275.     if(PlayerInfo[playerid][pFaction] != 1 && 2 && 3)
  4276.     {
  4277.         SendClientMessage(playerid, COLOR_GREY, "You are not in a faction with a megaphone.");
  4278.         return 1;
  4279.     }
  4280.     if(sscanf(params, "s[100]", action))
  4281.     {
  4282.         SendClientMessage(playerid, -1, "USAGE: /m [text]");
  4283.         return 1;
  4284.     }
  4285.     else
  4286.     {
  4287.         format(string, sizeof(string), "[MEGAPHONE] %s: %s", GetName(playerid), action);
  4288.         ProxDetector(30, playerid, string, COLOR_YELLOW);
  4289.     }
  4290.     return 1;
  4291. }
  4292.  
  4293. CMD:d(playerid, params[])
  4294. {
  4295.     new string[128], text[100];
  4296.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2 && PlayerInfo[playerid][pFaction] != 3)
  4297.     {
  4298.         SendClientMessage(playerid, COLOR_GREY, "You are not in a faction with a department radio.");
  4299.         return 1;
  4300.     }
  4301.     if(sscanf(params, "s[100]", text))
  4302.     {
  4303.         SendClientMessage(playerid, -1, "USAGE: /d(epartment chat) [text]");
  4304.         return 1;
  4305.     }
  4306.     if(PlayerInfo[playerid][pFacDiv] != 0)
  4307.     {
  4308.         format(string, sizeof(string), "* %s (%s) %s: %s", GetRankName(playerid), GetDivisionName(playerid), GetName(playerid), text);
  4309.     }
  4310.     else
  4311.     {
  4312.         format(string, sizeof(string), "* %s %s: %s", GetRankName(playerid), GetName(playerid), text);
  4313.     }
  4314.     SendClientMessageToDepartments(DEPTRADIO, string);
  4315.     Log("/logs/radio.txt", string);
  4316.     return 1;
  4317. }
  4318.  
  4319. CMD:invite(playerid, params[])
  4320. {
  4321.     new giveplayerid, str[126];
  4322.     if(PlayerInfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
  4323.     if(PlayerInfo[playerid][pFacRank] < 6 && PlayerInfo[playerid][pFacLeader] != PlayerInfo[playerid][pFaction]) return SendClientMessage(playerid, COLOR_GREY, "You are not rank 6 or have leadership powers.");
  4324.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /invite [playerid/partofname]");
  4325.     if(PlayerInfo[giveplayerid][pFaction] != 0) return SendClientMessage(playerid, COLOR_GREY, "The specified player is already in a faction.");
  4326.     invitedby[giveplayerid] = playerid;
  4327.     invitedto[giveplayerid] = PlayerInfo[playerid][pFaction];
  4328.     format(str, sizeof(str), "%s has invited you to the faction %s. (/accept invite to accept.)", GetName(playerid), GetFactionNameEx(PlayerInfo[playerid][pFaction]));
  4329.     SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4330.     format(str, sizeof(str), "You have invited %s to %s.", GetName(giveplayerid), GetFactionNameEx(PlayerInfo[playerid][pFaction]));
  4331.     SendClientMessage(playerid, COLOR_CYAN, str);
  4332.     format(str, sizeof(str), "%s has invited %s to %s.", GetName(playerid), GetName(giveplayerid), GetFactionNameEx(PlayerInfo[playerid][pFaction]));
  4333.     Log("/logs/invite.txt", str);
  4334.     return 1;
  4335. }
  4336.  
  4337. CMD:uninvite(playerid, params[])
  4338. {
  4339.     new giveplayerid, str[126];
  4340.     if(PlayerInfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
  4341.     if(PlayerInfo[playerid][pFacRank] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not above rank 5.");
  4342.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /uninvite [playerid/partofname]");
  4343.     if(PlayerInfo[giveplayerid][pFaction] != PlayerInfo[playerid][pFaction]) return SendClientMessage(playerid, COLOR_GREY, "The specified player is not in your faction.");
  4344.     format(str, sizeof(str), "%s has removed you from %s.", GetName(playerid), GetFactionNameEx(PlayerInfo[playerid][pFaction]));
  4345.     SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4346.     format(str, sizeof(str), "You have removed %s to %s.", GetName(giveplayerid), GetFactionNameEx(PlayerInfo[playerid][pFaction]));
  4347.     SendClientMessage(playerid, COLOR_CYAN, str);
  4348.     format(str, sizeof(str), "%s has uninvited %s from %s as a rank %i.", GetName(playerid), GetName(giveplayerid), GetFactionNameEx(PlayerInfo[playerid][pFaction]), PlayerInfo[playerid][pFacRank]);
  4349.     PlayerInfo[giveplayerid][pFaction] = 0;
  4350.     PlayerInfo[giveplayerid][pFacRank] = 0;
  4351.     PlayerInfo[giveplayerid][pFacDiv] = 0;
  4352.     SetPlayerColor(giveplayerid, 0xFFFFFF00);
  4353.     ShowPlayerDialog(giveplayerid, DIALOG_UNINVITESKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Skin change",""COL_WHITE"Select a skin to use. Valid skin IDs are 0 to 299.","Change","No");
  4354.     Log("/logs/invite.txt", str);
  4355.     return 1;
  4356. }
  4357.  
  4358. CMD:gov(playerid, params[])
  4359. {
  4360.     new say[126], str[126];
  4361.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2 && PlayerInfo[playerid][pFaction] != 3) return SendClientMessage(playerid, COLOR_GREY, "You don't have access to this command.");
  4362.     if(PlayerInfo[playerid][pFacRank] < 5) return SendClientMessage(playerid, COLOR_GREY, "You don't have access to this command.");
  4363.     if(sscanf(params, "s[126]", say)) return SendClientMessage(playerid, -1, "USAGE: /gov [text]");
  4364.     format(str, sizeof(str), "%s %s %s: %s", GetFactionName(playerid), GetRankName(playerid), GetName(playerid), say);
  4365.     SendClientMessageToAll(COLOR_GREEN, "|______________GOVERNMENT ANNOUNCEMENT______________|");
  4366.     SendClientMessageToAll(COLOR_TWBLUE, str);
  4367.     SendClientMessageToAll(COLOR_GREEN, "|___________________________________________________|");
  4368.     return 1;
  4369. }
  4370.  
  4371. CMD:givegun(playerid, params[])
  4372. {
  4373.     new giveplayerid, gun;
  4374.     if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  4375.     if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  4376.     {
  4377.         SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  4378.         return 1;
  4379.     }
  4380.     if(sscanf(params, "ui", giveplayerid, gun)) return SendClientMessage(playerid, -1, "USAGE: /givegun [playerid/partofname] [weaponid]");
  4381.     SendClientMessage(playerid, -1, "Gave player gun.");
  4382.     SendClientMessage(giveplayerid, -1, "Given gun.");
  4383.     GivePlayerValidWeapon(giveplayerid, gun, 999999);
  4384.     return 1;
  4385. }
  4386.  
  4387.  
  4388. CMD:findboatmatrun(playerid, params[])
  4389. {
  4390.     if(CPT[playerid] < 1) return SendClientMessage(playerid, -1, "You currently have a checkpoint, please /destroycheckpoint.");
  4391.     SetPlayerCheckpoint(playerid, 2099.64, -105.84, 0.68, 5);
  4392.     return 1;
  4393. }
  4394.    
  4395.  
  4396.  
  4397. CMD:accept(playerid, params[])
  4398. {
  4399.     new choice[56];
  4400.     if(sscanf(params, "s", choice)) { SendClientMessage(playerid, -1, "USAGE: /accept [choice]"); SendClientMessage(playerid, -1, "Choices: invite, wep"); return 1; }
  4401.     if(strcmp(choice, "hit", true) == 0)
  4402.     {
  4403.         new str[126];
  4404.         if(PlayerInfo[playerid][pFaction] != 4) return SendClientMessage(playerid, -1, "You are not in the Hitman Agency.");
  4405.         if(GetPVarInt(playerid, "givemehit") == -1) return SendClientMessage(playerid, -1, "No-one has offered you a contract.");
  4406.         SetPVarInt(playerid, "acceptcontract", GetPVarInt(playerid, "givemehit"));
  4407.         format(str, sizeof(str), "Hitman %s has accepted the hit on %s.", GetName(playerid), GetName(GetPVarInt(playerid, "givemehit")));
  4408.         SendClientMessageToHA(COLOR_YELLOW, str);
  4409.         SendClientMessageToAll(-1, str);
  4410.         return 1;
  4411.     }
  4412.     if(strcmp(choice, "vest", true) == 0)
  4413.     {
  4414.         new offeredby = GetPVarInt(playerid, "OfferedBy");
  4415.         new price = GetPVarInt(playerid, "VestPrice");
  4416.         if(GetPVarInt(playerid, "OfferedBy") == -1) return SendClientMessage(playerid, COLOR_GREY, "Nobody has offered you a vest.");
  4417.         if(GetPVarInt(playerid, "VestPrice") == 0) return SendClientMessage(playerid, COLOR_GREY, "Nobody has offered you a vest."); // just in case someone finds an exploit.
  4418.         if(PlayerInfo[playerid][pCash] < price) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough cash.");
  4419.         new Float:armor;
  4420.         GetPlayerArmour(playerid, armor);
  4421.         if(armor > 49) return SendClientMessage(playerid, COLOR_GREY, "You can't wear another vest as you already have one.");
  4422.         PlayerInfo[playerid][pArmor] = 50;
  4423.         SetPlayerArmour(playerid, 50);
  4424.         PlayerInfo[playerid][pCash] -= price;
  4425.         PlayerInfo[offeredby][pCash] += price;
  4426.         SetPVarInt(playerid, "VestPrice", 0);
  4427.         SetPVarInt(playerid, "OfferedBy", 0);
  4428.         return 1;
  4429.     }
  4430.     if(strcmp(choice, "invite", true) == 0)
  4431.     {
  4432.         if(invitedto[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "You have not been invited to join any faction.");
  4433.         new str[126];
  4434.         format(str, sizeof(str), "You have accepted the invite from %s to %s.", GetName(invitedby[playerid]), GetFactionNameEx(invitedto[playerid]));
  4435.         PlayerInfo[playerid][pFaction] = invitedto[playerid];
  4436.         PlayerInfo[playerid][pFacRank] = 0;
  4437.         PlayerInfo[playerid][pFacDiv] = 0;
  4438.         SendClientMessage(playerid, COLOR_CYAN, str);
  4439.         format(str, sizeof(str), "%s has accepted the invitation to join %s.", GetName(playerid), GetFactionName(PlayerInfo[playerid][pFaction]));
  4440.         SendClientMessage(invitedby[playerid], COLOR_CYAN, str);
  4441.         invitedby[playerid] = -1;
  4442.         invitedto[playerid] = 0;
  4443.         return 1;
  4444.     }
  4445.     if(strcmp(choice, "wep", true) == 0)
  4446.     {
  4447.         if(weaponbeingoffered[playerid] == 0) return SendClientMessage(playerid, COLOR_GRAD1, "No-one has offered you a weapon.");
  4448.         if(beingofferedby[playerid] > -1)
  4449.         {
  4450.             new str[128];
  4451.             waitcheck[playerid] = 1;
  4452.             if(waitcheck[playerid] == 2)
  4453.             waitcheck[playerid] = 0;
  4454.             GivePlayerValidWeapon(playerid, weaponbeingoffered[playerid], 60000);
  4455.             format(str, sizeof(str), "%s has accepted the weapon.", GetName(playerid));
  4456.             SendClientMessage(beingofferedby[playerid], COLOR_CYAN, str);
  4457.             format(str, sizeof(str), "You have accepted the weapon from %s.", GetName(beingofferedby[playerid]));
  4458.             SendClientMessage(beingofferedby[playerid], COLOR_CYAN, str);
  4459.             PlayerInfo[beingofferedby[playerid]][pWDealerSkill] += 1;
  4460.             beingofferedby[playerid] = -1;
  4461.             weaponbeingoffered[playerid] = 0;
  4462.             if(weaponbeingoffered[playerid] == 23)
  4463.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 100;
  4464.             if(weaponbeingoffered[playerid] == 22)
  4465.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 150;
  4466.             if(weaponbeingoffered[playerid] == 25)
  4467.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 200;
  4468.             if(weaponbeingoffered[playerid] == 29)
  4469.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 400;
  4470.             if(weaponbeingoffered[playerid] == 5)
  4471.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 25;
  4472.             if(weaponbeingoffered[playerid] == 33)
  4473.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 1500;
  4474.             if(weaponbeingoffered[playerid] == 8)
  4475.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 50;
  4476.             if(weaponbeingoffered[playerid] == 30)
  4477.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 2000;
  4478.             if(weaponbeingoffered[playerid] == 24)
  4479.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 1000;
  4480.             if(weaponbeingoffered[playerid] == 27)
  4481.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 6000;
  4482.             if(weaponbeingoffered[playerid] == 31)
  4483.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 3000;
  4484.             if(weaponbeingoffered[playerid] == 34)
  4485.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 7000;
  4486.             if(weaponbeingoffered[playerid] == 1)
  4487.             PlayerInfo[beingofferedby[playerid]][pMaterials] -= 50;
  4488.             return 1;
  4489.         }
  4490.     }
  4491.     return 1;
  4492. }
  4493.  
  4494.  
  4495. CMD:giverank(playerid, params[])
  4496. {
  4497.     new rank, giveplayerid, str[126];
  4498.     if(PlayerInfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
  4499.     if(PlayerInfo[playerid][pFacRank] < 5) return SendClientMessage(playerid, COLOR_GREY, "You are not above rank 5.");
  4500.     if(sscanf(params, "ui", giveplayerid, rank)) return SendClientMessage(playerid, -1, "USAGE: /give [playerid/partofname] [rank]");
  4501.     if(PlayerInfo[giveplayerid][pFaction] != PlayerInfo[playerid][pFaction]) return SendClientMessage(playerid, COLOR_GREY, "The specified player is not in your faction.");
  4502.     PlayerInfo[giveplayerid][pFacRank] = rank;
  4503.     format(str, sizeof(str), "You have set %s's rank to %i (%s)", GetName(giveplayerid), rank, GetRankName(giveplayerid));
  4504.     SendClientMessage(playerid, COLOR_CYAN, str);
  4505.     format(str, sizeof(str), "%s has set your rank to %i (%s)", GetName(playerid), rank, GetRankName(giveplayerid));
  4506.     SendClientMessage(playerid, COLOR_CYAN, str);
  4507.     return 1;
  4508. }
  4509.  
  4510. CMD:div(playerid, params[])
  4511. {
  4512.     new div, giveplayerid, str[126];
  4513.     if(PlayerInfo[playerid][pFaction] == 0) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
  4514.     if(PlayerInfo[playerid][pFacRank] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not above rank 4.");
  4515.     if(sscanf(params, "ui", giveplayerid, div))
  4516.     {
  4517.         SendClientMessage(playerid, -1, "USAGE: /div [playerid/partofname] [division number]");
  4518.         if(PlayerInfo[playerid][pFaction] == 1)
  4519.         {
  4520.         SendClientMessage(playerid, -1, "Divisions: 0) None - 1) SWAT - 2) TE - 3) FTO - 4) IA");
  4521.         }
  4522.         if(PlayerInfo[playerid][pFaction] == 2)
  4523.         {
  4524.         SendClientMessage(playerid, -1, "Divisions: 0) None - 1) FAN - 2) GU - 3) IA");
  4525.         }
  4526.         if(PlayerInfo[playerid][pFaction] == 3)
  4527.         {
  4528.         SendClientMessage(playerid, -1, "Divisions: 0) None - 1) Human Resources - 2) Life Flight");
  4529.         }
  4530.         return 1;
  4531.     }
  4532.     if(PlayerInfo[giveplayerid][pFaction] != PlayerInfo[playerid][pFaction]) return SendClientMessage(playerid, COLOR_GREY, "The specified player is not in your faction.");
  4533.     PlayerInfo[giveplayerid][pFacDiv] = div;
  4534.     format(str, sizeof(str), "You have set %s's divison to %s (%i)", GetName(giveplayerid), GetDivisionName(giveplayerid), div);
  4535.     SendClientMessage(playerid, COLOR_CYAN, str);
  4536.     format(str, sizeof(str), "%s has set your divison to %s (%i)", GetName(playerid), GetDivisionName(giveplayerid), div);
  4537.     SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4538.     return 1;
  4539. }
  4540.  
  4541. CMD:r(playerid, params[])
  4542. {
  4543.     new string[128], text[100];
  4544.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 3 && PlayerInfo[playerid][pFaction] != 2)
  4545.     {
  4546.         SendClientMessage(playerid, COLOR_GREY, "You are not in a faction with a radio.");
  4547.         return 1;
  4548.     }
  4549.     if(sscanf(params, "s[100]", text))
  4550.     {
  4551.         SendClientMessage(playerid, -1, "USAGE: /r(adio) [text]");
  4552.         return 1;
  4553.     }
  4554.     if(PlayerInfo[playerid][pFaction] == 1)
  4555.     {
  4556.         if(PlayerInfo[playerid][pFacDiv] > 0)
  4557.         {
  4558.         format(string, sizeof(string), "* %s %s (%s): %s", GetRankName(playerid), GetName(playerid), GetDivisionName(playerid), text);
  4559.         SendClientMessageToLSPD(RADIO, string);
  4560.         Log("/logs/radio.txt", string);
  4561.         }
  4562.             else
  4563.         {
  4564.         format(string, sizeof(string), "* %s %s: %s", GetRankName(playerid), GetName(playerid), text);
  4565.         SendClientMessageToLSPD(RADIO, string);
  4566.         Log("/logs/radio.txt", string);
  4567.         }
  4568.     }
  4569.     if(PlayerInfo[playerid][pFaction] == 2)
  4570.     {
  4571.         if(PlayerInfo[playerid][pFacDiv] > 0)
  4572.         {
  4573.         format(string, sizeof(string), "* %s %s (%s): %s", GetRankName(playerid), GetName(playerid), GetDivisionName(playerid), text);
  4574.         SendClientMessageToLSPD(RADIO, string);
  4575.         Log("/logs/radio.txt", string);
  4576.         }
  4577.             else
  4578.         {
  4579.         format(string, sizeof(string), "* %s %s: %s", GetRankName(playerid), GetName(playerid), text);
  4580.         SendClientMessageToLSPD(RADIO, string);
  4581.         Log("/logs/radio.txt", string);
  4582.         }
  4583.     }
  4584.     if(PlayerInfo[playerid][pFaction] == 3)
  4585.     {
  4586.         if(PlayerInfo[playerid][pFacDiv] > 0)
  4587.         {
  4588.         format(string, sizeof(string), "* %s %s (%s): %s", GetRankName(playerid), GetName(playerid), GetDivisionName(playerid), text);
  4589.         SendClientMessageToLSPD(RADIO, string);
  4590.         Log("/logs/radio.txt", string);
  4591.         }
  4592.             else
  4593.         {
  4594.         format(string, sizeof(string), "* %s %s: %s", GetRankName(playerid), GetName(playerid), text);
  4595.         SendClientMessageToLSPD(RADIO, string);
  4596.         Log("/logs/radio.txt", string);
  4597.         }
  4598.     }
  4599.     return 1;
  4600. }
  4601.  
  4602. CMD:me(playerid, params[])
  4603. {
  4604.     new
  4605.         string[128],
  4606.         action[100];
  4607.     if(sscanf(params, "s[100]", action))
  4608.     {
  4609.         SendClientMessage(playerid, -1, "USAGE: /me [action]");
  4610.         return 1;
  4611.     }
  4612.     else
  4613.     {
  4614.         format(string, sizeof(string), "* %s %s", GetName(playerid), action);
  4615.         ProxDetector(30, playerid, string, COLOR_PURPLE);
  4616.     }
  4617.     return 1;
  4618. }
  4619.  
  4620. CMD:do(playerid, params[])
  4621. {
  4622.     new
  4623.         string[128],
  4624.         action[100];
  4625.     if(sscanf(params, "s[100]", action))
  4626.     {
  4627.         SendClientMessage(playerid, -1, "USAGE: /do [action]");
  4628.         return 1;
  4629.     }
  4630.     else
  4631.     {
  4632.         format(string, sizeof(string), "* %s (( %s ))", action, GetName(playerid));
  4633.         ProxDetector(30, playerid, string, COLOR_PURPLE);
  4634.     }
  4635.     return 1;
  4636. }
  4637. CMD:shout(playerid, params[])
  4638. {
  4639.     new
  4640.         string[128],
  4641.         shout[100];
  4642.     if(sscanf(params, "s[100]", shout))
  4643.     {
  4644.         SendClientMessage(playerid, -1, "USAGE: /(s)hout [message]");
  4645.         return 1;
  4646.     }
  4647.     else
  4648.     {
  4649.         format(string, sizeof(string), "%s shouts: %s!",GetName(playerid),shout);
  4650.         ProxDetector(50.0, playerid, string, -1);
  4651.         Log("/logs/chat.txt", string);
  4652.     }
  4653.     return 1;
  4654. }
  4655. CMD:b(playerid, params[])
  4656. {
  4657.     new string[128], text[100];
  4658.     if(sscanf(params, "s[100]", text)) return SendClientMessage(playerid, -1, "USAGE: /b [TEXT]");
  4659.     format(string, sizeof(string), "(( %s says: %s ))", GetName(playerid), text);
  4660.     ProxDetector(30.0, playerid, string, COLOR_GREY);
  4661.     Log("/logs/chat.txt", string);
  4662.     return 1;
  4663. }
  4664. CMD:s(playerid, params[]) return cmd_shout(playerid, params);
  4665.  
  4666. CMD:pm(playerid, params[])
  4667. {
  4668.     new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
  4669.     if(sscanf(params, "us", id, str2))
  4670.     {
  4671.         SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm [playerid/partofname]");
  4672.         return 1;
  4673.     }
  4674.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
  4675.     if(playerid == id) return SendClientMessage(playerid, COLOR_GREY, "You can not PM yourself.");
  4676.     {
  4677.         GetPlayerName(playerid, Name1, sizeof(Name1));
  4678.         GetPlayerName(id, Name2, sizeof(Name2));
  4679.         format(str, sizeof(str), "(( PM to %s (ID %d): %s ))", Name2, id, str2);
  4680.         SendClientMessage(playerid, 0xFF0000FF, str);
  4681.         format(str, sizeof(str), "(( PM from %s (ID %d): %s ))", Name1, playerid, str2);
  4682.         SendClientMessage(id, 0xFF0000FF, str);
  4683.     }
  4684.     return 1;
  4685. }
  4686.  
  4687. CMD:kill(playerid, params[])
  4688. {
  4689.     if(GetPVarInt(playerid, "Restrained") == 1)
  4690.     {
  4691.         SendClientMessage(playerid, COLOR_GREY, "You can not kill yourself while restrained.");
  4692.         return 1;
  4693.     }
  4694.     if(GetPVarInt(playerid, "Cuffed") == 1)
  4695.     {
  4696.         SendClientMessage(playerid, COLOR_GREY, "You can not kill yourself while restrained.");
  4697.         return 1;
  4698.     }
  4699.     if(GetPVarInt(playerid, "Tazed") == 1)
  4700.     {
  4701.         SendClientMessage(playerid, COLOR_GREY, "You can not kill yourself while restrained.");
  4702.         return 1;
  4703.     }
  4704.     SetPlayerHealth(playerid, 0);
  4705.     SetPlayerArmour(playerid, 0);
  4706.     return 1;
  4707. }
  4708. CMD:giveup(playerid, params[])
  4709. {
  4710.     if(GetPVarInt(playerid, "Injured") == 1)
  4711.     {
  4712.         SetPlayerHealth(playerid, 0);
  4713.     }
  4714.     else
  4715.     {
  4716.         SendClientMessage(playerid, COLOR_GREY, "You are not injured.");
  4717.     }
  4718.     return 1;
  4719. }
  4720.  
  4721. CMD:stats(playerid, params[])
  4722. {
  4723.     ShowStats(playerid, playerid);
  4724.     return 1;
  4725. }
  4726. CMD:quitfaction(playerid, params[])
  4727. {
  4728.     if(PlayerInfo[playerid][pFaction] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
  4729.     PlayerInfo[playerid][pFaction] = 0;
  4730.     PlayerInfo[playerid][pFacRank] = 0;
  4731.     PlayerInfo[playerid][pFacDiv] = 0;
  4732.     PlayerInfo[playerid][pFacLeader] = 0;
  4733.     SetPlayerColor(playerid, 0xFFFFFF00);
  4734.     SendClientMessage(playerid, COLOR_OOC, "You have quit your faction and is now a civillian again.");
  4735.     ShowPlayerDialog(playerid, DIALOG_UNINVITESKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Skin change",""COL_WHITE"Select a skin to use. Valid skin IDs are 0 to 299.","Change","No");
  4736.     return 1;
  4737. }
  4738. CMD:veh(playerid, params[])
  4739. {
  4740.     if(IsPlayerConnected(playerid))
  4741.     {
  4742.         if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command-");
  4743.         new car, col1, col2, string[126];
  4744.         if(sscanf(params, "iii", car, col1, col2)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [carid] [color1] [color2]");
  4745.         if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_GREY, "Vehicle number can't be below 400 or above 611!");
  4746.         if(col1 < 0 || col1 > 256) return SendClientMessage(playerid, COLOR_GREY, "Color number can't be below 0 or above 256!");
  4747.         new Float:X,Float:Y,Float:Z;
  4748.         GetPlayerPos(playerid, X,Y,Z);
  4749.         new carid = CreateVehicle(car, X,Y,Z, 0.0, col1, col2, 60000);
  4750.         format(string, sizeof(string), "Vehicle %d spawned.", carid);
  4751.         SendClientMessage(playerid, COLOR_GREY, string);
  4752.     }
  4753.     return 1;
  4754. }
  4755. CMD:job(playerid, params[])
  4756. {
  4757.     new str[56];
  4758.     PlayerInfo[playerid][pJob] = strval(params);
  4759.     format(str, 56, "You have joined %s.", GetJobName(playerid));
  4760.     SendClientMessage(playerid, -1, str);
  4761.     return 1;
  4762. }
  4763. CMD:timeplayed(playerid, params[])
  4764. {
  4765.     new str[56];
  4766.     new hTime = PlayerInfo[playerid][pHours]/60/60;
  4767.     new mTime = PlayerInfo[playerid][pHours]/60;
  4768.     format(str, 56, "You have played %i hours,", hTime);
  4769.     SendClientMessage(playerid, -1, str);
  4770.     format(str, 56, "which is %i minutes,", mTime);
  4771.     SendClientMessage(playerid, -1, str);
  4772.     format(str, 56, "and that is %i seconds played.", PlayerInfo[playerid][pHours]);
  4773.     SendClientMessage(playerid, -1, str);
  4774.     return 1;
  4775. }
  4776. CMD:join(playerid, params[])
  4777. {
  4778.     if(IsPlayerInRangeOfPoint(playerid, 5, 2212, -2663.03, 13.55))
  4779.     {
  4780.         SendClientMessage(playerid, COLOR_CYAN, "You have joined the Trucker Job.");
  4781.         PlayerInfo[playerid][pJob] = 1;
  4782.         return 1;
  4783.     }
  4784.     if(IsPlayerInRangeOfPoint(playerid, 5, 1365.79, -1280, 13.55))
  4785.     {
  4786.         SendClientMessage(playerid, COLOR_CYAN, "You have joined the Weapon Dealer Job.");
  4787.         PlayerInfo[playerid][pJob] = 3;
  4788.         return 1;
  4789.     }
  4790.     else
  4791.     {
  4792.         SendClientMessage(playerid, COLOR_GREY, "You are not at a job location.");
  4793.         return 1;
  4794.     }
  4795. }
  4796. CMD:jobskill(playerid, params[])
  4797. {
  4798.     PlayerInfo[playerid][pTruckerSkill] = strval(params);
  4799.     PlayerInfo[playerid][pWDealerSkill] = strval(params);
  4800.     SendClientMessage(playerid, -1, "Skills set.");
  4801.     return 1;
  4802. }
  4803. CMD:quitjob(playerid, params[])
  4804. {
  4805.     PlayerInfo[playerid][pJob] = 0;
  4806.     SendClientMessage(playerid, COLOR_CYAN, "You have quit your job.");
  4807.     return 1;
  4808. }
  4809. CMD:destroycheckpoint(playerid, params[])
  4810. {
  4811.     DisablePlayerCheckpoint(playerid);
  4812.     SendClientMessage(playerid, COLOR_GREY, "You have ended all your missions and checkpoints.");
  4813.     CPT[playerid] = 0;
  4814.     return 1;
  4815. }
  4816. CMD:canceltruck(playerid, params[])
  4817. {
  4818.     DisablePlayerCheckpoint(playerid);
  4819.     SendClientMessage(playerid, COLOR_GREY, "You have ended your trucking mission.");
  4820.     CPT[playerid] = 0;
  4821.     return 1;
  4822. }
  4823.  
  4824. CMD:loadtruck(playerid, params[])
  4825. {
  4826.     if(IsPlayerInRangeOfPoint(playerid, 15, 2197.8425,-2662.9883,13.5469))
  4827.     { // Checks if you are close enough to the loading point.
  4828.         if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, COLOR_GREY, "You need to be in the driver seat to load a truck.");
  4829.         if(IsATruck(GetPlayerVehicleID(playerid)))
  4830.         {
  4831.             if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)) && !IsA1Truck(GetPlayerVehicleID(playerid)) && !IsA2Truck(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, COLOR_GREY, "You don't have a trailer attached.");
  4832.             loadtruck1(playerid); // calls the script to LoadTruck
  4833.             return 1;
  4834.         } else return SendClientMessage(playerid, COLOR_WHITE, "You are not in a truck.");
  4835.     }
  4836.     if(CPT[playerid] != 0)
  4837.     {
  4838.         SendClientMessage(playerid, -1, "You are currently on a route, or have another checkpoint.");
  4839.         return 1;
  4840.     }
  4841.     else
  4842.     {
  4843.         SendClientMessage(playerid, COLOR_WHITE, "To load the truck, go to the loading garage in Ocean Docks, then /loadtruck.");
  4844.         SetPlayerCheckpoint(playerid, 2197.8425,-2662.9883,13.5469,15);
  4845.         CPT[playerid] = 0; // waypoint
  4846.     }
  4847.     return 1;
  4848. }
  4849. CMD:secretcommand(playerid, params[])
  4850. {
  4851. ShowPlayerDialog(playerid, DIALOG_ADS, DIALOG_STYLE_INPUT,""COL_WHITE"Shhh",""COL_WHITE"Ok.","Okay","No");
  4852. return 1;
  4853. }
  4854.  
  4855. CMD:getmats(playerid, params[])
  4856. {
  4857.     if(PlayerInfo[playerid][pJob] != 3) return SendClientMessage(playerid, COLOR_GRAD2, "You're not a weapon dealer.");
  4858.     if(CPT[playerid] != 0) return SendClientMessage(playerid, COLOR_GRAD2, "You already have an existing material package or checkpoint.");
  4859.     if(IsPlayerInRangeOfPoint(playerid, 5, 2099.64, -105.84, 0.68))
  4860.     {
  4861.         SetPlayerCheckpoint(playerid, -331.24, -466.16, -0.54, 5.0); // sets a checkpoint.
  4862.         SendClientMessage(playerid, COLOR_YELLOW, "You have loaded the materials, and a marker have been set on your map to the destination.");
  4863.         CPT[playerid] = 3;
  4864.         return 1;
  4865.     }
  4866.     if(!IsPlayerInRangeOfPoint(playerid, 5, 1423.70, -1319, 13.55)) return SendClientMessage(playerid, COLOR_GRAD2, "You are not near enough the material pickup.");
  4867.     new rand = random(sizeof(MDestinations));
  4868.     SetPlayerCheckpoint(playerid, MDestinations[rand][0], MDestinations[rand][1], MDestinations[rand][2], 3.0); // sets a checkpoint.
  4869.     SendClientMessage(playerid, COLOR_YELLOW, "You have loaded the materials, and a marker have been set on your map to the destination.");
  4870.     CPT[playerid] = 3;
  4871.     return 1;
  4872. }
  4873.  
  4874. CMD:sellgun(playerid, params[])
  4875. {
  4876.     if(PlayerInfo[playerid][pJob] != 3)
  4877.     {
  4878.         SendClientMessage(playerid, COLOR_GRAD2, "You're not a weapon dealer.");
  4879.         return 1;
  4880.     }
  4881.  
  4882.     new choice[32], str[156];
  4883.     new giveplayerid;
  4884.     if(sscanf(params, "us[32]", giveplayerid, choice))
  4885.     {
  4886.         SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellgun [ID / name or part of name] [weapon]");
  4887.         SendClientMessage(playerid, COLOR_GREY, "Weapon Dealer Level 1: sdpistol(100 mats) 9mm(150 mats) shotgun(200 mats) ");
  4888.         SendClientMessage(playerid, COLOR_GREY, "Weapon Dealer Level 2: mp5(400 mats) bat(25 mats) rifle(1500 mats)");
  4889.         SendClientMessage(playerid, COLOR_GREY, "Weapon Dealer Level 3: katana(50 mats) ak47(2000 mats) deagle(1000 mats)");
  4890.         SendClientMessage(playerid, COLOR_GREY, "Weapon Dealer Level 4: spas(6000 mats) m4(3000 mats)");
  4891.         SendClientMessage(playerid, COLOR_GREY, "Weapon Dealer Level 5: sniper(7000 mats) knuckles(50 mats)");
  4892.         return 1;
  4893.     }
  4894.     if(strcmp(choice, "sdpistol", true) == 0)
  4895.     {
  4896.         if(PlayerInfo[playerid][pWDealerSkill] < 0) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4897.         if(PlayerInfo[playerid][pMaterials] < 100) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4898.         weaponbeingoffered[giveplayerid] = 23;
  4899.         beingofferedby[giveplayerid] = playerid;
  4900.         format(str, sizeof(str), "%s has offered you a silenced pistol. /accept wep to accept it.", GetName(playerid));
  4901.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4902.         return 1;
  4903.     }
  4904.     if(strcmp(choice, "9mm", true) == 0)
  4905.     {
  4906.         if(PlayerInfo[playerid][pWDealerSkill] < 0) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4907.         if(PlayerInfo[playerid][pMaterials] < 150) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4908.         weaponbeingoffered[giveplayerid] = 22;
  4909.         beingofferedby[giveplayerid] = playerid;
  4910.         format(str, sizeof(str), "%s has offered you a 9mm. /accept wep to accept it.", GetName(playerid));
  4911.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4912.         return 1;
  4913.     }
  4914.     if(strcmp(choice, "shotgun", true) == 0)
  4915.     {
  4916.         if(PlayerInfo[playerid][pWDealerSkill] < 0) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4917.         if(PlayerInfo[playerid][pMaterials] < 200) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4918.         weaponbeingoffered[giveplayerid] = 25;
  4919.         beingofferedby[giveplayerid] = playerid;
  4920.         format(str, sizeof(str), "%s has offered you a shotgun. /accept wep to accept it.", GetName(playerid));
  4921.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4922.         return 1;
  4923.     }
  4924.     if(strcmp(choice, "mp5", true) == 0)
  4925.     {
  4926.         if(PlayerInfo[playerid][pWDealerSkill] < 100) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4927.         if(PlayerInfo[playerid][pMaterials] < 400) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4928.         weaponbeingoffered[giveplayerid] = 29;
  4929.         beingofferedby[giveplayerid] = playerid;
  4930.         format(str, sizeof(str), "%s has offered you a mp5. /accept wep to accept it.", GetName(playerid));
  4931.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4932.         return 1;
  4933.     }
  4934.     if(strcmp(choice, "bat", true) == 0)
  4935.     {
  4936.         if(PlayerInfo[playerid][pWDealerSkill] < 100) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4937.         if(PlayerInfo[playerid][pMaterials] < 25) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4938.         weaponbeingoffered[giveplayerid] = 5;
  4939.         beingofferedby[giveplayerid] = playerid;
  4940.         format(str, sizeof(str), "%s has offered you a baseball bat. /accept wep to accept it.", GetName(playerid));
  4941.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4942.         return 1;
  4943.     }
  4944.     if(strcmp(choice, "ak47", true) == 0)
  4945.     {
  4946.         if(PlayerInfo[playerid][pWDealerSkill] < 200) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4947.         if(PlayerInfo[playerid][pMaterials] < 1500) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4948.         weaponbeingoffered[giveplayerid] = 30;
  4949.         beingofferedby[giveplayerid] = playerid;
  4950.         format(str, sizeof(str), "%s has offered you an ak47. /accept wep to accept it.", GetName(playerid));
  4951.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4952.         return 1;
  4953.     }
  4954.     if(strcmp(choice, "m4", true) == 0)
  4955.     {
  4956.         if(PlayerInfo[playerid][pWDealerSkill] < 300) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4957.         if(PlayerInfo[playerid][pMaterials] < 3000) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4958.         weaponbeingoffered[giveplayerid] = 31;
  4959.         beingofferedby[giveplayerid] = playerid;
  4960.         format(str, sizeof(str), "%s has offered you a m4. /accept wep to accept it.", GetName(playerid));
  4961.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4962.         return 1;
  4963.     }
  4964.     if(strcmp(choice, "rifle", true) == 0)
  4965.     {
  4966.         if(PlayerInfo[playerid][pWDealerSkill] < 100) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4967.         if(PlayerInfo[playerid][pMaterials] < 2000) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4968.         weaponbeingoffered[giveplayerid] = 33;
  4969.         beingofferedby[giveplayerid] = playerid;
  4970.         format(str, sizeof(str), "%s has offered you a rifle. /accept wep to accept it.", GetName(playerid));
  4971.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4972.         return 1;
  4973.     }
  4974.     if(strcmp(choice, "deagle", true) == 0)
  4975.     {
  4976.         if(PlayerInfo[playerid][pWDealerSkill] < 200) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4977.         if(PlayerInfo[playerid][pMaterials] < 1000) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4978.         weaponbeingoffered[giveplayerid] = 24;
  4979.         beingofferedby[giveplayerid] = playerid;
  4980.         format(str, sizeof(str), "%s has offered you a deagle. /accept wep to accept it.", GetName(playerid));
  4981.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4982.         return 1;
  4983.     }
  4984.     if(strcmp(choice, "spas", true) == 0)
  4985.     {
  4986.         if(PlayerInfo[playerid][pWDealerSkill] < 300) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4987.         if(PlayerInfo[playerid][pMaterials] < 6000) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4988.         weaponbeingoffered[giveplayerid] = 27;
  4989.         beingofferedby[giveplayerid] = playerid;
  4990.         format(str, sizeof(str), "%s has offered you a spas-12. /accept wep to accept it.", GetName(playerid));
  4991.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  4992.         return 1;
  4993.     }
  4994.     if(strcmp(choice, "katana", true) == 0)
  4995.     {
  4996.         if(PlayerInfo[playerid][pWDealerSkill] < 200) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  4997.         if(PlayerInfo[playerid][pMaterials] < 50) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  4998.         weaponbeingoffered[giveplayerid] = 8;
  4999.         beingofferedby[giveplayerid] = playerid;
  5000.         format(str, sizeof(str), "%s has offered you a katana. /accept wep to accept it.", GetName(playerid));
  5001.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  5002.         return 1;
  5003.     }
  5004.     if(strcmp(choice, "sniper", true) == 0)
  5005.     {
  5006.         if(PlayerInfo[playerid][pWDealerSkill] < 400) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  5007.         if(PlayerInfo[playerid][pMaterials] < 7000) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  5008.         weaponbeingoffered[giveplayerid] = 34;
  5009.         beingofferedby[giveplayerid] = playerid;
  5010.         format(str, sizeof(str), "%s has offered you a sniper. /accept wep to accept it.", GetName(playerid));
  5011.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  5012.         return 1;
  5013.     }
  5014.     if(strcmp(choice, "knuckles", true) == 0)
  5015.     {
  5016.         if(PlayerInfo[playerid][pWDealerSkill] < 400) return SendClientMessage(playerid, COLOR_GREY, "You are not a skilled enough weapon dealer.");
  5017.         if(PlayerInfo[playerid][pMaterials] < 50) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials.");
  5018.         weaponbeingoffered[giveplayerid] = 1;
  5019.         beingofferedby[giveplayerid] = playerid;
  5020.         format(str, sizeof(str), "%s has offered you a sniper. /accept wep to accept it.", GetName(playerid));
  5021.         SendClientMessage(giveplayerid, COLOR_CYAN, str);
  5022.         return 1;
  5023.     }
  5024.     return 1;
  5025. }
  5026.  
  5027.  
  5028. CMD:dooredit(playerid, params[])
  5029. {
  5030.     if(PlayerInfo[playerid][pAdmin] < 4)
  5031.     {
  5032.         SendClientMessage(playerid, COLOR_GRAD2, "You're not authorized to use that command!");
  5033.         return 1;
  5034.     }
  5035.  
  5036.     new string[128], choice[32], doorid, amount;
  5037.     if(sscanf(params, "s[32]dD(1)", choice, doorid, amount))
  5038.     {
  5039.         SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dooredit [name] [doorid] [###]");
  5040.         SendClientMessage(playerid, COLOR_GREY, "Names: Exterior, Interior, Faction, Admin, VehicleAble, Color, PickupModel, Delete");
  5041.         return 1;
  5042.     }
  5043.  
  5044.     if(doorid >= MAX_DDOORS)
  5045.     {
  5046.         SendClientMessage(playerid, COLOR_WHITE, "Invalid Door ID!");
  5047.         return 1;
  5048.     }
  5049.  
  5050.     if(strcmp(choice, "interior", true) == 0)
  5051.     {
  5052.         GetPlayerPos(playerid, DoorInfo[doorid][ddInteriorX], DoorInfo[doorid][ddInteriorY], DoorInfo[doorid][ddInteriorZ]);
  5053.         GetPlayerFacingAngle(playerid, DoorInfo[doorid][ddInteriorA]);
  5054.         DoorInfo[doorid][ddInteriorInt] = GetPlayerInterior(playerid);
  5055.         DoorInfo[doorid][ddInteriorVW] = GetPlayerVirtualWorld(playerid);
  5056.         SendClientMessage(playerid, COLOR_WHITE, "You have changed the interior!");
  5057.         SaveDynamicDoors();
  5058.         format(string, sizeof(string), "%s has edited DoorID %d's Interior.", GetPlayerNameEx(playerid), doorid);
  5059.         return 1;
  5060.     }
  5061.     else if(strcmp(choice, "custominterior", true) == 0)
  5062.     {
  5063.         if(DoorInfo[doorid][ddCustomInterior] == 0)
  5064.         {
  5065.             DoorInfo[doorid][ddCustomInterior] = 1;
  5066.             SendClientMessage(playerid, COLOR_WHITE, "Door set to custom interior!");
  5067.         }
  5068.         else
  5069.         {
  5070.             DoorInfo[doorid][ddCustomInterior] = 0;
  5071.             SendClientMessage(playerid, COLOR_WHITE, "Door set to normal (not custom) interior!");
  5072.         }
  5073.         SaveDynamicDoors();
  5074.         format(string, sizeof(string), "%s has edited DoorID %d's CustomInterior.", GetPlayerNameEx(playerid), doorid);
  5075.  
  5076.         return 1;
  5077.     }
  5078.     else if(strcmp(choice, "customexterior", true) == 0)
  5079.     {
  5080.         if(DoorInfo[doorid][ddCustomExterior] == 0)
  5081.         {
  5082.             DoorInfo[doorid][ddCustomExterior] = 1;
  5083.             SendClientMessage(playerid, COLOR_WHITE, "Door set to custom exterior!");
  5084.         }
  5085.         else
  5086.         {
  5087.             DoorInfo[doorid][ddCustomExterior] = 0;
  5088.             SendClientMessage(playerid, COLOR_WHITE, "Door set to normal (not custom) exterior!");
  5089.         }
  5090.         SaveDynamicDoors();
  5091.         format(string, sizeof(string), "%s has edited DoorID %d's CustomExterior.", GetPlayerNameEx(playerid), doorid);
  5092.  
  5093.         return 1;
  5094.     }
  5095.     else if(strcmp(choice, "exterior", true) == 0)
  5096.     {
  5097.         GetPlayerPos(playerid, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]);
  5098.         GetPlayerFacingAngle(playerid, DoorInfo[doorid][ddExteriorA]);
  5099.         DoorInfo[doorid][ddExteriorVW] = GetPlayerVirtualWorld(playerid);
  5100.         DoorInfo[doorid][ddExteriorInt] = GetPlayerInterior(playerid);
  5101.         SendClientMessage(playerid, COLOR_WHITE, "You have changed the exterior!");
  5102.         DestroyPickup(DoorInfo[doorid][ddPickupID]);
  5103.         if(IsValidDynamic3DTextLabel(DoorInfo[doorid][ddTextID])) DestroyDynamic3DTextLabel(DoorInfo[doorid][ddTextID]);
  5104.         CreateDynamicDoor(doorid);
  5105.         SaveDynamicDoors();
  5106.         format(string, sizeof(string), "%s has edited DoorID %d's Exterior.", GetPlayerNameEx(playerid), doorid);
  5107.  
  5108.     }
  5109.  
  5110.     else if(strcmp(choice, "faction", true) == 0)
  5111.     {
  5112.         DoorInfo[doorid][ddFaction] = amount;
  5113.  
  5114.         format(string, sizeof(string), "You have changed the Faction to %d.", amount);
  5115.         SendClientMessage(playerid, COLOR_WHITE, string);
  5116.  
  5117.         SaveDynamicDoors();
  5118.         format(string, sizeof(string), "%s has edited DoorID %d's Faction.", GetPlayerNameEx(playerid), doorid);
  5119.         return 1;
  5120.     }
  5121.     else if(strcmp(choice, "admin", true) == 0)
  5122.     {
  5123.         DoorInfo[doorid][ddAdmin] = amount;
  5124.  
  5125.         format(string, sizeof(string), "You have changed the Admin Level to %d.", amount);
  5126.         SendClientMessage(playerid, COLOR_WHITE, string);
  5127.  
  5128.         SaveDynamicDoors();
  5129.         format(string, sizeof(string), "%s has edited DoorID %d's Admin Level.", GetPlayerNameEx(playerid), doorid);
  5130.         return 1;
  5131.     }
  5132.     else if(strcmp(choice, "vehicleable", true) == 0)
  5133.     {
  5134.         DoorInfo[doorid][ddVehicleAble] = amount;
  5135.  
  5136.         format(string, sizeof(string), "You have changed the VehicleAble to %d.", amount);
  5137.         SendClientMessage(playerid, COLOR_WHITE, string);
  5138.  
  5139.         SaveDynamicDoors();
  5140.         format(string, sizeof(string), "%s has edited DoorID %d's VehicleAble.", GetPlayerNameEx(playerid), doorid);
  5141.         return 1;
  5142.     }
  5143.     else if(strcmp(choice, "color", true) == 0)
  5144.     {
  5145.         DoorInfo[doorid][ddColor] = amount;
  5146.  
  5147.         format(string, sizeof(string), "You have changed the Color to %d.", amount);
  5148.         SendClientMessage(playerid, COLOR_WHITE, string);
  5149.         DestroyPickup(DoorInfo[doorid][ddPickupID]);
  5150.         if(IsValidDynamic3DTextLabel(DoorInfo[doorid][ddTextID])) DestroyDynamic3DTextLabel(DoorInfo[doorid][ddTextID]);
  5151.         CreateDynamicDoor(doorid);
  5152.  
  5153.         SaveDynamicDoors();
  5154.         format(string, sizeof(string), "%s has edited DoorID %d's Color.", GetPlayerNameEx(playerid), doorid);
  5155.         return 1;
  5156.     }
  5157.     else if(strcmp(choice, "pickupmodel", true) == 0)
  5158.     {
  5159.         DoorInfo[doorid][ddPickupModel] = amount;
  5160.  
  5161.         format(string, sizeof(string), "You have changed the PickupModel to %d.", amount);
  5162.         SendClientMessage(playerid, COLOR_WHITE, string);
  5163.         DestroyPickup(DoorInfo[doorid][ddPickupID]);
  5164.         if(IsValidDynamic3DTextLabel(DoorInfo[doorid][ddTextID])) DestroyDynamic3DTextLabel(DoorInfo[doorid][ddTextID]);
  5165.         CreateDynamicDoor(doorid);
  5166.  
  5167.         SaveDynamicDoors();
  5168.         format(string, sizeof(string), "%s has edited DoorID %d's PickupModel.", GetPlayerNameEx(playerid), doorid);
  5169.         return 1;
  5170.     }
  5171.     else if(strcmp(choice, "delete", true) == 0)
  5172.     {
  5173.         if(DoorInfo[doorid][ddName] == 0) {
  5174.             format(string, sizeof(string), "DoorID %d does not exist.", doorid);
  5175.             SendClientMessage(playerid, COLOR_WHITE, string);
  5176.             return 1;
  5177.         }
  5178.         DestroyPickup(DoorInfo[doorid][ddPickupID]);
  5179.         DestroyDynamic3DTextLabel(DoorInfo[doorid][ddTextID]);
  5180.         DoorInfo[doorid][ddName] = 0;
  5181.         DoorInfo[doorid][ddCustomInterior] = 0;
  5182.         DoorInfo[doorid][ddExteriorVW] = 0;
  5183.         DoorInfo[doorid][ddExteriorInt] = 0;
  5184.         DoorInfo[doorid][ddInteriorVW] = 0;
  5185.         DoorInfo[doorid][ddInteriorInt] = 0;
  5186.         DoorInfo[doorid][ddExteriorX] = 0;
  5187.         DoorInfo[doorid][ddExteriorY] = 0;
  5188.         DoorInfo[doorid][ddExteriorZ] = 0;
  5189.         DoorInfo[doorid][ddExteriorA] = 0;
  5190.         DoorInfo[doorid][ddInteriorX] = 0;
  5191.         DoorInfo[doorid][ddInteriorY] = 0;
  5192.         DoorInfo[doorid][ddInteriorZ] = 0;
  5193.         DoorInfo[doorid][ddInteriorA] = 0;
  5194.         DoorInfo[doorid][ddCustomExterior] = 0;
  5195.         DoorInfo[doorid][ddFaction] = 0;
  5196.         DoorInfo[doorid][ddAdmin] = 0;
  5197.         DoorInfo[doorid][ddWanted] = 0;
  5198.         DoorInfo[doorid][ddVehicleAble] = 0;
  5199.         DoorInfo[doorid][ddColor] = 0;
  5200.         DoorInfo[doorid][ddPass] = 0;
  5201.         DoorInfo[doorid][ddLocked] = 0;
  5202.         DoorInfo[doorid][ddNotEditable] = 0;
  5203.         SaveDynamicDoors();
  5204.         format(string, sizeof(string), "You have deleted DoorID %d.", doorid);
  5205.         SendClientMessage(playerid, COLOR_WHITE, string);
  5206.         format(string, sizeof(string), "%s has deleted DoorID %d.", GetPlayerNameEx(playerid), doorid);
  5207.         return 1;
  5208.     }
  5209.     return 1;
  5210. }
  5211.  
  5212. public OnGameModeInit()
  5213. {
  5214.     settime();
  5215.     WeekDayg = TextDrawCreate(502.000000,11.000000,"----");
  5216.     TextDrawAlignment(WeekDayg,0);
  5217.     TextDrawBackgroundColor(WeekDayg,0x000000ff);
  5218.     TextDrawFont(WeekDayg,3);
  5219.     TextDrawLetterSize(WeekDayg,0.700000,1.000000);
  5220.     TextDrawColor(WeekDayg,0xffff00cc);
  5221.     TextDrawSetOutline(WeekDayg,1);
  5222.     TextDrawSetProportional(WeekDayg,1);
  5223.     TextDrawSetShadow(WeekDayg,10);
  5224.     Clock = TextDrawCreate(547.0, 24.0, "--:--");
  5225.     TextDrawLetterSize(Clock, 0.6, 1.8);
  5226.     TextDrawFont(Clock, 3);
  5227.     TextDrawSetOutline(Clock, 2);
  5228.  
  5229.     SetTimer("settime",1000,true);
  5230.     SetTimer("weatherchange",10800000,true);
  5231.     EnableStuntBonusForAll(0);
  5232.     UsePlayerPedAnims();
  5233.     LoadDynamicDoors();
  5234.     DisableInteriorEnterExits();
  5235.     SetGameModeText(version);
  5236.     LSPDGate = CreateObject(971, 1589.04, -1637.95, 14.73, 0.00, 0.00, 180.00);
  5237.     LSPDBarrier = CreateObject(968, 1544.69, -1630.80, 13.08, -90.00, 0.00, 0.00);
  5238.     LSPDDoor1 = CreateObject(1536,244.89999390,72.50000000,1002.59997559,0.00000000,0.00000000,0.00000000); //object(gen_doorext15) (1)
  5239.     LSPDDoor2 = CreateObject(1536,247.89999390,72.50000000,1002.59997559,0.00000000,0.00000000,180.00000000); //object(gen_doorext15) (2)
  5240.     CreateObject(1495, 1582.62, -1637.90, 12.33, 0.00, 0.00, 0.00);
  5241.     CreateObject(1653, 1577.74, -1637.86, 15.49, 0.00, 0.00, 0.00);
  5242.     CreateObject(983, 1543.96, -1632.96, 13.23,   0.00, 0.00, 90.00);
  5243.     CreateObject(983, 1547.15, -1636.21, 13.23,   0.00, 4.00, 0.00);
  5244.     CreateObject(983, 1544.66, -1622.93, 13.23,   0.00, 0.00, 90.00);
  5245.     CreateObject(983, 1547.15, -1636.21, 13.23,   0.00, 4.00, 0.00);
  5246.     CreateObject(983, 1548.03, -1619.75, 13.23,   0.00, 0.00, -4.00);
  5247.     CreateObject(1227, 1548.27, -1616.84, 13.55,   0.00, 0.00, 0.00);
  5248.     AddPlayerClass(299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  5249.     // Pickups
  5250.     CreatePickup(1239, 1, 2212, -2663.03, 13.55, 0);
  5251.     CreatePickup(1239, 1, 1366, -1276, 13.55, 0);
  5252.     CreatePickup(1239, 1, 1423.70, -1319, 13.55, 0);
  5253.     CreatePickup(1239, 1, 1526.92, -1677, 5.89, 0); // Arrest Point
  5254.     CreatePickup(1239, 1, 1141.23, -1326.42, 13.65, 0); // Hospital Delivery
  5255.     CreatePickup(1239, 1, 2017.17, -1413.84, 16.99, 0); // Hospital Delivery
  5256.     CreatePickup(1239, 1, 207.48, -101.49, 1005.26, 45235); // Binco
  5257.     CreatePickup(1239, 1, -27.69, -89.42, 1003.55, 53434241); // 24/7
  5258.     CreatePickup(1239, 1, -27.69, -89.42, 1003.55, 53434242); // 24/7
  5259.     CreatePickup(1239, 1, -27.69, -89.42, 1003.55, 53434243); // 24/7
  5260.     CreatePickup(1239, 1, 2099.64, -105.84, 0.68, 0); // Boat Delivery
  5261.     Create3DTextLabel("Arrest Point - /arrest", 0x008080FF, 1526.92, -1677, 5.89, 5.0, 0, 0);
  5262.     Create3DTextLabel("Hospital Delivery Point - /deliver", 0x008080FF, 1141.23, -1326.42, 13.65, 30.0, 0, 0);
  5263.     Create3DTextLabel("Hospital Delivery Point - /deliver", 0x008080FF, 2017.17, -1413.84, 16.99, 30.0, 0, 0);
  5264.     Create3DTextLabel("LSPD Lockers - /lockers", 0x0008080FF, 254, 77, 1003, 10, 1337, 0);
  5265.     Create3DTextLabel("Binco - /buy", 0x0008080FF, 207.48, -101.49, 1005.26, 15, 45235, 0);
  5266.     Create3DTextLabel("24/7 - /buy", 0x0008080FF, -27.69, -89.42, 1003.55, 18, 53434241, 0);
  5267.     Create3DTextLabel("24/7 - /buy", 0x0008080FF, -27.69, -89.42, 1003.55, 18, 53434242, 0);
  5268.     Create3DTextLabel("24/7 - /buy", 0x0008080FF, -27.69, -89.42, 1003.55, 18, 53434243, 0);
  5269.     Create3DTextLabel("Boat materials pickup - /getmats", 0x0008080FF, 2099.64, -105.84, 0.68, 0, 0, 0);
  5270.     // Trucker
  5271.     level1Trucks[0] = AddStaticVehicle(499,2248.7166,-2641.8423,13.5628,88.1596,1,31); // level 1 truck
  5272.     level1Trucks[1] = AddStaticVehicle(499,2249.7317,-2649.7966,13.5401,89.4008,31,31); // level 1 truck
  5273.     level1Trucks[2] = AddStaticVehicle(414,2233.6287,-2680.4116,13.5382,356.4799,6,41); // level 1 truck
  5274.     level1Trucks[3] = AddStaticVehicle(499,2227.4983,-2679.9048,13.5463,0.3895,37,21); // level 1 truck
  5275.     level1Trucks[4] = AddStaticVehicle(414,2245.2544,-2681.3452,13.5427,0.2067,27,17); // level 1 truck
  5276.     level1Trucks[5] = AddStaticVehicle(414,2252.2861,-2679.6343,13.5426,1.2572,36,47); // level 1 truck
  5277.     //
  5278.     level2Trucks[0] = AddStaticVehicle(498,2261.5137,-2680.0657,13.6207,359.5156,36,10); // Level 2 truck
  5279.     level2Trucks[1] = AddStaticVehicle(498,2238.7996,-2603.8298,13.6184,90.1549,54,59); // Level 2 truck
  5280.     level2Trucks[2] = AddStaticVehicle(498,2238.5786,-2619.1267,13.6145,86.9422,45,40); // Level 2 truck
  5281.     level2Trucks[3] = AddStaticVehicle(498,2238.9553,-2611.7659,13.6141,91.2811,8,40); // Level 2 truck
  5282.     //
  5283.     level3Trucks[0] = AddStaticVehicle(403,2184.0037,-2639.8213,14.5653,180.8443,26,20); // Truck (LEVEL 3)
  5284.     level3Trucks[1] = AddStaticVehicle(403,2176.6162,-2637.8469,14.5890,175.4726,26,20); // Truck (LEVEL 3)
  5285.     level3Trucks[2] = AddStaticVehicle(403,2250.3188,-2634.3699,14.1771,91.0775,40,40); // Truck (LEVEL 3)
  5286.     //
  5287.     level5Trucks[0] = AddStaticVehicle(515,2207.8276,-2598.1008,14.5620,267.6627,0,58); // Level 5 Truck
  5288.     level5Trucks[1] = AddStaticVehicle(515,2230.3008,-2555.9944,14.4759,0.7771,0,58); // Level 5 Truck
  5289.     level5Trucks[2] = AddStaticVehicle(515,2205.2166,-2570.2583,14.5752,270.1937,0,58); // Level 5 Truck
  5290.     //
  5291.     trailers[0] = AddStaticVehicle(591,2178.0486,-2624.6274,14.1822,175.1626,56,31); // Trailer
  5292.     trailers[1] = AddStaticVehicle(591,2184.6934,-2625.1929,14.1454,175.1649,56,31); // Trailer
  5293.     trailers[2] = AddStaticVehicle(591,2230.5833,-2576.0195,14.0940,0.7798,7,16); // Trailer
  5294.     trailers[3] = AddStaticVehicle(591,2229.7905,-2534.6511,14.1194,0.7601,7,16); // Trailer
  5295.     trailers[4] = AddStaticVehicle(591,2220.0430,-2624.9260,14.0625,0.9242,7,16); // Trailer
  5296.     trailers[5] = AddStaticVehicle(591,2203.8923,-2642.7629,14.1967,266.2004,35,41); // Trailer
  5297.     // LSPD
  5298.     LSPDVeh[0] = AddStaticVehicle(596, 1601.795898, -1684.209350, 5.631327, 90.0, 79, 1); // Police Car (LSPD)
  5299.     LSPDVeh[1] = AddStaticVehicle(596, 1601.790527, -1688.099243, 5.611071, 90.0, 79, 1); // Police Car (LSPD)
  5300.     LSPDVeh[2] = AddStaticVehicle(596, 1601.790649, -1692.043945, 5.627151, 90.0, 79, 1); // Police Car (LSPD)
  5301.     LSPDVeh[3] = AddStaticVehicle(596, 1601.790527, -1696.380981, 5.617440, 90.0, 79, 1); // Police Car (LSPD)
  5302.     LSPDVeh[4] = AddStaticVehicle(596, 1601.790161, -1700.374267, 5.618237, 90.0, 86, 1); // Police Car (LSPD)
  5303.     LSPDVeh[5] = AddStaticVehicle(596, 1601.791015, -1704.578247, 5.613302, 90.0, 86, 1); // Police Car (LSPD)
  5304.     LSPDVeh[6] = AddStaticVehicle(596, 1595.375122, -1710.665039, 5.629010, 0.0, 86, 1); // Police Car (LSPD)
  5305.     LSPDVeh[7] = AddStaticVehicle(596, 1591.266113, -1711.172851, 5.562825, 0.0, 86, 1); // Police Car (LSPD)
  5306.     LSPDVeh[8] = AddStaticVehicle(596, 1587.176269, -1711.167724, 5.559627, 0.0, 0, 1); // Police Car (LSPD)
  5307.     LSPDVeh[9] = AddStaticVehicle(596, 1583.157104, -1711.164550, 5.575726, 0.0, 0, 1); // Police Car (LSPD)
  5308.     LSPDVeh[10] = AddStaticVehicle(596, 1578.746948, -1711.159790, 5.579936, 0.0, 0, 1); // Police Car (LSPD)
  5309.     LSPDVeh[11] = AddStaticVehicle(596, 1574.747192, -1711.155517, 5.616508, 0.0, 0, 1); // Police Car (LSPD)
  5310.     LSPDVeh[12] = AddStaticVehicle(596, 1570.507080, -1711.150390, 5.631289, 0.0, 0, 1); // Police Car (LSPD)
  5311.     LSPDVeh[13] = AddStaticVehicle(402, 1545.363403, -1684.183715, 5.776185, 90.0, 0, 0); // Buffalo
  5312.     LSPDVeh[14] = AddStaticVehicle(402, 1545.271606, -1680.033325, 5.789134, 90.0, 0, 0); // Buffalo
  5313.     LSPDVeh[15] = AddStaticVehicle(451, 1545.206909, -1676.062377, 5.768874, 90.0, 0, 0); // Turismo
  5314.     LSPDVeh[16] = AddStaticVehicle(560, 1545.136840, -1671.935791, 5.796144, 90.0, 0, 79); // Sultan
  5315.     LSPDVeh[17] = AddStaticVehicle(525, 1545.113891, -1667.590332, 5.768740, 90.0, 0, 79); // Tow Truck
  5316.     LSPDVeh[18] = AddStaticVehicle(525, 1545.052978, -1663.159057, 5.769451, 90.0, 0, 79); // Tow Truck
  5317.     LSPDVeh[19] = AddStaticVehicle(528, 1539.080932, -1644.956298, 6.022599, 180.0, 0, 1); // S.W.A.T. Van
  5318.     LSPDVeh[20] = AddStaticVehicle(528, 1534.736694, -1644.953979, 6.025968, 180.0, 0, 1); // S.W.A.T. Van
  5319.     LSPDVeh[21] = AddStaticVehicle(601, 1530.765136, -1644.953735, 5.626488, 180.0, 0, 0); // S.W.A.T. Van
  5320.     LSPDVeh[22] = AddStaticVehicle(601, 1526.807250, -1644.952392, 5.685305, 180.0, 0, 0); // S.W.A.T. Van
  5321.     LSPDVeh[23] = AddStaticVehicle(523, 1586.753173, -1680.919067, 5.467967, 270.0, 0, 0); // HPV-1000
  5322.     LSPDVeh[24] = AddStaticVehicle(523, 1583.504272, -1680.935913, 5.456614, 270.0, 0, 0); // HPV-1000
  5323.     LSPDVeh[25] = AddStaticVehicle(523, 1583.508789, -1678.958862, 5.454283, 270.0, 0, 0); // HPV-1000
  5324.     LSPDVeh[26] = AddStaticVehicle(523, 1583.510498, -1677.093017, 5.481368, 270.0, 0, 0); // HPV-1000
  5325.     LSPDVeh[27] = AddStaticVehicle(523, 1583.519409, -1675.270629, 5.453042, 270.0, 0, 0); // HPV-1000
  5326.     LSPDVeh[28] = AddStaticVehicle(523, 1586.685302, -1678.958740, 5.490104, 270.0, 0, 0); // HPV-1000
  5327.     LSPDVeh[29] = AddStaticVehicle(523, 1586.702880, -1677.099365, 5.452620, 270.0, 0, 0); // HPV-1000
  5328.     LSPDVeh[30] = AddStaticVehicle(523, 1586.705566, -1675.270629, 5.434679, 270.0, 0, 0); // HPV-1000
  5329.     LSPDVeh[31] = AddStaticVehicle(599, 1585.306152, -1667.855957, 6.086935, 270.0, 0, 1); // Police Ranger
  5330.     LSPDVeh[32] = AddStaticVehicle(599, 1585.286010, -1671.934448, 6.118605, 270.0, 0, 1); // Police Ranger
  5331.     LSPDVeh[33] = AddStaticVehicle(427, 1544.986694, -1659.187500, 6.019245, 90.0, 0, 1); // Enforcer
  5332.     LSPDVeh[34] = AddStaticVehicle(598, 1544.987060, -1655.224243, 6.054365, 90.0, 0, 1); // LVPD
  5333.     LSPDVeh[35] = AddStaticVehicle(598, 1544.987182, -1651.171020, 6.010422, 90.0, 0, 1); // LVPD
  5334.     LSPDVeh[36] = AddStaticVehicle(599, 1558.675781, -1711.144897, 6.032533, 0.0, 0, 1); // Police Ranger
  5335.     LSPDVeh[37] = AddStaticVehicle(497,1564.34960938,-1648.89172363,28.66711426,90.00000000,0,1); //Police Maverick
  5336.     LSPDVeh[38] = AddStaticVehicle(497,1564.30908203,-1700.77612305,28.66711426,90.00000000,0,1); //Police Maverick
  5337.     // LSFMD
  5338.     LSFMDVeh[0] = AddStaticVehicle(416,1180.2567,-1309.1852,13.8508,271.2980,1,7); // Ambulance (LSFMD)
  5339.     LSFMDVeh[1] = AddStaticVehicle(416,1180.1334,-1339.1980,13.9381,269.7634,1,7); // Ambulance (LSFMD)
  5340.     LSFMDVeh[2] = AddStaticVehicle(416,1211.5840,-1321.3564,13.6269,179.5706,1,7); // Ambulance (LSFMD)
  5341.     LSFMDVeh[3] = AddStaticVehicle(416,2010.0961,-1414.6855,17.1415,268.0157,1,7); // Ambulance (LSFMD)
  5342.     LSFMDVeh[4] = AddStaticVehicle(416,2034.0977,-1442.0782,17.4529,183.7214,1,7); // Ambulance (LSFMD)
  5343.     LSFMDVeh[5] = AddStaticVehicle(416,2035.1072,-1428.5984,17.1647,178.6801,1,7); // Ambulance (LSFMD)
  5344.     // Dealership
  5345.     DSV[0] = AddStaticVehicle(560, 533.3519,-1277.7756,16.9470, 224.1641, 1, 0); // Sultan
  5346.     DSV[1] = AddStaticVehicle(562,537.9197,-1274.1235,17.1387,220.2820, 1, 1); // Elegy
  5347.    
  5348.     //
  5349.     /*
  5350.     Random Vehicles
  5351.     */
  5352.     AddStaticVehicle(553,1944.5242,-2639.1465,14.8823,28.0299,-1, -1);
  5353.     AddStaticVehicle(553,1984.2778,-2637.7561,14.8831,9.0602,-1, -1);
  5354.     AddStaticVehicle(553,2019.7615,-2642.5803,14.8759,318.3256,-1, -1);
  5355.     AddStaticVehicle(510,2081.9866,-2359.7229,13.1551,64.1485,-1, -1);
  5356.     AddStaticVehicle(510,1866.6115,-2660.4602,13.1552,18.6151,-1, -1);
  5357.     AddStaticVehicle(513,1881.0273,-2632.3281,14.0996,40.9586,-1, -1);
  5358.     AddStaticVehicle(513,1891.9824,-2632.7056,14.1085,332.5663,-1, -1);
  5359.     AddStaticVehicle(463,920.4453,-1290.5063,13.3508,118.6505,-1, -1);
  5360.     AddStaticVehicle(542,863.2733,-1375.0151,13.3187,85.7265,-1, -1);
  5361.     AddStaticVehicle(496,821.6033,-1473.7249,12.5756,357.5008,-1, -1);
  5362.     AddStaticVehicle(461,1031.1113,-1446.3105,13.1411,59.0580,-1, -1);
  5363.     AddStaticVehicle(418,1005.0084,-1461.3424,13.6427,183.0261,-1, -1);
  5364.     AddStaticVehicle(489,990.5985,-1306.8129,13.5204,179.0488,-1, -1);
  5365.     AddStaticVehicle(475,1002.5063,-1306.5654,13.1866,359.6424,-1, -1);
  5366.     AddStaticVehicle(518,981.5054,-1306.6899,13.1630,181.0135,-1, -1);
  5367.     AddStaticVehicle(549,955.8333,-1190.2795,16.6425,270.2728,-1, -1);
  5368.     AddStaticVehicle(482,956.0022,-1199.3633,17.1270,268.5538,-1, -1);
  5369.     AddStaticVehicle(468,956.3898,-1193.4253,16.6297,89.6432,-1, -1);
  5370.     AddStaticVehicle(567,1085.8342,-1199.3883,17.7945,90.5839,-1, -1);
  5371.     AddStaticVehicle(542,1097.0354,-1218.1705,17.5471,356.6483,-1, -1);
  5372.     AddStaticVehicle(461,1084.2866,-1232.2461,15.3945,243.6654,-1, -1);
  5373.     AddStaticVehicle(461,1083.9337,-1235.0449,15.4088,243.8919,-1, -1);
  5374.     AddStaticVehicle(461,1083.7941,-1238.1573,15.4110,243.1097,-1, -1);
  5375.     AddStaticVehicle(405,1109.0310,-1225.8809,15.6987,181.5343,-1, -1);
  5376.     AddStaticVehicle(461,1032.2993,-1082.4255,23.4136,166.6669,-1, -1);
  5377.     AddStaticVehicle(475,1003.6659,-1054.6088,30.6946,3.0438,-1, -1);
  5378.     AddStaticVehicle(560,1070.9109,-1102.3247,24.4439,270.7971,-1, -1);
  5379.     AddStaticVehicle(496,1137.6492,-1025.5586,31.5121,177.9917,-1, -1);
  5380.     AddStaticVehicle(558,1131.7341,-1010.0580,29.4899,95.0937,-1, -1);
  5381.     AddStaticVehicle(581,1205.2384,-977.0176,43.0742,179.7537,-1, -1);
  5382.     AddStaticVehicle(536,1227.2596,-974.1713,43.2139,180.2966,-1, -1);
  5383.     AddStaticVehicle(581,989.3703,-1589.3812,13.0903,21.5606,-1, -1);
  5384.     AddStaticVehicle(542,1061.2451,-1665.2649,13.4966,91.9120,-1, -1);
  5385.     AddStaticVehicle(405,1136.5767,-1695.5199,13.6956,88.9354,-1, -1);
  5386.     AddStaticVehicle(463,1137.1466,-1700.1902,13.3869,87.9396,-1, -1);
  5387.     AddStaticVehicle(518,1280.4908,-1816.1259,13.0556,270.4623,-1, -1);
  5388.     AddStaticVehicle(482,1250.2468,-1835.0884,13.5047,180.4024,-1, -1);
  5389.     AddStaticVehicle(545,1238.0167,-1835.2385,13.2008,177.5310,-1, -1);
  5390.     AddStaticVehicle(468,1900.5659,-1849.8379,13.2277,44.6102,-1, -1);
  5391.     AddStaticVehicle(463,1097.5217,-1763.8896,12.8933,267.4286,-1, -1);
  5392.     AddStaticVehicle(475,892.6356,-1668.8604,13.3544,179.2466,-1, -1);
  5393.     AddStaticVehicle(535,276.9328,-1267.3054,73.7098,302.5802,-1, -1);
  5394.     AddStaticVehicle(496,280.3806,-1255.7952,73.6166,281.7693,-1, -1);
  5395.     AddStaticVehicle(589,569.3154,-1131.7330,50.2950,243.4572,-1, -1);
  5396.     AddStaticVehicle(562,687.5812,-1072.8162,49.1274,62.7814,-1, -1);
  5397.     AddStaticVehicle(545,795.9840,-840.3973,60.4526,174.5740,-1, -1);
  5398.     AddStaticVehicle(534,831.9914,-858.8560,69.6527,199.3811,-1, -1);
  5399.     AddStaticVehicle(535,839.4457,-893.5928,68.5340,21.2260,-1, -1);
  5400.     AddStaticVehicle(477,912.5916,-832.0980,92.1407,218.1897,-1, -1);
  5401.     AddStaticVehicle(562,966.6584,-842.2115,95.4213,208.6852,-1, -1);
  5402.     AddStaticVehicle(589,1024.2820,-777.6995,102.7277,142.3072,-1, -1);
  5403.     AddStaticVehicle(477,1460.3851,-633.6793,95.5530,179.4419,-1, -1);
  5404.     AddStaticVehicle(535,1516.9452,-765.4361,79.7405,142.5422,-1, -1);
  5405.     AddStaticVehicle(458,1530.6602,-814.2603,71.8145,269.5966,-1, -1);
  5406.     AddStaticVehicle(560,1536.7003,-841.9440,64.3992,91.2450,-1, -1);
  5407.     AddStaticVehicle(550,1038.2852,-640.5812,119.9407,3.9959,-1, -1);
  5408.     AddStaticVehicle(534,834.7188,-754.2109,85.0352,221.3681,-1, -1);
  5409.     AddStaticVehicle(545,812.7324,-768.6061,76.6226,240.9842,-1, -1);
  5410.     AddStaticVehicle(562,792.6622,-824.7413,69.7717,10.8903,-1, -1);
  5411.     AddStaticVehicle(405,211.8928,-1419.0681,13.1531,135.6236,-1, -1);
  5412.     AddStaticVehicle(461,203.5655,-1441.0552,12.6881,319.3540,-1, -1);
  5413.     AddStaticVehicle(482,216.6308,-1431.9065,13.3691,313.9951,-1, -1);
  5414.     AddStaticVehicle(462,338.6057,-1340.7114,14.1075,116.4867,-1, -1);
  5415.     AddStaticVehicle(439,343.3987,-1353.3427,14.4033,299.2459,-1, -1);
  5416.     AddStaticVehicle(542,412.7446,-1318.5144,14.6645,210.7711,-1, -1);
  5417.     AddStaticVehicle(521,411.1232,-1311.2087,14.5024,140.9818,-1, -1);
  5418.     AddStaticVehicle(562,500.5935,-1304.4486,16.8673,309.5460,-1, -1);
  5419.     AddStaticVehicle(521,531.3096,-1315.9927,16.8135,188.1211,-1, -1);
  5420.     AddStaticVehicle(461,587.8506,-1279.8562,15.9628,75.5049,-1, -1);
  5421.     AddStaticVehicle(463,588.5497,-1282.7085,15.7110,71.1037,-1, -1);
  5422.     AddStaticVehicle(589,569.1940,-1264.3147,16.4483,105.7125,-1, -1);
  5423.     AddStaticVehicle(474,580.0232,-1310.1290,13.6310,190.1793,-1, -1);
  5424.     AddStaticVehicle(463,892.2068,-944.0689,41.3930,346.6371,-1, -1);
  5425.     AddStaticVehicle(496,1039.0024,-925.8621,42.0801,3.8901,-1, -1);
  5426.     AddStaticVehicle(496,1028.1858,-887.8458,41.8743,18.1745,-1, -1);
  5427.     AddStaticVehicle(534,1091.6672,-934.4342,42.7434,181.8923,-1, -1);
  5428.     AddStaticVehicle(496,1196.4460,-887.2950,42.7778,4.9401,-1, -1);
  5429.     AddStaticVehicle(461,1184.3699,-898.7025,42.8468,50.8006,-1, -1);
  5430.     AddStaticVehicle(576,929.9745,-996.4139,37.8311,274.6470,-1, -1);
  5431.     AddStaticVehicle(404,863.1107,-1056.6387,24.8362,216.7097,-1, -1);
  5432.     AddStaticVehicle(463,868.9804,-1068.5559,24.6418,26.0884,-1, -1);
  5433.     AddStaticVehicle(439,783.3749,-1356.8221,13.4354,272.4747,-1, -1);
  5434.     AddStaticVehicle(463,733.6376,-1347.5618,13.0519,258.9138,-1, -1);
  5435.     AddStaticVehicle(536,1696.6791,-2097.0415,13.2841,179.3459,-1, -1);
  5436.     AddStaticVehicle(542,1662.7777,-2110.7148,13.2900,90.3870,-1, -1);
  5437.     AddStaticVehicle(400,1707.4287,-2142.6919,13.6471,229.0505,-1, -1);
  5438.     AddStaticVehicle(567,1725.0461,-2130.4683,13.4259,180.7540,-1, -1);
  5439.     AddStaticVehicle(412,1724.0801,-2092.9343,13.3837,178.9921,-1, -1);
  5440.     AddStaticVehicle(536,1747.4430,-2097.3616,13.2870,179.0798,-1, -1);
  5441.     AddStaticVehicle(576,1793.3020,-2149.7551,13.2392,180.6801,-1, -1);
  5442.     AddStaticVehicle(536,1772.7323,-2096.0732,13.2853,181.7548,-1, -1);
  5443.     AddStaticVehicle(549,1948.6121,-2114.0183,13.2416,90.8657,-1, -1);
  5444.     AddStaticVehicle(475,2014.0079,-1597.3103,13.3757,134.4442,-1, -1);
  5445.     AddStaticVehicle(466,2057.4875,-1636.5558,13.2887,269.2682,-1, -1);
  5446.     AddStaticVehicle(496,2062.4905,-1694.4796,13.3308,89.8789,-1, -1);
  5447.     AddStaticVehicle(533,2062.6511,-1738.6663,13.2560,90.7603,-1, -1);
  5448.     AddStaticVehicle(412,2238.7908,-1630.9789,15.5684,339.3786,-1, -1);
  5449.     AddStaticVehicle(534,2284.0630,-1681.7241,13.8912,0.3629,-1, -1);
  5450.     AddStaticVehicle(475,2271.4482,-1634.8553,15.1246,1.4485,-1, -1);
  5451.     AddStaticVehicle(463,2289.7493,-1685.7275,13.2727,338.6942,-1, -1);
  5452.     AddStaticVehicle(496,2296.9233,-1644.5267,14.5451,178.7794,-1, -1);
  5453.     AddStaticVehicle(474,2328.1565,-1677.1449,14.1746,268.4948,-1, -1);
  5454.     AddStaticVehicle(475,2416.0103,-1707.7166,13.5772,180.6127,-1, -1);
  5455.     AddStaticVehicle(400,2443.6687,-1637.1934,13.3619,180.6244,-1, -1);
  5456.     AddStaticVehicle(426,2500.2908,-1755.7277,13.1737,179.5942,-1, -1);
  5457.     AddStaticVehicle(479,2452.3486,-1784.1185,13.3435,358.6820,-1, -1);
  5458.     AddStaticVehicle(475,2498.7920,-1953.6908,13.2268,180.0759,-1, -1);
  5459.     AddStaticVehicle(482,2482.8601,-1953.4886,13.5429,359.9536,-1, -1);
  5460.     AddStaticVehicle(475,2731.4260,-1937.1626,13.3474,270.9490,-1, -1);
  5461.     AddStaticVehicle(536,2685.3967,-2021.3516,13.2650,179.1453,-1, -1);
  5462.     AddStaticVehicle(475,2644.9438,-1989.3313,13.3576,178.5030,-1, -1);
  5463.     AddStaticVehicle(547,2787.8420,-1876.2371,9.5681,179.4587,-1, -1);
  5464.     AddStaticVehicle(426,2757.7773,-1847.0181,9.4532,21.0801,-1, -1);
  5465.     AddStaticVehicle(521,2654.6636,-1692.5939,8.8779,251.8571,-1, -1);
  5466.     AddStaticVehicle(463,2696.4189,-1669.2604,9.0249,152.7104,-1, -1);
  5467.     AddStaticVehicle(474,2813.8862,-1429.2637,16.0126,357.9624,-1, -1);
  5468.     AddStaticVehicle(546,2792.6982,-1432.1294,19.9428,95.9562,-1, -1);
  5469.     AddStaticVehicle(521,2819.5498,-1427.8861,27.7283,97.0200,-1, -1);
  5470.     AddStaticVehicle(400,2794.7859,-1464.7653,40.1536,180.1253,-1, -1);
  5471.     AddStaticVehicle(418,2816.5820,-1431.5497,40.1556,268.4159,-1, -1);
  5472.     AddStaticVehicle(521,2794.0625,-1576.2109,10.4993,252.9832,-1, -1);
  5473.     AddStaticVehicle(600,2796.4966,-1562.6956,10.6452,89.5535,-1, -1);
  5474.     AddStaticVehicle(426,2822.3193,-1553.4038,10.6672,89.8755,-1, -1);
  5475.     AddStaticVehicle(533,2807.4377,-1540.4016,10.6310,180.0459,-1, -1);
  5476.     AddStaticVehicle(589,2855.3896,-1354.9142,10.8385,271.7889,-1, -1);
  5477.     AddStaticVehicle(521,2850.3010,-1323.3470,10.8710,43.7938,-1, -1);
  5478.     AddStaticVehicle(562,2845.5762,-1287.0035,18.8725,276.4800,-1, -1);
  5479.     AddStaticVehicle(463,2802.9653,-1174.3158,25.0878,148.6355,-1, -1);
  5480.     AddStaticVehicle(589,2814.8518,-1186.5088,24.9740,125.2599,-1, -1);
  5481.     AddStaticVehicle(496,2827.8259,-1165.8298,24.8425,74.4954,-1, -1);
  5482.     AddStaticVehicle(419,2828.4297,-1193.2813,24.7035,319.2678,-1, -1);
  5483.     AddStaticVehicle(521,2686.6938,-1102.2723,68.9335,36.2440,-1, -1);
  5484.     AddStaticVehicle(536,2570.6431,-1101.5728,65.9616,224.2815,-1, -1);
  5485.     AddStaticVehicle(461,2589.6411,-967.6470,80.9740,54.8113,-1, -1);
  5486.     AddStaticVehicle(543,2561.0659,-955.9353,82.5712,189.2468,-1, -1);
  5487.     AddStaticVehicle(543,2499.9092,-961.6536,82.0865,177.1486,-1, -1);
  5488.     AddStaticVehicle(478,2492.5671,-951.8682,82.2364,268.9169,-1, -1);
  5489.     AddStaticVehicle(463,2450.5344,-957.0054,79.5994,88.6032,-1, -1);
  5490.     AddStaticVehicle(521,2359.4319,-648.6396,127.7032,321.5916,-1, -1);
  5491.     AddStaticVehicle(478,2368.4819,-651.1127,127.6424,221.5063,-1, -1);
  5492.     AddStaticVehicle(529,2497.5225,-1063.2612,69.7644,180.0623,-1, -1);
  5493.     AddStaticVehicle(536,2485.7839,-1015.6508,65.0513,332.0788,-1, -1);
  5494.     AddStaticVehicle(475,2453.7122,-1011.7231,59.5763,354.2991,-1, -1);
  5495.     AddStaticVehicle(475,2390.2915,-1487.7120,23.6330,90.8244,-1, -1);
  5496.     AddStaticVehicle(400,2390.6387,-1503.7330,23.9272,270.7136,-1, -1);
  5497.     AddStaticVehicle(463,2389.4578,-1497.8422,23.3752,243.2236,-1, -1);
  5498.     AddStaticVehicle(545,2396.8088,-1536.9807,23.8111,0.1546,-1, -1);
  5499.     AddStaticVehicle(479,2407.3284,-1538.0587,23.7968,0.6749,-1, -1);
  5500.     AddStaticVehicle(466,2412.8625,-1537.3831,23.7432,357.6566,-1, -1);
  5501.     AddStaticVehicle(475,2449.7637,-1556.8450,23.8046,1.3418,-1, -1);
  5502.     AddStaticVehicle(529,2454.6299,-1557.0045,23.6327,180.1560,-1, -1);
  5503.     AddStaticVehicle(496,2477.5659,-1557.4111,23.7818,358.5618,-1, -1);
  5504.     AddStaticVehicle(463,2491.4055,-1535.6182,23.5519,59.4337,-1, -1);
  5505.     AddStaticVehicle(461,2491.1179,-1529.3501,23.5688,56.2088,-1, -1);
  5506.     AddStaticVehicle(521,2491.4360,-1532.5398,23.5717,55.7102,-1, -1);
  5507.     AddStaticVehicle(496,2489.5791,-1518.4509,23.7588,269.8171,-1, -1);
  5508.     AddStaticVehicle(562,2482.6208,-1557.3427,23.6524,2.3099,-1, -1);
  5509.     AddStaticVehicle(468,2499.0034,-1538.0708,23.6439,335.4962,-1, -1);
  5510.     AddStaticVehicle(536,2520.1445,-1480.9065,23.7363,1.3232,-1, -1);
  5511.     AddStaticVehicle(533,2573.5979,-1489.6091,23.7162,87.7542,-1, -1);
  5512.     AddStaticVehicle(521,2554.3159,-1367.9281,31.7872,241.1393,-1, -1);
  5513.     AddStaticVehicle(536,2411.6626,-1390.6456,24.0787,268.8195,-1, -1);
  5514.     AddStaticVehicle(533,1819.8600,-1403.5051,13.1363,89.9457,-1, -1);
  5515.     AddStaticVehicle(496,1809.4696,-1432.1268,13.0139,274.7705,-1, -1);
  5516.     AddStaticVehicle(400,2784.2922,-2387.0547,13.7279,89.7828,-1, -1);
  5517.     AddStaticVehicle(400,2753.1467,-2387.5439,13.7358,1.3794,-1, -1);
  5518.     AddStaticVehicle(552,2656.9172,-2451.1821,13.3204,93.4499,-1, -1);
  5519.     AddStaticVehicle(422,2428.1499,-2492.5559,13.6317,45.6813,-1, -1);
  5520.     AddStaticVehicle(530,2435.3372,-2434.5278,13.3911,41.7356,-1, -1);
  5521.     AddStaticVehicle(530,2418.4021,-2506.5557,13.4131,273.4680,-1, -1);
  5522.     AddStaticVehicle(455,2152.5361,-2148.2825,13.9860,310.8004,-1, -1);
  5523.     AddStaticVehicle(439,1373.6738,-1634.1741,13.2790,271.5004,-1, -1);
  5524.     AddStaticVehicle(542,1362.9803,-1659.5125,13.1263,270.4668,-1, -1);
  5525.     AddStaticVehicle(475,1359.6680,-1749.6177,13.1843,0.0962,-1, -1);
  5526.     AddStaticVehicle(439,1401.3602,-1507.1211,13.4834,163.4146,-1, -1);
  5527.     AddStaticVehicle(475,1500.1357,-1487.4355,13.3556,91.3002,-1, -1);
  5528.     AddStaticVehicle(542,1797.1293,-1701.1102,13.2757,179.5340,-1, -1);
  5529.     AddStaticVehicle(521,1807.9387,-1688.3774,13.1068,105.3693,-1, -1);
  5530.     AddStaticVehicle(475,306.7730,-1438.4087,27.7341,120.6372,-1, -1);
  5531.     AddStaticVehicle(475,1277.5547,-1610.1168,13.3511,90.3928,-1, -1);
  5532.     AddStaticVehicle(475,1145.1482,-1366.7389,13.5456,184.4175,-1, -1);
  5533.     AddStaticVehicle(418,2090.4797,-1556.7979,13.2113,181.8175,-1, -1);
  5534.     AddStaticVehicle(554,2224.8198,-2211.0693,13.6286,314.5282,-1, -1);
  5535.     AddStaticVehicle(439,2393.2522,-1927.3457,13.2782,179.4218,-1, -1);
  5536.     AddStaticVehicle(475,2383.3689,-1928.1165,13.1844,179.4976,-1, -1);
  5537.     AddStaticVehicle(521,2376.8760,-1929.3613,12.9563,341.1395,-1, -1);
  5538.     AddStaticVehicle(439,2349.1824,-2000.2684,13.2666,267.0585,-1, -1);
  5539.     AddStaticVehicle(542,1512.3342,-2211.7639,13.2940,359.3842,-1, -1);
  5540.     AddStaticVehicle(518,1546.2539,-2211.5557,13.2254,178.7042,-1, -1);
  5541.     AddStaticVehicle(521,1560.0939,-2243.5127,13.1179,94.0584,-1, -1);
  5542.     AddStaticVehicle(518,1454.6436,-2224.9185,13.2177,0.2168,-1, -1);
  5543.     AddStaticVehicle(496,1408.1469,-2242.1521,13.2630,359.3946,-1, -1);
  5544.     AddStaticVehicle(439,1398.1570,-2225.4885,13.4427,179.6260,-1, -1);
  5545.     AddStaticVehicle(475,1391.6555,-2241.8704,13.3495,180.5889,-1, -1);
  5546.     AddStaticVehicle(542,1364.5348,-2242.7036,13.2899,270.7713,-1, -1);
  5547.     AddStaticVehicle(542,1404.6641,-2314.1211,13.2898,180.5298,-1, -1);
  5548.     AddStaticVehicle(518,1411.2491,-2347.3430,13.2101,180.0483,-1, -1);
  5549.     AddStaticVehicle(496,1391.5173,-2364.2131,13.2633,179.7053,-1, -1);
  5550.     AddStaticVehicle(521, 1365.7269, -2351.5515, 13.1069, 87.0619, -1, -1);
  5551.     AddStaticVehicle(487, -146.6659, 1043.2775, 20.1435, 10.6522, 256, 6);
  5552.     return 1;
  5553. }
  5554.  
  5555. public OnGameModeExit()
  5556. {
  5557.     for(new i;MAX_PLAYERS>i;i++)
  5558.     {
  5559.         SaveChar(i);
  5560.     }
  5561.     return 1;
  5562. }
  5563.  
  5564. public OnPlayerRequestClass(playerid, classid)
  5565. {
  5566.     if(Connected[playerid] == 1 && GetPVarInt(playerid, "prelogin") == 0)
  5567.     {
  5568.     SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ], 0, 0, 0, 0, 0, 0, 0);
  5569.     SpawnPlayer(playerid);
  5570.     return 1;
  5571.     }
  5572.     return 0;
  5573. }
  5574.  
  5575.  
  5576. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  5577. {
  5578.  
  5579.     if(!success)
  5580.     {
  5581.     new str[126];
  5582.     format(str, sizeof(str), "Error executing command {FFFFFF}%s{E39656}. Please type /help for a list of available commands.",cmdtext);
  5583.     SendClientMessage(playerid, 0xE39656AA, str);
  5584.     return 1;
  5585.     }
  5586.     return 1;
  5587. }
  5588.  
  5589. public OnPlayerCommandReceived(playerid, cmdtext[])
  5590. {
  5591.     if(Connected[playerid] != 1)
  5592.     {
  5593.         SendClientMessage(playerid, COLOR_RED, "You're not logged in.");
  5594.         return 0;
  5595.     }
  5596.     new cmd[256];
  5597.     format(cmd, 256, "[cmd] [%s]: %s", GetPlayerNameEx(playerid), cmdtext);
  5598.     Log("/logs/cmd.txt", cmd);
  5599.     return 1;
  5600. }
  5601.  
  5602. forward LoadingScreen(playerid);
  5603. public LoadingScreen(playerid)
  5604. {
  5605.     if(fexist(UserPath(playerid)))
  5606.     {
  5607.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  5608.         if(PlayerInfo[playerid][pBanned] > 0)
  5609.         {
  5610.             Connected[playerid] = 0;
  5611.             SendClientMessage(playerid, COLOR_ORANGE, "This account name is banned from the server. Please appeal your ban at http://changeme.com");
  5612.             Kick(playerid);
  5613.             return 1;
  5614.         }
  5615.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  5616.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
  5617.         SetPVarInt(playerid, "prelogin", 1);
  5618.         InterpolateCameraPos(playerid, 2356.6528, -1742.2469, 142.7728, 1174.76, -1377.98, 150.88, 50000, CAMERA_MOVE);
  5619.         InterpolateCameraLookAt(playerid, 1513.8353, -1655.7241, 58.0422, 1513.8353, -1655.7241, 58.0422, 50000, CAMERA_MOVE);
  5620.     }
  5621.     else
  5622.     {   new ip[126]; GetPlayerIp(playerid, ip, 126);
  5623.         new str[126];
  5624.         SetPVarInt(playerid, "prelogin", 1);
  5625.         format(str, sizeof(str), ""COL_WHITE"Type your password below to register a new account. Your IP is %s", ip);
  5626.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_WHITE"Registering...",str,"Register","Quit");
  5627.         InterpolateCameraPos(playerid, 2356.6528, -1742.2469, 142.7728, 1174.76, -1377.98, 150.88, 50000, CAMERA_MOVE);
  5628.         InterpolateCameraLookAt(playerid, 1513.8353, -1655.7241, 58.0422, 1513.8353, -1655.7241, 58.0422, 50000, CAMERA_MOVE);
  5629.         SetPVarInt(playerid, "Quiz", 1);
  5630.     }
  5631.     new PlayerName[MAX_PLAYER_NAME], Length;
  5632.     GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  5633.     Length = strlen(PlayerName);
  5634.     if(PlayerName[Length - 1] == '_' || PlayerName[0] == '_' || strfind(PlayerName, "_", false) == -1)
  5635.     {
  5636.         SendClientMessage(playerid, COLOR_CYAN, "You have failed to connect with a role play name, please select another name.");
  5637.         ShowPlayerDialog(playerid, DIALOG_NAME, DIALOG_STYLE_INPUT,""COL_WHITE"Name Change",""COL_WHITE"Type in another name to play with.","Change","No!");
  5638.         return 1;
  5639.     }
  5640.     return 1;
  5641. }
  5642.  
  5643. public OnPlayerConnect(playerid)
  5644. {
  5645.     settime();
  5646.     SetTimerEx("LoadingScreen", 1500, false, "i", playerid);
  5647.     GameTextForPlayer(playerid, "~w~Loading account info..", 1500, 3);
  5648.     SetPVarInt(playerid, "prelogin", 1);
  5649.     SetPVarInt(playerid, "SpecOff", 1);
  5650.     SetPVarInt(playerid, "givemehit", -1);
  5651.     SetPVarInt(playerid, "acceptcontract", -1);
  5652.     ForceClassSelection(playerid);
  5653.     TogglePlayerSpectating(playerid, 1);
  5654.     new PlayerIp[32];
  5655.     GetPlayerIp(playerid, PlayerIp, 32);
  5656.     if(CheckBan(PlayerIp) == 1) {
  5657.     SendClientMessage(playerid, -1, "Your IP is banned from the server.");
  5658.     Kick(playerid);
  5659.     return 1;
  5660.     }
  5661.     GetPlayerIp(playerid, PlayerInfo[playerid][pIp], 50);
  5662.     SetPlayerColor(playerid, 0xFFFFFF00);
  5663.     return 1;
  5664. }
  5665.  
  5666. public OnPlayerDisconnect(playerid, reason)
  5667. {
  5668.     new l[56];
  5669.     if(reason == 0) { l = "Timed out"; }
  5670.     if(reason == 1) { l = "Leaving"; }
  5671.     if(reason == 2) { l = "kicked / banned"; }
  5672.     if(GetPVarInt(playerid, "Cuffed") == 1 && reason != 2)
  5673.     {
  5674.         new brcst[126];
  5675.         format(brcst, sizeof(brcst), "AdmCmd: %s has been automatically prisoned for logging while cuffed. (%s)", GetName(playerid), l);
  5676.         SendClientMessageToAll(COLOR_LIGHTRED, brcst);
  5677.         PlayerInfo[playerid][pJail] = 2700;
  5678.     }
  5679.     if(GetPVarInt(playerid, "Restrained") == 1)
  5680.     {
  5681.         new brcst[126];
  5682.         format(brcst, sizeof(brcst), "AdmCmd: %s has been automatically prisoned for logging while tazed. (%s)", GetName(playerid), l);
  5683.         SendClientMessageToAll(COLOR_LIGHTRED, brcst);
  5684.         PlayerInfo[playerid][pJail] = 2700;
  5685.     }
  5686.     AntiSpam[playerid] = 0;
  5687.     TextDrawHideForPlayer(playerid, Clock);
  5688.     TextDrawHideForPlayer(playerid, WeekDayg);
  5689.     new str[256];
  5690.     format(str, sizeof(str), "%s has left the server (%s)", GetName(playerid), l);
  5691.     ProxDetector(50.0, playerid, str, COLOR_YELLOW);
  5692.     SaveChar(playerid);
  5693.     UnloadChar(playerid);
  5694.     pass[playerid] = -1;
  5695.     spec[playerid] = -1;
  5696.     SetPVarInt(playerid, "SpecOff", 1);
  5697.     TogglePlayerSpectating(playerid, false);
  5698.     SetCameraBehindPlayer(playerid);
  5699.     AdminDuty[playerid] = 0;
  5700.     AutoTPban[playerid] = 0;
  5701.     if(IsPlayerConnected(playerid))
  5702.     {
  5703.         if(GetPVarInt(playerid, "Quiz") == 1)
  5704.         {
  5705.             new account[126];
  5706.             new name[126];
  5707.             GetPlayerName(playerid, name, sizeof(name));
  5708.             format(account, 126, "/users/%s.ini", name);
  5709.             fremove(account);
  5710.         }
  5711.     }
  5712.     for(new i; MAX_PLAYERS>i; i++)
  5713.     if(beingdragged[i] == playerid)
  5714.     {
  5715.         if(GetPVarInt(i, "Dragged") == 1)
  5716.         {
  5717.             SetPVarInt(i, "Dragged", 0);
  5718.             beingdragged[i] = 0;
  5719.         }
  5720.     }
  5721.     if(IsPlayerConnected(playerid))
  5722.     {
  5723.         if(GetPVarInt(playerid, "Injured") == 1)
  5724.         {
  5725.             SaveChar(playerid);
  5726.             Connected[playerid] = 0;
  5727.             PlayerInfo[playerid][pHealth] = -1337;
  5728.         }
  5729.  
  5730.         if(GetPVarInt(playerid, "Recovering") == 1)
  5731.         {
  5732.             SaveChar(playerid);
  5733.             PlayerInfo[playerid][pHealth] = -1337;
  5734.         }
  5735.         else
  5736.         {
  5737.         return 1;
  5738.         }
  5739.     }
  5740.     return 1;
  5741. }
  5742.  
  5743. forward Unmute(playerid);
  5744. public Unmute(playerid)
  5745. {
  5746.     mute[playerid] = 0;
  5747. }
  5748.  
  5749. forward ansp(playerid);
  5750. public ansp(playerid)
  5751. {
  5752.     AntiSpam[playerid] = 0;
  5753. }
  5754.  
  5755. public OnPlayerSpawn(playerid)
  5756. {
  5757.     TextDrawShowForPlayer(playerid, Clock);
  5758.     TextDrawShowForPlayer(playerid, WeekDayg);
  5759.     Connected[playerid] = 1;
  5760.     SetPlayerWeaponsEx(playerid);
  5761.     if(PlayerInfo[playerid][pJail] > 0)
  5762.     {
  5763.     SetPlayerInterior(playerid, 6);
  5764.     SetPlayerVirtualWorld(playerid, 1337);
  5765.     SetPlayerPos(playerid, 264.67, 77.79, 1001.04);
  5766.     return 1;
  5767.     }
  5768.     if(GetPVarInt(playerid, "Injured") == 1)
  5769.     {
  5770.         iitimer[playerid] = SetTimerEx("LoseHP", 20000, true, "i", playerid);
  5771.         SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
  5772.         SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
  5773.         ClearAnimations(playerid, 1);
  5774.         GameTextForPlayer(playerid, "~w~ Type ~r~/ems~w~ or ~r~/giveup~w~.", 6000, 3);
  5775.         SendClientMessage(playerid, COLOR_RED, "You are critically injured. You have to call for EMS or give up hope.");
  5776.         ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 0);
  5777.         return 1;
  5778.     }
  5779.     if(GetPVarInt(playerid, "Recovering") == 1)
  5780.     {
  5781.         SetPlayerInterior(playerid, 0);
  5782.         SetPlayerVirtualWorld(playerid, 0);
  5783.         SetPlayerHealth(playerid, 40);
  5784.         TogglePlayerControllable(playerid, 0);
  5785.         SetPlayerCameraPos(playerid, 1201.5009,-1325.1001,16.6868);
  5786.         SetPlayerCameraLookAt(playerid, 1176.9282,-1323.5554,14.0455);
  5787.         return 1;
  5788.     }
  5789.     if(GetPVarInt(playerid, "Recovering") == 2)
  5790.     {
  5791.         SetPlayerInterior(playerid, 0);
  5792.         SetPlayerVirtualWorld(playerid, 0);
  5793.         SetPlayerHealth(playerid, 40);
  5794.         TogglePlayerControllable(playerid, 0);
  5795.         SetPlayerCameraPos(playerid, 2030.01, -1432.00, 23.00);
  5796.         SetPlayerCameraLookAt(playerid, 2031.33, -1408.66, 19.17);
  5797.         return 1;
  5798.     }
  5799.     return 1;
  5800. }
  5801.  
  5802. public OnPlayerDeath(playerid, killerid, reason)
  5803. {
  5804.     if(GetPVarInt(playerid, "InEvent") == 1)
  5805.     {
  5806.         SetPVarInt(playerid, "Injured", 0);
  5807.         SkipWepCheck(playerid);
  5808.         SetPVarInt(playerid, "InEvent", 0);
  5809.         SetPlayerInterior(playerid, oINT[playerid]);
  5810.         SetPlayerVirtualWorld(playerid, oVW[playerid]);
  5811.         SetPlayerPos(playerid, oX[playerid], oY[playerid], oZ[playerid]);
  5812.         SetPlayerHealth(playerid, oHP[playerid]);
  5813.         SkipWepCheck(playerid);
  5814.         SkipACheck(playerid);
  5815.         PlayerInfo[playerid][pArmor] = oA[playerid];
  5816.         SetPlayerArmour(playerid, oA[playerid]);
  5817.         SetPlayerWeaponsEx(playerid);
  5818.         SetPlayerSkin(playerid, oSkin[playerid]);
  5819.         ClearAnimations(playerid);
  5820.         return 1;
  5821.     }
  5822.     if(GetPVarInt(killerid, "acceptcontract") == playerid)
  5823.     {
  5824.         if(AdminDuty[playerid] == 1 || AdminDuty[killerid] == 1) return 1;
  5825.         if(PlayerInfo[playerid][pContracted] != 1) return 1;
  5826.         new str[126];
  5827.         format(str, sizeof(str), "You have been critically wounded by a hitman and have lost $%i. This note was left: %s", PlayerInfo[playerid][pContractAmount], PlayerInfo[playerid][pContractReason]);
  5828.         SendClientMessage(playerid, COLOR_YELLOW, str);
  5829.         format(str, sizeof(str), "Hitman %s has completed the hit on %s and got $%i.", GetName(killerid), GetName(playerid), PlayerInfo[playerid][pContractAmount]);
  5830.         SendClientMessage(killerid, -1, "You have completed a contract. A successfull hit has been added to your hitman statistics.");
  5831.         PlayerInfo[playerid][pCash] -= PlayerInfo[playerid][pContractAmount];
  5832.         PlayerInfo[killerid][pCash] += PlayerInfo[playerid][pContractAmount];
  5833.         SendClientMessageToHA(COLOR_YELLOW, str);
  5834.         PlayerInfo[playerid][pContracted] = 0;
  5835.         format(PlayerInfo[playerid][pContractReason], 126, "None");
  5836.         PlayerInfo[playerid][pContractAmount] = 0;
  5837.         format(PlayerInfo[playerid][pContractedBy], 126, "None");
  5838.         SetPVarInt(killerid, "givemehit", -1);
  5839.         SetPVarInt(killerid, "acceptcontract", -1);
  5840.         PlayerInfo[killerid][pSuccess]++;
  5841.     }
  5842.     if(GetPVarInt(playerid, "acceptcontract") == killerid)
  5843.     {
  5844.         if(AdminDuty[playerid] == 1 || AdminDuty[killerid] == 1) return 1;
  5845.         if(PlayerInfo[killerid][pContracted] != 1) return 1;
  5846.         new str[126];
  5847.         format(str, sizeof(str), "You have critically wounded the hitman that was after you. You got: $%i. Contracted by %s for %s.", PlayerInfo[killerid][pContractAmount], PlayerInfo[killerid][pContractedBy],PlayerInfo[killerid][pContractReason]);
  5848.         SendClientMessage(killerid, COLOR_YELLOW, str);
  5849.         format(str, sizeof(str), "Hitman %s has failed the hit on %s.", GetName(playerid), GetName(killerid));
  5850.         SendClientMessage(playerid, -1, "You have failed a contract. A failed hit has been added to your hitman statistics.");
  5851.         SendClientMessageToHA(COLOR_YELLOW, str);
  5852.         PlayerInfo[playerid][pCash] -= PlayerInfo[killerid][pContractAmount];
  5853.         PlayerInfo[killerid][pCash] += PlayerInfo[killerid][pContractAmount];
  5854.         PlayerInfo[killerid][pContracted] = 0;
  5855.         format(PlayerInfo[killerid][pContractReason], 126, "None");
  5856.         PlayerInfo[killerid][pContractAmount] = 0;
  5857.         format(PlayerInfo[killerid][pContractedBy], 126, "None");
  5858.         SetPVarInt(playerid, "givemehit", -1);
  5859.         SetPVarInt(playerid, "acceptcontract", -1);
  5860.         PlayerInfo[playerid][pFailed]++;
  5861.     }
  5862.     if(reason == 40 || reason == 43 || reason == 44 || reason == 45 || reason == 46 || reason == 46)
  5863.     {
  5864.         new string[156];
  5865.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Fake kills death (%i)", GetName(playerid), reason);
  5866.         PlayerInfo[playerid][pBanned] = 1;
  5867.         new ip[28];
  5868.         GetPlayerIp(playerid, ip, sizeof(ip));
  5869.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  5870.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Fake kills death (%i)", GetName(playerid), ip, reason);
  5871.         Log("/logs/ban.txt", string);
  5872.         AddBan(ip);
  5873.         Kick(playerid);
  5874.         return 1;
  5875.     }
  5876.     for(new i; MAX_PLAYERS>i; i++)
  5877.     if(beingdragged[i] == playerid)
  5878.     {
  5879.         if(GetPVarInt(i, "Dragged") == 1)
  5880.         {
  5881.             SetPVarInt(i, "Dragged", 0);
  5882.             beingdragged[i] = 0;
  5883.         }
  5884.     }
  5885.     if(PlayerInfo[playerid][pAdmin] > 0 && AdminDuty[playerid] == 1)
  5886.     {
  5887.         GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
  5888.         SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ], 0, 0, 0, 0, 0, 0, 0);
  5889.         SpawnPlayer(playerid);
  5890.         SetPlayerHealth(playerid, 100);
  5891.     }
  5892.     if(reason == 50)
  5893.     {
  5894.         new string[128];
  5895.         format(string, 128, "AdmWarn: %s (ID: %i) has possibly just helibladed %s.", GetName(killerid), killerid, GetName(playerid));
  5896.         SendClientMessageToAdmins(COLOR_YELLOW, string, 1);
  5897.     }
  5898.     if(reason == 49)
  5899.     {
  5900.         new string[128];
  5901.         format(string, 128, "AdmWarn: %s (ID: %i) has possibly just car rammed %s to death.", GetName(killerid), killerid, GetName(playerid));
  5902.         SendClientMessageToAdmins(COLOR_YELLOW, string, 1);
  5903.     }
  5904.     if(AdminDuty[playerid] > 0)
  5905.     {
  5906.     return 1;
  5907.     }
  5908.     if(PlayerInfo[playerid][pJail] > 0)
  5909.     {
  5910.         SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 264.67, 77.79, 1001.04, 0, 0, 0, 0, 0, 0, 0);
  5911.         SpawnPlayer(playerid);
  5912.         return 1;
  5913.     }
  5914.     if(GetPVarInt(playerid, "Recovering") == 1) // to prevent double recovering in case of a bug
  5915.     {
  5916.         SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1178, -1324, 5.11, 0, 0, 0, 0, 0, 0, 0);
  5917.         SpawnPlayer(playerid);
  5918.         TogglePlayerControllable(playerid, 0);
  5919.         return 1;
  5920.     }
  5921.  
  5922.     if(GetPVarInt(playerid, "Injured") != 1)
  5923.     {
  5924.         SetPVarInt(playerid, "Injured", 1);
  5925.         PlayerInfo[playerid][pVW] = GetPlayerVirtualWorld(playerid);
  5926.         PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
  5927.         GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
  5928.         SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ], 0, 0, 0, 0, 0, 0, 0);
  5929.         GetPlayerPos(playerid, iX[playerid], iY[playerid], iZ[playerid]);
  5930.         itimer[playerid] = SetTimerEx("checkmoved", 1000, true, "i", playerid);
  5931.         PreloadAnims(playerid);
  5932. //      SendClientMessage(playerid, -1, "Entering injured state.");
  5933.     }
  5934.     else
  5935.     {
  5936.         new rand = random(2);
  5937.         if(rand == 1)
  5938.         {
  5939.             SendClientMessage(playerid, -1, "The medics failed to save you, and you were immediately sent to hospital.");
  5940.             RecoverHospital(playerid);
  5941.             KillTimer(iitimer[playerid]);
  5942.             KillTimer(itimer[playerid]);
  5943.             SetTimerEx("RecoverHospital2", 6000, false, "i", playerid);
  5944.             SetTimerEx("RecoverHospital3", 8000, false, "i", playerid);
  5945.             SetTimerEx("RecoverHospital4", 10000, false, "i", playerid);
  5946.             SetTimerEx("RecoverHospital5", 12000, false, "i", playerid);
  5947.             SetTimerEx("RecoverHospital6", 14000, false, "i", playerid);
  5948.             SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1178, -1324, 8.11, 0, 0, 0, 0, 0, 0, 0);
  5949.             SetPVarInt(playerid, "Injured", 0);
  5950.             SetPVarInt(playerid, "Recovering", 1);
  5951.             SpawnPlayer(playerid);
  5952.             PlayerInfo[killerid][pKills]++;
  5953.             PlayerInfo[playerid][pDeaths]++;
  5954.             TogglePlayerControllable(playerid, 1);
  5955.             return 1;
  5956.         }
  5957.         else
  5958.         {
  5959.             SendClientMessage(playerid, -1, "The medics failed to save you, and you were immediately sent to hospital.");
  5960.             RecoverHospital(playerid);
  5961.             KillTimer(iitimer[playerid]);
  5962.             KillTimer(itimer[playerid]);
  5963.             SetTimerEx("RecoverHospital2", 6000, false, "i", playerid);
  5964.             SetTimerEx("RecoverHospital3", 8000, false, "i", playerid);
  5965.             SetTimerEx("RecoverHospital4", 10000, false, "i", playerid);
  5966.             SetTimerEx("RecoverHospital5", 12000, false, "i", playerid);
  5967.             SetTimerEx("RecoverHospital26", 14000, false, "i", playerid);
  5968.             SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 2029.52, -1421.81, 10.99, 0, 0, 0, 0, 0, 0, 0);
  5969.             SetPVarInt(playerid, "Injured", 0);
  5970.             SetPVarInt(playerid, "Recovering", 2);
  5971.             SpawnPlayer(playerid);
  5972.             PlayerInfo[killerid][pKills]++;
  5973.             PlayerInfo[playerid][pDeaths]++;
  5974.             TogglePlayerControllable(playerid, 1);
  5975.             return 1;
  5976.         }
  5977.     }
  5978.     return 1;
  5979. }
  5980.  
  5981. public OnVehicleSpawn(vehicleid)
  5982. {
  5983.     new plate[126];
  5984.     format(plate, sizeof(plate), "LS%i", vehicleid);
  5985.     SetVehicleNumberPlate(vehicleid, plate);
  5986.     return 1;
  5987. }
  5988.  
  5989. public OnVehicleDeath(vehicleid, killerid)
  5990. {
  5991.     for(new i; i < MAX_PLAYERS; i++)
  5992.     if(IsATruck(vehicleid))
  5993.     {
  5994.         if(truckloadedon[i] == vehicleid && truckloadedon[i] != -1 && truckloaded[i] == 1)
  5995.         {
  5996.             DisablePlayerCheckpoint(i);
  5997.             SendClientMessage(i, COLOR_GRAD1, "Your truck suffered terminal damage and your trucking route was cancelled.");
  5998.             truckloadedon[i] = -1;
  5999.             CPT[i] = 0;
  6000.             return 1;
  6001.         }
  6002.     }
  6003.     return 1;
  6004. }
  6005.  
  6006. public OnPlayerText(playerid, text[])
  6007. {
  6008.     if(AntiSpam[playerid] > 1)
  6009.     {
  6010.         SetTimerEx("ansp", 100, false, "i", playerid);
  6011.     }
  6012.     AntiSpam[playerid] += 1;
  6013.     if(AntiSpam[playerid] > 10)
  6014.     {
  6015.         new str[156];
  6016.         format(str, sizeof(str), "AdmWarn: %s may possibly have attempted to crash the server.", GetName(playerid));
  6017.         SendClientMessageToAdmins(COLOR_RED, str, 1);
  6018.         Kick(playerid);
  6019.         Log("logs/crasher.txt", str);
  6020.     }
  6021.     new message[128], string[126];
  6022.  
  6023.     if(OnCall[playerid] == -1 || OnCall[playerid] == 0)
  6024.     {
  6025.         format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
  6026.         ProxDetector(30.0, playerid, message, -1);
  6027.         Log("/logs/chat.txt", message);
  6028.         SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
  6029.     }
  6030.     if(OnCall[playerid] != -1 && OnCall[playerid] != 0)
  6031.     {
  6032.         format(string, sizeof(string), "(cellphone) %s says: %s", GetPlayerNameEx(playerid), text);
  6033.         ProxDetector(20.0, playerid, string,COLOR_FADE1);
  6034.         SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
  6035.     }
  6036.        
  6037.     if(IsPlayerConnected(OnCall[playerid]))
  6038.     {
  6039.         if(OnCall[OnCall[playerid]] == playerid)
  6040.         {
  6041.             SendClientMessage(OnCall[playerid], COLOR_YELLOW, string);
  6042.             Log("/logs/cellphone.txt", message);
  6043.         }
  6044.     }
  6045.     return 0;
  6046. }
  6047.  
  6048. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  6049. {
  6050.     if(ispassenger) return 1;
  6051.     if(IsACopCar(vehicleid))
  6052.     {
  6053.         if(PlayerInfo[playerid][pFaction] != 1)
  6054.         {
  6055.             SendClientMessage(playerid, COLOR_OOC, "You are not in the LSPD!");
  6056.             GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
  6057.             SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]+0.5);
  6058.         }
  6059.     }
  6060.     if(IsAnAmbulance(vehicleid))
  6061.     {
  6062.         if(PlayerInfo[playerid][pFaction] != 3)
  6063.         {
  6064.             SendClientMessage(playerid, COLOR_OOC, "You are not in the LSFMD!");
  6065.             GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
  6066.             SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]+0.5);
  6067.         }
  6068.     }
  6069.     if(IsA3Truck(vehicleid))
  6070.     {
  6071.         if(PlayerInfo[playerid][pJob] == 1 && PlayerInfo[playerid][pTruckerSkill] < 200)
  6072.         {
  6073.             SendClientMessage(playerid, COLOR_OOC, "You are not a level 3 trucker.");
  6074.             GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
  6075.             SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]+0.5);
  6076.         }
  6077.     }
  6078.     if(IsA2Truck(vehicleid))
  6079.     {
  6080.         if(PlayerInfo[playerid][pJob] == 1 && PlayerInfo[playerid][pTruckerSkill] < 100)
  6081.         {
  6082.             SendClientMessage(playerid, COLOR_OOC, "You are not a level 2 trucker.");
  6083.             GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
  6084.             SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]+0.5);
  6085.         }
  6086.     }
  6087.     if(IsA5Truck(vehicleid))
  6088.     {
  6089.         if(PlayerInfo[playerid][pJob] == 1 && PlayerInfo[playerid][pTruckerSkill] < 400)
  6090.         {
  6091.             SendClientMessage(playerid, COLOR_OOC, "You are not a level 5 trucker.");
  6092.             GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
  6093.             SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]+0.5);
  6094.         }
  6095.     }
  6096.     if(IsATruck(vehicleid))
  6097.     {
  6098.         if(PlayerInfo[playerid][pJob] != 1)
  6099.         {
  6100.             SendClientMessage(playerid, COLOR_OOC, "You are not a trucker.");
  6101.             GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
  6102.             SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]+0.5);
  6103.         }
  6104.     }
  6105.     return 1;
  6106. }
  6107.  
  6108. public OnPlayerExitVehicle(playerid, vehicleid)
  6109. {
  6110.     //new string[128];
  6111.     cardetain[playerid] = vehicleid;
  6112. //  format(string, 128, "#DEBUG# Detain-Vehicle for %s is now %i.", GetName(playerid), cardetain[playerid]);
  6113. //  SendClientMessageToAll(COLOR_CYAN, string);
  6114.     return 1;
  6115. }
  6116.  
  6117. public OnPlayerStateChange(playerid, newstate, oldstate)
  6118. {
  6119.     if(newstate == 2)
  6120.     {
  6121.         carsentered[playerid] += 1;
  6122.         if(carsentered[playerid] > 5 && dontcheck[playerid] != 1)
  6123.         {
  6124.             new string[126];
  6125.             format(string, sizeof(string), "AdmWarn: %s (ID: %i) may possibly be warp-hacking.", GetName(playerid), playerid);
  6126.             SendClientMessageToAdmins(COLOR_YELLOW, string, 1);
  6127.             SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  6128.             dontcheck[playerid] = 1;
  6129.         }
  6130.     }
  6131.     if(newstate == 2)
  6132.     {
  6133.         new car = GetPlayerVehicleID(playerid);
  6134.         for(new x;x<MAX_PLAYER_VEHICLES;x++)
  6135.         {
  6136.             if(PlayerInfo[playerid][pVehicleSpawnedID][x] == car)
  6137.             {
  6138.                 SendClientMessage(playerid, -1, "This is your vehicle.");
  6139.             }
  6140.         }
  6141.         new str[126];
  6142.         for(new x;x<MAX_PLAYERS;x++)
  6143.         {
  6144.             for(new y;y<MAX_PLAYER_VEHICLES;y++)
  6145.             {
  6146.                 if(PlayerInfo[x][pVehicleSpawnedID][y] == car && x != playerid)
  6147.                 {
  6148.                    format(str, sizeof(str), "This vehicle is registered to %s.", GetName(x));
  6149.                    SendClientMessage(playerid, -1, str);
  6150.                 }
  6151.             }
  6152.         }
  6153.     }
  6154.     if(newstate == 2)
  6155.     {
  6156.         if(IsATruck(GetPlayerVehicleID(playerid)) && PlayerInfo[playerid][pJob] != 1)
  6157.         {
  6158.         RemovePlayerFromVehicle(playerid);
  6159.         }
  6160.     }
  6161.     if(newstate == 2)
  6162.     {
  6163.         if(IsADSV(GetPlayerVehicleID(playerid)))
  6164.         {
  6165.         new strbuy[126];
  6166.         format(strbuy, sizeof(strbuy), "You can buy this vehicle. \n Price: $%i", GetVehicleCost(GetVehicleModel(GetPlayerVehicleID(playerid))));
  6167.         ShowPlayerDialog(playerid, DIALOG_BUYCAR, DIALOG_STYLE_MSGBOX, "Buy car", strbuy, "Buy", "Close");
  6168.         }
  6169.     }
  6170.     if(newstate == 2)
  6171.     {
  6172.         if(IsATruck(GetPlayerVehicleID(playerid)))
  6173.         {
  6174.         SendClientMessage(playerid, COLOR_YELLOW, "You've entered a truck. /loadtruck to load some goods.");
  6175.         }
  6176.     }
  6177.     if(newstate == 2)
  6178.     {
  6179.         if(IsA3Truck(GetPlayerVehicleID(playerid)) && PlayerInfo[playerid][pJob] == 1 && PlayerInfo[playerid][pTruckerSkill] < 300)
  6180.         {
  6181.         RemovePlayerFromVehicle(playerid);
  6182.         SendClientMessage(playerid, COLOR_GREY, "You are not a level 3 trucker.");
  6183.         }
  6184.     }
  6185.     if(newstate == 2)
  6186.     {
  6187.         if(IsA5Truck(GetPlayerVehicleID(playerid)) && PlayerInfo[playerid][pJob] == 1 && PlayerInfo[playerid][pTruckerSkill] < 500)
  6188.         {
  6189.         RemovePlayerFromVehicle(playerid);
  6190.         SendClientMessage(playerid, COLOR_GREY, "You are not a level 5 trucker.");
  6191.         }
  6192.     }
  6193.     if(newstate == 2)
  6194.     {
  6195.         if(IsACopCar(GetPlayerVehicleID(playerid)) && PlayerInfo[playerid][pFaction] != 1)
  6196.         {
  6197.         RemovePlayerFromVehicle(playerid);
  6198.         }
  6199.     }
  6200.     if(newstate == 2)
  6201.     {
  6202.         if(IsAnAmbulance(GetPlayerVehicleID(playerid)) && PlayerInfo[playerid][pFaction] != 3)
  6203.         {
  6204.         RemovePlayerFromVehicle(playerid);
  6205.         }
  6206.     }
  6207.     return 1;
  6208. }
  6209.  
  6210. CMD:doors(playerid, params[])
  6211. {
  6212.     if(!IsPlayerInRangeOfPoint(playerid, 5, 245.89999390,72.50000000,1002.59997559)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the LSPD doors.");
  6213.     if(PlayerInfo[playerid][pFaction] != 1 && PlayerInfo[playerid][pFaction] != 2) return SendClientMessage(playerid, COLOR_GREY, "You are not in the LSPD.");
  6214.     if(LSPDDoorStatus == 0)
  6215.     {
  6216.         MoveObject(LSPDDoor1, 240.89999390,72.50000000,1002.59997559, 3);
  6217.         MoveObject(LSPDDoor2, 251.89999390,72.50000000,1002.59997559, 3);
  6218.         SendClientMessage(playerid, -1, "Doors opened.");
  6219.         LSPDDoorStatus = 1;
  6220.         return 1;
  6221.     }
  6222.     if(LSPDDoorStatus == 1)
  6223.     {
  6224.         MoveObject(LSPDDoor1, 244.89999390,72.50000000,1002.59997559, 3);
  6225.         MoveObject(LSPDDoor2, 247.89999390,72.50000000,1002.59997559, 3);
  6226.         SendClientMessage(playerid, -1, "Doors closed.");
  6227.         LSPDDoorStatus = 0;
  6228.         return 1;
  6229.     }
  6230.     return 1;
  6231. }
  6232.  
  6233. CMD:gate(playerid, params[])
  6234. {
  6235.     /* LSPD BARRIER */
  6236.     new str[126];
  6237.     if(IsPlayerInRangeOfPoint(playerid, 8, 1544.79, -1627.07, 13.37))
  6238.     {
  6239.         if(PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, COLOR_GREY, "You are not in the LSPD.");
  6240.         if(LSPDBarrierStatus == 0)
  6241.         {
  6242.             format(str, sizeof(str), "%s presses their remote control and opens the barrier.", GetName(playerid));
  6243.             ProxDetector(50.0, playerid, str, COLOR_PURPLE);
  6244.             MoveObject(LSPDBarrier, 1544.69, -1630.80, 13.08, 1, -0.0, -0.0, -0.0);
  6245.             LSPDBarrierStatus = 1;
  6246.             return 1;
  6247.         }
  6248.         if(LSPDBarrierStatus == 1)
  6249.         {
  6250.             format(str, sizeof(str), "%s presses their remote control and closes the barrier.", GetName(playerid));
  6251.             ProxDetector(50.0, playerid, str, COLOR_PURPLE);
  6252.             MoveObject(LSPDBarrier, 1544.69, -1630.80, 13.08, 1, -90.00, -0.0, -0.0);
  6253.             LSPDBarrierStatus = 0;
  6254.             return 1;
  6255.         }
  6256.     }
  6257.     /* LSPD GATE */
  6258.     if(IsPlayerInRangeOfPoint(playerid, 8, 1588.31, -1637.49, 13.37))
  6259.     {
  6260.         if(PlayerInfo[playerid][pFaction] != 1) return SendClientMessage(playerid, COLOR_GREY, "You are not in the LSPD.");
  6261.         if(LSPDGateStatus == 0)
  6262.         {
  6263.             format(str, sizeof(str), "%s presses their remote control and opens the gate.", GetName(playerid));
  6264.             ProxDetector(50.0, playerid, str, COLOR_PURPLE);
  6265.             MoveObject(LSPDGate, 1589.04, -1637.95, 7.73, 2);
  6266.             LSPDGateStatus = 1;
  6267.             return 1;
  6268.         }
  6269.         if(LSPDGateStatus == 1)
  6270.         {
  6271.             format(str, sizeof(str), "%s presses their remote control and closes the gate.", GetName(playerid));
  6272.             ProxDetector(50.0, playerid, str, COLOR_PURPLE);
  6273.             MoveObject(LSPDGate, 1589.04, -1637.95, 14.73, 2);
  6274.             LSPDGateStatus = 0;
  6275.             return 1;
  6276.         }
  6277.     }
  6278.     return 1;
  6279. }
  6280.  
  6281.  
  6282. CMD:unbanip(playerid, params[])
  6283. {
  6284.     if(PlayerInfo[playerid][pAdmin] >= 4)
  6285.     {
  6286.         if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  6287.         {
  6288.             SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  6289.             return 1;
  6290.         }
  6291.         if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unbanip [ip]");
  6292.  
  6293.         new string[128];
  6294.         RemoveBan(params);
  6295.         format(string, 128, "AdmCmd: %s has unbanned IP %s", GetName(playerid), params);
  6296.         SendClientMessageToAdmins(COLOR_LIGHTRED,string,1);
  6297.         format(string, sizeof(string), "AdmCmd: %s has unbanned IP %s", GetName(playerid), params);
  6298.         Log("logs/bans.txt", string);
  6299.     }
  6300.  
  6301.     return 1;
  6302. }
  6303. CMD:banip(playerid, params[])
  6304. {
  6305.     if(PlayerInfo[playerid][pAdmin] >= 4)
  6306.     {
  6307.         if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  6308.         {
  6309.             SendClientMessage(playerid,COLOR_WHITE, "You are not on duty as an admin, /aduty to go on duty.");
  6310.             return 1;
  6311.         }
  6312.         if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /banip [ip]");
  6313.  
  6314.         new string[128];
  6315.         AddBan(params);
  6316.         format(string, 128, "AdmCmd: %s has banned IP %s", GetName(playerid), params);
  6317.         SendClientMessageToAdmins(COLOR_LIGHTRED,string,1);
  6318.         format(string, sizeof(string), "AdmCmd: %s has banned IP %s", GetName(playerid), params);
  6319.         Log("logs/bans.txt", string);
  6320.     }
  6321.  
  6322.     return 1;
  6323. }
  6324. CMD:cc(playerid, params[])
  6325. {
  6326.     new string[128];
  6327.     format(string, 128, "Connected = %i. Injured = %i. Recovering = %i", Connected[playerid], GetPVarInt(playerid, "Injured"), GetPVarInt(playerid, "Recovering"));
  6328.     SendClientMessage(playerid, COLOR_CYAN, string);
  6329.     return 1;
  6330. }
  6331. CMD:ct(playerid, params[])
  6332. {
  6333.     new string[128];
  6334.     new truck;
  6335.     if(IsA1Truck(GetPlayerVehicleID(playerid)))
  6336.     {
  6337.     truck = 1;
  6338.     }
  6339.     if(IsA2Truck(GetPlayerVehicleID(playerid)))
  6340.     {
  6341.     truck = 2;
  6342.     }
  6343.     if(IsA3Truck(GetPlayerVehicleID(playerid)))
  6344.     {
  6345.     truck = 3;
  6346.     }
  6347.     if(IsA5Truck(GetPlayerVehicleID(playerid)))
  6348.     {
  6349.     truck = 5;
  6350.     }
  6351.     if(GetPlayerState(playerid) != 2)
  6352.     {
  6353.     truck = 0;
  6354.     }
  6355.     new trailer = GetVehicleTrailer(GetPlayerVehicleID(playerid));
  6356.     if(IsTrailerAttachedToVehicle(trailer))
  6357.     {
  6358.     trailer = 1;
  6359.     }
  6360.     format(string, sizeof(string), "Truck Loaded: %i. CPT: %i. Truck: Level %i. Trailer ID: %i", truckloaded[playerid], CPT[playerid], truck, trailer);
  6361.     SendClientMessage(playerid, COLOR_CYAN, string);
  6362.     return 1;
  6363. }
  6364. public OnPlayerEnterCheckpoint(playerid)
  6365. {
  6366.     if(CPT[playerid] == 3)
  6367.     {
  6368.         new str[128];
  6369.         new rand = random(100)+200;
  6370.         format(str, sizeof(str), "You have delivered the package, and you got %i materials from them.", rand);
  6371.         SendClientMessage(playerid, COLOR_CYAN, str);
  6372.         PlayerInfo[playerid][pMaterials] += rand;
  6373.         CPT[playerid] = 0;
  6374.     }
  6375.     if(GetPlayerState(playerid) == 2)
  6376.     {
  6377.         if(IsA1Truck(GetPlayerVehicleID(playerid))) // Level 1 trucks
  6378.         {
  6379.             if(truckloaded[playerid] == 1)
  6380.             {
  6381.                 if(CPT[playerid] == 1) // Stage: Delivery
  6382.                 {
  6383.                     if(GetPlayerVehicleID(playerid) != truckloadedon[playerid])
  6384.                     {
  6385.                         SendClientMessage(playerid, COLOR_GREY, "This is not the truck that you loaded the goods in.");
  6386.                         CPT[playerid] = 0;
  6387.                         DisablePlayerCheckpoint(playerid);
  6388.                         truckloaded[playerid] = 0;
  6389.                         truckloadedon[playerid] = -1;
  6390.                         return 1;
  6391.                     }
  6392.                     SendClientMessage(playerid, COLOR_GREEN, "You have delivered the goods, and you have been paid $75. You will recieve a bonus of $50");
  6393.                     SendClientMessage(playerid, COLOR_GREEN, "if you return the truck. "COL_RED"You will only recieve a skill point if you return it.");
  6394.                     PlayerInfo[playerid][pCash] += 75;
  6395.                     CPT[playerid] = 2;
  6396.                     DisablePlayerCheckpoint(playerid);
  6397.                     SetPlayerCheckpoint(playerid, 2223.48, -2650.71, 13.40, 15);
  6398.                     return 1;
  6399.                 }
  6400.             }
  6401.             if(truckloaded[playerid] == 1) // Stage: Return
  6402.             {
  6403.                 if(CPT[playerid] == 2)
  6404.                 {
  6405.                     if(GetPlayerVehicleID(playerid) != truckloadedon[playerid])
  6406.                     {
  6407.                         SendClientMessage(playerid, COLOR_GREY, "This is not the truck that you loaded the goods in.");
  6408.                         CPT[playerid] = 0;
  6409.                         DisablePlayerCheckpoint(playerid);
  6410.                         truckloaded[playerid] = 0;
  6411.                         truckloadedon[playerid] = -1;
  6412.                         return 1;
  6413.                     }
  6414.                     SendClientMessage(playerid, COLOR_GREEN, "You have returned the truck, and you have recieved a $50 bonus and a skill point.");
  6415.                     PlayerInfo[playerid][pCash] += 50;
  6416.                     PlayerInfo[playerid][pTruckerSkill] +=1;
  6417.                     DisablePlayerCheckpoint(playerid);
  6418.                     truckloaded[playerid] = 0;
  6419.                     truckloadedon[playerid] = -1;
  6420.                     CPT[playerid] = 0;
  6421.                     return 1;
  6422.                 }
  6423.             }
  6424.             return DisablePlayerCheckpoint(playerid);
  6425.         }
  6426.         if(IsA2Truck(GetPlayerVehicleID(playerid))) // Level 1 trucks
  6427.         {
  6428.             if(truckloaded[playerid] == 1)
  6429.             {
  6430.                 if(CPT[playerid] == 1) // Stage: Delivery
  6431.                 {
  6432.                     if(GetPlayerVehicleID(playerid) != truckloadedon[playerid])
  6433.                     {
  6434.                         SendClientMessage(playerid, COLOR_GREY, "This is not the truck that you loaded the goods in.");
  6435.                         CPT[playerid] = 0;
  6436.                         truckloaded[playerid] = 0;
  6437.                         truckloadedon[playerid] = -1;
  6438.                         DisablePlayerCheckpoint(playerid);
  6439.                         return 1;
  6440.                     }
  6441.                     SendClientMessage(playerid, COLOR_GREEN, "You have delivered the goods, and you have been paid $125. You will recieve a bonus of $50");
  6442.                     SendClientMessage(playerid, COLOR_GREEN, "if you return the truck. "COL_RED"You will only recieve a skill point if you return it.");
  6443.                     PlayerInfo[playerid][pCash] += 125;
  6444.                     CPT[playerid] = 2;
  6445.                     DisablePlayerCheckpoint(playerid);
  6446.                     SetPlayerCheckpoint(playerid, 2223.48, -2650.71, 13.40, 15);
  6447.                     return 1;
  6448.                 }
  6449.             }
  6450.             if(truckloaded[playerid] == 1) // Stage: Return
  6451.             {
  6452.                 if(CPT[playerid] == 2)
  6453.                 {
  6454.                     if(GetPlayerVehicleID(playerid) != truckloadedon[playerid])
  6455.                     {
  6456.                         SendClientMessage(playerid, COLOR_GREY, "This is not the truck that you loaded the goods in.");
  6457.                         CPT[playerid] = 0;
  6458.                         truckloaded[playerid] = 0;
  6459.                         truckloadedon[playerid] = -1;
  6460.                         DisablePlayerCheckpoint(playerid);
  6461.                         return 1;
  6462.                     }
  6463.                     SendClientMessage(playerid, COLOR_GREEN, "You have returned the truck, and you have recieved a $50 bonus and a skill point.");
  6464.                     PlayerInfo[playerid][pCash] += 50;
  6465.                     PlayerInfo[playerid][pTruckerSkill] +=1;
  6466.                     truckloaded[playerid] = 0;
  6467.                     truckloadedon[playerid] = -1;
  6468.                     DisablePlayerCheckpoint(playerid);
  6469.                     CPT[playerid] = 0;
  6470.                     return 1;
  6471.                 }
  6472.             }
  6473.             return DisablePlayerCheckpoint(playerid);
  6474.         }
  6475.         if(IsA3Truck(GetPlayerVehicleID(playerid))) // Level 3 trucks
  6476.         {
  6477.             if(truckloaded[playerid] == 1)
  6478.             {
  6479.                 if(CPT[playerid] == 1) // Stage: Delivery
  6480.                 {
  6481.                     new truck = GetPlayerVehicleID(playerid);
  6482.                     if(!IsTrailerAttachedToVehicle(truck))
  6483.                     {
  6484.                     SendClientMessage(playerid, COLOR_GREY, "You have lost your trailer, and the route have been cancelled.");
  6485.                     CPT[playerid] = 0;
  6486.                     truckloaded[playerid] = 0;
  6487.                     truckloadedon[playerid] = -1;
  6488.                     DisablePlayerCheckpoint(playerid);
  6489.                     return 1;
  6490.                     }
  6491.                     if(GetPlayerVehicleID(playerid) != truckloadedon[playerid])
  6492.                     {
  6493.                         SendClientMessage(playerid, COLOR_GREY, "This is not the truck that you loaded the goods in.");
  6494.                         CPT[playerid] = 0;
  6495.                         truckloaded[playerid] = 0;
  6496.                         truckloadedon[playerid] = -1;
  6497.                         DisablePlayerCheckpoint(playerid);
  6498.                         return 1;
  6499.                     }
  6500.                     new trailer = GetVehicleTrailer(GetPlayerVehicleID(playerid));
  6501.                     SetVehicleToRespawn(trailer);
  6502.                     SendClientMessage(playerid, COLOR_GREEN, "You have delivered the goods, and you have been paid $200. You will recieve a bonus of $50");
  6503.                     SendClientMessage(playerid, COLOR_GREEN, "if you return the truck. "COL_RED"You will only recieve a skill point if you return it.");
  6504.                     PlayerInfo[playerid][pCash] += 200;
  6505.                     CPT[playerid] = 2;
  6506.                     DisablePlayerCheckpoint(playerid);
  6507.                     SetPlayerCheckpoint(playerid, 2223.48, -2650.71, 13.40, 15);
  6508.                     return 1;
  6509.                 }
  6510.             }
  6511.             if(truckloaded[playerid] == 1) // Stage: Return
  6512.             {
  6513.                 if(CPT[playerid] == 2)
  6514.                 {
  6515.                     if(GetPlayerVehicleID(playerid) != truckloadedon[playerid])
  6516.                     {
  6517.                         SendClientMessage(playerid, COLOR_GREY, "This is not the truck that you loaded the goods in.");
  6518.                         CPT[playerid] = 0;
  6519.                         truckloaded[playerid] = 0;
  6520.                         truckloadedon[playerid] = -1;
  6521.                         DisablePlayerCheckpoint(playerid);
  6522.                         return 1;
  6523.                     }
  6524.                     SendClientMessage(playerid, COLOR_GREEN, "You have returned the truck, and you have recieved a $50 bonus and a skill point.");
  6525.                     PlayerInfo[playerid][pCash] += 50;
  6526.                     PlayerInfo[playerid][pTruckerSkill] +=1;
  6527.                     DisablePlayerCheckpoint(playerid);
  6528.                     truckloaded[playerid] = 0;
  6529.                     truckloadedon[playerid] = -1;
  6530.                     CPT[playerid] = 0;
  6531.                     return 1;
  6532.                 }
  6533.             }
  6534.             return DisablePlayerCheckpoint(playerid);
  6535.         }
  6536.         if(IsA5Truck(GetPlayerVehicleID(playerid))) // Level 5 trucks
  6537.         {
  6538.             if(truckloaded[playerid] == 1)
  6539.             {
  6540.                 if(CPT[playerid] == 1) // Stage: Delivery
  6541.                 {
  6542.                     new truck = GetPlayerVehicleID(playerid);
  6543.                     if(!IsTrailerAttachedToVehicle(truck))
  6544.                     {
  6545.                     SendClientMessage(playerid, COLOR_GREY, "You have lost your trailer, and the route have been cancelled.");
  6546.                     CPT[playerid] = 0;
  6547.                     DisablePlayerCheckpoint(playerid);
  6548.                     truckloaded[playerid] = 0;
  6549.                     truckloadedon[playerid] = -1;
  6550.                     return 1;
  6551.                     }
  6552.                     if(GetPlayerVehicleID(playerid) != truckloadedon[playerid])
  6553.                     {
  6554.                         SendClientMessage(playerid, COLOR_GREY, "This is not the truck that you loaded the goods in.");
  6555.                         CPT[playerid] = 0;
  6556.                         DisablePlayerCheckpoint(playerid);
  6557.                         truckloaded[playerid] = 0;
  6558.                         truckloadedon[playerid] = -1;
  6559.                         return 1;
  6560.                     }
  6561.                     new trailer = GetVehicleTrailer(GetPlayerVehicleID(playerid));
  6562.                     SetVehicleToRespawn(trailer);
  6563.                     SendClientMessage(playerid, COLOR_GREEN, "You have delivered the goods, and you have been paid $450. You will recieve a bonus of $50");
  6564.                     SendClientMessage(playerid, COLOR_GREEN, "if you return the truck. "COL_RED"You will only recieve a skill point if you return it.");
  6565.                     PlayerInfo[playerid][pCash] += 200;
  6566.                     DisablePlayerCheckpoint(playerid);
  6567.                     CPT[playerid] = 2;
  6568.                     return 1;
  6569.                 }
  6570.             }
  6571.  
  6572.             if(truckloaded[playerid] == 1)
  6573.             {
  6574.                 if(CPT[playerid] == 2) // Stage: Return
  6575.                 {
  6576.                     if(GetPlayerVehicleID(playerid) != truckloadedon[playerid])
  6577.                     {
  6578.                         SendClientMessage(playerid, COLOR_GREY, "This is not the truck that you loaded the goods in.");
  6579.                         CPT[playerid] = 0;
  6580.                         DisablePlayerCheckpoint(playerid);
  6581.                         truckloaded[playerid] = 0;
  6582.                         truckloadedon[playerid] = -1;
  6583.                         return 1;
  6584.                     }
  6585.                     SendClientMessage(playerid, COLOR_GREEN, "You have returned the truck, and you have recieved a $50 bonus and a skill point.");
  6586.                     PlayerInfo[playerid][pCash] += 50;
  6587.                     PlayerInfo[playerid][pTruckerSkill] +=1;
  6588.                     DisablePlayerCheckpoint(playerid);
  6589.                     truckloaded[playerid] = 0;
  6590.                     truckloadedon[playerid] = -1;
  6591.                     CPT[playerid] = 0;
  6592.                     return 1;
  6593.                 }
  6594.             }
  6595.         }
  6596.     }
  6597.     return DisablePlayerCheckpoint(playerid);
  6598. }
  6599.  
  6600. public OnPlayerLeaveCheckpoint(playerid)
  6601. {
  6602.     return 1;
  6603. }
  6604.  
  6605. public OnPlayerEnterRaceCheckpoint(playerid)
  6606. {
  6607.     return 1;
  6608. }
  6609.  
  6610. public OnPlayerLeaveRaceCheckpoint(playerid)
  6611. {
  6612.     return 1;
  6613. }
  6614.  
  6615. public OnRconCommand(cmd[])
  6616. {
  6617.     return 1;
  6618. }
  6619.  
  6620. public OnPlayerRequestSpawn(playerid)
  6621. {
  6622.     SendClientMessage(playerid, -1, "3");
  6623.     return 1;
  6624. }
  6625.  
  6626. public OnObjectMoved(objectid)
  6627. {
  6628.     return 1;
  6629. }
  6630.  
  6631. public OnPlayerObjectMoved(playerid, objectid)
  6632. {
  6633.     return 1;
  6634. }
  6635.  
  6636. public OnPlayerPickUpPickup(playerid, pickupid)
  6637. {
  6638.     return 1;
  6639. }
  6640.  
  6641. public OnVehicleMod(playerid, vehicleid, componentid)
  6642. {
  6643.     return 1;
  6644. }
  6645.  
  6646. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  6647. {
  6648.     return 1;
  6649. }
  6650.  
  6651. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  6652. {
  6653.     return 1;
  6654. }
  6655.  
  6656. public OnPlayerSelectedMenuRow(playerid, row)
  6657. {
  6658.     return 1;
  6659. }
  6660.  
  6661. public OnPlayerExitedMenu(playerid)
  6662. {
  6663.     return 1;
  6664. }
  6665.  
  6666. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  6667. {
  6668.     return 1;
  6669. }
  6670.  
  6671. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  6672. {
  6673. if(IsKeyJustDown(KEY_YES, newkeys, oldkeys))
  6674. {
  6675. return cmd_enter(playerid, "");
  6676. }
  6677. return 1;
  6678. }
  6679.  
  6680. public OnRconLoginAttempt(ip[], password[], success)
  6681. {
  6682.     return 1;
  6683. }
  6684.  
  6685.  
  6686. public OnPlayerUpdate(playerid)
  6687. {
  6688.         if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  6689.         {
  6690.             for(new i = 0; i < sizeof(SpikeInfo); i++)
  6691.             {
  6692.                 if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
  6693.                 {
  6694.                     if(SpikeInfo[i][sCreated] == 1)
  6695.                     {
  6696.                         new panels, doors, lights, tires;
  6697.                         new carid = GetPlayerVehicleID(playerid);
  6698.                         GetVehicleDamageStatus(carid, panels, doors, lights, tires);
  6699.                         tires = encode_tires(1, 1, 1, 1);
  6700.                         UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
  6701.                         return 0;
  6702.                     }
  6703.                 }
  6704.             }
  6705.         }
  6706.         SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
  6707.         new Float:gx, Float:gy, Float:gz;
  6708.         if(GetPVarInt(playerid, "Dragged") == 1)
  6709.         {
  6710.             if(beingdragged[playerid] == -1)
  6711.             {
  6712.                 SetPVarInt(playerid, "Dragged", 0);
  6713.             }
  6714.             if(beingdragged[playerid] == INVALID_PLAYER_ID)
  6715.             {
  6716.             beingdragged[playerid] = -1;
  6717.             SetPVarInt(playerid, "Dragged", 0);
  6718.             }
  6719.             GetPlayerPos(beingdragged[playerid], gx, gy, gz);
  6720.             SetPlayerInterior(playerid, GetPlayerInterior(beingdragged[playerid]));
  6721.             SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(beingdragged[playerid]));
  6722.             SetPlayerPos(playerid, gx, gy-1, gz);
  6723.         }
  6724.         if(tazer[playerid] == 1)
  6725.         {
  6726.             SetPlayerArmedWeapon(playerid, 23);
  6727.         }
  6728.  
  6729.         if(IsPlayerInRangeOfPoint(playerid, 5, 2212, -2663.03, 13.55))
  6730.         {
  6731.             GameTextForPlayer(playerid, "~g~Trucker Job ~w~- ~r~/join", 5000, 3);
  6732.         }
  6733.         if(IsPlayerInRangeOfPoint(playerid, 5, 1366, -1276, 13.55))
  6734.         {
  6735.             GameTextForPlayer(playerid, "~g~Weapon Dealer Job ~w~- ~r~/join", 5000, 3);
  6736.         }
  6737.         if(IsPlayerInRangeOfPoint(playerid, 5, 1423.70, -1319, 13.55))
  6738.         {
  6739.             GameTextForPlayer(playerid, "~r~ Materials Package ~w~ - ~g~~n~ /getmats to get a package.", 5000, 3);
  6740.         }
  6741.         if(IsPlayerInRangeOfPoint(playerid, 5, 2099.64, -105.84, 0.68))
  6742.         {
  6743.             GameTextForPlayer(playerid, "~r~ Materials Package ~w~ - ~g~~n~ /getmats to get a package.", 5000, 3);
  6744.         }
  6745.         SetPlayerMoney(playerid);
  6746.         new hTime = PlayerInfo[playerid][pHours]/60/60;
  6747.         if(hTime < 8)
  6748.         {
  6749.             SetPlayerScore(playerid, 1);
  6750.             PlayerInfo[playerid][pLevel] = 1;
  6751.             return 1;
  6752.         }
  6753.         if(hTime > 8)
  6754.         {
  6755.             SetPlayerScore(playerid, hTime/8);
  6756.             PlayerInfo[playerid][pLevel] = hTime/8;
  6757.             return 1;
  6758.         }
  6759.         return 1;
  6760. }
  6761.  
  6762. public OnPlayerStreamIn(playerid, forplayerid)
  6763. {
  6764.     return 1;
  6765. }
  6766.  
  6767. public OnPlayerStreamOut(playerid, forplayerid)
  6768. {
  6769.     return 1;
  6770. }
  6771.  
  6772. public OnVehicleStreamIn(vehicleid, forplayerid)
  6773. {
  6774.     return 1;
  6775. }
  6776.  
  6777. public OnVehicleStreamOut(vehicleid, forplayerid)
  6778. {
  6779.     return 1;
  6780. }
  6781.  
  6782.  
  6783. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  6784. {
  6785.     new string[256];
  6786.     if(strfind(inputtext, "%s", true) != -1)
  6787.     {
  6788.         format(string, sizeof(string), "AdmCmd: %s was kicked by system, Reason: Dialog Exploiting", GetName(playerid));
  6789.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  6790.         Kick(playerid);
  6791.         return 1;
  6792.     }
  6793.     switch( dialogid )
  6794.     {
  6795.         case DIALOG_BAR:
  6796.         {
  6797.             if(!response) return -1;
  6798.             if(response)
  6799.             {
  6800.                 switch(listitem)
  6801.                 {
  6802.                     // 0 = Beer ($2) 1= Wine ($5) 2= Cocktail ($4) 3= Piñacolada ($4) 4= Mojito ($4) 5=Cider ($3) 6=Sprunk ($1)
  6803.                     case 0:
  6804.                     {
  6805.                         SetPVarInt(playerid, "DrinkPrice", 2);
  6806.                         SetPVarString(playerid, "DrinkName", "bottle of beer");
  6807.                         SetPVarInt(playerid, "Animation", SPECIAL_ACTION_DRINK_BEER);
  6808.                     }
  6809.                     case 1:
  6810.                     {
  6811.                         SetPVarInt(playerid, "DrinkPrice", 5);
  6812.                         SetPVarString(playerid, "DrinkName", "glass wine");
  6813.                         SetPVarInt(playerid, "Animation", SPECIAL_ACTION_DRINK_WINE);
  6814.                     }
  6815.                     case 2:
  6816.                     {
  6817.                         SetPVarInt(playerid, "DrinkPrice", 4);
  6818.                         SetPVarString(playerid, "DrinkName", "cocktail");
  6819.                         SetPVarInt(playerid, "Animation", SPECIAL_ACTION_DRINK_WINE);
  6820.                     }
  6821.                     case 3:
  6822.                     {
  6823.                         SetPVarInt(playerid, "DrinkPrice", 4);
  6824.                         SetPVarString(playerid, "DrinkName", "glass of piñacolada");
  6825.                         SetPVarInt(playerid, "Animation", SPECIAL_ACTION_DRINK_WINE);
  6826.                     }
  6827.                     case 4:
  6828.                     {
  6829.                         SetPVarInt(playerid, "DrinkPrice", 4);
  6830.                         SetPVarString(playerid, "DrinkName", "glass of mojito");
  6831.                     }
  6832.                     case 5:
  6833.                     {
  6834.                         SetPVarInt(playerid, "DrinkPrice", 3);
  6835.                         SetPVarString(playerid, "DrinkName", "bottle of cider");
  6836.                     }
  6837.                     case 6:
  6838.                     {
  6839.                         SetPVarInt(playerid, "DrinkPrice", 1);
  6840.                         SetPVarString(playerid, "DrinkName", "cup of sprunk");
  6841.                     }
  6842.                 }
  6843.                 new price = GetPVarInt(playerid, "DrinkPrice");
  6844.                 new drink[56];
  6845.                 GetPVarString(playerid, "DrinkName", drink, sizeof(drink));
  6846.                 new action = GetPVarInt(playerid, "Animation");
  6847.                 SetPlayerSpecialAction(playerid, action);
  6848.                 if(price > PlayerInfo[playerid][pCash]) return SendClientMessage(playerid, -1, "You can't afford the drink.");
  6849.                 new str[126];
  6850.                 format(str, sizeof(str), "You bought a %s for $%i", drink, price);
  6851.                 SendClientMessage(playerid, -1, str);
  6852.                 return 1;
  6853.             }
  6854.         }
  6855.  
  6856.         case DIALOG_CHANGENAME:
  6857.         {
  6858.             if(!response) return -1;
  6859.             if(response)
  6860.             {
  6861.                 if(doesAccountExist(inputtext)) return SendClientMessage(playerid, -1, "Name is already taken.");
  6862.                 new oldName[MAX_PLAYER_NAME], str[150];
  6863.                 GetPlayerName(playerid, oldName, sizeof(oldName));
  6864.                 new name[MAX_PLAYER_NAME];
  6865.                 format(name, sizeof(name), "%s", inputtext);
  6866.                 SetPlayerName(playerid, name);
  6867.                 new PlayerName[MAX_PLAYER_NAME], Length;
  6868.                 GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  6869.                 Length = strlen(PlayerName);
  6870.                 if(oldName[playerid] == PlayerName[playerid]) return 1;
  6871.                 if(PlayerName[Length - 1] == '_' || PlayerName[0] == '_' || strfind(PlayerName, "_", false) == -1)
  6872.                 {
  6873.                     SetPlayerName(playerid, oldName);
  6874.                     SendClientMessage(playerid, COLOR_CYAN, "You failed to select a role play name, please select another name.");
  6875.                     ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT,""COL_WHITE"Name Change",""COL_WHITE"Type in another name to use.","Change","No!");
  6876.                     return 1;
  6877.                 }
  6878.                 format(str, sizeof(str), "AdmWarn: %s (ID: %i) has changed name to %s.", oldName, playerid, name);
  6879.                 SendClientMessageToAdmins(COLOR_YELLOW, str, 1);
  6880.                 new account[126];
  6881.                 format(account, sizeof(account), "/users/%s.ini", oldName);
  6882.                 pass[playerid] = PlayerInfo[playerid][pPass];
  6883.                 SetPVarInt(playerid, "RecentlyChangedName", 1);
  6884.                 fremove(account);
  6885.                 Log("/logs/changename.txt", str);
  6886.                 SaveChar(playerid);
  6887.                 INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  6888.                 return 1;
  6889.             }
  6890.         }
  6891.         case DIALOG_REGISTER:
  6892.         {
  6893.             if (!response) return Kick(playerid);
  6894.             if(response)
  6895.             {
  6896.                 if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
  6897.                 new INI:File = INI_Open(UserPath(playerid));
  6898.                 INI_SetTag(File,"data");
  6899.                 INI_WriteInt(File,"Password",udb_hash(inputtext));
  6900.                 INI_WriteInt(File,"Health", 100);
  6901.                 INI_Close(File);
  6902.                 ShowPlayerDialog(playerid, DIALOG_QUIZ, DIALOG_STYLE_LIST, "Quiz - What is deathmatching?", "Duelling someone.\nHaving a boxing fight with someone to death.\nShooting someone for no In Character reason.", "Answer", "Quit");
  6903.                 ForceClassSelection(playerid);
  6904.                 Connected[playerid] = 1;
  6905.                 SetPlayerCameraPos(playerid, 1545.2980, -1361.2811, 368.0274);
  6906.                 SetPlayerCameraLookAt(playerid, 1545.1799, -1362.2729, 367.2717);
  6907.                 InterpolateCameraLookAt(playerid, 1590.0299, -1689.4938, 47.3620, 1412.5718, -1690.9845, 41.9617, 5000, CAMERA_MOVE);
  6908.             }
  6909.         }
  6910.        
  6911.         case DIALOG_BUYCAR:
  6912.         {
  6913.             if (!response) return RemovePlayerFromVehicle(playerid);
  6914.             if(response)
  6915.             {
  6916.                 new car, str[126], ownedcar;
  6917.                 car = GetVehicleModel(GetPlayerVehicleID(playerid));
  6918.                 for(new x;x<MAX_PLAYER_VEHICLES;x++)
  6919.                 {
  6920.                     if(GetVehicleCost(car) == -1) { SendClientMessage(playerid, -1, "Default price has not been changed yet, you can not buy this vehicle."); RemovePlayerFromVehicle(playerid); return 1; }
  6921.                     if(PlayerInfo[playerid][pVehicle][x] == 0)
  6922.                     {
  6923.                         new rand = random(255), rand2 = random(255);
  6924.                         if(PlayerInfo[playerid][pCash] < GetVehicleCost(car)) { SendClientMessage(playerid, -1, "You don't have enough cash."); RemovePlayerFromVehicle(playerid); return 1; }
  6925.                         PlayerInfo[playerid][pVehicle][x] = car;
  6926.                         PlayerInfo[playerid][pCash] -= GetVehicleCost(car);
  6927.                         SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  6928.                         RemovePlayerFromVehicle(playerid);
  6929.                         PlayerInfo[playerid][pVehicleSpawned][x] = 1;
  6930.                         PlayerInfo[playerid][pVehiclePosX][x] = 555.87;
  6931.                         PlayerInfo[playerid][pVehiclePosY][x] = -1265.16;
  6932.                         PlayerInfo[playerid][pVehiclePosZ][x] = 17.24;
  6933.                         PlayerInfo[playerid][pVehicleCol1][x] = rand;
  6934.                         PlayerInfo[playerid][pVehicleCol1][x] = rand2;
  6935.                         ownedcar = CreateVehicle(car, PlayerInfo[playerid][pVehiclePosX][x], PlayerInfo[playerid][pVehiclePosY][x], PlayerInfo[playerid][pVehiclePosZ][x], 0, rand, rand2, 0);
  6936.                         PlayerInfo[playerid][pVehicleSpawnedID][x] = ownedcar;
  6937.                         PutPlayerInVehicle(playerid, ownedcar, 0);
  6938.                         format(str, sizeof(str), "MoneyTrace: %s bought a car (MID: %i) for %i.", GetName(playerid), car, GetVehicleCost(car));
  6939.                         Log("/logs/moneytrace.txt", str);
  6940.                         format(str, sizeof(str), "You bought a car for %i. (%i)", GetVehicleCost(car), ownedcar);
  6941.                         SendClientMessage(playerid, -1, str);
  6942.                         new plate[126];
  6943.                         format(plate, sizeof(plate), "LS%i", ownedcar);
  6944.                         SetVehicleNumberPlate(ownedcar, plate);
  6945.                         break;
  6946.                     }
  6947.                 }
  6948.             }
  6949.         }
  6950.  
  6951.         case DIALOG_QUIZ:
  6952.         {
  6953.             if (!response) return Kick(playerid);
  6954.             if(response)
  6955.             {
  6956.                 if(listitem != 2)
  6957.                 {
  6958.                 SendClientMessage(playerid, COLOR_NEWBIE, "Wrong answer.");
  6959.                 ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST, "Quiz - What is powergaming?", "Forcing a roleplay action towards a player, not giving them a chance to resist.\nUsing the powers of fast cars to escape the police.\nFlying a plane without a pilot's license.", "Answer", "Quit");
  6960.                 quizwrong[playerid] += 1;
  6961.                 }
  6962.                 if(listitem == 2)
  6963.                 {
  6964.                 SendClientMessage(playerid, COLOR_NEWBIE, "Correct answer.");
  6965.                 ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST, "Quiz - What is metagaming?", "Forcing roleplay action towards a player, not giving them a chance to resist.\nUsing OOC information ICly.\nCommitting crimes in a crowded place.", "Answer", "Quit");
  6966.                 InterpolateCameraPos(playerid, 1544.7931, -1362.1440, 366.9819, 1459.6842, -1661.7963, 57.8967, 5000, CAMERA_MOVE);
  6967.                 InterpolateCameraLookAt(playerid, 1412.5718, -1690.9845, 41.9617, 1531.1875, -1672.8884, 27.4342, 5000, CAMERA_MOVE);
  6968.                 }
  6969.             }
  6970.             return 1;
  6971.         }
  6972.  
  6973.  
  6974.         case DIALOG_QUIZ2:
  6975.         {
  6976.             if (!response) return Kick(playerid);
  6977.             if(response)
  6978.             {
  6979.                 if(listitem != 1)
  6980.                 {
  6981.                 SendClientMessage(playerid, COLOR_NEWBIE, "Wrong answer.");
  6982.                 quizwrong[playerid] += 1;
  6983.                 ShowPlayerDialog(playerid, DIALOG_QUIZ5, DIALOG_STYLE_LIST, "Quiz - What do you do if you spot a hacker?", "PM them to stop hacking.\nCalmly report the player, and try to avoid him.\nPM admins in game.", "Answer", "Quit");
  6984.                 }
  6985.                 if(quizwrong[playerid] > 2)
  6986.                 {
  6987.                     SendClientMessage(playerid, -1, "You failed the quiz.");
  6988.                     Kick(playerid);
  6989.                 }
  6990.                 if(listitem == 1)
  6991.                 {
  6992.                 InterpolateCameraPos(playerid, 1459.6842, -1661.7963, 57.8967, 1474.3441, -1709.7754, 37.5671, 5000, CAMERA_MOVE);
  6993.                 InterpolateCameraLookAt(playerid, 1531.1875, -1672.8884, 27.4342, 1477.4785, -1726.4415, 30.8563, 5000, CAMERA_MOVE);
  6994.                 SendClientMessage(playerid, COLOR_NEWBIE, "Correct answer.");
  6995.                 ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST, "Quiz - What is powergaming?", "Forcing a roleplay action toward a player, not giving them a chance to resist.\nUsing the powers of fast cars to escape the police.\nFlying a plane without a pilot's license.", "Answer", "Quit");
  6996.                 }
  6997.             }
  6998.             return 1;
  6999.         }
  7000.  
  7001.  
  7002.         case DIALOG_QUIZ3:
  7003.         {
  7004.             if (!response) return Kick(playerid);
  7005.             if(response)
  7006.             {
  7007.                 if(listitem != 0)
  7008.                 {
  7009.                 SendClientMessage(playerid, COLOR_NEWBIE, "Wrong answer.");
  7010.                 quizwrong[playerid] += 1;
  7011.                 ShowPlayerDialog(playerid, DIALOG_QUIZ5, DIALOG_STYLE_LIST, "Quiz - How do you properly take out a big weapon?", "/me takes out a gun\n/me pops open the trunk as he grasps his shotgun.\nJust take it out.", "Answer", "Quit");
  7012.                 }
  7013.                 if(quizwrong[playerid] > 2)
  7014.                 {
  7015.                     SendClientMessage(playerid, -1, "You failed the quiz.");
  7016.                     Kick(playerid);
  7017.                 }
  7018.                 if(listitem == 0)
  7019.                 {
  7020.                 InterpolateCameraPos(playerid, 1474.3441, -1709.7754, 37.5671, 2162.6824, -1756.9773, 45.1830, 5000, CAMERA_MOVE);
  7021.                 InterpolateCameraLookAt(playerid, 1477.4785, -1726.4415, 30.8563, 2220.4507, -1726.3226, 18.5690, 3000, CAMERA_MOVE);
  7022.                 SendClientMessage(playerid, COLOR_NEWBIE, "Correct answer.");
  7023.                 ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST, "Quiz - What do you do if you spot a hacker?", "PM them to stop hacking.\nCalmly report the player, and try to avoid him.\nPM admins in game.", "Answer", "Quit");
  7024.                 }
  7025.             }
  7026.             return 1;
  7027.         }
  7028.  
  7029.         case DIALOG_QUIZ4:
  7030.         {
  7031.             if (!response) return Kick(playerid);
  7032.             if(response)
  7033.             {
  7034.                 if(listitem != 1)
  7035.                 {
  7036.                 SendClientMessage(playerid, COLOR_NEWBIE, "Wrong answer.");
  7037.                 quizwrong[playerid] += 1;
  7038.                 ShowPlayerDialog(playerid, DIALOG_QUIZ6, DIALOG_STYLE_LIST, "Quiz - What is roleplay?", "Playing a role as a serial killer.\nHelping in /newb.\nActing out a character realisticly and using /me and /do.", "Answer", "Quit");
  7039.                 }
  7040.                 if(quizwrong[playerid] > 2)
  7041.                 {
  7042.                     SendClientMessage(playerid, -1, "You failed the quiz.");
  7043.                     Kick(playerid);
  7044.                 }
  7045.                 if(listitem == 1)
  7046.                 {
  7047.                 SendClientMessage(playerid, COLOR_NEWBIE, "Correct answer.");
  7048.                 InterpolateCameraPos(playerid, 2162.6824, -1756.9773, 45.1830, 2265.1353, -2682.1121, 88.5434, 5000, CAMERA_MOVE);
  7049.                 InterpolateCameraLookAt(playerid, 2220.4507, -1726.3226, 18.5690, 2201.1077, -2638.2690, 16.4266, 3000, CAMERA_MOVE);
  7050.                 ShowPlayerDialog(playerid, DIALOG_QUIZ5, DIALOG_STYLE_LIST, "Quiz - How do you properly take out a big weapon?", "/me takes out a gun\n/me pops open the trunk as he grasps his shotgun.\nJust take it out.", "Answer", "Quit");
  7051.                 }
  7052.             }
  7053.             return 1;
  7054.         }
  7055.  
  7056.         case DIALOG_QUIZ5:
  7057.         {
  7058.             if (!response) return Kick(playerid);
  7059.             if(response)
  7060.             {
  7061.                 if(listitem != 1)
  7062.                 {
  7063.                 SendClientMessage(playerid, COLOR_NEWBIE, "Wrong answer.");
  7064.                 quizwrong[playerid] += 1;
  7065.                 ShowPlayerDialog(playerid, DIALOG_QUIZ7, DIALOG_STYLE_LIST, "Quiz - If you need help, what do you do?", "Ask politely on /newb about your issues.\nPM the admins that are online.\nAsk everyone around you on /b.", "Answer", "Quit");
  7066.                 }
  7067.                 if(quizwrong[playerid] > 2)
  7068.                 {
  7069.                     SendClientMessage(playerid, -1, "You failed the quiz.");
  7070.                     Kick(playerid);
  7071.                 }
  7072.                 if(listitem == 1)
  7073.                 {
  7074.                 SendClientMessage(playerid, COLOR_NEWBIE, "Correct answer.");
  7075.                 InterpolateCameraPos(playerid, 2265.1353, -2682.1121, 88.5434, 1306.0331, -1283.6243, 52.5546, 5000, CAMERA_MOVE);
  7076.                 InterpolateCameraLookAt(playerid, 2201.1077, -2638.2690, 16.4266, 1360.0269, -1280.1663, 18.9822, 3000, CAMERA_MOVE);
  7077.                 ShowPlayerDialog(playerid, DIALOG_QUIZ6, DIALOG_STYLE_LIST, "Quiz - What is roleplay?", "Playing a role as a serial killer.\nHelping in /newb.\nActing out a character realisticly and using /me and /do.", "Answer", "Quit");
  7078.                 }
  7079.             }
  7080.             return 1;
  7081.         }
  7082.  
  7083.         case DIALOG_QUIZ6:
  7084.         {
  7085.             if (!response) return Kick(playerid);
  7086.             if(response)
  7087.             {
  7088.                 if(listitem != 2)
  7089.                 {
  7090.                 SendClientMessage(playerid, COLOR_NEWBIE, "Wrong answer.");
  7091.                 quizwrong[playerid] += 1;
  7092.                 ShowPlayerDialog(playerid, DIALOG_QUIZ8, DIALOG_STYLE_LIST, "Quiz - What is IC and OOC?", "In Car and Out Of Car.\nInjured Crackhead and Out Of Crack\nIn Character and Out Of Character", "Answer", "Quit");
  7093.                 }
  7094.                 if(quizwrong[playerid] > 2)
  7095.                 {
  7096.                     SendClientMessage(playerid, -1, "You failed the quiz.");
  7097.                     Kick(playerid);
  7098.                 }
  7099.                 if(listitem == 2)
  7100.                 {
  7101.                 SendClientMessage(playerid, COLOR_NEWBIE, "Correct answer.");
  7102.                 InterpolateCameraPos(playerid, 1306.0331, -1283.6243, 52.5546, 1223.0563, -1304.5181, 59.4092, 5000, CAMERA_MOVE);
  7103.                 InterpolateCameraLookAt(playerid, 1360.0269, -1280.1663, 18.9822, 1177.9976, -1353.1117, 29.8385, 3000, CAMERA_MOVE);
  7104.                 ShowPlayerDialog(playerid, DIALOG_QUIZ7, DIALOG_STYLE_LIST, "Quiz - If you need help, what do you do?", "Ask politely on /newb about your issues.\nPM the admins that are online.\nAsk everyone around you on /b.", "Answer", "Quit");
  7105.                 }
  7106.             }
  7107.             return 1;
  7108.         }
  7109.  
  7110.         case DIALOG_QUIZ7:
  7111.         {
  7112.             if (!response) return Kick(playerid);
  7113.             if(response)
  7114.             {
  7115.                 if(listitem != 0)
  7116.                 {
  7117.                     SendClientMessage(playerid, COLOR_NEWBIE, "Wrong answer.");
  7118.                     quizwrong[playerid] += 1;
  7119.                     if(quizwrong[playerid] > 2)
  7120.                     {
  7121.                         SendClientMessage(playerid, -1, "You failed the quiz.");
  7122.                         Kick(playerid);
  7123.                     }
  7124.                     ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Select Skin",""COL_WHITE"You passed the test. Select a skin to start with. Valid skin IDs are 0 to 299.","Change","No");
  7125.                 }
  7126.                 if(listitem == 0)
  7127.                 {
  7128.                 SendClientMessage(playerid, COLOR_NEWBIE, "Correct answer.");
  7129.                 InterpolateCameraPos(playerid, 1223.0563, -1304.5181, 59.4092, 1395.4175, -937.2007, 106.7558, 5000, CAMERA_MOVE);
  7130.                 InterpolateCameraLookAt(playerid, 1177.9976, -1353.1117, 29.8385, 1407.9408, -840.4412, 86.2264, 3000, CAMERA_MOVE);
  7131.                 ShowPlayerDialog(playerid, DIALOG_QUIZ8, DIALOG_STYLE_LIST, "Quiz - What is IC and OOC?", "In Car and Out Of Car.\nInjured Crackhead and Out Of Crack\nIn Character and Out Of Character", "Answer", "Quit");
  7132.                 }
  7133.             }
  7134.             return 1;
  7135.         }
  7136.  
  7137.         case DIALOG_QUIZ8:
  7138.         {
  7139.             if (!response) return Kick(playerid);
  7140.             if(response)
  7141.             {
  7142.                 if(listitem != 2)
  7143.                 {
  7144.                 SendClientMessage(playerid, COLOR_NEWBIE, "Wrong answer.");
  7145.                 quizwrong[playerid] += 1;
  7146.                 }
  7147.                 if(quizwrong[playerid] > 2)
  7148.                 {
  7149.                     SendClientMessage(playerid, -1, "You failed the quiz.");
  7150.                     Kick(playerid);
  7151.                 }
  7152.                 if(listitem == 2)
  7153.                 {
  7154.                 SendClientMessage(playerid, COLOR_NEWBIE, "You have passed the test.");
  7155.                 InterpolateCameraPos(playerid, 1395.4175, -937.2007, 106.7558, 1543.3014, -1329.3446, 647.5134, 5000, CAMERA_MOVE);
  7156.                 InterpolateCameraLookAt(playerid, 1407.9408, -840.4412, 86.2264, 1543.0229, -1358.7617, 334.1657, 3000, CAMERA_MOVE);
  7157.                 ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Select Skin",""COL_WHITE"You passed the test. Select a skin to start with. Valid skin IDs are 0 to 299.","Change","No");
  7158.                 }
  7159.             }
  7160.             return 1;
  7161.         }
  7162.  
  7163.         case DIALOG_247:
  7164.         {
  7165.             if(!response)
  7166.             {
  7167.                 ProxDetector(50.0, playerid, "Shop Clerk: Alright, come back later then.", COLOR_GRAD1);
  7168.                 return 1;
  7169.             }
  7170.             if(response)
  7171.             {
  7172.                 new cost, str[126];
  7173.                 if(listitem == 0)
  7174.                 {
  7175.                     new numb = 1 + random(100000);
  7176.                     if(numb == 911)
  7177.                     {
  7178.                     numb = numb + random(100000-numb);
  7179.                     }
  7180.                     if(numb == 555)
  7181.                     {
  7182.                     numb = numb + random(100000-numb);
  7183.                     }
  7184.                     if(numb == 0)
  7185.                     {
  7186.                     numb = 1 + random(100000);
  7187.                     }
  7188.                     if(CheckPh(numb) == 1)
  7189.                     {
  7190.                         numb = random(100000);
  7191.                     }
  7192.                     if(CheckPh(numb) == 1)
  7193.                     {
  7194.                         ProxDetector(50.0, playerid, "Shop Clerk: Uh, we had an error setting up your phone. Try again.", COLOR_GRAD1);
  7195.                         return 1;
  7196.                     }
  7197.                     AddPh(PlayerInfo[playerid][pPhone], numb);
  7198.                     PlayerInfo[playerid][pPhone] = numb;
  7199.                     cost = 600;
  7200.                     SendClientMessage(playerid, -1, "You bought a cellphone.");
  7201.                     PlayerInfo[playerid][pCash] -= cost;
  7202.                     format(str, sizeof(str), "MoneyTrace: %s bought a cellphone for $%i", GetName(playerid), cost);
  7203.                     Log("/logs/moneytrace.txt", str);
  7204.                     format(str, sizeof(str), "Your number is %i.", numb);
  7205.                     SendClientMessage(playerid, -1, str);
  7206.                     return 1;
  7207.                 }
  7208.                 if(listitem == 1)
  7209.                 {
  7210.                     cost = 300;
  7211.                     if(PlayerInfo[playerid][pSpraycan] > 25) return SendClientMessage(playerid, COLOR_GREY, "You can't hold more spraycans.");
  7212.                     SendClientMessage(playerid, -1, "You bought 5 spraycans.");
  7213.                     PlayerInfo[playerid][pCash] -= cost;
  7214.                     PlayerInfo[playerid][pSpraycan] += 5;
  7215.                     format(str, sizeof(str), "MoneyTrace: %s bought 5 spraycans for $%i", GetName(playerid), cost);
  7216.                     Log("/logs/moneytrace.txt", str);
  7217.                     return 1;
  7218.                 }
  7219.                 if(listitem == 2)
  7220.                 {
  7221.                     cost = 1;
  7222.                     SendClientMessage(playerid, -1, "Item 3");
  7223.                     PlayerInfo[playerid][pCash] -= cost;
  7224.                     format(str, sizeof(str), "MoneyTrace: %s bought Item 3 for $%i", GetName(playerid), cost);
  7225.                     Log("/logs/moneytrace.txt", str);
  7226.                     return 1;
  7227.                 }
  7228.                 if(listitem == 3)
  7229.                 {
  7230.                     cost = 1;
  7231.                     SendClientMessage(playerid, -1, "Item 4");
  7232.                     PlayerInfo[playerid][pCash] -= cost;
  7233.                     format(str, sizeof(str), "MoneyTrace: %s bought Item 4 for $%i", GetName(playerid), cost);
  7234.                     Log("/logs/moneytrace.txt", str);
  7235.                     return 1;
  7236.                 }
  7237.                 if(listitem == 4)
  7238.                 {
  7239.                     cost = 1;
  7240.                     SendClientMessage(playerid, -1, "Item 5");
  7241.                     PlayerInfo[playerid][pCash] -= cost;
  7242.                     format(str, sizeof(str), "MoneyTrace: %s bought Item 5 for $%i", GetName(playerid), cost);
  7243.                     Log("/logs/moneytrace.txt", str);
  7244.                     return 1;
  7245.                 }
  7246.                 if(listitem == 5)
  7247.                 {
  7248.                     cost = 1;
  7249.                     SendClientMessage(playerid, -1, "Item 6");
  7250.                     PlayerInfo[playerid][pCash] -= cost;
  7251.                     format(str, sizeof(str), "MoneyTrace: %s bought Item 6 for $%i", GetName(playerid), cost);
  7252.                     Log("/logs/moneytrace.txt", str);
  7253.                     return 1;
  7254.                 }
  7255.             }
  7256.         }
  7257.  
  7258.         case DIALOG_FBI:
  7259.         {
  7260.             if(!response)
  7261.             {
  7262.                 return 1;
  7263.             }
  7264.             if(response)
  7265.             {
  7266.                 if(listitem == 0)
  7267.                 {
  7268.                     if(badge[playerid] == 0)
  7269.                     {
  7270.                         SetPlayerColor(playerid, 0x9FA1ED00);
  7271.                         badge[playerid] = 1;
  7272.                         SkipWepCheck(playerid);
  7273.                         SkipACheck(playerid);
  7274.                         PlayerInfo[playerid][pArmor] = 100;
  7275.                         SetPlayerArmour(playerid, 100);
  7276.                         SetPlayerHealth(playerid, 100);
  7277.                         GivePlayerValidWeapon(playerid, 24, 999999);
  7278.                         GivePlayerValidWeapon(playerid, 29, 999999);
  7279.                         GivePlayerValidWeapon(playerid, 3, 999999);
  7280.                         GivePlayerValidWeapon(playerid, 25, 999999);
  7281.                         GivePlayerValidWeapon(playerid, 41, 999999);
  7282.                         PlayerInfo[playerid][pSkin] = 286;
  7283.                         SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7284.                         return 1;
  7285.                     }
  7286.                     if(badge[playerid] == 1)
  7287.                     {
  7288.                         SetPlayerColor(playerid, 0xFFFFFF00);
  7289.                         badge[playerid] = 0;
  7290.                         SkipWepCheck(playerid);
  7291.                         SkipACheck(playerid);
  7292.                         PlayerInfo[playerid][pArmor] = 100;
  7293.                         SetPlayerArmour(playerid, 100);
  7294.                         SetPlayerHealth(playerid, 100);
  7295.                         ResetPlayerWeapons(playerid);
  7296.                         ResetPlayerWeaponsEx(playerid);
  7297.                         PlayerInfo[playerid][pSkin] = 2;
  7298.                         SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7299.                         return 1;
  7300.                     }
  7301.                 }
  7302.                 if(listitem == 1)
  7303.                 {
  7304.                     ShowPlayerDialog(playerid, DIALOG_FBI2, DIALOG_STYLE_LIST, "Equipment", "Desert Eagle ($0)\nShotgun ($0)\nMP5 ($0)\nM4($0)\nSpray Can ($0)\nNitestick\nSpas-12 ($600)\nSniper ($700)\nFirst Aid Kit\nKevlar Vest", "Ok", "Close");
  7305.                     return 1;
  7306.                 }
  7307.                 if(listitem == 2)
  7308.                 {
  7309.                     ShowPlayerDialog(playerid, DIALOG_FBI3, DIALOG_STYLE_LIST, "Uniform", "FBI Agent (Blue Coat)\nAgent\nAgent\nDark Agent\nBlack Agent", "Ok", "Close");
  7310.                     return 1;
  7311.                 }
  7312.                 if(listitem == 3)
  7313.                 {
  7314.                     ShowPlayerDialog(playerid, DIALOG_UNINVITESKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Skin change",""COL_WHITE"Select a skin to use. Valid skin IDs are 0 to 299.","Change","No");
  7315.                     return 1;
  7316.                 }
  7317.                 if(listitem == 4)
  7318.                 {
  7319.                     ShowPlayerDialog(playerid, DIALOG_CHANGENAME, DIALOG_STYLE_INPUT,""COL_WHITE"Name Change",""COL_WHITE"Change your identity to go undercover.","Change","No");
  7320.                     return 1;
  7321.                 }
  7322.             }
  7323.             return 1;
  7324.         }
  7325.  
  7326.  
  7327.         case DIALOG_FBI2:
  7328.         {
  7329.             if(!response)
  7330.             {
  7331.                 ShowPlayerDialog(playerid, DIALOG_FBI, DIALOG_STYLE_LIST, "Locker", "Duty\nEquipment\nUniform\nSelect Skin\nChange Name", "Ok", "Close");
  7332.                 return 1;
  7333.             }
  7334.             if(response)
  7335.             {
  7336.                 switch(listitem)
  7337.                 {
  7338.                     case 0:
  7339.                     {
  7340.                     SkipWepCheck(playerid);
  7341.                     GivePlayerValidWeapon(playerid, 24, 99999);
  7342.                     }
  7343.                     case 1:
  7344.                     {
  7345.                     SkipWepCheck(playerid);
  7346.                     GivePlayerValidWeapon(playerid, 25, 99999);
  7347.                     }
  7348.                     case 2:
  7349.                     {
  7350.                     SkipWepCheck(playerid);
  7351.                     GivePlayerValidWeapon(playerid, 29, 99999);
  7352.                     }
  7353.                     case 3:
  7354.                     {
  7355.                     SkipWepCheck(playerid);
  7356.                     GivePlayerValidWeapon(playerid, 31, 99999);
  7357.                     }
  7358.                     case 4:
  7359.                     {
  7360.                     SkipWepCheck(playerid);
  7361.                     GivePlayerValidWeapon(playerid, 41, 99999);
  7362.                     }
  7363.                     case 5:
  7364.                     {
  7365.                     SkipWepCheck(playerid);
  7366.                     GivePlayerValidWeapon(playerid, 3, 1);
  7367.                     }
  7368.                     case 6:
  7369.                     {
  7370.                     if(PlayerInfo[playerid][pCash] < 600) { SendClientMessage(playerid, -1, "You don't have enough cash to buy this."); return -1; }
  7371.                     GivePlayerValidWeapon(playerid, 27, 99999);
  7372.                     PlayerInfo[playerid][pCash] -= 600;
  7373.                     }
  7374.                     case 7:
  7375.                     {
  7376.                     if(PlayerInfo[playerid][pCash] < 700) { SendClientMessage(playerid, -1, "You don't have enough cash to buy this."); return -1; }
  7377.                     GivePlayerValidWeapon(playerid, 34, 99999);
  7378.                     PlayerInfo[playerid][pCash] -= 700;
  7379.                     }
  7380.                     case 8:
  7381.                     {
  7382.                     SetPlayerHealth(playerid, 100);
  7383.                     }
  7384.                     case 9:
  7385.                     {
  7386.                     SkipACheck(playerid);
  7387.                     PlayerInfo[playerid][pArmor] = 100;
  7388.                     SetPlayerArmour(playerid, 100);
  7389.                     }
  7390.                 }
  7391.                 return 1;
  7392.             }
  7393.             return 1;
  7394.         }
  7395.  
  7396.         case DIALOG_FBI3:
  7397.         {
  7398.             if(!response)
  7399.             {
  7400.                 ShowPlayerDialog(playerid, DIALOG_FBI, DIALOG_STYLE_LIST, "Locker", "Duty\nEquipment\nUniform\nSelect Skin\nChange Name", "Ok", "Close");
  7401.                 return 1;
  7402.             }
  7403.             if(response)
  7404.             {
  7405.                 if(listitem == 0)
  7406.                 {
  7407.                     PlayerInfo[playerid][pSkin] = 286; // FBI skin
  7408.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7409.                 }
  7410.                 if(listitem == 1)
  7411.                 {
  7412.                     PlayerInfo[playerid][pSkin] = 165; // White Agent with a black suit
  7413.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7414.                 }
  7415.                 if(listitem == 2)
  7416.                 {
  7417.                     PlayerInfo[playerid][pSkin] = 164; // White Agent with a black suit
  7418.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7419.                 }
  7420.                 if(listitem == 3)
  7421.                 {
  7422.                     PlayerInfo[playerid][pSkin] = 163; // Dark Agent with a black suit
  7423.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7424.                 }
  7425.                 if(listitem == 4)
  7426.                 {
  7427.                     PlayerInfo[playerid][pSkin] = 166; // Black Agent
  7428.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7429.                 }
  7430.                 return 1;
  7431.             }
  7432.             return 1;
  7433.         }
  7434.         case DIALOG_LSPD:
  7435.         {
  7436.             if(!response)
  7437.             {
  7438.                 return 1;
  7439.             }
  7440.             if(response)
  7441.             {
  7442.                 if(listitem == 0)
  7443.                 {
  7444.                     if(badge[playerid] == 0)
  7445.                     {
  7446.                         SetPlayerColor(playerid, 0x0800FF00);
  7447.                         badge[playerid] = 1;
  7448.                         SkipWepCheck(playerid);
  7449.                         SkipACheck(playerid);
  7450.                         PlayerInfo[playerid][pArmor] = 100;
  7451.                         SetPlayerArmour(playerid, 100);
  7452.                         SetPlayerHealth(playerid, 100);
  7453.                         GivePlayerValidWeapon(playerid, 24, 99999);
  7454.                         GivePlayerValidWeapon(playerid, 29, 99999);
  7455.                         GivePlayerValidWeapon(playerid, 3, 99999);
  7456.                         GivePlayerValidWeapon(playerid, 25, 99999);
  7457.                         GivePlayerValidWeapon(playerid, 41, 99999);
  7458.                         PlayerInfo[playerid][pSkin] = 280;
  7459.                         SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7460.                         return 1;
  7461.                     }
  7462.                     if(badge[playerid] == 1)
  7463.                     {
  7464.                         SetPlayerColor(playerid, 0xFFFFFF00);
  7465.                         badge[playerid] = 0;
  7466.                         SkipWepCheck(playerid);
  7467.                         SkipACheck(playerid);
  7468.                         PlayerInfo[playerid][pArmor] = 100;
  7469.                         SetPlayerArmour(playerid, 100);
  7470.                         SetPlayerHealth(playerid, 100);
  7471.                         ResetPlayerWeapons(playerid);
  7472.                         ResetPlayerWeaponsEx(playerid);
  7473.                         PlayerInfo[playerid][pSkin] = 2;
  7474.                         SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7475.                         return 1;
  7476.                     }
  7477.                 }
  7478.                 if(listitem == 1)
  7479.                 {
  7480.                     ShowPlayerDialog(playerid, DIALOG_LSPD2, DIALOG_STYLE_LIST, "Equipment", "Desert Eagle ($0)\nShotgun ($0)\nMP5 ($0)\nM4($0)\nSpray Can ($0)\nNitestick\nSpas-12 ($700)\nSniper ($800)\nFirst Aid Kit\nKevlar Vest", "Ok", "Close");
  7481.                     return 1;
  7482.                 }
  7483.                 if(listitem == 2)
  7484.                 {
  7485.                     ShowPlayerDialog(playerid, DIALOG_LSPD3, DIALOG_STYLE_LIST, "Uniform", "Cadet\nOfficer\nCorporal\nCorporal2\nCorporal3\nBike Officer\nSergeant\nLieutenant\nChief\nSWAT", "Ok", "Close");
  7486.                     return 1;
  7487.                 }
  7488.                 if(listitem == 2)
  7489.                 {
  7490.                     ShowPlayerDialog(playerid, DIALOG_UNINVITESKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Skin change",""COL_WHITE"Select a skin to use. Valid skin IDs are 0 to 299.","Change","No");
  7491.                     return 1;
  7492.                 }
  7493.             }
  7494.             return 1;
  7495.         }
  7496.  
  7497.  
  7498.         case DIALOG_LSPD2:
  7499.         {
  7500.             if(!response)
  7501.             {
  7502.                 ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_LIST, "Locker", "Duty\nEquipment\nUniform\nSelect Skin", "Ok", "Close");
  7503.                 return 1;
  7504.             }
  7505.             if(response)
  7506.             {
  7507.                 switch(listitem)
  7508.                 {
  7509.                     case 0:
  7510.                     {
  7511.                     SkipWepCheck(playerid);
  7512.                     GivePlayerValidWeapon(playerid, 24, 99999);
  7513.                     }
  7514.                     case 1:
  7515.                     {
  7516.                     SkipWepCheck(playerid);
  7517.                     GivePlayerValidWeapon(playerid, 25, 99999);
  7518.                     }
  7519.                     case 2:
  7520.                     {
  7521.                     SkipWepCheck(playerid);
  7522.                     GivePlayerValidWeapon(playerid, 29, 99999);
  7523.                     }
  7524.                     case 3:
  7525.                     {
  7526.                     SkipWepCheck(playerid);
  7527.                     GivePlayerValidWeapon(playerid, 31, 99999);
  7528.                     }
  7529.                     case 4:
  7530.                     {
  7531.                     SkipWepCheck(playerid);
  7532.                     GivePlayerValidWeapon(playerid, 41, 99999);
  7533.                     }
  7534.                     case 5:
  7535.                     {
  7536.                     SkipWepCheck(playerid);
  7537.                     GivePlayerValidWeapon(playerid, 3, 1);
  7538.                     }
  7539.                     case 6:
  7540.                     {
  7541.                     if(PlayerInfo[playerid][pCash] < 700) { SendClientMessage(playerid, -1, "You don't have enough cash to buy this."); return -1; }
  7542.                     GivePlayerValidWeapon(playerid, 27, 99999);
  7543.                     PlayerInfo[playerid][pCash] -= 700;
  7544.                     }
  7545.                     case 7:
  7546.                     {
  7547.                     if(PlayerInfo[playerid][pCash] < 800) { SendClientMessage(playerid, -1, "You don't have enough cash to buy this."); return -1; }
  7548.                     GivePlayerValidWeapon(playerid, 34, 99999);
  7549.                     PlayerInfo[playerid][pCash] -= 800;
  7550.                     }
  7551.                     case 8:
  7552.                     {
  7553.                     SetPlayerHealth(playerid, 100);
  7554.                     }
  7555.                     case 9:
  7556.                     {
  7557.                     SkipACheck(playerid);
  7558.                     PlayerInfo[playerid][pArmor] = 100;
  7559.                     SetPlayerArmour(playerid, 100);
  7560.                     }
  7561.                 }
  7562.                 return 1;
  7563.             }
  7564.             return 1;
  7565.         }
  7566.  
  7567.         case DIALOG_LSPD3:
  7568.         {
  7569.             if(!response)
  7570.             {
  7571.                 ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_LIST, "Locker", "Duty\nEquipment\nUniform\nSelect Skin", "Ok", "Close");
  7572.                 return 1;
  7573.             }
  7574.             if(response)
  7575.             {
  7576.                 if(listitem == 0)
  7577.                 {
  7578.                     PlayerInfo[playerid][pSkin] = 71; // cadet
  7579.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7580.                 }
  7581.                 if(listitem == 1)
  7582.                 {
  7583.                     PlayerInfo[playerid][pSkin] = 280; // officer
  7584.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7585.                 }
  7586.                 if(listitem == 2)
  7587.                 {
  7588.                     PlayerInfo[playerid][pSkin] = 281; // corporal 1
  7589.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7590.                 }
  7591.                 if(listitem == 3)
  7592.                 {
  7593.                     PlayerInfo[playerid][pSkin] = 266; // corporal 2
  7594.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7595.                 }
  7596.                 if(listitem == 4)
  7597.                 {
  7598.                     PlayerInfo[playerid][pSkin] = 267; // corporal 3
  7599.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7600.                 }
  7601.                 if(listitem == 5)
  7602.                 {
  7603.                     PlayerInfo[playerid][pSkin] = 284; // bike officer
  7604.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7605.                 }
  7606.                 if(listitem == 6)
  7607.                 {
  7608.                     PlayerInfo[playerid][pSkin] = 282; // sergeant
  7609.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7610.                 }
  7611.                 if(listitem == 7)
  7612.                 {
  7613.                     PlayerInfo[playerid][pSkin] = 283; // lieutenant
  7614.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7615.                 }
  7616.                 if(listitem == 8)
  7617.                 {
  7618.                     PlayerInfo[playerid][pSkin] = 288; // chief
  7619.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7620.                 }
  7621.                 if(listitem == 9)
  7622.                 {
  7623.                     PlayerInfo[playerid][pSkin] = 285; // SWAT
  7624.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7625.                 }
  7626.                 return 1;
  7627.             }
  7628.             return 1;
  7629.         }
  7630.         case DIALOG_NAME:
  7631.         {
  7632.             if(!response)
  7633.             {
  7634.                 Kick(playerid);
  7635.             }
  7636.             if(response)
  7637.             {
  7638.                 SetPlayerName(playerid, inputtext);
  7639.                 new Name[MAX_PLAYER_NAME], Len;
  7640.                 GetPlayerName(playerid, Name, sizeof(Name));
  7641.                 Len = strlen(Name);
  7642.                 if(Name[Len - 1] == '_' || Name[0] == '_' || strfind(Name, "_", false) == -1)
  7643.                 {
  7644.                     SendClientMessage(playerid, COLOR_CYAN, "You failed to select a role play name, please select another name.");
  7645.                     ShowPlayerDialog(playerid, DIALOG_NAME, DIALOG_STYLE_INPUT,""COL_WHITE"Name Change",""COL_WHITE"Type in another name to use.","Change","No!");
  7646.                     return 1;
  7647.                 }
  7648.                 INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  7649.                 ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
  7650.             }
  7651.         }
  7652.  
  7653.         case DIALOG_SKIN:
  7654.         {
  7655.             if(!response)
  7656.             {
  7657.                 PlayerInfo[playerid][pCash] = 300;
  7658.                 PlayerInfo[playerid][pBank] = 300;
  7659.                 PlayerInfo[playerid][pLevel] = 1;
  7660.                 SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  7661.                 TogglePlayerSpectating(playerid, 0);
  7662.                 PlayerInfo[playerid][pSkin] = 299;
  7663.                 SetSpawnInfo(playerid, 0, 299, 1780.1759,-1933.6698,13.3859,356.5534, 0, 0, 0, 0, 0, 0);
  7664.                 SpawnPlayer(playerid);
  7665.                 Connected[playerid] = 1;
  7666.                 SetPVarInt(playerid, "prelogin", 0);
  7667.                 TogglePlayerControllable(playerid, 1);
  7668.                 SetPVarInt(playerid, "Quiz", 0);
  7669.                 SaveChar(playerid);
  7670.                 SetCameraBehindPlayer(playerid);
  7671.             }
  7672.             if(response)
  7673.             {
  7674.                 new skin = strval(inputtext);
  7675.                 if(skin < 0 || skin > 299) return ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Skin change",""COL_WHITE"Invalid skin. Valid skin IDs are 0 to 299.","Change","No");
  7676.                 TogglePlayerSpectating(playerid, 0);
  7677.                 PlayerInfo[playerid][pCash] = 300;
  7678.                 PlayerInfo[playerid][pBank] = 300;
  7679.                 PlayerInfo[playerid][pLevel] = 1;
  7680.                 SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  7681.                 PlayerInfo[playerid][pSkin] = skin;
  7682.                 SetSpawnInfo(playerid, 0, skin, 1780.1759,-1933.6698,13.3859,356.5534, 0, 0, 0, 0, 0, 0);
  7683.                 SpawnPlayer(playerid);
  7684.                 Connected[playerid] = 1;
  7685.                 SetPVarInt(playerid, "prelogin", 0);
  7686.                 TogglePlayerControllable(playerid, 1);
  7687.                 SetPVarInt(playerid, "Quiz", 0);
  7688.                 SaveChar(playerid);
  7689.                 SetCameraBehindPlayer(playerid);
  7690.             }
  7691.             return 1;
  7692.         }
  7693.  
  7694.         case DIALOG_UNINVITESKIN:
  7695.         {
  7696.             if(!response)
  7697.             {
  7698.                 PlayerInfo[playerid][pSkin] = 299;
  7699.                 SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7700.             }
  7701.             if(response)
  7702.             {
  7703.                 new skin = strval(inputtext);
  7704.                 if(skin < 0 || skin > 299) return ShowPlayerDialog(playerid, DIALOG_UNINVITESKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Skin change",""COL_WHITE"Invalid skin. Valid skin IDs are 0 to 299.","Change","No");
  7705.                 PlayerInfo[playerid][pSkin] = skin;
  7706.                 SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7707.             }
  7708.             return 1;
  7709.         }
  7710.  
  7711.         case DIALOG_BUYSKIN:
  7712.         {
  7713.             if(!response)
  7714.             {
  7715.                 ProxDetector(50.0, playerid, "Shop Clerk says: Alright, come back later.", COLOR_GRAD1);
  7716.             }
  7717.             if(response)
  7718.             {
  7719.                 new skin = strval(inputtext);
  7720.                 if(skin < 0 || skin > 299) return ShowPlayerDialog(playerid, DIALOG_BUYSKIN, DIALOG_STYLE_INPUT,""COL_WHITE"Buy clothes",""COL_WHITE"Invalid skin. Valid skin IDs are 0 to 299.","Buy","No");
  7721.                 if(PlayerInfo[playerid][pCash] < 300)
  7722.                 {
  7723.                     ProxDetector(50.0, playerid, "Shop Clerk says: Oh I am sorry, I don't think that's enough cash.", COLOR_GRAD1);
  7724.                     return 1;
  7725.                 }
  7726.                 PlayerInfo[playerid][pCash] -= 300;
  7727.                 PlayerInfo[playerid][pSkin] = skin;
  7728.                 SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  7729.                 ProxDetector(50.0, playerid, "Shop Clerk says: Excellent choice!", COLOR_GRAD1);
  7730.                 new str[126];
  7731.                 format(str, sizeof(str), "MoneyTrace: %s bought clothes for $300", GetName(playerid));
  7732.                 Log("/logs/moneytrace.txt", str);
  7733.             }
  7734.             return 1;
  7735.         }
  7736.  
  7737.         case DIALOG_ADS:
  7738.         {
  7739.             new str[128];
  7740.             format(str, 128, "%s: %s", GetName(playerid), inputtext);
  7741.             SendClientMessageToAll(COLOR_RED, str);
  7742.             return 1;
  7743.         }
  7744.  
  7745.  
  7746.         case DIALOG_LOGIN:
  7747.         {
  7748.             if ( !response ) return Kick ( playerid );
  7749.             if( response )
  7750.             {
  7751.                 if(udb_hash(inputtext) != PlayerInfo[playerid][pPass]) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
  7752.                 if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  7753.                 {
  7754.                     TogglePlayerSpectating(playerid, 0);
  7755.                     INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  7756.                     SetPVarInt(playerid, "prelogin", 0);
  7757.                     SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ], 0, 0, 0, 0, 0, 0, 0);
  7758.                     SpawnPlayer(playerid);
  7759.                     SetPlayerWeapons(playerid);
  7760.                     SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
  7761.                     SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
  7762.                     SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  7763.                     SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
  7764.                     SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
  7765.                     SetPlayerWeaponsEx(playerid);
  7766.                     SetTimerEx("PlayerTime", 1000, true, "i", playerid);
  7767.                     SetTimerEx("CheckArmHack", 5000, true, "i", playerid);
  7768.                     SetTimerEx("CheckWepHack", 1000, true, "i", playerid);
  7769.                     SetTimerEx("CheckTPHack", 3000, true, "i", playerid);
  7770.                     SetTimerEx("CheckWarpHack", 3000, true, "i", playerid);
  7771.                     SetTimerEx("SaveChar", 200000, true, "i", playerid);
  7772.                     SendClientMessage(playerid, -1, "Welcome back to the Roleplay Server.");
  7773.                     Connected[playerid] = 1;
  7774.                     SetCameraBehindPlayer(playerid);
  7775.                     TogglePlayerControllable(playerid, 1);
  7776.                     //
  7777.                     if(PlayerInfo[playerid][pX] == 0 && PlayerInfo[playerid][pY] == 0 && PlayerInfo[playerid][pZ] == 0)
  7778.                     {
  7779.                         PlayerInfo[playerid][pX] = 1780.1759;
  7780.                         PlayerInfo[playerid][pY] = -1933.6698;
  7781.                         PlayerInfo[playerid][pZ] = 13.3859;
  7782.                         SetPlayerHealth(playerid, 100);
  7783.                         SetPlayerVirtualWorld(playerid, 0);
  7784.                         SetPlayerInterior(playerid, 0);
  7785.                         SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
  7786.                         SendClientMessage(playerid, COLOR_CYAN, "Your spawn location got saved inproperly, you have been sent to Los Santos.");
  7787.                     }
  7788.                     //
  7789.                     if(PlayerInfo[playerid][pHealth] == -1337)
  7790.                     {
  7791.                         SetPlayerInterior(playerid, 0);
  7792.                         SetPlayerVirtualWorld(playerid, 0);
  7793.                         SetPlayerHealth(playerid, 40);
  7794.                         TogglePlayerControllable(playerid, 0);
  7795.                         SetPlayerCameraPos(playerid, 1201.5009,-1325.1001,16.6868);
  7796.                         SetPlayerCameraLookAt(playerid, 1176.9282,-1323.5554,14.0455);
  7797.                         RecoverHospital(playerid);
  7798.                         SetTimerEx("RecoverHospital2", 6000, false, "i", playerid);
  7799.                         SetTimerEx("RecoverHospital3", 8000, false, "i", playerid);
  7800.                         SetTimerEx("RecoverHospital4", 10000, false, "i", playerid);
  7801.                         SetTimerEx("RecoverHospital5", 12000, false, "i", playerid);
  7802.                         SetTimerEx("RecoverHospital6", 14000, false, "i", playerid);
  7803.                         SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1178, -1324, 8.11, 0, 0, 0, 0, 0, 0, 0);
  7804.                         SpawnPlayer(playerid);
  7805.                         SetPVarInt(playerid, "Injured", 0);
  7806.                         SetPVarInt(playerid, "Recovering", 1);
  7807.                     }
  7808.                     if(PlayerInfo[playerid][pJail] >= 1)
  7809.                     {
  7810.                         rtimer[playerid] = SetTimerEx("arrestrelease", 1000, true, "i", playerid);
  7811.                        // SendClientMessage(playerid, COLOR_CYAN, "You got sent back to jail.");
  7812.                     }
  7813.                 }
  7814.                 return 1;
  7815.             }
  7816.         }
  7817.     }
  7818.     return 1;
  7819. }
  7820.  
  7821. forward checkmoved(playerid);
  7822. public checkmoved(playerid)
  7823. {
  7824.     if(!IsPlayerInRangeOfPoint(playerid, 6, iX[playerid], iY[playerid], iZ[playerid]))
  7825.     {
  7826.     SetPlayerHealth(playerid, 0);
  7827.     KillTimer(itimer[playerid]);
  7828.     KillTimer(iitimer[playerid]);
  7829.     return 1;
  7830.     }
  7831.     return 1;
  7832. }
  7833.  
  7834. forward PlayerTime();
  7835. public PlayerTime()
  7836. {
  7837.     for(new i = 0; i < MAX_PLAYERS; i++)
  7838.     {
  7839.         if(IsPlayerConnected(i))
  7840.         {
  7841.             PlayerInfo[i][pHours]++;
  7842.         }
  7843.     }
  7844.     return 1;
  7845. }
  7846.  
  7847. forward LoseHP(playerid);
  7848. public LoseHP(playerid)
  7849. {
  7850.     new Float:HP;
  7851.     GetPlayerHealth(playerid, HP);
  7852.     SetPlayerHealth(playerid, HP-5);
  7853. }
  7854.  
  7855. forward RecoverHospital(playerid);
  7856. public RecoverHospital(playerid)
  7857. {
  7858.     SendClientMessage(playerid, -1, "You have to recover health at the hospital.");
  7859.     SetPlayerHealth(playerid, 50);
  7860. }
  7861. forward RecoverHospital2(playerid);
  7862. public RecoverHospital2(playerid)
  7863. {
  7864.     SetPlayerHealth(playerid, 60);
  7865. }
  7866. forward RecoverHospital3(playerid);
  7867. public RecoverHospital3(playerid)
  7868. {
  7869.     SetPlayerHealth(playerid, 65);
  7870. }
  7871. forward RecoverHospital4(playerid);
  7872. public RecoverHospital4(playerid)
  7873. {
  7874.     SetPlayerHealth(playerid, 70);
  7875. }
  7876. forward RecoverHospital5(playerid);
  7877. public RecoverHospital5(playerid)
  7878. {
  7879.     SetPlayerHealth(playerid, 75);
  7880. }
  7881. forward RecoverHospital6(playerid);
  7882. public RecoverHospital6(playerid)
  7883. {
  7884.     SetPlayerPos(playerid, 1178.4980,-1323.4543,14.1230);
  7885.     SetPlayerFacingAngle(playerid, 271.3259);
  7886.     SetPlayerHealth(playerid, 80);
  7887.     TogglePlayerControllable(playerid, 1);
  7888.     SetCameraBehindPlayer(playerid);
  7889.     SetPVarInt(playerid, "Recovering", 0);
  7890.     SendClientMessage(playerid, COLOR_LIGHTRED, "Hospital: The hospital bill came to $200. Buy an insurance for a cheaper bill.");
  7891.     ResetPlayerWeapons(playerid);
  7892.     ResetPlayerWeaponsEx(playerid);
  7893.     PlayerInfo[playerid][pCash] -= 200;
  7894. }
  7895. forward RecoverHospital26(playerid);
  7896. public RecoverHospital26(playerid)
  7897. {
  7898.     SetPlayerPos(playerid, 2029.52, -1421.81, 16.99);
  7899.     SetPlayerHealth(playerid, 80);
  7900.     TogglePlayerControllable(playerid, 1);
  7901.     SetCameraBehindPlayer(playerid);
  7902.     SetPVarInt(playerid, "Recovering", 0);
  7903.     SendClientMessage(playerid, COLOR_LIGHTRED, "Hospital: The hospital bill came to $200. Buy an insurance for a cheaper bill.");
  7904.     ResetPlayerWeapons(playerid);
  7905.     ResetPlayerWeaponsEx(playerid);
  7906.     PlayerInfo[playerid][pCash] -= 200;
  7907. }
  7908.  
  7909.  
  7910. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  7911. {
  7912.     return 1;
  7913. }
  7914.  
  7915. stock IsNearLoadingPoint(playerid)
  7916. {
  7917.     if(IsPlayerInRangeOfPoint(playerid, 20, 1141.23, -1326.42, 13.65)) return 1;
  7918.     if(IsPlayerInRangeOfPoint(playerid, 20, 2017.17, -1413.84, 16.99)) return 1;
  7919.     return 0;
  7920. }
  7921.  
  7922. stock GetVehicleCost(carid)
  7923. {
  7924.     if(carid == 560) return 60000;
  7925.     if(carid == 562) return 85000;
  7926.     return -1;
  7927. }
  7928.  
  7929.  
  7930.  
  7931. stock GetZone(playerid)
  7932. {
  7933.     new zone[50];
  7934.     GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
  7935.     return zone;
  7936. }
  7937.  
  7938.  
  7939. stock LoadDynamicDoors()
  7940. {
  7941.     new arrCoords[26][64];
  7942.     new strFromFile2[256];
  7943.     new File: file = fopen("dynamicdoors.cfg", io_read);
  7944.     if(file)
  7945.     {
  7946.         new idx;
  7947.         while (idx < sizeof(DoorInfo))
  7948.         {
  7949.             fread(file, strFromFile2);
  7950.             splits(strFromFile2, arrCoords, '|');
  7951.             strmid(DoorInfo[idx][ddName], arrCoords[0], 0, strlen(arrCoords[0]), 128);
  7952.             DoorInfo[idx][ddCustomInterior] = strval(arrCoords[1]);
  7953.             DoorInfo[idx][ddExteriorVW] = strval(arrCoords[2]);
  7954.             DoorInfo[idx][ddExteriorInt] = strval(arrCoords[3]);
  7955.             DoorInfo[idx][ddInteriorVW] = strval(arrCoords[4]);
  7956.             DoorInfo[idx][ddInteriorInt] = strval(arrCoords[5]);
  7957.             DoorInfo[idx][ddExteriorX] = floatstr(arrCoords[6]);
  7958.             DoorInfo[idx][ddExteriorY] = floatstr(arrCoords[7]);
  7959.             DoorInfo[idx][ddExteriorZ] = floatstr(arrCoords[8]);
  7960.             DoorInfo[idx][ddExteriorA] = floatstr(arrCoords[9]);
  7961.             DoorInfo[idx][ddInteriorX] = floatstr(arrCoords[10]);
  7962.             DoorInfo[idx][ddInteriorY] = floatstr(arrCoords[11]);
  7963.             DoorInfo[idx][ddInteriorZ] = floatstr(arrCoords[12]);
  7964.             DoorInfo[idx][ddInteriorA] = floatstr(arrCoords[13]);
  7965.             DoorInfo[idx][ddCustomExterior] = strval(arrCoords[14]);
  7966.             DoorInfo[idx][ddFaction] = strval(arrCoords[17]);
  7967.             DoorInfo[idx][ddAdmin] = strval(arrCoords[18]);
  7968.             DoorInfo[idx][ddWanted] = strval(arrCoords[19]);
  7969.             DoorInfo[idx][ddVehicleAble] = strval(arrCoords[20]);
  7970.             DoorInfo[idx][ddColor] = strval(arrCoords[21]);
  7971.             DoorInfo[idx][ddPickupModel] = strval(arrCoords[22]);
  7972.             strmid(DoorInfo[idx][ddPass], arrCoords[23], 0, strlen(arrCoords[23]), 24);
  7973.             DoorInfo[idx][ddLocked] = strval(arrCoords[24]);
  7974.             DoorInfo[idx][ddNotEditable] = strval(arrCoords[25]);
  7975.  
  7976.             if(!isnull(DoorInfo[idx][ddName]))
  7977.             {
  7978.                 CreateDynamicDoor(idx);
  7979.             }
  7980.  
  7981.             idx++;
  7982.         }
  7983.         fclose(file);
  7984.     }
  7985.     return 1;
  7986. }
  7987.  
  7988.  
  7989. stock SaveDynamicDoors()
  7990. {
  7991.  
  7992.     new
  7993.         szFileStr[512],
  7994.         File: fHandle = fopen("dynamicdoors.cfg", io_write);
  7995.  
  7996.     for(new iIndex; iIndex < MAX_DDOORS; iIndex++) {
  7997.         format(szFileStr, sizeof(szFileStr), "%s|%d|%d|%d|%d|%d|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%s|%d|%d\r\n",
  7998.             DoorInfo[iIndex][ddName],
  7999.             DoorInfo[iIndex][ddCustomInterior],
  8000.             DoorInfo[iIndex][ddExteriorVW],
  8001.             DoorInfo[iIndex][ddExteriorInt],
  8002.             DoorInfo[iIndex][ddInteriorVW],
  8003.             DoorInfo[iIndex][ddInteriorInt],
  8004.             DoorInfo[iIndex][ddExteriorX],
  8005.             DoorInfo[iIndex][ddExteriorY],
  8006.             DoorInfo[iIndex][ddExteriorZ],
  8007.             DoorInfo[iIndex][ddExteriorA],
  8008.             DoorInfo[iIndex][ddInteriorX],
  8009.             DoorInfo[iIndex][ddInteriorY],
  8010.             DoorInfo[iIndex][ddInteriorZ],
  8011.             DoorInfo[iIndex][ddInteriorA],
  8012.             DoorInfo[iIndex][ddCustomExterior],
  8013.             0,
  8014.             0,
  8015.             DoorInfo[iIndex][ddFaction],
  8016.             DoorInfo[iIndex][ddAdmin],
  8017.             DoorInfo[iIndex][ddWanted],
  8018.             DoorInfo[iIndex][ddVehicleAble],
  8019.             DoorInfo[iIndex][ddColor],
  8020.             DoorInfo[iIndex][ddPickupModel],
  8021.             DoorInfo[iIndex][ddPass],
  8022.             DoorInfo[iIndex][ddLocked],
  8023.             DoorInfo[iIndex][ddNotEditable]
  8024.         );
  8025.         fwrite(fHandle, szFileStr);
  8026.     }
  8027.     return fclose(fHandle);
  8028. }
  8029.  
  8030. stock CreateDynamicDoor(doorid)
  8031. {
  8032.     new string[128];
  8033.     //format(string, sizeof(string), "%s\nID: %d",DoorInfo[doorid][ddName],doorid);
  8034.     format(string, sizeof(string), "%s",DoorInfo[doorid][ddName]);
  8035.  
  8036.     switch(DoorInfo[doorid][ddColor])
  8037.     {
  8038.         case -1:{ /* Disable 3d Textdraw */ }
  8039.         case 1:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWWHITE, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8040.         case 2:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWPINK, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8041.         case 3:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWRED, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8042.         case 4:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWBROWN, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8043.         case 5:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWGRAY, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8044.         case 6:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWOLIVE, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8045.         case 7:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWPURPLE, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8046.         case 8:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWORANGE, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8047.         case 9:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWAZURE, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8048.         case 10:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWGREEN, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8049.         case 11:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWBLUE, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8050.         case 12:{DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_TWBLACK, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);}
  8051.         default:
  8052.         {
  8053.             DoorInfo[doorid][ddTextID] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ]+0.7,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, DoorInfo[doorid][ddExteriorVW], DoorInfo[doorid][ddExteriorInt], -1);
  8054.         }
  8055.     }
  8056.  
  8057.     switch(DoorInfo[doorid][ddPickupModel])
  8058.     {
  8059.         case -1: { /* Disable Pickup */ }
  8060.         case 1:
  8061.         {
  8062.             {DoorInfo[doorid][ddPickupID] = CreatePickup(1210, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8063.         }
  8064.         case 2: {DoorInfo[doorid][ddPickupID] = CreatePickup(1212, 1, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8065.         case 3:{DoorInfo[doorid][ddPickupID] = CreatePickup(1239, 1, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8066.         case 4:{DoorInfo[doorid][ddPickupID] = CreatePickup(1240, 1, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8067.         case 5:{DoorInfo[doorid][ddPickupID] = CreatePickup(1241, 1, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8068.         case 6:{DoorInfo[doorid][ddPickupID] = CreatePickup(1242, 1, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8069.         case 7:{DoorInfo[doorid][ddPickupID] = CreatePickup(1247, 1, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8070.         case 8:{DoorInfo[doorid][ddPickupID] = CreatePickup(1248, 1, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8071.         case 9:{DoorInfo[doorid][ddPickupID] = CreatePickup(1252, 1, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8072.         case 10:{DoorInfo[doorid][ddPickupID] = CreatePickup(1253, 1, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8073.         case 11:{DoorInfo[doorid][ddPickupID] = CreatePickup(1254, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8074.         case 12:{DoorInfo[doorid][ddPickupID] = CreatePickup(1313, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8075.         case 13:{DoorInfo[doorid][ddPickupID] = CreatePickup(1272, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8076.         case 14:{DoorInfo[doorid][ddPickupID] = CreatePickup(1273, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8077.         case 15:{DoorInfo[doorid][ddPickupID] = CreatePickup(1274, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8078.         case 16:{DoorInfo[doorid][ddPickupID] = CreatePickup(1275, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8079.         case 17:{DoorInfo[doorid][ddPickupID] = CreatePickup(1276, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8080.         case 18:{DoorInfo[doorid][ddPickupID] = CreatePickup(1277, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8081.         case 19:{DoorInfo[doorid][ddPickupID] = CreatePickup(1279, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8082.         case 20:{DoorInfo[doorid][ddPickupID] = CreatePickup(1314, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8083.         case 21:{DoorInfo[doorid][ddPickupID] = CreatePickup(1316, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8084.         case 22:{DoorInfo[doorid][ddPickupID] = CreatePickup(1317, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8085.         case 23:{DoorInfo[doorid][ddPickupID] = CreatePickup(1559, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8086.         case 24:{DoorInfo[doorid][ddPickupID] = CreatePickup(1582, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8087.         case 25:{DoorInfo[doorid][ddPickupID] = CreatePickup(2894, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);}
  8088.         default:
  8089.         {
  8090.             DoorInfo[doorid][ddPickupID] = CreatePickup(1318, 23, DoorInfo[doorid][ddExteriorX], DoorInfo[doorid][ddExteriorY], DoorInfo[doorid][ddExteriorZ], DoorInfo[doorid][ddExteriorVW]);
  8091.         }
  8092.     }
  8093. }
  8094.  
  8095.  
  8096. stock GetPlayerNameEx(playerid)
  8097. {
  8098.  
  8099.     new
  8100.         sz_playerName[MAX_PLAYER_NAME],
  8101.         i_pos;
  8102.  
  8103.     GetPlayerName(playerid, sz_playerName, MAX_PLAYER_NAME);
  8104.     while ((i_pos = strfind(sz_playerName, "_", false, i_pos)) != -1) sz_playerName[i_pos] = ' ';
  8105.     return sz_playerName;
  8106. }
  8107.  
  8108. stock ShowPlayerDialogEx(playerid, dialogid, style, caption[], info[], button1[], button2[]) {
  8109.     SetPVarInt(playerid, "dialog", dialogid);
  8110.     ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);
  8111.     return 1;
  8112. }
  8113.  
  8114. stock IsKeyJustDown(key, newkeys, oldkeys)
  8115. {
  8116.     if((newkeys & key) && !(oldkeys & key)) return 1;
  8117.     return 0;
  8118. }
  8119.  
  8120.  
  8121. stock IsACop(playerid)
  8122. {
  8123.     if(PlayerInfo[playerid][pFaction] == 1)
  8124.     {
  8125.         return 1;
  8126.     }
  8127.     return 0;
  8128. }
  8129.  
  8130. stock LoadObjectsForPlayer(playerid) {
  8131.     TogglePlayerControllable(playerid, 0);
  8132.     for(new o = 0; o < 6; o++)
  8133.     {
  8134.     TextDrawShowForPlayer(playerid, ObjectsLoadingTD[o]);
  8135.     }
  8136.     SetPVarInt(playerid, "LoadingObjects", 1);
  8137.     SetTimerEx("SafeLoadObjects", 3000, 0, "d", playerid);
  8138. }
  8139.  
  8140. stock splits(const strsrc[], strdest[][], delimiter)
  8141. {
  8142.     new i, li;
  8143.     new aNum;
  8144.     new len;
  8145.     while(i <= strlen(strsrc)){
  8146.         if(strsrc[i]==delimiter || i==strlen(strsrc)){
  8147.             len = strmid(strdest[aNum], strsrc, li, i, 128);
  8148.             strdest[aNum][len] = 0;
  8149.             li = i+1;
  8150.             aNum++;
  8151.         }
  8152.         i++;
  8153.     }
  8154.     return 1;
  8155. }
  8156.  
  8157. stock Log(FileName[], Input[]) {
  8158.  
  8159.     new string[156], date[2][3], File: fileHandle = fopen(FileName, io_append);
  8160.     gettime(date[0][0], date[0][1], date[0][2]);
  8161.     getdate(date[1][0], date[1][1], date[1][2]);
  8162.     format(string, sizeof(string), "[%i/%i/%i - %i:%i:%i] %s\r\n", date[1][2], date[1][1], date[1][0], date[0][0], date[0][1], date[0][2], Input);
  8163.     fwrite(fileHandle, string);
  8164.     return fclose(fileHandle);
  8165. }
  8166.  
  8167. stock CreateFile(FileName[], Input[]) {
  8168.  
  8169.     new string[156], File: fileHandle = fopen(FilneName, io_append);
  8170.     format(string, sizeof(string), "%s\r\n", Input);
  8171.     fwrite(fileHandle, string);
  8172.     return fclose(fileHandle);
  8173. }
  8174.  
  8175. stock SendClientMessageToAdmins(color,string[],level)
  8176. {
  8177.     foreach(Player, i)
  8178.     {
  8179.         if(!IsPlayerConnected(i)) return 1;
  8180.         if(PlayerInfo[i][pAdmin] >= level && Connected[i] == 1)
  8181.         {
  8182.             SendClientMessage(i, color, string);
  8183.             //printf("%s", string);
  8184.         }
  8185.     }
  8186.     return 1;
  8187. }
  8188.  
  8189. stock SendClientMessageToHelpersEx(color,string[],level)
  8190. {
  8191.     foreach(Player, i)
  8192.     {
  8193.         if(!IsPlayerConnected(i)) return 1;
  8194.         if(PlayerInfo[i][pAdmin] >= level && Connected[i] == 1)
  8195.         {
  8196.             SendClientMessage(i, color, string);
  8197.             //printf("%s", string);
  8198.         }
  8199.     }
  8200.     return 1;
  8201. }
  8202.  
  8203. stock SendClientMessageToLSPD(color,string[])
  8204. {
  8205.     foreach(Player, i)
  8206.     {
  8207.         if(!IsPlayerConnected(i)) return 1;
  8208.         if(PlayerInfo[i][pFaction] == 1 && Connected[i] == 1)
  8209.         {
  8210.             SendClientMessage(i, color, string);
  8211.             //printf("%s", string);
  8212.         }
  8213.     }
  8214.     return 1;
  8215. }
  8216.  
  8217. stock SendClientMessageToHelpers(color,string[])
  8218. {
  8219.     foreach(Player, i)
  8220.     {
  8221.         if(!IsPlayerConnected(i)) return 1;
  8222.         if(PlayerInfo[i][pHelper] > 0 && Connected[i] == 1)
  8223.         {
  8224.             SendClientMessage(i, color, string);
  8225.         }
  8226.     }
  8227.     return 1;
  8228. }
  8229.  
  8230. stock SCMTO(string[])
  8231. {
  8232.     foreach(Player, i)
  8233.     {
  8234.         if(!IsPlayerConnected(i)) return 1;
  8235.         if(togo[i] == 1 && Connected[i] == 1)
  8236.         {
  8237.             SendClientMessage(i, COLOR_OOC, string);
  8238.         }
  8239.     }
  8240.     return 1;
  8241. }
  8242.  
  8243. stock Newbie(string[])
  8244. {
  8245.     foreach(Player, i)
  8246.     {
  8247.         if(!IsPlayerConnected(i)) return 1;
  8248.         if(tognewbie[i] == 0 && Connected[i] == 1)
  8249.         {
  8250.             SendClientMessage(i, COLOR_NEWBIE, string);
  8251.         }
  8252.     }
  8253.     return 1;
  8254. }
  8255.  
  8256. stock SendClientMessageToFBI(color,string[])
  8257. {
  8258.     foreach(Player, i)
  8259.     {
  8260.         if(!IsPlayerConnected(i)) return 1;
  8261.         if(PlayerInfo[i][pFaction] == 2 && Connected[i] == 1)
  8262.         {
  8263.             SendClientMessage(i, color, string);
  8264.             //printf("%s", string);
  8265.         }
  8266.     }
  8267.     return 1;
  8268. }
  8269.  
  8270. stock SendClientMessageToLSFMD(color,string[])
  8271. {
  8272.     foreach(Player, i)
  8273.     {
  8274.         if(!IsPlayerConnected(i)) return 1;
  8275.         if(PlayerInfo[i][pFaction] == 3 && Connected[i] == 1)
  8276.         {
  8277.             SendClientMessage(i, color, string);
  8278.             //printf("%s", string);
  8279.         }
  8280.     }
  8281.     return 1;
  8282. }
  8283.  
  8284. stock SendClientMessageToHA(color,string[])
  8285. {
  8286.     foreach(Player, i)
  8287.     {
  8288.         if(!IsPlayerConnected(i)) return 1;
  8289.         if(PlayerInfo[i][pFaction] == 4 && Connected[i] == 1)
  8290.         {
  8291.             SendClientMessage(i, color, string);
  8292.             //printf("%s", string);
  8293.         }
  8294.     }
  8295.     return 1;
  8296. }
  8297.  
  8298. stock SendClientMessageToGOV(color,string[])
  8299. {
  8300.     foreach(Player, i)
  8301.     {
  8302.         if(!IsPlayerConnected(i)) return 1;
  8303.         if(PlayerInfo[i][pFaction] == 5 && Connected[i] == 1)
  8304.         {
  8305.             SendClientMessage(i, color, string);
  8306.             //printf("%s", string);
  8307.         }
  8308.     }
  8309.     return 1;
  8310. }
  8311.  
  8312. stock SendClientMessageToSN(color,string[])
  8313. {
  8314.     foreach(Player, i)
  8315.     {
  8316.         if(!IsPlayerConnected(i)) return 1;
  8317.         if(PlayerInfo[i][pFaction] == 6 && Connected[i] == 1)
  8318.         {
  8319.             SendClientMessage(i, color, string);
  8320.             //printf("%s", string);
  8321.         }
  8322.     }
  8323.     return 1;
  8324. }
  8325.  
  8326. stock SendClientMessageToDepartments(color,string[])
  8327. {
  8328.     foreach(Player, i)
  8329.     {
  8330.         if(!IsPlayerConnected(i)) return 1;
  8331.         if(PlayerInfo[i][pFaction] == 1 || PlayerInfo[i][pFaction] == 2 || PlayerInfo[i][pFaction] == 3 || PlayerInfo[i][pFaction] == 5  && Connected[i] == 1)
  8332.         {
  8333.             SendClientMessage(i, color, string);
  8334.             //printf("%s", string);
  8335.         }
  8336.         if(!IsPlayerConnected(i)) return 1;
  8337.         if(PlayerInfo[i][pFaction] == 4 && togdr[i] == 1 && Connected[i] == 1)
  8338.         {
  8339.             SendClientMessage(i, color, string);
  8340.             //printf("%s", string);
  8341.         }
  8342.     }
  8343.     return 1;
  8344. }
  8345.  
  8346. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) {
  8347.         if(tazer[playerid] == 1)
  8348.         {
  8349.             if(weaponid == 23)
  8350.             {
  8351.                 if(AdminDuty[damagedid] == 1)
  8352.                 {
  8353.                     SendClientMessage(playerid, -1, "You can not taze that admin at the moment.");
  8354.                     return 1;
  8355.                 }
  8356.                 if(GetPVarInt(damagedid, "Restrained") == 1)
  8357.                 {
  8358.                     SendClientMessage(playerid, -1, "This player is already restrained.");
  8359.                     return 1;
  8360.                 }
  8361.                 if(GetPVarInt(damagedid, "Cuffed") == 1)
  8362.                 {
  8363.                     SendClientMessage(playerid, -1, "This player is cuffed.");
  8364.                     return 1;
  8365.                 }
  8366.                 if(GetPVarInt(damagedid, "Recovering") == 1)
  8367.                 {
  8368.                     SendClientMessage(playerid, -1, "This player is in hospital.");
  8369.                     return 1;
  8370.                 }
  8371.                 if(GetPVarInt(damagedid, "Injured") == 1)
  8372.                 {
  8373.                     SendClientMessage(playerid, -1, "This player is injured,");
  8374.                     return 1;
  8375.                 }
  8376.                 new playerState = GetPlayerState(damagedid); // Get the killer's state
  8377.                 if (playerState == PLAYER_STATE_PASSENGER || playerState == PLAYER_STATE_DRIVER) return 1;
  8378.                 if(playerid == damagedid) return Kick(playerid);
  8379.                 new string[56];
  8380.                 format(string, sizeof(string), "* %s fires their tazer at %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(damagedid));
  8381.                 ProxDetector(30.0, playerid, string, COLOR_PURPLE);
  8382.                 GameTextForPlayer(damagedid, "~r~Tazed", 3500, 3);
  8383.                 TogglePlayerControllable(damagedid, 0);
  8384.                 PreloadAnims(playerid);
  8385.                 ApplyAnimation(damagedid,"CRACK","crckdeth2",4.1,0,1,1,1,1,0);
  8386.                 SetTimerEx("untaze", 5000, false, "i", damagedid);
  8387.                 SetPVarInt(damagedid, "Restrained", 1);
  8388.                 return 1;
  8389.             }
  8390.         }
  8391.         return 1;
  8392. }
  8393.  
  8394. forward untaze(playerid);
  8395. public untaze(playerid)
  8396. {
  8397.     if(GetPVarInt(playerid, "Cuffed") == 1) return SetPVarInt(playerid, "Restrained", 0);
  8398.     ClearAnimations(playerid);
  8399.     TogglePlayerControllable(playerid, 1);
  8400.     SetPVarInt(playerid, "Restrained", 0);
  8401.     return 1;
  8402. }
  8403.  
  8404. stock SetPlayerWeaponsEx(playerid)
  8405. {
  8406.     ResetPlayerWeapons(playerid);
  8407.     for(new s = 0; s < 12; s++)
  8408.     {
  8409.         if(PlayerInfo[playerid][pGuns][s] > 0)
  8410.         {
  8411.             GivePlayerValidWeapon(playerid, PlayerInfo[playerid][pGuns][s], 60000);
  8412.         }
  8413.     }
  8414.     SetPlayerArmedWeapon(playerid, GetPVarInt(playerid, "LastWeapon"));
  8415. }
  8416.  
  8417. stock GivePlayerValidWeapon(playerid, WeaponID, Ammo)
  8418. {
  8419.     switch(WeaponID)
  8420.     {
  8421.         case 0, 1:
  8422.         {
  8423.             PlayerInfo[playerid][pGuns][0] = WeaponID;
  8424.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8425.         }
  8426.         case 2, 3, 4, 5, 6, 7, 8, 9:
  8427.         {
  8428.             PlayerInfo[playerid][pGuns][1] = WeaponID;
  8429.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8430.         }
  8431.         case 22, 23, 24:
  8432.         {
  8433.             PlayerInfo[playerid][pGuns][2] = WeaponID;
  8434.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8435.         }
  8436.         case 25, 26, 27:
  8437.         {
  8438.             PlayerInfo[playerid][pGuns][3] = WeaponID;
  8439.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8440.         }
  8441.         case 28, 29, 32:
  8442.         {
  8443.             PlayerInfo[playerid][pGuns][4] = WeaponID;
  8444.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8445.         }
  8446.         case 30, 31:
  8447.         {
  8448.             PlayerInfo[playerid][pGuns][5] = WeaponID;
  8449.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8450.         }
  8451.         case 33, 34:
  8452.         {
  8453.             PlayerInfo[playerid][pGuns][6] = WeaponID;
  8454.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8455.         }
  8456.         case 35, 36, 37, 38:
  8457.         {
  8458.             PlayerInfo[playerid][pGuns][7] = WeaponID;
  8459.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8460.         }
  8461.         case 16, 17, 18, 39, 40:
  8462.         {
  8463.             PlayerInfo[playerid][pGuns][8] = WeaponID;
  8464.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8465.         }
  8466.         case 41, 42, 43:
  8467.         {
  8468.             PlayerInfo[playerid][pGuns][9] = WeaponID;
  8469.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8470.         }
  8471.         case 10, 11, 12, 13, 14, 15:
  8472.         {
  8473.             PlayerInfo[playerid][pGuns][10] = WeaponID;
  8474.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8475.         }
  8476.         case 44, 45, 46:
  8477.         {
  8478.             PlayerInfo[playerid][pGuns][11] = WeaponID;
  8479.             GivePlayerWeapon(playerid, WeaponID, Ammo);
  8480.         }
  8481.     }
  8482.     return 1;
  8483. }
  8484. stock SetPlayerWeapons(playerid)
  8485. {
  8486.     if(GetPVarInt(playerid, "PBM") > 0) { return 1; }
  8487.     ResetPlayerWeapons(playerid);
  8488.     for(new s = 0; s < 12; s++)
  8489.     {
  8490.         if(PlayerInfo[playerid][pGuns][s] > 0)
  8491.         {
  8492.             if(PlayerInfo[playerid][pGuns][s] == 17)
  8493.                 GivePlayerValidWeapon(playerid, PlayerInfo[playerid][pGuns][s], 5);
  8494.             else
  8495.                 GivePlayerValidWeapon(playerid, PlayerInfo[playerid][pGuns][s], 60000);
  8496.         }
  8497.     }
  8498.     return 1;
  8499. }
  8500. RemovePlayerWeapon(playerid, weaponid)
  8501. {
  8502.     new plyWeapons[13];
  8503.     for(new s = 0; s < 13; s++)
  8504.     {
  8505.         new wep, ammo;
  8506.         GetPlayerWeaponData(playerid, s, wep, ammo);
  8507.  
  8508.         if(wep != weaponid)
  8509.         {
  8510.             GetPlayerWeaponData(playerid, s, plyWeapons[s], ammo);
  8511.         }
  8512.         else
  8513.         {
  8514.             PlayerInfo[playerid][pGuns][s] = 0;
  8515.         }
  8516.     }
  8517.  
  8518.     ResetPlayerWeapons(playerid);
  8519.     for(new s = 0; s < 12; s++)
  8520.     {
  8521.         GivePlayerValidWeapon(playerid, plyWeapons[s], 60000);
  8522.     }
  8523.     return 1;
  8524. }
  8525.  
  8526. stock ResetPlayerWeaponsEx(playerid)
  8527. {
  8528.     ResetPlayerWeapons(playerid);
  8529.     PlayerInfo[playerid][pGuns][0] = 0;
  8530.     PlayerInfo[playerid][pGuns][1] = 0;
  8531.     PlayerInfo[playerid][pGuns][2] = 0;
  8532.     PlayerInfo[playerid][pGuns][3] = 0;
  8533.     PlayerInfo[playerid][pGuns][4] = 0;
  8534.     PlayerInfo[playerid][pGuns][5] = 0;
  8535.     PlayerInfo[playerid][pGuns][6] = 0;
  8536.     PlayerInfo[playerid][pGuns][7] = 0;
  8537.     PlayerInfo[playerid][pGuns][8] = 0;
  8538.     PlayerInfo[playerid][pGuns][9] = 0;
  8539.     PlayerInfo[playerid][pGuns][10] = 0;
  8540.     PlayerInfo[playerid][pGuns][11] = 0;
  8541.     return 1;
  8542. }
  8543.  
  8544. forward loadtruck1(playerid);
  8545. forward loadtruck2(playerid);
  8546. forward loadtruck3(playerid);
  8547. forward loadtruck4(playerid);
  8548. forward loadtruck5(playerid);
  8549. forward loadtruckGO(playerid);
  8550. public loadtruck1(playerid)
  8551. {
  8552.     GameTextForPlayer(playerid, "~g~|||~y~|||~r~||||", 5000, 3);
  8553.     SetTimerEx("loadtruck2", 1000, false, "i", playerid);
  8554.     TogglePlayerControllable(playerid, 0);
  8555. }
  8556. public loadtruck2(playerid)
  8557. {
  8558.     GameTextForPlayer(playerid, "~g~|||~y~|||~r~||", 5000, 3);
  8559.     SetTimerEx("loadtruck3", 1500, false, "i", playerid);
  8560. }
  8561. public loadtruck3(playerid)
  8562. {
  8563.     GameTextForPlayer(playerid, "~g~|||~y~|||", 5000, 3);
  8564.     SetTimerEx("loadtruck4", 1500, false, "i", playerid);
  8565. }
  8566. public loadtruck4(playerid)
  8567. {
  8568.     GameTextForPlayer(playerid, "~g~|||~y~|", 5000, 3);
  8569.     SetTimerEx("loadtruck5", 1500, false, "i", playerid);
  8570. }
  8571. public loadtruck5(playerid)
  8572. {
  8573.     GameTextForPlayer(playerid, "~g~||", 5000, 3);
  8574.     SetTimerEx("loadtruckGO", 1500, false, "i", playerid);
  8575. }
  8576. public loadtruckGO(playerid)
  8577. {
  8578.     new currenttruck;
  8579.     currenttruck = GetPlayerVehicleID(playerid);
  8580.     GameTextForPlayer(playerid, "Loaded", 3000, 3);
  8581.     new rand = random(sizeof(Destinations)); // defines the rand variable.
  8582.     SetPlayerCheckpoint(playerid, Destinations[rand][0], Destinations[rand][1], Destinations[rand][2], 3.0); // sets a checkpoint.
  8583.     SendClientMessage(playerid, COLOR_YELLOW, "Truck loaded - Go to the checkpoint to collect your payment.");
  8584.     truckloaded[playerid] = 1;
  8585.     truckloadedon[playerid] = currenttruck;
  8586.     CPT[playerid] = 1;
  8587.     TogglePlayerControllable(playerid, 1);
  8588. }
  8589.  
  8590. forward CheckArmHack(playerid);
  8591. public CheckArmHack(playerid)
  8592. {
  8593.  
  8594.     new Float:armr, str[100];
  8595.     GetPlayerArmour(playerid, armr);
  8596.     if(skipacheck[playerid] > 0)
  8597.     {
  8598.     skipacheck[playerid] =- 1;
  8599.     return 1; // wait.
  8600.     }
  8601.     if(armr > PlayerInfo[playerid][pArmor] && AdminDuty[playerid] != 1)
  8602.     {
  8603.         format(str, 100, "WARNING: %s may possibly be armor hacking. Has %.1f while he is supposed to have %.1f", GetName(playerid), armr, PlayerInfo[playerid][pArmor]);
  8604.         SendClientMessageToAdmins(COLOR_YELLOW, str, 1);
  8605.         Log("/logs/hacks.txt", str);
  8606.     }
  8607.     return 1;
  8608. }
  8609.  
  8610. forward CheckWarpHack(playerid);
  8611. public CheckWarpHack(playerid)
  8612. {
  8613.     carsentered[playerid] = 0;
  8614.     dontcheck[playerid] = 0;
  8615.     return 1;
  8616. }
  8617.  
  8618. forward CheckWepHack(playerid);
  8619. public CheckWepHack(playerid)
  8620. {
  8621.     if(waitcheck[playerid] > 0)
  8622.     {
  8623.         waitcheck[playerid] -= 1;
  8624.         return 1;
  8625.     }
  8626.     new wep;
  8627.  
  8628.     if(!IsPlayerConnected(playerid)) return 1; // if is not connected skip
  8629.     if(Connected[playerid] == 0) return 1; // if not logged in
  8630.     if(AdminDuty[playerid] > 0 && PlayerInfo[playerid][pAdmin] > 0) return 1;// dont check if admin duty and is admin
  8631.     if(GetPVarInt(playerid, "Injured") == 1) return 1; // dont check if injured
  8632.     if(GetPVarInt(playerid, "prelogin") == 1) return 1; // dont check if not finished the login screen.
  8633.     if(GetPlayerInterior(playerid) > 1) return 1; // likely entered a bulding
  8634.     if(spec[playerid] != -1 && PlayerInfo[playerid][pAdmin] > 0) return 1; // spectate mode
  8635.  
  8636.     if(wep == 1 && PlayerInfo[playerid][pGuns][0] != wep)
  8637.     {
  8638.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8639.     }
  8640.     if(wep == 3 && PlayerInfo[playerid][pGuns][1] != wep)
  8641.     {
  8642.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8643.     }
  8644.     if(wep == 4 && PlayerInfo[playerid][pGuns][1] != wep)
  8645.     {
  8646.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8647.     }
  8648.     if(wep == 5 && PlayerInfo[playerid][pGuns][1] != wep)
  8649.     {
  8650.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8651.     }
  8652.     if(wep == 6 && PlayerInfo[playerid][pGuns][1] != wep)
  8653.     {
  8654.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8655.     }
  8656.     if(wep == 7 && PlayerInfo[playerid][pGuns][1] != wep)
  8657.     {
  8658.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8659.     }
  8660.     if(wep == 8 && PlayerInfo[playerid][pGuns][1] != wep)
  8661.     {
  8662.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8663.     }
  8664.     if(wep == 9 && PlayerInfo[playerid][pGuns][1] != wep)
  8665.     {
  8666.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8667.     }
  8668.     if(wep == 22 && PlayerInfo[playerid][pGuns][2] != wep)
  8669.     {
  8670.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8671.     }
  8672.     if(wep == 23 && PlayerInfo[playerid][pGuns][2] != wep)
  8673.     {
  8674.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8675.     }
  8676.     if(wep == 24 && PlayerInfo[playerid][pGuns][2] != wep)
  8677.     {
  8678.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8679.     }
  8680.     if(wep == 25 && PlayerInfo[playerid][pGuns][3] != wep)
  8681.     {
  8682.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8683.     }
  8684.     if(wep == 26 && PlayerInfo[playerid][pGuns][3] != wep)
  8685.     {
  8686.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8687.     }
  8688.     if(wep == 27 && PlayerInfo[playerid][pGuns][3] != wep)
  8689.     {
  8690.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8691.     }
  8692.     if(wep == 28 && PlayerInfo[playerid][pGuns][4] != wep)
  8693.     {
  8694.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8695.     }
  8696.     if(wep == 29 && PlayerInfo[playerid][pGuns][4] != wep)
  8697.     {
  8698.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8699.     }
  8700.     if(wep == 32 && PlayerInfo[playerid][pGuns][4] != wep)
  8701.     {
  8702.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8703.     }
  8704.     if(wep == 30 && PlayerInfo[playerid][pGuns][5] != wep)
  8705.     {
  8706.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8707.     }
  8708.     if(wep == 31 && PlayerInfo[playerid][pGuns][5] != wep)
  8709.     {
  8710.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8711.     }
  8712.     if(wep == 34 && PlayerInfo[playerid][pGuns][6] != wep)
  8713.     {
  8714.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8715.     }
  8716.     if(wep == 33 && PlayerInfo[playerid][pGuns][6] != wep)
  8717.     {
  8718.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8719.     }
  8720.     if(wep == 35 && PlayerInfo[playerid][pGuns][7] != wep)
  8721.     {
  8722.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8723.     }
  8724.     if(wep == 36 && PlayerInfo[playerid][pGuns][7] != wep)
  8725.     {
  8726.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8727.     }
  8728.     if(wep == 37 && PlayerInfo[playerid][pGuns][7] != wep)
  8729.     {
  8730.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8731.     }
  8732.     if(wep == 16 && PlayerInfo[playerid][pGuns][8] != wep)
  8733.     {
  8734.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8735.     }
  8736.     if(wep == 17 && PlayerInfo[playerid][pGuns][8] != wep)
  8737.     {
  8738.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8739.     }
  8740.     if(wep == 18 && PlayerInfo[playerid][pGuns][8] != wep)
  8741.     {
  8742.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8743.     }
  8744.     if(wep == 39 && PlayerInfo[playerid][pGuns][8] != wep)
  8745.     {
  8746.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8747.     }
  8748.     if(wep == 40 && PlayerInfo[playerid][pGuns][8] != wep)
  8749.     {
  8750.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8751.     }
  8752.     if(wep == 41 && PlayerInfo[playerid][pGuns][9] != wep)
  8753.     {
  8754.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8755.     }
  8756.     if(wep == 42 && PlayerInfo[playerid][pGuns][9] != wep)
  8757.     {
  8758.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8759.     }
  8760.     if(wep == 43 && PlayerInfo[playerid][pGuns][9] != wep)
  8761.     {
  8762.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8763.     }
  8764.     if(wep == 10 && PlayerInfo[playerid][pGuns][10] != wep)
  8765.     {
  8766.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8767.     }
  8768.     if(wep == 11 && PlayerInfo[playerid][pGuns][10] != wep)
  8769.     {
  8770.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8771.     }
  8772.     if(wep == 12 && PlayerInfo[playerid][pGuns][10] != wep)
  8773.     {
  8774.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8775.     }
  8776.     if(wep == 13 && PlayerInfo[playerid][pGuns][10] != wep)
  8777.     {
  8778.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8779.     }
  8780.     if(wep == 14 && PlayerInfo[playerid][pGuns][10] != wep)
  8781.     {
  8782.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8783.     }
  8784.     if(wep == 15 && PlayerInfo[playerid][pGuns][10] != wep)
  8785.     {
  8786.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8787.     }
  8788.     if(wep == 44 && PlayerInfo[playerid][pGuns][11] != wep)
  8789.     {
  8790.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8791.     }
  8792.     if(wep == 45 && PlayerInfo[playerid][pGuns][11] != wep)
  8793.     {
  8794.         SetTimerEx("DoubleCheck", 500, false, "i", playerid);
  8795.     }
  8796.     return 1;
  8797. }
  8798.  
  8799. forward DoubleCheck(playerid);
  8800. public DoubleCheck(playerid)
  8801. {
  8802.     new wep, string[128];
  8803.     new wepname[56];
  8804.     wep = GetPlayerWeapon(playerid);
  8805.     GetWeaponName(wep, wepname, sizeof(wepname));
  8806.    
  8807.     if(waitcheck[playerid] > 0)
  8808.     {
  8809.         waitcheck[playerid] -= 1;
  8810.         return 1;
  8811.     }
  8812.  
  8813.     if(wep == 1 && PlayerInfo[playerid][pGuns][0] != wep)
  8814.     {
  8815.         new sttrrr[236], wepp[126];
  8816.         GetWeaponName(wep, wepp, 126);
  8817.         format(sttrrr, 236, "gun %s", wepp);
  8818.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8819.         PlayerInfo[playerid][pBanned] =  1;
  8820.         new ip[28];
  8821.         GetPlayerIp(playerid, ip, sizeof(ip));
  8822.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8823.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8824.         Log("/logs/ban.txt", string);
  8825.         AddBan(ip);
  8826.         Kick(playerid);
  8827.     }
  8828.     if(wep == 3 && PlayerInfo[playerid][pGuns][1] != wep)
  8829.     {
  8830.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8831.         PlayerInfo[playerid][pBanned] =  1;
  8832.         new ip[28];
  8833.         GetPlayerIp(playerid, ip, sizeof(ip));
  8834.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8835.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8836.         Log("/logs/ban.txt", string);
  8837.         AddBan(ip);
  8838.         Kick(playerid);
  8839.     }
  8840.     if(wep == 4 && PlayerInfo[playerid][pGuns][1] != wep)
  8841.     {
  8842.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8843.         PlayerInfo[playerid][pBanned] =  1;
  8844.  
  8845.         new ip[28];
  8846.         GetPlayerIp(playerid, ip, sizeof(ip));
  8847.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8848.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8849.         Log("/logs/ban.txt", string);
  8850.         AddBan(ip);
  8851.         Kick(playerid);
  8852.     }
  8853.     if(wep == 5 && PlayerInfo[playerid][pGuns][1] != wep)
  8854.     {
  8855.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8856.         PlayerInfo[playerid][pBanned] =  1;
  8857.  
  8858.         new ip[28];
  8859.         GetPlayerIp(playerid, ip, sizeof(ip));
  8860.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8861.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8862.         Log("/logs/ban.txt", string);
  8863.         AddBan(ip);
  8864.         Kick(playerid);
  8865.     }
  8866.     if(wep == 6 && PlayerInfo[playerid][pGuns][1] != wep)
  8867.     {
  8868.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8869.         PlayerInfo[playerid][pBanned] =  1;
  8870.  
  8871.         new ip[28];
  8872.         GetPlayerIp(playerid, ip, sizeof(ip));
  8873.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8874.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8875.         Log("/logs/ban.txt", string);
  8876.         AddBan(ip);
  8877.         Kick(playerid);
  8878.     }
  8879.     if(wep == 7 && PlayerInfo[playerid][pGuns][1] != wep)
  8880.     {
  8881.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8882.         PlayerInfo[playerid][pBanned] =  1;
  8883.  
  8884.         new ip[28];
  8885.         GetPlayerIp(playerid, ip, sizeof(ip));
  8886.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8887.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8888.         Log("/logs/ban.txt", string);
  8889.         AddBan(ip);
  8890.         Kick(playerid);
  8891.     }
  8892.     if(wep == 8 && PlayerInfo[playerid][pGuns][1] != wep)
  8893.     {
  8894.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8895.         PlayerInfo[playerid][pBanned] =  1;
  8896.  
  8897.         new ip[28];
  8898.         GetPlayerIp(playerid, ip, sizeof(ip));
  8899.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8900.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8901.         Log("/logs/ban.txt", string);
  8902.         AddBan(ip);
  8903.         Kick(playerid);
  8904.     }
  8905.     if(wep == 9 && PlayerInfo[playerid][pGuns][1] != wep)
  8906.     {
  8907.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8908.         PlayerInfo[playerid][pBanned] =  1;
  8909.  
  8910.         new ip[28];
  8911.         GetPlayerIp(playerid, ip, sizeof(ip));
  8912.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8913.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8914.         Log("/logs/ban.txt", string);
  8915.         AddBan(ip);
  8916.         Kick(playerid);
  8917.     }
  8918.     if(wep == 22 && PlayerInfo[playerid][pGuns][2] != wep)
  8919.     {
  8920.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8921.         PlayerInfo[playerid][pBanned] =  1;
  8922.  
  8923.         new ip[28];
  8924.         GetPlayerIp(playerid, ip, sizeof(ip));
  8925.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8926.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8927.         Log("/logs/ban.txt", string);
  8928.         AddBan(ip);
  8929.         Kick(playerid);
  8930.     }
  8931.     if(wep == 23 && PlayerInfo[playerid][pGuns][2] != wep)
  8932.     {
  8933.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8934.         PlayerInfo[playerid][pBanned] =  1;
  8935.  
  8936.         new ip[28];
  8937.         GetPlayerIp(playerid, ip, sizeof(ip));
  8938.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8939.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8940.         Log("/logs/ban.txt", string);
  8941.         AddBan(ip);
  8942.         Kick(playerid);
  8943.     }
  8944.     if(wep == 24 && PlayerInfo[playerid][pGuns][2] != wep)
  8945.     {
  8946.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8947.         PlayerInfo[playerid][pBanned] =  1;
  8948.  
  8949.         new ip[28];
  8950.         GetPlayerIp(playerid, ip, sizeof(ip));
  8951.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8952.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8953.         Log("/logs/ban.txt", string);
  8954.         AddBan(ip);
  8955.         Kick(playerid);
  8956.     }
  8957.     if(wep == 25 && PlayerInfo[playerid][pGuns][3] != wep)
  8958.     {
  8959.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8960.         PlayerInfo[playerid][pBanned] =  1;
  8961.  
  8962.         new ip[28];
  8963.         GetPlayerIp(playerid, ip, sizeof(ip));
  8964.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8965.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8966.         Log("/logs/ban.txt", string);
  8967.         AddBan(ip);
  8968.         Kick(playerid);
  8969.     }
  8970.     if(wep == 26 && PlayerInfo[playerid][pGuns][3] != wep)
  8971.     {
  8972.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8973.         PlayerInfo[playerid][pBanned] =  1;
  8974.  
  8975.         new ip[28];
  8976.         GetPlayerIp(playerid, ip, sizeof(ip));
  8977.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8978.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8979.         Log("/logs/ban.txt", string);
  8980.         AddBan(ip);
  8981.         Kick(playerid);
  8982.     }
  8983.     if(wep == 27 && PlayerInfo[playerid][pGuns][3] != wep)
  8984.     {
  8985.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8986.         PlayerInfo[playerid][pBanned] =  1;
  8987.  
  8988.         new ip[28];
  8989.         GetPlayerIp(playerid, ip, sizeof(ip));
  8990.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  8991.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  8992.         Log("/logs/ban.txt", string);
  8993.         AddBan(ip);
  8994.         Kick(playerid);
  8995.     }
  8996.     if(wep == 28 && PlayerInfo[playerid][pGuns][4] != wep)
  8997.     {
  8998.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  8999.         PlayerInfo[playerid][pBanned] =  1;
  9000.  
  9001.         new ip[28];
  9002.         GetPlayerIp(playerid, ip, sizeof(ip));
  9003.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9004.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9005.         Log("/logs/ban.txt", string);
  9006.         AddBan(ip);
  9007.         Kick(playerid);
  9008.     }
  9009.     if(wep == 29 && PlayerInfo[playerid][pGuns][4] != wep)
  9010.     {
  9011.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9012.         PlayerInfo[playerid][pBanned] =  1;
  9013.  
  9014.         new ip[28];
  9015.         GetPlayerIp(playerid, ip, sizeof(ip));
  9016.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9017.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9018.         Log("/logs/ban.txt", string);
  9019.         AddBan(ip);
  9020.         Kick(playerid);
  9021.     }
  9022.     if(wep == 32 && PlayerInfo[playerid][pGuns][4] != wep)
  9023.     {
  9024.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9025.         PlayerInfo[playerid][pBanned] =  1;
  9026.  
  9027.         new ip[28];
  9028.         GetPlayerIp(playerid, ip, sizeof(ip));
  9029.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9030.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9031.         Log("/logs/ban.txt", string);
  9032.         AddBan(ip);
  9033.         Kick(playerid);
  9034.     }
  9035.     if(wep == 30 && PlayerInfo[playerid][pGuns][5] != wep)
  9036.     {
  9037.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9038.         PlayerInfo[playerid][pBanned] =  1;
  9039.  
  9040.         new ip[28];
  9041.         GetPlayerIp(playerid, ip, sizeof(ip));
  9042.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9043.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9044.         Log("/logs/ban.txt", string);
  9045.         AddBan(ip);
  9046.         Kick(playerid);
  9047.     }
  9048.     if(wep == 31 && PlayerInfo[playerid][pGuns][5] != wep)
  9049.     {
  9050.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9051.         PlayerInfo[playerid][pBanned] =  1;
  9052.  
  9053.         new ip[28];
  9054.         GetPlayerIp(playerid, ip, sizeof(ip));
  9055.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9056.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9057.         Log("/logs/ban.txt", string);
  9058.         AddBan(ip);
  9059.         Kick(playerid);
  9060.     }
  9061.     if(wep == 34 && PlayerInfo[playerid][pGuns][6] != wep)
  9062.     {
  9063.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9064.         PlayerInfo[playerid][pBanned] =  1;
  9065.  
  9066.         new ip[28];
  9067.         GetPlayerIp(playerid, ip, sizeof(ip));
  9068.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9069.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9070.         Log("/logs/ban.txt", string);
  9071.         AddBan(ip);
  9072.         Kick(playerid);
  9073.     }
  9074.     if(wep == 33 && PlayerInfo[playerid][pGuns][6] != wep)
  9075.     {
  9076.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9077.         PlayerInfo[playerid][pBanned] =  1;
  9078.  
  9079.         new ip[28];
  9080.         GetPlayerIp(playerid, ip, sizeof(ip));
  9081.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9082.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9083.         Log("/logs/ban.txt", string);
  9084.         AddBan(ip);
  9085.         Kick(playerid);
  9086.     }
  9087.     if(wep == 35 && PlayerInfo[playerid][pGuns][7] != wep)
  9088.     {
  9089.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9090.         PlayerInfo[playerid][pBanned] =  1;
  9091.  
  9092.         new ip[28];
  9093.         GetPlayerIp(playerid, ip, sizeof(ip));
  9094.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9095.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9096.         Log("/logs/ban.txt", string);
  9097.         AddBan(ip);
  9098.         Kick(playerid);
  9099.     }
  9100.     if(wep == 36 && PlayerInfo[playerid][pGuns][7] != wep)
  9101.     {
  9102.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9103.         PlayerInfo[playerid][pBanned] =  1;
  9104.  
  9105.         new ip[28];
  9106.         GetPlayerIp(playerid, ip, sizeof(ip));
  9107.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9108.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9109.         Log("/logs/ban.txt", string);
  9110.         AddBan(ip);
  9111.         Kick(playerid);
  9112.     }
  9113.     if(wep == 37 && PlayerInfo[playerid][pGuns][7] != wep)
  9114.     {
  9115.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9116.         PlayerInfo[playerid][pBanned] =  1;
  9117.  
  9118.         new ip[28];
  9119.         GetPlayerIp(playerid, ip, sizeof(ip));
  9120.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9121.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9122.         Log("/logs/ban.txt", string);
  9123.         AddBan(ip);
  9124.         Kick(playerid);
  9125.     }
  9126.     if(wep == 16 && PlayerInfo[playerid][pGuns][8] != wep)
  9127.     {
  9128.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9129.         PlayerInfo[playerid][pBanned] =  1;
  9130.  
  9131.         new ip[28];
  9132.         GetPlayerIp(playerid, ip, sizeof(ip));
  9133.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9134.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9135.         Log("/logs/ban.txt", string);
  9136.         AddBan(ip);
  9137.         Kick(playerid);
  9138.     }
  9139.     if(wep == 17 && PlayerInfo[playerid][pGuns][8] != wep)
  9140.     {
  9141.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9142.         PlayerInfo[playerid][pBanned] =  1;
  9143.  
  9144.         new ip[28];
  9145.         GetPlayerIp(playerid, ip, sizeof(ip));
  9146.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9147.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9148.         Log("/logs/ban.txt", string);
  9149.         AddBan(ip);
  9150.         Kick(playerid);
  9151.     }
  9152.     if(wep == 18 && PlayerInfo[playerid][pGuns][8] != wep)
  9153.     {
  9154.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9155.         PlayerInfo[playerid][pBanned] =  1;
  9156.  
  9157.         new ip[28];
  9158.         GetPlayerIp(playerid, ip, sizeof(ip));
  9159.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9160.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9161.         Log("/logs/ban.txt", string);
  9162.         AddBan(ip);
  9163.         Kick(playerid);
  9164.     }
  9165.     if(wep == 39 && PlayerInfo[playerid][pGuns][8] != wep)
  9166.     {
  9167.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9168.         PlayerInfo[playerid][pBanned] =  1;
  9169.  
  9170.         new ip[28];
  9171.         GetPlayerIp(playerid, ip, sizeof(ip));
  9172.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9173.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9174.         Log("/logs/ban.txt", string);
  9175.         AddBan(ip);
  9176.         Kick(playerid);
  9177.     }
  9178.     if(wep == 40 && PlayerInfo[playerid][pGuns][8] != wep)
  9179.     {
  9180.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9181.         PlayerInfo[playerid][pBanned] =  1;
  9182.  
  9183.         new ip[28];
  9184.         GetPlayerIp(playerid, ip, sizeof(ip));
  9185.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9186.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9187.         Log("/logs/ban.txt", string);
  9188.         AddBan(ip);
  9189.         Kick(playerid);
  9190.     }
  9191.     if(wep == 41 && PlayerInfo[playerid][pGuns][9] != wep)
  9192.     {
  9193.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9194.         PlayerInfo[playerid][pBanned] =  1;
  9195.  
  9196.         new ip[28];
  9197.         GetPlayerIp(playerid, ip, sizeof(ip));
  9198.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9199.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9200.         Log("/logs/ban.txt", string);
  9201.         AddBan(ip);
  9202.         Kick(playerid);
  9203.     }
  9204.     if(wep == 42 && PlayerInfo[playerid][pGuns][9] != wep)
  9205.     {
  9206.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9207.         PlayerInfo[playerid][pBanned] =  1;
  9208.  
  9209.         new ip[28];
  9210.         GetPlayerIp(playerid, ip, sizeof(ip));
  9211.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9212.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9213.         Log("/logs/ban.txt", string);
  9214.         AddBan(ip);
  9215.         Kick(playerid);
  9216.     }
  9217.     if(wep == 43 && PlayerInfo[playerid][pGuns][9] != wep)
  9218.     {
  9219.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9220.         PlayerInfo[playerid][pBanned] =  1;
  9221.  
  9222.         new ip[28];
  9223.         GetPlayerIp(playerid, ip, sizeof(ip));
  9224.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9225.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9226.         Log("/logs/ban.txt", string);
  9227.         AddBan(ip);
  9228.         Kick(playerid);
  9229.     }
  9230.     if(wep == 10 && PlayerInfo[playerid][pGuns][10] != wep)
  9231.     {
  9232.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9233.         PlayerInfo[playerid][pBanned] =  1;
  9234.  
  9235.         new ip[28];
  9236.         GetPlayerIp(playerid, ip, sizeof(ip));
  9237.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9238.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9239.         Log("/logs/ban.txt", string);
  9240.         AddBan(ip);
  9241.         Kick(playerid);
  9242.     }
  9243.     if(wep == 11 && PlayerInfo[playerid][pGuns][10] != wep)
  9244.     {
  9245.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9246.         PlayerInfo[playerid][pBanned] =  1;
  9247.  
  9248.         new ip[28];
  9249.         GetPlayerIp(playerid, ip, sizeof(ip));
  9250.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9251.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9252.         Log("/logs/ban.txt", string);
  9253.         AddBan(ip);
  9254.         Kick(playerid);
  9255.     }
  9256.     if(wep == 12 && PlayerInfo[playerid][pGuns][10] != wep)
  9257.     {
  9258.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9259.         PlayerInfo[playerid][pBanned] =  1;
  9260.  
  9261.         new ip[28];
  9262.         GetPlayerIp(playerid, ip, sizeof(ip));
  9263.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9264.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9265.         Log("/logs/ban.txt", string);
  9266.         AddBan(ip);
  9267.         Kick(playerid);
  9268.     }
  9269.     if(wep == 13 && PlayerInfo[playerid][pGuns][10] != wep)
  9270.     {
  9271.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9272.         PlayerInfo[playerid][pBanned] =  1;
  9273.  
  9274.         new ip[28];
  9275.         GetPlayerIp(playerid, ip, sizeof(ip));
  9276.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9277.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9278.         Log("/logs/ban.txt", string);
  9279.         AddBan(ip);
  9280.         Kick(playerid);
  9281.     }
  9282.     if(wep == 14 && PlayerInfo[playerid][pGuns][10] != wep)
  9283.     {
  9284.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9285.         PlayerInfo[playerid][pBanned] =  1;
  9286.  
  9287.         new ip[28];
  9288.         GetPlayerIp(playerid, ip, sizeof(ip));
  9289.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9290.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9291.         Log("/logs/ban.txt", string);
  9292.         AddBan(ip);
  9293.         Kick(playerid);
  9294.     }
  9295.     if(wep == 15 && PlayerInfo[playerid][pGuns][10] != wep)
  9296.     {
  9297.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9298.         PlayerInfo[playerid][pBanned] =  1;
  9299.  
  9300.         new ip[28];
  9301.         GetPlayerIp(playerid, ip, sizeof(ip));
  9302.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9303.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9304.         Log("/logs/ban.txt", string);
  9305.         AddBan(ip);
  9306.         Kick(playerid);
  9307.     }
  9308.     if(wep == 44 && PlayerInfo[playerid][pGuns][11] != wep)
  9309.     {
  9310.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9311.         PlayerInfo[playerid][pBanned] =  1;
  9312.  
  9313.         new ip[28];
  9314.         GetPlayerIp(playerid, ip, sizeof(ip));
  9315.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9316.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9317.         Log("/logs/ban.txt", string);
  9318.         AddBan(ip);
  9319.         Kick(playerid);
  9320.     }
  9321.     if(wep == 45 && PlayerInfo[playerid][pGuns][11] != wep)
  9322.     {
  9323.         format(string, sizeof(string), "AdmCmd: %s was banned, Reason: Weapon Hacks (%s)", GetName(playerid), wepname);
  9324.         PlayerInfo[playerid][pBanned] =  1;
  9325.         new ip[28];
  9326.         GetPlayerIp(playerid, ip, sizeof(ip));
  9327.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  9328.         format(string, sizeof(string), "AdmCmd: %s (IP: %s) was banned, Reason: Weapon Hacks (%s)", GetName(playerid), ip, wepname);
  9329.         Log("/logs/ban.txt", string);
  9330.         AddBan(ip);
  9331.         Kick(playerid);
  9332.     }
  9333.     return 1;
  9334. }
  9335.  
  9336.  
  9337. forward GetWeekdayNum(d,m,y);
  9338. forward settime();
  9339. forward weatherchange();
  9340.  
  9341.  
  9342. public weatherchange(){
  9343.     SetWeather(random(18));
  9344. }
  9345.  
  9346. public settime(){
  9347.     new hour,minute,second;
  9348.     new string[256];
  9349.     gettime(hour,minute,second);
  9350.     if (minute <= 9){format(string,25,"%d:0%d",hour,minute);}
  9351.     else {format(string,25,"%d:%d",hour,minute);}
  9352.     TextDrawSetString(Clock,string);
  9353.     SetWorldTime(hour);
  9354.     new day, month, year;
  9355.     new weekday;
  9356.     getdate(day, month, year);
  9357.     weekday = GetWeekdayNum(day, month, year);
  9358.     if(weekday == 1){TextDrawSetString(WeekDayg,"Monday");}
  9359.     if(weekday == 2){TextDrawSetString(WeekDayg,"Tuesday");}
  9360.     if(weekday == 3){TextDrawSetString(WeekDayg,"Wednesday");}
  9361.     if(weekday == 4){TextDrawSetString(WeekDayg,"Thursday");}
  9362.     if(weekday == 5){TextDrawSetString(WeekDayg,"Friday");}
  9363.     if(weekday == 6){TextDrawSetString(WeekDayg,"Saturday");}
  9364.     if(weekday == 7){TextDrawSetString(WeekDayg,"Sunday");}
  9365.     return 1;
  9366. }
  9367.  
  9368. public GetWeekdayNum(d,m,y) //by d.wine
  9369. {
  9370.     m-=2;
  9371.     if(m<=0)
  9372.         {
  9373.         y--;
  9374.         m+=12;
  9375.         }
  9376.     new cen = y/100;
  9377.     y=getrem(y,100);
  9378.     new w = d + ((13*m-1)/5) + y + (y/4) + (cen/4) - 2*cen;
  9379.     w=getrem(w,7);
  9380.     if (w==0) w=7;
  9381.     return w-1;
  9382. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement