Advertisement
Guest User

TwD Freeroam [Basic Starter]

a guest
Jul 5th, 2013
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 59.32 KB | None | 0 0
  1. /*
  2.  
  3. TwD Freeroam
  4. Copyright © SoomroTayab
  5. This script is made by SoomroTayab (Goldilox) from scratch.
  6. Please obey the terms of use.
  7.  
  8.     TERMS OF USE:
  9.         ø You should not remove this entire comment, it doens't costs you anything.
  10.         ø You can relase this script and can also remove the command /credits as long as you keep this comment.
  11.         ø You can edit it anyway you want.
  12.         ø You shouldn't credit yourself of creating this script.
  13.         ø You can remove my name from entire script such as the prints as long as you keep this comment.
  14.  
  15. If you experience any bug or something, I can fix it for you. Just reply on the topic, PM me or even email me at me@soomrotayab.com.
  16. If you are releasing this script, you can also change the hostname if you like to.
  17.  
  18. I am working on another relase of this, by updating some stuff.
  19. Thanks for downloading.
  20.  
  21. */
  22. #include <a_samp>
  23. #include <dini>
  24. #include <zcmd>
  25. #include <dudb>
  26. #include <sscanf>
  27. #include <acuf>
  28. #include <streamer>
  29.  
  30.  
  31. enum pInfo
  32. {
  33.     VIP,
  34.     Mute,
  35.     TimePast,
  36.     Hours,
  37.     Minutes,
  38.     AdminLevel
  39. }
  40.  
  41. #define LOGIN       1
  42. #define REGISTER    2
  43. #define TUNE        3
  44. #define COLORCHAT   4
  45. #define COLORCAR    5
  46. #define PBALL       6
  47. #define PBINFO      7
  48. #define PB_PLAYERS  8
  49.  
  50.  
  51. #define MAX_COMP 40
  52.  
  53.  
  54. #define COLOR_WHITE     0xFFFFFFAA
  55. #define COLOR_GREY      0xCCCCCCFF
  56. #define COLOR_YELLOW    0xFFFF00AA
  57. #define COLOR_SYSTEM    0x58ACFAAA
  58. #define COLOR_LIGHTBLUE 0x33CCFFAA
  59. #define COLOR_GREEN     0x01DF01AA
  60. #define COLOR_RED       0xFF0000AA
  61. #define COLOR_TEAL      0xA9C4E4FF
  62. #define COLOR_ORANGE    0xFF8000AA
  63. #define COLOR_LIME      0x10F441AA
  64. #define COLOR_MAGENTA   0xFF00FFFF
  65. #define COLOR_MAROON    0x800000AA
  66. #define COLOR_BLUE      0x0000BBAA
  67. #define COLOR_AQUA      0xF0F8FFAA
  68.  
  69. forward SetupPlayerForClassSelection(playerid);
  70. forward SaveIn(filename[],text[]);
  71. forward LoadingArea(playerid);
  72.  
  73. new name[MAX_PLAYER_NAME];
  74. new OnlineTimer[MAX_PLAYERS];
  75. new IsLogged[MAX_PLAYERS];
  76. new PlayerInfo[MAX_PLAYERS][pInfo];
  77. new registered[MAX_PLAYERS];
  78. new God[MAX_PLAYERS] = 0;
  79. new paintball;
  80. new VGod[MAX_PLAYERS] = 0;
  81. //blackmarket gates
  82. new Gate1;
  83. new Gate2;
  84. new countVehicle[MAX_PLAYERS];
  85. new componentsid[MAX_PLAYERS][MAX_COMP];
  86. new PB[MAX_PLAYERS];
  87. new bool:flying[MAX_PLAYERS];
  88. new pblv;
  89. new Float:PBSpawn[][] =
  90. {
  91.     {2532.9934,2834.7104,10.8203,183.8086}, // Randomspawn
  92.     {2578.1511,2807.3320,10.8203,303.1663}, // Randomspawn
  93.     {2651.2966,2763.5530,10.8203,1.1102}, // Randomspawn
  94.     {2626.1477,2779.5415,23.8222,128.6146}, // Randomspawn
  95.     {2565.8464,2718.0959,22.9507,308.7598}, // Randomspawn
  96.     {2596.3523,2718.1089,25.8222,339.7568}
  97. };
  98.  
  99.  
  100. main()
  101. {
  102.     print("\n----------------------------------");
  103.     print(" TwD Freeroam Copyright © SoomroTayab\n Thanks for downlaoding!.\n Please obey the terms of use.");
  104.     print("----------------------------------\n");
  105. }
  106.  
  107. public OnGameModeInit()
  108. {
  109.     pblv     = CreateDynamicCP(2014.2784,1104.2804,10.8203,1.0,-1,-1,-1,15.0);
  110.     paintball = CreateDynamicPickup(1239,1,2015.5741,1106.1957,10.8203,-1);
  111.     SetGameModeText("Freeroam/Drifting");
  112.     //gate blackmarket
  113.     Gate1 = CreateObject(975, 2237.5, -2218.6001, 14.2, 0, 0, 314);
  114.     Gate2 = CreateObject(975, 2231.3999, -2212.5, 14.2, 0, 0, 315);
  115.     if(!fexist("Records.txt"))return dini_Create("Records.txt");
  116.     AddPlayerClass(1,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  117.     print("Skin ID 1");
  118.     AddPlayerClass(2,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  119.     print("Skin ID 2");
  120.     AddPlayerClass(3,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  121.     print("Skin ID 3");
  122.     AddPlayerClass(4,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  123.     print("Skin ID 4");
  124.     AddPlayerClass(5,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  125.     print("Skin ID 5");
  126.     AddPlayerClass(6,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  127.     print("Skin ID 6");
  128.     AddPlayerClass(7,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  129.     print("Skin ID 7");
  130.     AddPlayerClass(8,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  131.     print("Skin ID 8");
  132.     AddPlayerClass(9,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  133.     print("Skin ID 9");
  134.     AddPlayerClass(10,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  135.     print("Skin ID 10");
  136.     AddPlayerClass(11,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  137.     print("Skin ID 11");
  138.     AddPlayerClass(12,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  139.     print("Skin ID 12");
  140.     AddPlayerClass(13,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  141.     print("Skin ID 13");
  142.     AddPlayerClass(14,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  143.     print("Skin ID 14");
  144.     AddPlayerClass(15,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  145.     print("Skin ID 15");
  146.     AddPlayerClass(16,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  147.     print("Skin ID 16");
  148.     AddPlayerClass(17,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  149.     print("Skin ID 17");
  150.     AddPlayerClass(18,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  151.     print("Skin ID 18");
  152.     AddPlayerClass(19,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  153.     print("Skin ID 19");
  154.     AddPlayerClass(20,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  155.     print("Skin ID 20");
  156.     AddPlayerClass(21,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  157.     print("Skin ID 21");
  158.     AddPlayerClass(22,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  159.     print("Skin ID 22");
  160.     AddPlayerClass(23,1310.1309,-1370.0226,13.5700,180.4759,0,0,0,0,0,0); // spawning
  161.     print("________________");
  162.     print("Classes successfully loaded");
  163.     return 1;
  164. }
  165.  
  166. public OnGameModeExit()
  167. {
  168.     SStats(MAX_PLAYERS);
  169.     return 1;
  170. }
  171.  
  172. public OnPlayerRequestClass(playerid, classid)
  173. {
  174.     SetPlayerPos(playerid, 1256.7449,-1439.0409,18.8538);
  175.     SetPlayerFacingAngle(playerid,259.4132);
  176.     SetPlayerCameraPos(playerid, 1259.5579,-1439.0704,19.8866);
  177.     SetPlayerCameraLookAt(playerid, 1256.7449,-1439.0409,18.8538);
  178.     return 1;
  179. }
  180. public SetupPlayerForClassSelection(playerid)
  181. {
  182.     SetPlayerInterior(playerid,14);
  183.     SetPlayerFacingAngle(playerid, 270.0);
  184.     PlayerPlaySound(playerid, 1186, 0.0, 0.0, 5.0);
  185.     SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
  186.     SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
  187.     SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
  188. }
  189. public OnPlayerConnect(playerid)
  190. {
  191.     PB[playerid]=0;
  192.     if(dini_Exists(Pos(playerid)))
  193.     {
  194.         new str1[128];
  195.         format(str1, 500, "{FFFFFF}Welcome back to Fg!\n\nUsername: %s\nAccount Status: {ADFF2F}Registered\n{FFFFFF}Please punch in your password in order to play.",name);
  196.         ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Membership Area", str1, "Login", "");
  197.     }
  198.     if (!dini_Exists(Pos(playerid)))
  199.     {
  200.         new str1[128];
  201.         format(str1, 500, "{FFFFFF}Welcome to Fg!\n\nUsername: %s\nAccount Status: {FE9A2E}Unregistered\n{FFFFFF}Choose an account password for registration. \nYou have to remember your password for all of your play time.", name);
  202.         ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, "Registration", str1, "Register", "");
  203.     }
  204.     SendClientMessage(playerid,COLOR_WHITE, "You need to login in order to play.");
  205.     OnlineTimer[playerid] = SetTimerEx("OnlineTime", 60000, 1, "i", playerid);
  206.     return 1;
  207. }
  208.  
  209. public OnPlayerDisconnect(playerid, reason)
  210. {
  211.     if(IsLogged[playerid] == 1)
  212.     {
  213.         SStats(playerid);
  214.     }
  215.     new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
  216.     GetPlayerName(playerid, pname, sizeof(pname));
  217.     switch(reason)
  218.     {
  219.         case 0: format(string, sizeof(string), "~ %s has left the server. (Timeout)", pname);
  220.         case 1: format(string, sizeof(string), "*%s has left the server.", pname);
  221.         case 2: return 0;
  222.     }
  223.     SendClientMessageToAll(COLOR_GREY,string);
  224.     KillTimer(OnlineTimer[playerid]);
  225.     return 1;
  226. }
  227.  
  228. public OnPlayerSpawn(playerid)
  229. {
  230.     if(PB[playerid] == 1)
  231.     {
  232.         new Random = random(sizeof(PBSpawn));
  233.         SetPlayerInterior(playerid,0);
  234.         GivePlayerWeapon(playerid, 29, 2500);
  235.         SetPlayerPos(playerid, PBSpawn[Random][0], PBSpawn[Random][1], PBSpawn[Random][2]);
  236.         return 1;
  237.     }
  238.     if(registered[playerid] == 1)
  239.     {
  240.         registered[playerid]=0;
  241.         ResetPlayerWeapons(playerid);
  242.         SetPlayerInterior(playerid,0);
  243.         GivePlayerMoney(playerid, 25000);
  244.         SetPlayerVirtualWorld(playerid,0);
  245.         dini_IntSet(Pos(playerid), "Skin",GetPlayerSkin(playerid));
  246.     }
  247.     SetPlayerVirtualWorld(playerid, 0);
  248.     return 1;
  249. }
  250.  
  251. public OnPlayerDeath(playerid, killerid, reason)
  252. {
  253.     if(PB[playerid]==1)
  254.         {
  255.             new str[128],nam[24];
  256.             GetPlayerName(playerid, nam, 24);
  257.             GetPlayerName(killerid, name, 24);
  258.             format(str,sizeof(str),"%s has hunted %s down",name,nam);
  259.             GivePlayerMoney(playerid,250);
  260.             GameTextForPlayer(playerid,"~g~+$250", 3000, 1);
  261.             for(new i=0; i<MAX_PLAYERS; i++)
  262.             {
  263.                 if(PB[playerid] == 1)
  264.                 {
  265.                     SendClientMessage(i,COLOR_ORANGE,str);
  266.                 }
  267.             }
  268.             return 1;
  269.         }
  270.     return 1;
  271. }
  272.  
  273. public OnVehicleSpawn(vehicleid)
  274. {
  275.     return 1;
  276. }
  277.  
  278. public OnVehicleDeath(vehicleid, killerid)
  279. {
  280.     return 1;
  281. }
  282.  
  283. public OnPlayerText(playerid, text[])
  284. {
  285.     return 1;
  286. }
  287.  
  288. public OnPlayerCommandText(playerid, cmdtext[])
  289. {
  290.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  291.     {
  292.         // Do something here
  293.         return 1;
  294.     }
  295.     return 0;
  296. }
  297.  
  298. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  299. {
  300.     return 1;
  301. }
  302.  
  303. public OnPlayerExitVehicle(playerid, vehicleid)
  304. {
  305.     return 1;
  306. }
  307.  
  308. public OnPlayerStateChange(playerid, newstate, oldstate)
  309. {
  310.     return 1;
  311. }
  312.  
  313. public OnPlayerEnterCheckpoint(playerid)
  314. {
  315.     return 1;
  316. }
  317.  
  318. public OnPlayerLeaveCheckpoint(playerid)
  319. {
  320.     return 1;
  321. }
  322.  
  323. public OnPlayerEnterRaceCheckpoint(playerid)
  324. {
  325.     return 1;
  326. }
  327.  
  328. public OnPlayerLeaveRaceCheckpoint(playerid)
  329. {
  330.     return 1;
  331. }
  332.  
  333. public OnRconCommand(cmd[])
  334. {
  335.     return 1;
  336. }
  337.  
  338. public OnPlayerRequestSpawn(playerid)
  339. {
  340.     return 1;
  341. }
  342.  
  343. public OnObjectMoved(objectid)
  344. {
  345.     return 1;
  346. }
  347.  
  348. public OnPlayerObjectMoved(playerid, objectid)
  349. {
  350.     return 1;
  351. }
  352.  
  353. public OnPlayerPickUpPickup(playerid, pickupid)
  354. {
  355.     return 1;
  356. }
  357.  
  358. public OnVehicleMod(playerid, vehicleid, componentid)
  359. {
  360.     return 1;
  361. }
  362.  
  363. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  364. {
  365.     return 1;
  366. }
  367.  
  368. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  369. {
  370.     return 1;
  371. }
  372.  
  373. public OnPlayerSelectedMenuRow(playerid, row)
  374. {
  375.     return 1;
  376. }
  377.  
  378. public OnPlayerExitedMenu(playerid)
  379. {
  380.     return 1;
  381. }
  382.  
  383. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  384. {
  385.     return 1;
  386. }
  387.  
  388. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  389. {
  390.     return 1;
  391. }
  392.  
  393. public OnRconLoginAttempt(ip[], password[], success)
  394. {
  395.     return 1;
  396. }
  397.  
  398. public OnPlayerUpdate(playerid)
  399. {
  400.     return 1;
  401. }
  402.  
  403. public OnPlayerStreamIn(playerid, forplayerid)
  404. {
  405.     return 1;
  406. }
  407.  
  408. public OnPlayerStreamOut(playerid, forplayerid)
  409. {
  410.     return 1;
  411. }
  412.  
  413. public OnVehicleStreamIn(vehicleid, forplayerid)
  414. {
  415.     return 1;
  416. }
  417.  
  418. public OnVehicleStreamOut(vehicleid, forplayerid)
  419. {
  420.     return 1;
  421. }
  422.  
  423. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  424. {
  425.     if(dialogid == PBALL)
  426.     {
  427.         if(!response) return 1;
  428.         switch (listitem)
  429.         {
  430.             case 0:
  431.             {
  432.                 new string[128];
  433.                 new Random = random(sizeof(PBSpawn));
  434.                 if(GetPlayerWantedLevel(playerid) >= 1)return SendClientMessage(playerid,COLOR_GREY,"You're a suspect!");
  435.                 SetPlayerPos(playerid, PBSpawn[Random][0], PBSpawn[Random][1], PBSpawn[Random][2]);
  436.                 SetPlayerFacingAngle(playerid, PBSpawn[Random][3]);
  437.                 SendClientMessage(playerid,COLOR_YELLOW,"Type /paintball again in order to stop paintballing.");
  438.                 GivePlayerWeapon(playerid, 29, 2500);
  439.                 GetPlayerName(playerid,name,sizeof(name));
  440.                 format(string,sizeof(string),"%s has joined paintball.",name);
  441.                 PB[playerid]=1;
  442.                 for(new i = 0; i < MAX_PLAYERS; i++)
  443.                 {
  444.                     if(PB[i] == 1)
  445.                     {
  446.                         SendClientMessage(i,0x04B4AEAA,string);
  447.                         return 1;
  448.                     }
  449.                 }
  450.             }
  451.             case 1:
  452.             {
  453.                 SendClientMessage(playerid,COLOR_WHITE,"Welcome to Las Ventures Paintball! This game is developed for the entertainment");
  454.                 SendClientMessage(playerid,COLOR_WHITE,"of the players around the server. You got one M4 Gun inside and it's taken away as");
  455.                 SendClientMessage(playerid,COLOR_WHITE,"soon as you exit the paintball The area completely closed and doesn't have any way");
  456.                 SendClientMessage(playerid,COLOR_WHITE,"out during the game, that is to prevent the DM \nYou spawn in the paintball field");
  457.                 SendClientMessage(playerid,COLOR_WHITE,"randomly to prevent spawn kill Paintball don't restrict you from deathmatch but we");
  458.                 SendClientMessage(playerid,COLOR_WHITE,"appreciate you don't become violent on events occur in the paintball");
  459.                 SendClientMessage(playerid,COLOR_WHITE,"Have a nice time!");
  460.                 return 1;
  461.             }
  462.             case 3:
  463.             {
  464.                 new count = 0;
  465.                 new string[128];
  466.                 new name1[MAX_PLAYER_NAME];
  467.                 for(new i = 0; i < MAX_PLAYERS; i++)
  468.                 {
  469.                     if(PB[i] == 1)
  470.                     {
  471.                         GetPlayerName(i,name1,MAX_PLAYER_NAME);
  472.                     }
  473.                 }
  474.                 format(string,sizeof(string), "%s", name1);
  475.                 ShowPlayerDialog(playerid,PB_PLAYERS,DIALOG_STYLE_MSGBOX,"Current Players",string,"Close","");
  476.                 count++;
  477.  
  478.             }
  479.         }
  480.     }
  481.  
  482.     if(dialogid == COLORCHAT)
  483.     {
  484.         if(!response) return 1;
  485.         switch(listitem)
  486.         {
  487.             case 0:
  488.             {
  489.                 SetPlayerColor(playerid,COLOR_BLUE);
  490.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to blue.");
  491.                 return 1;
  492.             }
  493.             case 1:
  494.             {
  495.                 SetPlayerColor(playerid,0xF5A9A9FF);
  496.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to pink.");
  497.                 return 1;
  498.             }
  499.             case 2:
  500.             {
  501.                 SetPlayerColor(playerid,COLOR_RED);
  502.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to red.");
  503.                 return 1;
  504.             }
  505.             case 3:
  506.             {
  507.                 SetPlayerColor(playerid,COLOR_YELLOW);
  508.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to yellow.");
  509.                 return 1;
  510.             }
  511.             case 4:
  512.             {
  513.                 SetPlayerColor(playerid,COLOR_ORANGE);
  514.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to orange.");
  515.                 return 1;
  516.             }
  517.             case 5:
  518.             {
  519.                 SetPlayerColor(playerid,COLOR_AQUA);
  520.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to aqua.");
  521.                 return 1;
  522.             }
  523.             case 6:
  524.             {
  525.                 SetPlayerColor(playerid,COLOR_LIME);
  526.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to lime.");
  527.                 return 1;
  528.             }
  529.             case 7:
  530.             {
  531.                 SetPlayerColor(playerid,COLOR_MAROON);
  532.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to maroon.");
  533.                 return 1;
  534.             }
  535.             case 8:
  536.             {
  537.                 SetPlayerColor(playerid,COLOR_MAGENTA);
  538.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to magenta.");
  539.                 return 1;
  540.             }
  541.             case 9:
  542.             {
  543.                 SetPlayerColor(playerid,COLOR_TEAL);
  544.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to teal.");
  545.                 return 1;
  546.             }
  547.             case 10:
  548.             {
  549.                 SetPlayerColor(playerid,COLOR_WHITE);
  550.                 SendClientMessage(playerid,COLOR_WHITE,"You've set your color to white.");
  551.                 return 1;
  552.             }
  553.         }
  554.     }
  555.  
  556.     if(dialogid == COLORCAR)
  557.     {
  558.         if(!response) return 1;
  559.         switch(listitem)
  560.         {
  561.             case 0:
  562.             {
  563.                 new veh;
  564.                 veh = GetPlayerVehicleID(playerid);
  565.                 ChangeVehicleColor(veh,0,0);
  566.                 SendClientMessage(playerid,COLOR_WHITE,"You've set the car's color to black.");
  567.                 return 1;
  568.             }
  569.             case 1:
  570.             {
  571.                 new veh;
  572.                 veh = GetPlayerVehicleID(playerid);
  573.                 ChangeVehicleColor(veh,1,1);
  574.                 SendClientMessage(playerid,COLOR_WHITE,"You've set the car's color to white.");
  575.                 return 1;
  576.             }
  577.         }
  578.     }
  579.     if(dialogid == TUNE)
  580.      if(response)
  581.      {
  582.         for(new i=0;i<=countVehicle[playerid];i++)
  583.         {
  584.             if(listitem == i)
  585.             {
  586.                 if(IsVehicleUpgradeCompatible(GetVehicleModel(GetPlayerVehicleID(playerid)),componentsid[playerid][i]))
  587.                 {
  588.                     AddVehicleComponent(GetPlayerVehicleID(playerid), componentsid[playerid][i]);
  589.                     new string[128];
  590.                     format(string, sizeof(string),"New component %s added!", GetComponentName(componentsid[playerid][i]));
  591.                     SendClientMessage(playerid,COLOR_WHITE,string);
  592.                     return cmd_tune(playerid, " ");
  593.                 }
  594.                 else SendClientMessage(playerid,COLOR_GREY, "This component is not compitable with your vehicle model.");
  595.             }
  596.         }
  597.     }
  598.  
  599.     if (dialogid == REGISTER)
  600.     {
  601.         new string[128], str[128], str1[128];
  602.         GetPlayerName(playerid, name, sizeof(name));
  603.         if(!response) return Kick(playerid);
  604.         format(str1, 128, "{FFFFFF}Welcome to Fg Clan\n\n{DDCA22}Account:{FFFFFF} %s\n\nPlease Enter Your Password Below", name);if(!strlen(inputtext)) return
  605.         ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "Registration", str1, "Register", "");
  606.         dini_Create(Pos(playerid));
  607.         IsLogged[playerid] = 1;
  608.         registered[playerid] = 1;
  609.         PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  610.         dini_IntSet(Pos(playerid), "Password", udb_hash(inputtext));
  611.         dini_IntSet(Pos(playerid), "Banned", 0);
  612.         dini_IntSet(Pos(playerid), "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0);
  613.         format(string, 128, "Your registration was successfull! Username: %s || Password: %s.", name, inputtext);
  614.         format(str, 128, "Looks like you are new here.");
  615.         SendClientMessage(playerid, COLOR_YELLOW, string);
  616.         SendClientMessage(playerid,COLOR_WHITE, str);
  617.         SendClientMessage(playerid,COLOR_WHITE, "This is a Freeroam/Role-Play server.");
  618.         SendClientMessage(playerid,COLOR_WHITE, "You can do whatever you want in the server as");
  619.         SendClientMessage(playerid, COLOR_WHITE, "long as you are within the server rules.");
  620.         SendClientMessage(playerid, COLOR_WHITE, "For the server rules, type /rules.");
  621.         return 1;
  622.     }
  623.  
  624.     if (dialogid == LOGIN)
  625.     {
  626.       new str1[128], tmp=dini_Int(Pos(playerid), "Password");
  627.       if(!response) return Kick(playerid);
  628.       GetPlayerName(playerid, name, sizeof(name));
  629.       format(str1, 128, "{FFFFFF}Welcome to Fg Clan\n\n{DDCA22}Account:{FFFFFF} %s\n\nPlease Enter Your Password Below", name);
  630.       if (!strlen(inputtext)) return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Login Account",str1, "Login", "");
  631.       if(udb_hash(inputtext) == tmp)
  632.       {
  633.         LoadStats(playerid);
  634.         IsLogged[playerid] = 1;
  635.         PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  636.         GetPlayerName(playerid, name, sizeof(name));
  637.         format(str1, 128, "Welcome back %s! your statistics have been successfully restored.", name);
  638.         SendClientMessage(playerid,COLOR_WHITE,str1);
  639.         SetSpawnInfo(playerid,0,dini_Int(Pos(playerid),"Skin"),dini_Int(Pos(playerid), "X1"),dini_Int(Pos(playerid), "Y1"), dini_Int(Pos(playerid), "Z1"),0, 0, 0, 0, 0, 0, 0 );
  640.         SpawnPlayer(playerid);
  641.         PlayerConnect(playerid);
  642.         if(PlayerInfo[playerid][VIP]== 1 || PlayerInfo[playerid][VIP]== 2)
  643.         {
  644.             SendClientMessage(playerid,0x086A87AA,"VIP Stauts: {FFFFFF}Active");
  645.         }
  646.         if(PlayerInfo[playerid][VIP]==3)
  647.         {
  648.             SendClientMessage(playerid,0x086A87AA,"VIP Status: {FFFFFF}Active - Lifetime");
  649.         }
  650.       }
  651.       else
  652.       {
  653.             SendClientMessage(playerid,-1, "Login failed.");
  654.             ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Membership Area", "{FFFFFF}Your entered password was incorrect\n\nPlease try again.", "Login", "");
  655.       }
  656.       return 1;
  657.     }
  658.     return 1;
  659. }
  660. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  661. {
  662.     if(PlayerInfo[playerid][AdminLevel] >= 4)
  663.     {
  664.  
  665.     SetPlayerPosFindZ(playerid, fX, fY, fZ);
  666.     return 1;
  667.     }
  668.     return 1;
  669. }
  670. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  671. {
  672.     return 1;
  673. }
  674. stock Pos(playerid)
  675. {
  676. new x[128]; format(x, sizeof(x), "Accounts/%s.ini",GetPlayerName(playerid,name,sizeof(name)));
  677. return x;
  678. }
  679. SStats(playerid)
  680. {
  681.   new Float:x,Float:y,Float:z,Float:armour;
  682.   GetPlayerPos(playerid, x, y, z);
  683.   GetPlayerArmour(playerid, armour);
  684.   dini_IntSet(Pos(playerid),"Armor", floatround(armour));
  685.   dini_IntSet(Pos(playerid),"VIP",PlayerInfo[playerid][VIP]);
  686.   dini_IntSet(Pos(playerid),"Money",GetPlayerMoney(playerid));
  687.   dini_IntSet(Pos(playerid),"Score",GetPlayerScore(playerid));
  688.   dini_IntSet(Pos(playerid),"TimePast",PlayerInfo[playerid][TimePast]);
  689.   dini_IntSet(Pos(playerid),"Interior", GetPlayerInterior(playerid));
  690.   dini_IntSet(Pos(playerid),"HoursPlayed",PlayerInfo[playerid][Hours]);
  691.   dini_IntSet(Pos(playerid),"MinutesPlayed",PlayerInfo[playerid][Minutes]);
  692.   dini_IntSet(Pos(playerid),"AdminLevel",PlayerInfo[playerid][AdminLevel]);
  693.   return 1;
  694. }
  695. LoadStats(playerid)
  696. {
  697.   SetPlayerArmour(playerid,dini_Int(Pos(playerid),"Armor"));
  698.   SetPlayerScore(playerid, dini_Int(Pos(playerid),"Score"));
  699.   PlayerInfo[playerid][VIP] = dini_Int(Pos(playerid),"VIP");
  700.   PlayerInfo[playerid][TimePast]      = dini_Int(Pos(playerid),"TimePast");
  701.   PlayerInfo[playerid][Hours]=dini_Int(Pos(playerid),"HoursPlayed");
  702.   PlayerInfo[playerid][AdminLevel] = dini_Int(Pos(playerid),"AdminLevel");
  703.   PlayerInfo[playerid][Minutes] = dini_Int(Pos(playerid),"MinutesPlayed");
  704. }
  705. stock PlayerConnect(playerid)
  706. {
  707.     new tmp3[50],PlayerName[MAX_PLAYER_NAME],string[128];
  708.     GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
  709.     GetPlayerIp(playerid,tmp3,50);
  710.     if(strlen(dini_Get("Records.txt", tmp3)) == 0)
  711.     dini_Set("Records.txt", tmp3, PlayerName);
  712.     else
  713.     {
  714.         if( strfind( dini_Get("Records.txt", tmp3), PlayerName, true) == -1 )
  715.         {
  716.         format(string,sizeof(string),"%s,%s", dini_Get("Records.txt",tmp3), PlayerName);
  717.         dini_Set("Records.txt", tmp3, string);
  718.         }
  719.     }
  720.     return 1;
  721. }
  722. CMD:report(playerid, params[])
  723. {
  724.     new str[50];
  725.     if(sscanf(params, "s[50]", str)== 0) return SendClientMessage(playerid, COLOR_WHITE, "/report [text]");
  726.     SendClientMessage(playerid, COLOR_YELLOW, "Your report has been sent to any online admins.");
  727.     for(new i=0; i<MAX_PLAYERS; i++)
  728.     {
  729.         if(PlayerInfo[i][AdminLevel]>= 1 || IsPlayerAdmin(i))
  730.         {
  731.             format(str, sizeof(str), "%s has reported, \"%s\"", GetPName(playerid), params);
  732.             SendClientMessage(i, COLOR_SYSTEM, str);
  733.         }
  734.     }
  735.     return 1;
  736. }
  737. CMD:godmode(playerid, params[])
  738.     {
  739.         if (God[playerid] == 1)
  740.         {
  741.             SendClientMessage(playerid, COLOR_RED, "You have disabled god mode.");
  742.             SetPlayerHealth(playerid, 100);
  743.             SetPlayerArmour(playerid, 100);
  744.             God[playerid] = 0;
  745.             return 1;
  746.         }
  747.         else if(God[playerid] == 0)
  748.         {
  749.             SendClientMessage(playerid, COLOR_GREEN, "You have enabled god mode.");
  750.             God[playerid] = 1;
  751.             SetPlayerArmour(playerid, 9999999);
  752.             SetPlayerHealth(playerid, 9999999);
  753.             return 1;
  754.         }
  755.         return 1;
  756. }
  757. CMD:vgod(playerid, params[])
  758. {
  759.         if(VGod[playerid] == 1)
  760.             {
  761.         VGod[playerid] = 0;
  762.         SendClientMessage(playerid,COLOR_RED,"Vehicle god disabled.");
  763.         return 1;
  764.         }
  765.         else if(VGod[playerid] == 0)
  766.         {
  767.         VGod[playerid] = 1;
  768.         SendClientMessage(playerid,COLOR_GREEN,"Vehicle god enabled.");
  769.         return 1;
  770.         }
  771.         return 1;
  772. }
  773. CMD:compound(playerid, params[])
  774. {
  775.     SetPlayerPos(playerid,2178.9536,-2255.7134,14.7734);
  776.     return 1;
  777. }
  778. CMD:acmds(playerid, params[])
  779. {
  780.     if(PlayerInfo[playerid][AdminLevel] >=1)
  781.     {
  782.         SendClientMessage(playerid, COLOR_WHITE, "/repair  /freeze  /unfreeze");
  783.     }
  784.     if(PlayerInfo[playerid][AdminLevel] >=2)
  785.     {
  786.         SendClientMessage(playerid, COLOR_WHITE, "/mute /unmute /goto /gethere /vrespawn /veh /kick");
  787.     }
  788.     if(PlayerInfo[playerid][AdminLevel] >=3)
  789.     {
  790.         SendClientMessage(playerid, COLOR_WHITE, "/ban /apm /disarm /akill");
  791.     }
  792.     if(PlayerInfo[playerid][AdminLevel] >=4)
  793.     {
  794.         SendClientMessage(playerid, COLOR_WHITE, "/sethp /restart /setscore /setarmour /givewep /setallskin /setskin");
  795.     }
  796.     if(PlayerInfo[playerid][AdminLevel] >=5)
  797.     {
  798.         SendClientMessage(playerid, COLOR_WHITE, "/setlevel /fly");
  799.     }
  800.     else
  801.     {
  802.     SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command.");
  803.     }
  804.     return 1;
  805. }
  806. CMD:setskin(playerid,params[])
  807. {
  808.         if(PlayerInfo[playerid][AdminLevel] < 3) return 0;
  809.         new SetterName[MAX_PLAYER_NAME],skin, SettedName[MAX_PLAYER_NAME], string[128], string2[128],pID;
  810.         if(sscanf(params, "ud",pID,skin)) return SendClientMessage(playerid,COLOR_GREY,"/setskin [playerid] [skin id]");
  811.         if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,COLOR_GREY,"Player is not connected.");
  812.         if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_GREY,"Invalid ID");
  813.         GetPlayerName(playerid, SetterName, sizeof(SetterName));
  814.         GetPlayerName(pID, SettedName, sizeof(SettedName));
  815.         format(string, sizeof(string), "You've set %s's skin to ID %d", SettedName, skin);
  816.         format(string2, sizeof(string2), "An administrator has changed your skin.", skin);
  817.         SendClientMessage(playerid, COLOR_WHITE, string);
  818.         SendClientMessage(pID, COLOR_SYSTEM, string2);
  819.         SetPlayerSkin(pID, skin);
  820.         return 1;
  821. }
  822. CMD:setallskin(playerid,params[])
  823. {
  824.         if(PlayerInfo[playerid][AdminLevel] < 3) return 0;
  825.         new skin, string[128];
  826.         if(sscanf(params, "d",skin)) return SendClientMessage(playerid,COLOR_GREY,"/skinall [skin id]");
  827.         if(skin < 0 || skin > 299) return SendClientMessage(playerid,COLOR_GREY,"Invalid skin ID");
  828.         format(string, sizeof(string), "You've set everyone's skin to ID %d", skin);
  829.         SendClientMessage(playerid, COLOR_WHITE, string);
  830.         for(new i = 0; i <MAX_PLAYERS; i++)
  831.         {
  832.             new string1[128];
  833.             SetPlayerSkin(i, skin);
  834.             format(string1,sizeof(string1),"An administrator has set everyone's skin ID to %d",skin);
  835.             SendClientMessage(i,COLOR_SYSTEM,string1);
  836.         }
  837.         return 1;
  838.  
  839. }
  840. CMD:givewep(playerid,params[])
  841.     {
  842.         if(PlayerInfo[playerid][AdminLevel] < 3) return 0;
  843.         new pID,wepid,ammo,string[128],nameadmin[MAX_PLAYER_NAME];
  844.         if(sscanf(params,"udd",pID,wepid,ammo)) return SendClientMessage(playerid,COLOR_GREY,"/givewep [playerid] [wepid] [ammo]");
  845.         if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,COLOR_GREY,"Player is not connected.");
  846.         if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_GREY,"Invalid player ID");
  847.         if(wepid < 0 || wepid > 46) return SendClientMessage(playerid,COLOR_GREY," Invalid weapon ID");
  848.         GetPlayerName(pID,name,sizeof(name));
  849.         GetPlayerName(playerid,nameadmin,sizeof(nameadmin));
  850.         format(string,sizeof(string),"An administrator has given you a weapon of ID %d",wepid);
  851.         SendClientMessage(pID,COLOR_WHITE,string);
  852.         GivePlayerWeapon(pID,wepid,ammo);
  853.         for(new i=0; i < MAX_PLAYERS; i++)
  854.         {
  855.             if(PlayerInfo[i][AdminLevel] > 1)
  856.             {
  857.                 format(string,sizeof(string),"%s has give %s a weapon of ID %d with ammo of %d",nameadmin,name,wepid,ammo);
  858.                 SendClientMessage(i,COLOR_WHITE,string);
  859.             }
  860.         }
  861.         return 1;
  862.  
  863. }
  864. CMD:setarmour(playerid,params[])
  865.     {
  866.         if(PlayerInfo[playerid][AdminLevel] < 3) return 0;
  867.         new Float:Armour, SetterName[MAX_PLAYER_NAME], SettedName[MAX_PLAYER_NAME], string[128], string2[128],pID;
  868.         if(sscanf(params, "uf",pID,Armour)) return SendClientMessage(playerid,COLOR_GREY,"/setarmour [playerid] [ammount]");
  869.         GetPlayerName(playerid, SetterName, sizeof(SetterName));
  870.         GetPlayerName(pID, SettedName, sizeof(SettedName));
  871.         format(string, sizeof(string), "You have set %s's armour to %f", SettedName, Armour);
  872.         format(string2, sizeof(string2), "An administrator has set your armour to %f", Armour);
  873.         SendClientMessage(playerid, COLOR_WHITE, string);
  874.         SendClientMessage(pID, COLOR_SYSTEM, string2);
  875.         SetPlayerArmour(pID, Armour);
  876.         return 1;
  877. }
  878. CMD:setscore(playerid,params[])
  879.     {
  880.         if(PlayerInfo[playerid][AdminLevel] < 3) return 0;
  881.         new SetterName[MAX_PLAYER_NAME], SettedName[MAX_PLAYER_NAME], string[128], string2[128], score,pID;
  882.         if(sscanf(params, "ud",pID,score)) return SendClientMessage(playerid,COLOR_GREY,"/setscore [playerid] [score]");
  883.         GetPlayerName(playerid, SetterName, sizeof(SetterName));
  884.         GetPlayerName(pID, SettedName, sizeof(SettedName));
  885.         format(string, sizeof(string), "You have set %s's score to %d", SettedName, score);
  886.         format(string2, sizeof(string2), "Your score was set to %d by an Admin.", score);
  887.         SendClientMessage(playerid, COLOR_SYSTEM, string);
  888.         SendClientMessage(pID, COLOR_SYSTEM, string2);
  889.         SetPlayerScore(pID, score);
  890.         return 1;
  891. }
  892.     //LEVEL 1
  893. CMD:fly(playerid,params[])
  894.     {
  895.         new Float:x, Float:y, Float:z;
  896.         if(PlayerInfo[playerid][AdminLevel] > 4)
  897.         {
  898.         if((flying[playerid] = !flying[playerid]))
  899.         {
  900.             GetPlayerPos(playerid, x, y, z);
  901.             SetPlayerPos(playerid, x, y, z+5);
  902.             SetPlayerArmour(playerid, 1000000000.0);
  903.             SetPlayerHealth(playerid, 1000000000.0);
  904.             SetTimerEx("AdminFly", 100, 0, "d", playerid);
  905.         }
  906.         else
  907.         {
  908.             GetPlayerPos(playerid, x, y, z);
  909.             SetPlayerPos(playerid, x, y, z+0.5);
  910.             ClearAnimations(playerid);
  911.             SetPlayerArmour(playerid, 100.0);
  912.             SetPlayerHealth(playerid, 100.0);
  913.             return 1;
  914.         }
  915.         }
  916.         else return 0;
  917.         return 1;
  918. }
  919. CMD:vrespawn(playerid, params[])
  920. {
  921.     if(PlayerInfo[playerid][AdminLevel] >=2)
  922.      {
  923.         new bool:unwanted[MAX_VEHICLES];
  924.         for(new player=0; player<MAX_PLAYERS; player++)
  925.         {
  926.             if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
  927.         }
  928.         for(new i = 1; i <MAX_VEHICLES; i++)
  929.         {
  930.             if(!unwanted[i]) SetVehicleToRespawn(i);
  931.         }
  932.         SendClientMessage(playerid, COLOR_TEAL, "All currently unused vehicles have been respawned.");
  933.     }
  934.     else return 0;
  935.     return 1;
  936. }
  937. CMD:goto(playerid, params[])
  938. {
  939.      if(PlayerInfo[playerid][AdminLevel] >=2)
  940.      {
  941.      new ID;
  942.      new pn[MAX_PLAYER_NAME];
  943.      new an[MAX_PLAYER_NAME];
  944.      new str[128];
  945.      if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /goto [ID]"); //This is a long line, "sscanf" is the plugin that search the missing params, "params" is the param that define params LOL, "u" is the PARAM that define the MISSING ID, ID is the param for the targetid
  946.      if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: This player is not connected");//Same as !IsPlayerAdmin, but instead of "playerid" we put "ID" because it's the targetid
  947.      GetPlayerName(playerid, an, MAX_PLAYER_NAME);//Define the playerid's param
  948.      GetPlayerName(ID, pn, MAX_PLAYER_NAME);//Define the ID's param
  949.      new Float:x; //Defining float X
  950.      new Float:y; //Same
  951.      new Float:z; //Same
  952.      GetPlayerPos(ID, x, y, z); //This line get the "ID" position
  953.      SetPlayerPos(playerid, x+1, y+1, z); //This line set the "playerid" position from "ID" position, with some changes(x+1, y+1);
  954.      format(str, sizeof(str), "You have been teleported to %s", pn); //Showed before, this is the line that give the message to playerid)
  955.      SendClientMessage(playerid, 0x00FF00AA, str); //This line give the message to playerid
  956.      if(IsPlayerInAnyVehicle(playerid)) //Mhh, let's give you a question, what should this callback do?
  957.      {
  958.           GetPlayerPos(ID, x, y, z);
  959.           SetVehiclePos(playerid, x+1, y+1, z); //And this one? :D
  960.      }
  961.      else return 0;
  962.   }
  963.      return 1;
  964. }
  965. CMD:gethere(playerid, params[])
  966. {
  967.     if(PlayerInfo[playerid][AdminLevel] >=2) {
  968.         new Float:x, Float:y, Float:z, Float:a, giveplayerid;
  969.         if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");
  970.         if(!IsPlayerConnected(giveplayerid)) return 1;
  971.         GetPlayerPos(playerid, x, y, z);
  972.         GetPlayerFacingAngle(playerid, a);
  973.         SetPlayerPos(giveplayerid, x-1, y-1, z);
  974.         SetPlayerFacingAngle(giveplayerid, a);
  975.     }
  976.     return 1;
  977. }
  978. CMD:apm(playerid, params[])
  979. {
  980.     if(PlayerInfo[playerid][AdminLevel] >=3) {
  981.         new str1[128],str[128], giveplayerid;
  982.         if(sscanf(params, "us[50]", giveplayerid, str)== 0) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /apm [playerid] [text]");
  983.         if(!IsPlayerConnected(giveplayerid)) return 1;
  984.         format(str1, sizeof(str1), "PM from Administration: %s", params[2]);
  985.         format(str, sizeof(str), "(ADMININFO) {FFFF00}Your admin PM was sent to %i", strval(params));
  986.         SendClientMessage(giveplayerid, COLOR_SYSTEM, str1);
  987.         SendClientMessage(playerid, COLOR_WHITE, str);
  988.     }
  989.     return 1;
  990. }
  991. CMD:repair(playerid, params[])
  992. {
  993.     if(PlayerInfo[playerid][AdminLevel] >=1) {
  994.         if(IsPlayerInAnyVehicle(playerid)) {
  995.             SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
  996.             RepairVehicle(GetPlayerVehicleID(playerid));
  997.             SendClientMessage(playerid, COLOR_YELLOW, "You have repaired your vehicle.");
  998.         }
  999.     }
  1000.     return 1;
  1001. }
  1002. CMD:freeze(playerid, params[])
  1003. {
  1004.     new giveplayerid, str[128];
  1005.     if(PlayerInfo[playerid][AdminLevel] >=1) {
  1006.         if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /freeze [playerid]");
  1007.         if(!IsPlayerConnected(giveplayerid)) return 1;
  1008.         format(str, 128, "You have frozen %s.", GetPName(giveplayerid));
  1009.         SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
  1010.         SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "You have been frozen by an administrator.");
  1011.         TogglePlayerControllable(giveplayerid, 0);
  1012.     }
  1013.     return 1;
  1014. }
  1015. CMD:unfreeze(playerid, params[])
  1016. {
  1017.     new giveplayerid, str[128];
  1018.     if(PlayerInfo[playerid][AdminLevel] >=1) {
  1019.         if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unfreeze [playerid]");
  1020.         if(!IsPlayerConnected(giveplayerid)) return 1;
  1021.         format(str, 128, "You have unfrozen %s.", GetPName(giveplayerid));
  1022.         SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
  1023.         SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "You have been unfrozen by an administrator.");
  1024.         TogglePlayerControllable(giveplayerid, 1);
  1025.     }
  1026.     return 1;
  1027. }
  1028. CMD:mute(playerid, params[])
  1029. {
  1030.     new giveplayerid, str[128];
  1031.     if(PlayerInfo[playerid][AdminLevel] >=2) {
  1032.         if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /mute [playerid]");
  1033.         if(!IsPlayerConnected(giveplayerid)) return 1;
  1034.         if(PlayerInfo[giveplayerid][Mute] == 0) {
  1035.             PlayerInfo[giveplayerid][Mute] = 1;
  1036.             format(str, 128, "You have muted %s.", GetPName(giveplayerid));
  1037.             SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
  1038.             SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "You have been muted by an administrator.");
  1039.         }else {
  1040.             SendClientMessage(playerid, COLOR_RED, "Player is already muted!");
  1041.         }
  1042.     }
  1043.     return 1;
  1044. }
  1045. CMD:unmute(playerid, params[])
  1046. {
  1047.     new giveplayerid, str[128];
  1048.     if(PlayerInfo[playerid][AdminLevel] >=2) {
  1049.         if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unmute [playerid]");
  1050.         if(!IsPlayerConnected(giveplayerid)) return 1;
  1051.         if(PlayerInfo[giveplayerid][Mute] == 1) {
  1052.             PlayerInfo[giveplayerid][Mute] = 0;
  1053.             format(str, 128, "You have unmuted %s.", GetPName(giveplayerid));
  1054.             SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
  1055.             SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "You have been unmuted by an administrator.");
  1056.         }else {
  1057.             SendClientMessage(playerid, COLOR_RED, "Player is not muted!");
  1058.         }
  1059.     }
  1060.     return 1;
  1061. }
  1062. CMD:a(playerid, params[])
  1063. {
  1064.     new str[50];
  1065.     if(PlayerInfo[playerid][AdminLevel] >=1) {
  1066.         if(sscanf(params, "s[50]", str)== 0) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /a [announcement]");
  1067.         SendClientMessageToAll(COLOR_RED, params);
  1068.     }
  1069.     return 1;
  1070. }
  1071.  
  1072. CMD:disarm(playerid, params[])
  1073. {
  1074.     new giveplayerid, str[128];
  1075.     if(PlayerInfo[playerid][AdminLevel] >=3) {
  1076.         if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /disarm [playerid]");
  1077.         if(!IsPlayerConnected(giveplayerid)) return 1;
  1078.         format(str, 128, "You have disarmed %s.", GetPName(giveplayerid));
  1079.         SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "Your weapons have been reset by an administrator.");
  1080.         ResetPlayerWeapons(giveplayerid);
  1081.     }
  1082.     return 1;
  1083. }
  1084. CMD:veh(playerid, params[])
  1085. {
  1086.     if(PlayerInfo[playerid][AdminLevel] >=2) {
  1087.         new car;
  1088.         if(IsPlayerInAnyVehicle(playerid)) return 1;
  1089.         if(sscanf(params, "i", car)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [vehid]");
  1090.         if(strval(params) >611 || strval(params) <400) return SendClientMessage(playerid, COLOR_RED, "Invalid model id!");
  1091.         new Float:x, Float:y, Float:z, Float:a;
  1092.         GetPlayerPos(playerid, x,y,z);
  1093.         GetPlayerFacingAngle(playerid, a);
  1094.         car = CreateVehicle(strval(params), x, y, z,a, -1, -1, 60);
  1095.         PutPlayerInVehicle(playerid, car, 0);
  1096.         SetPVarInt(playerid, "AdminVeh", car);
  1097.     }
  1098.     return 1;
  1099. }
  1100. CMD:kick(playerid, params[])
  1101. {
  1102.  new playerb, string1[128];
  1103.  if(PlayerInfo[playerid][AdminLevel] < 1) return 0;
  1104.  if(sscanf(params, "us[128]", playerb, params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
  1105.  if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
  1106.  if(PlayerInfo[playerid][AdminLevel] < PlayerInfo[playerb][AdminLevel]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you.");
  1107.  KickWithMessage(playerb);
  1108.  format(string1,sizeof(string1),"You have been kicked from this server, reason ~ %s",params);
  1109.  SendClientMessage(playerb,COLOR_GREY,string1);
  1110.  return 1;
  1111. }
  1112. CMD:givemoney(playerid, params[])
  1113. {
  1114.     if(PlayerInfo[playerid][AdminLevel] >=3) {
  1115.         new giveplayerid, money;
  1116.         if(sscanf(params, "ui", giveplayerid, money)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid] [amount]");
  1117.         if(!IsPlayerConnected(giveplayerid)) return 1;
  1118.         GivePlayerMoney(playerid, money);
  1119.     }
  1120.     return 1;
  1121. }
  1122.  
  1123. CMD:akill(playerid, params[])
  1124. {
  1125.     new giveplayerid, str[128];
  1126.     if(PlayerInfo[playerid][AdminLevel] >=3) {
  1127.         if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /akill [playerid]");
  1128.         if(!IsPlayerConnected(giveplayerid)) return 1;
  1129.         SetPlayerHealth(giveplayerid, 0);
  1130.         format(str, 128, "You have admin-killed %s.", GetPName(giveplayerid));
  1131.         SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
  1132.         SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "You have been killed by an administrator.");
  1133.     }
  1134.     return 1;
  1135. }
  1136. CMD:checkhp(playerid, params[])
  1137. {
  1138.     if(PlayerInfo[playerid][AdminLevel] >=3)
  1139.     {
  1140.     new id, Float:hp, string[256];
  1141.     if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "Syntax: /checkhp [playeri/partofname]");
  1142.     else
  1143.     {
  1144.         GetPlayerHealth(id, hp);
  1145.         format(string, sizeof(string), "Player has %.d hp.", hp);
  1146.         SendClientMessage(playerid, -1, string);
  1147.     }
  1148.   }
  1149.     return 1;
  1150. }
  1151.     CMD:ban(playerid,params[])
  1152.     {
  1153.         if(PlayerInfo[playerid][AdminLevel] < 2) return 0;
  1154.         new BannerName[MAX_PLAYER_NAME], BannedName[MAX_PLAYER_NAME], string[256], reason[24],pID;
  1155.         if(sscanf(params,"us", pID,reason)) return SendClientMessage(playerid,COLOR_GREY,"/ban [playerid] [reason]");
  1156.         GetPlayerName(playerid,BannerName,sizeof(BannerName));
  1157.         GetPlayerName(pID,BannedName,sizeof(BannedName));
  1158.         for (new a=0;a<MAX_PLAYERS;a++)
  1159.             {
  1160.                 if (IsPlayerConnected(a))
  1161.                     {
  1162.                         if(PlayerInfo[a][AdminLevel]>=1)
  1163.                             {
  1164.                                 format(string,sizeof(string),"%s has banned %s - %s",BannerName, BannedName, reason);
  1165.                                 SendClientMessage(a,COLOR_WHITE,string);
  1166.                             }
  1167.                     }
  1168.             }
  1169.         format(string, sizeof(string), "%s has been banned from the server for %s by %s", BannedName, reason,BannerName);
  1170.         SaveIn("Logs",string);
  1171.         TogglePlayerControllable(pID, false);
  1172.         dini_IntSet(Pos(pID), "Banned", 1);
  1173.         dini_Set(Pos(pID), "Reason", reason);
  1174.         dini_Set(Pos(pID), "Banner", BannerName);
  1175.         GetPlayerIp(playerid, string, sizeof(string));
  1176.         dini_Set(Pos(pID),"IP",string);
  1177.         SetCameraBehindPlayer(pID);
  1178.         BanWithMessage(pID);
  1179.         GetPlayerName(playerid, BannerName, sizeof(BannerName));
  1180.         GetPlayerName(pID, BannedName, sizeof(BannedName));
  1181.         format(string, sizeof(string), "%s has been banned from the server - %s", BannedName, reason);
  1182.         SendClientMessageToAll(COLOR_RED, string);
  1183.         return 1;
  1184.     }
  1185.  
  1186.  
  1187. CMD:sethp(playerid, params[])
  1188. {
  1189.     new user, health;
  1190.     if(!sscanf(params, "ui", user, health))
  1191.     {
  1192.         if(user != INVALID_PLAYER_ID)
  1193.         {
  1194.             SetPlayerHealth(user, health);
  1195.         }
  1196.         else return SendClientMessage(playerid, COLOR_RED, "Invalid Player ID.");
  1197.     }
  1198.     else return SendClientMessage(playerid, COLOR_WHITE, "/sethealth [playerid] [health]");
  1199.     return 1;
  1200. }
  1201. CMD:restart(playerid, params[])
  1202. {
  1203.     if(PlayerInfo[playerid][AdminLevel] >=4) {
  1204.         SendRconCommand("gmx");
  1205.     }
  1206.     return 1;
  1207. }
  1208. CMD:setweather(playerid, params[])
  1209. {
  1210.     if(PlayerInfo[playerid][AdminLevel] >=4)
  1211.     {
  1212.         new id,string[128];
  1213.         if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_GREY, "/setweather [weatherid]");
  1214.         if(id < 0 || id > 22) return SendClientMessage(playerid,COLOR_GREY,"Weather IDs [0 - 22]");
  1215.         GetPlayerName(playerid,name,24);
  1216.         for(new i = 0; i < MAX_PLAYERS; i++)
  1217.         {
  1218.             if(IsPlayerConnected(i))
  1219.             {
  1220.                 PlayerPlaySound(i,1057,0.0,0.0,0.0);
  1221.                 SetPlayerWeather(i, id);
  1222.             }
  1223.         }
  1224.         new wname[128];
  1225.         if(id == 8)
  1226.         {
  1227.             wname = "Stormy";
  1228.         }
  1229.         else if(id == 9)
  1230.         {
  1231.             wname = "Foggy";
  1232.         }
  1233.         else if(id == 11 || id == 17 || id == 18)
  1234.         {
  1235.             wname = "Scorching Hot";
  1236.         }
  1237.         else if(id == 16)
  1238.         {
  1239.             wname = "Cloudy/Rainly";
  1240.         }
  1241.         else if(id == 19)
  1242.         {
  1243.             wname = "Sand Storm";
  1244.         }
  1245.         else if(id == 20)
  1246.         {
  1247.             wname = "Green Fog";
  1248.         }
  1249.         else if(id == 12 || id == 13 || id == 14 || id == 15)
  1250.         {
  1251.             wname = "Hazzy";
  1252.         }
  1253.         else if(id == 27 || id == 28 || id == 29)
  1254.         {
  1255.             wname = "Fresh Sky";
  1256.         }
  1257.         else if(id == -66)
  1258.         {
  1259.             wname = "Spazzy";
  1260.         }
  1261.         else if(id == 0 || id == 1 || id == 2 || id == 3 || id == 4 || id == 5 || id == 6 || id == 7 || id == 10)
  1262.         {
  1263.             wname = "Bright/Cloudy";
  1264.         }
  1265.         else if(id == 21 || id == 22)
  1266.         {
  1267.             wname = "Dark";
  1268.         }
  1269.         format(string,sizeof(string),"An administrator has changed the weather to %s",wname);
  1270.         return SendClientMessageToAll(0x00FF80AA, string);
  1271.     }
  1272.     else return 0;
  1273. }
  1274. CMD:setlevel(playerid, params[])
  1275. {
  1276.     new levels,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],str[500],ID,mode[128];
  1277.     if(PlayerInfo[playerid][AdminLevel] == 5 || IsPlayerAdmin(playerid))
  1278.     {
  1279.     if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid,COLOR_GREY, "/setlevel [playerid] [level 1 - 5]");
  1280.  
  1281.     if(levels > 5) return SendClientMessage(playerid,COLOR_GREY,"LEVELS AVAILABLE 1-5!");
  1282.     if(!IsPlayerConnected(ID))return SendClientMessage(playerid,COLOR_GREY,"User is not connected.");
  1283.     if(PlayerInfo[ID][AdminLevel] == levels) return SendClientMessage(playerid,COLOR_GREY, "Player already has that level.");
  1284.     GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
  1285.     GetPlayerName(ID,pname,MAX_PLAYER_NAME);
  1286.     if(levels==1)
  1287.     {mode = "{FF6600}Server Moderator";}
  1288.     if(levels==2)
  1289.     {mode = "{0000AA}Global Moderator";}
  1290.     if(levels==3)
  1291.     {mode = "{DB0000}Admin{FFFFFF}";}
  1292.     if(levels==4)
  1293.     {mode = "{008000}Leading Admin";}
  1294.     if(levels==5)
  1295.     {mode = "{008000}Founder";}
  1296.     if(levels==6)
  1297.     {mode = "{008000}Scripter";}
  1298.     if(levels < PlayerInfo[ID][AdminLevel])
  1299.     {
  1300.         format(str, sizeof(str),"You have been {F0101}Demoted{FFFFFF} to %s {FFFFFF} by Server.",mode);
  1301.         GameTextForPlayer(ID,"~r~Demotion", 2000, 0);
  1302.         SendClientMessage(ID,COLOR_WHITE,str);
  1303.         format(str, sizeof(str),"Level set [%s to %s{FFFFFF}]",pname,mode);
  1304.         SendClientMessage(playerid,COLOR_WHITE,str);
  1305.         PlayerInfo[ID][AdminLevel] = levels;
  1306.         return 1;
  1307.     }
  1308.     else
  1309.     {
  1310.     format(str, sizeof(str),"You have been {04B404}Promoted{FFFFFF} to %s by Server.",mode);
  1311.     SendClientMessage(ID,COLOR_WHITE,str);
  1312.     GameTextForPlayer(ID,"~g~Promotion", 2000, 0);
  1313.     format(str, sizeof(str),"Level set [%s to %s{FFFFFF}]",pname,mode);
  1314.     SendClientMessage(playerid,COLOR_WHITE,str);
  1315.     PlayerInfo[ID][AdminLevel] = levels;
  1316.     }
  1317.     }else return 0;
  1318.     return 1;
  1319. }
  1320.  
  1321.  
  1322. CMD:fr(playerid, params[])
  1323.         {
  1324.         new Float:x, Float:y, Float:z;
  1325.         PlayerPlaySound(playerid, 1133, x, y, z);
  1326.         if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle!");
  1327.         RepairVehicle(GetPlayerVehicleID(playerid));
  1328.         SendClientMessage(playerid, COLOR_WHITE, "Your vehicle has been successfully repaired!");
  1329.         return 1;
  1330. }
  1331. CMD:help(playerid, params[])
  1332.     {
  1333.         SendClientMessage(playerid, COLOR_TEAL, "To view the existing server commands, type /cmds");
  1334.         return 1;
  1335.     }
  1336.  
  1337. CMD:url(playerid, params[])
  1338.     {
  1339.         SendClientMessage(playerid, COLOR_TEAL, "ST Official Web URL");
  1340.         SendClientMessage(playerid, COLOR_YELLOW, "http://www.soomrotayab.com");
  1341.         return 1;
  1342.     }
  1343. CMD:open(playerid, params[])
  1344. {
  1345.     if(IsPlayerInRangeOfPoint(playerid, 15.0, 2237.5, -2218.6001, 14.2))
  1346.     {
  1347.     MoveObject(Gate1,2242.69995, -2223.80005, 14.2,1);
  1348.     MoveObject(Gate2,2226.1001, -2207.6001, 14.2,1);
  1349.     SendClientMessage(playerid, COLOR_GREEN, "Gate has been opened");
  1350.     return 1;
  1351.     }
  1352.     return 1;
  1353. }
  1354. CMD:close(playerid, params[])
  1355.     {
  1356.     new Closed =MoveObject(Gate1,2237.5, -2218.6001, 14.2,1);
  1357.     new Closed1 =MoveObject(Gate2,2231.3999, -2212.5, 14.2,1);
  1358.     if(IsPlayerInRangeOfPoint(playerid, 15.0, 2237.5, -2218.6001, 14.2))
  1359.     if (Closed == 1)
  1360.     if (Closed1 == 1)
  1361.     {
  1362.     MoveObject(Gate1,2237.5, -2218.6001, 14.2,1);
  1363.     MoveObject(Gate2,2231.3999, -2212.5, 14.2,1);
  1364.     SendClientMessage(playerid, COLOR_GREEN, "Gate has been closed");
  1365.     return 1;
  1366.     }
  1367.     else {
  1368.     SendClientMessage(playerid, COLOR_TEAL, "Gate already closed.");
  1369.     return 1;
  1370. }
  1371.     return 1;
  1372.     }
  1373. CMD:rules(playerid, params[])
  1374.     {
  1375.         SendClientMessage(playerid, COLOR_TEAL, "TwD Server Rules");
  1376.         SendClientMessage(playerid, COLOR_YELLOW, "Goto the website of TwD to view the list of rules.");
  1377.         SendClientMessage(playerid, COLOR_YELLOW, "Server Website http://www.soomrotayab.com");
  1378.         SendClientMessage(playerid, COLOR_WHITE, "_________________________");
  1379.         return 1;
  1380.  
  1381.     }
  1382. CMD:cmds(playerid, params[])
  1383.     {
  1384.         SendClientMessage(playerid, COLOR_YELLOW, "TwD Official Command List");
  1385.         SendClientMessage(playerid, COLOR_WHITE, "/help - /suicide - /rules - /flip - /fr - /url");
  1386.         SendClientMessage(playerid, COLOR_WHITE, "/credits - /drift1 - /drift2 - /drift3 - ");
  1387.         SendClientMessage(playerid, COLOR_WHITE, "/open - /close");
  1388.         SendClientMessage(playerid, COLOR_YELLOW, "_________________________");
  1389.         return 1;
  1390.     }
  1391. CMD:suicide(playerid, params[])
  1392.     {
  1393.         SetPlayerHealth(playerid,0);
  1394.         SendClientMessage(playerid, COLOR_RED, "You have commited suicide.");
  1395.         return 1;
  1396.     }
  1397. CMD:flip(playerid, params[])
  1398.     {
  1399.         if(IsPlayerInAnyVehicle(playerid))
  1400.         {
  1401.             new Float:PX, Float:PY, Float:PZ, Float:PA;
  1402.             GetPlayerPos(playerid, PX, PY, PZ);
  1403.             GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
  1404.             SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
  1405.             SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
  1406.             SendClientMessage(playerid, COLOR_WHITE, "Your vehicle has been flipped!");
  1407.             PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  1408.         }
  1409.         else
  1410.         {
  1411.             SendClientMessage(playerid, COLOR_RED, "You need to be in a vehicle to use this command!");
  1412.         }
  1413.         return 1;
  1414.     }
  1415. CMD:credits(playerid, params[])
  1416.     {
  1417.             SendClientMessage(playerid, COLOR_YELLOW, "TwD Development Team");
  1418.             SendClientMessage(playerid, COLOR_GREEN, "Founder/Developer: {FFFFFF}SoomroTayab (Goldilox)");
  1419.             SendClientMessage(playerid, 0xF80000AA, "Other: {FFFFFF}Alex Y_Less Cole\n Bennie\n Onfroi");
  1420.             SendClientMessage(playerid, COLOR_WHITE, "_______________");
  1421.             return 1;
  1422.     }
  1423. CMD:stats(playerid, params[])
  1424.     {
  1425.         new str[128],PName[MAX_PLAYER_NAME];
  1426.         GetPlayerName(playerid, PName, MAX_PLAYER_NAME);
  1427.         SendClientMessage(playerid,0x80DD22C8,"______________________________");
  1428.         format(str,sizeof(str),"|_______|%sStats|________|",PName);
  1429.         SendClientMessage(playerid,0x80DD22C8,str);
  1430.         format(str,sizeof(str),"Score: {FFFFFF}%d",GetPlayerScore(playerid));
  1431.         SendClientMessage(playerid,0x40BFA600,str);
  1432.         format(str,sizeof(str),"Cash: {FFFFFF} $%d",GetPlayerMoney(playerid));
  1433.         SendClientMessage(playerid,0xEEE8AA00,str);
  1434.         return 1;
  1435.     }
  1436. CMD:drift(playerid,params[])
  1437. {
  1438.     new did;
  1439.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_GREY,"You have to be in vehicle.");
  1440.     if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_GREY,"You've to be the driver of a car.");
  1441.     if(sscanf(params,"d",did)) return SendClientMessage(playerid,COLOR_GREY,"/drift [id]") && SendClientMessage(playerid,COLOR_GREY,"Current IDs [1-3]");
  1442.     if(did < 1 || did > 3) return SendClientMessage(playerid,COLOR_GREY,"Invalid ID");
  1443.     if(did == 1)
  1444.     {
  1445.         new string[128], pName[MAX_PLAYER_NAME];
  1446.         SetVehiclePos(GetPlayerVehicleID(playerid), -358.1943,1531.2909,75.1698 );
  1447.         SetVehicleZAngle(GetPlayerVehicleID(playerid), 264.7289);
  1448.         SetCameraBehindPlayer(playerid);
  1449.         format(string, sizeof(string), "%s [ID:%d] has gone to Drift 1 (/drift1)", pName, playerid);
  1450.         SendClientMessageToAll(COLOR_YELLOW, string);
  1451.         GameTextForPlayer(playerid, "~w~Welcome To Drift 1! ~G~", 5000, 5);
  1452.     }
  1453.     else if(did == 2)
  1454.     {
  1455.         new string[128], pName[MAX_PLAYER_NAME];
  1456.         SetVehiclePos(GetPlayerVehicleID(playerid), 2265.3010,1399.5085,42.8203);
  1457.         SetVehicleZAngle(GetPlayerVehicleID(playerid), 269.7637);
  1458.         SetCameraBehindPlayer(playerid);
  1459.         format(string, sizeof(string), "%s [ID:%d] has gone to Drift 2 (/drift2)", pName, playerid);
  1460.         SendClientMessageToAll(COLOR_YELLOW, string);
  1461.         GameTextForPlayer(playerid, "~w~Welcome To Drift 2! ~G~", 5000, 5);
  1462.  
  1463.     }
  1464.     else if(did == 3)
  1465.     {
  1466.         new string[128], pName[MAX_PLAYER_NAME];
  1467.         SetVehiclePos(GetPlayerVehicleID(playerid),835.6555,-878.2632,68.0216);
  1468.         SetVehicleZAngle(GetPlayerVehicleID(playerid), 238.8432);
  1469.         SetCameraBehindPlayer(playerid);
  1470.         format(string, sizeof(string), "%s [ID:%d] has gone to Drift 53 (/drift3)", pName, playerid);
  1471.         SendClientMessageToAll(COLOR_YELLOW, string);
  1472.         GameTextForPlayer(playerid, "~w~Welcome To Drift 3! ~G~", 5000, 5);
  1473.     }
  1474.     return 1;
  1475. }
  1476. CMD:setvip(playerid, params[])
  1477.  
  1478. {
  1479.     new levels,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],str[128],ID;
  1480.     if(PlayerInfo[playerid][AdminLevel] == 5 || IsPlayerAdmin(playerid))
  1481.     {
  1482.     if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid,COLOR_GREY, "/setvip [id] [level]");
  1483.     if(levels > 3) return SendClientMessage(playerid,COLOR_GREY,"Maximum level - 3");
  1484.     if(!IsPlayerConnected(ID))return SendClientMessage(playerid,COLOR_GREY,"That user is not connected.");
  1485.     new string[128];
  1486.     format(string,sizeof(string),"That person already posses VIP Level %d.",levels);
  1487.     if(PlayerInfo[ID][VIP] == levels) return SendClientMessage(playerid,COLOR_GREY,string);
  1488.     GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
  1489.     GetPlayerName(ID,pname,MAX_PLAYER_NAME);
  1490.     if(levels==1)
  1491.     {
  1492.         SendClientMessage(ID,COLOR_YELLOW,"You have recieved VIP Package 1 (2 Months) Subscribtion.");
  1493.         GameTextForPlayer(ID, "Enjoy~g~ 2 Month VIP!", 3000, 5);
  1494.         SendClientMessage(ID,COLOR_WHITE,"Type /vipcmds for the list of VIP commands.");
  1495.         format(str, sizeof(str),"You've given %s a VIP Package 1 (2 Months) subscription",pname);
  1496.         SendClientMessage(playerid,COLOR_WHITE,str);
  1497.         PlayerInfo[ID][VIP] = levels;
  1498.         // just do this, it is quicker
  1499.         dini_IntSet(Pos(ID),"VIPTIME",gettime()+60*60*24*60);
  1500.     }
  1501.     if(levels==2)
  1502.     {
  1503.         SendClientMessage(ID,COLOR_YELLOW,"You have recieved VIP Package 2 (5 Months) Subscribtion.");
  1504.         GameTextForPlayer(ID, "Enjoy~g~ 5 Month VIP!", 3000, 5);
  1505.         SendClientMessage(ID,COLOR_WHITE,"Type /vipcmds for the list of VIP commands.");
  1506.         format(str, sizeof(str),"You've given %s a VIP Package 2 (5 Months) subscription",pname);
  1507.         SendClientMessage(playerid,COLOR_WHITE,str);
  1508.         PlayerInfo[ID][VIP] = levels;
  1509.         dini_IntSet(Pos(ID),"VIPTIME",gettime()+60*60*24*150);
  1510.     }
  1511.     if(levels==3)
  1512.     {
  1513.         SendClientMessage(ID,COLOR_YELLOW,"You have recieved VIP Package 3 (Lifetime) Subscribtion.");
  1514.         GameTextForPlayer(ID, "Enjoy~g~ Lifetime VIP!", 3000, 5);
  1515.         SendClientMessage(ID,COLOR_WHITE,"Type /vipcmds for the list of VIP commands.");
  1516.         format(str, sizeof(str),"You've given %s a VIP Package 3 (Lifetime) subscription",pname);
  1517.         SendClientMessage(playerid,COLOR_WHITE,str);
  1518.         PlayerInfo[ID][VIP] = levels;
  1519.         dini_IntSet(Pos(ID),"VIPTIME",gettime()+60*60*24*1000);
  1520.     }
  1521.     if(levels ==0)
  1522.     {
  1523.         SendClientMessage(ID,COLOR_RED,"Your VIP privillages have been removed.");
  1524.         SendClientMessage(ID,COLOR_WHITE,"If it was unfair, post it on forum.");
  1525.         return 1;
  1526.     }
  1527.     if(levels > 3)
  1528.     {
  1529.         SendClientMessage(playerid,COLOR_GREY,"Maximum V.I.P Level is 3.");
  1530.     }
  1531.     if(levels < 0)
  1532.     {
  1533.         SendClientMessage(playerid,COLOR_GREY,"Minumum V.I.P Level is 1.");
  1534.     }
  1535.     }
  1536.     return 1;
  1537. }
  1538.  
  1539.  
  1540. CMD:heal(playerid, params[]){ //A typical vip command (Health)
  1541.         if(PlayerInfo[playerid][VIP] < 1) return 0;
  1542.         SetPlayerHealth(playerid, 100);
  1543.         SendClientMessage(playerid, COLOR_GREEN, "You have been healed.");
  1544.         return 1;
  1545.         }
  1546.  
  1547. CMD:armour(playerid, params[]){ //A typical vip command2 (Armor)
  1548.         if(PlayerInfo[playerid][VIP] < 1) return 0;
  1549.         SetPlayerArmour(playerid, 100);
  1550.         SendClientMessage(playerid, COLOR_WHITE, "Armor activated.");
  1551.         return 1;}
  1552.  
  1553. CMD:night(playerid, params[]){
  1554.         if(PlayerInfo[playerid][VIP] < 1) return 0;
  1555.         new time;
  1556.         SetPlayerTime(playerid,time,0);
  1557.         SendClientMessage(playerid, COLOR_WHITE, "You have set night time at you.");
  1558.         return 1;}
  1559. CMD:tune(playerid, params[]){
  1560.     if(PlayerInfo[playerid][VIP] < 1) return 0;
  1561.     if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You must be the the driver of the vehicle.");
  1562.     new vehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
  1563.     if(vehiclemodel < 400 || vehiclemodel > 611) return SendClientMessage(playerid,COLOR_GREY, "Untunable vehicle.");
  1564.     new string[2048];
  1565.     new component;
  1566.     countVehicle[playerid] = 1;
  1567.     while(GetVehicleCompatibleUpgrades(vehiclemodel, countVehicle[playerid], component)){
  1568.         if(countVehicle[playerid] <= MAX_COMP){
  1569.             if(countVehicle[playerid] == 1) format(string, sizeof(string), "%s", GetComponentName(component));
  1570.             else format(string, sizeof(string), "%s\n%s", string, GetComponentName(component));
  1571.             componentsid[playerid][countVehicle[playerid]-1] = component;
  1572.             countVehicle[playerid]++;
  1573.         }
  1574.         else break;
  1575.     }
  1576.     new title[80];
  1577.     format(title, sizeof(title), "Vehicle Components for vehicle model %d", vehiclemodel);
  1578.     ShowPlayerDialog(playerid,TUNE,DIALOG_STYLE_LIST, title, string, "Attach", "Cancel");
  1579.     return 1;
  1580. }
  1581. CMD:day(playerid, params[]){
  1582.         if(PlayerInfo[playerid][VIP] < 1) return 0;
  1583.         new time;
  1584.         SetPlayerTime(playerid,time,10);
  1585.         SendClientMessage(playerid, COLOR_WHITE, "You have set night time at you.");
  1586.         return 1;}
  1587. CMD:viphelp(playerid, params[])
  1588. {
  1589.         if(PlayerInfo[playerid][VIP] < 1) return 0;
  1590.         SendClientMessage(playerid, COLOR_TEAL, "For available vip commands, type /vcmds.");
  1591.         return 1;
  1592. }
  1593. CMD:vcmds(playerid, params[])
  1594. {
  1595.         if(PlayerInfo[playerid][VIP] < 1) return 0;
  1596.         SendClientMessage(playerid,COLOR_YELLOW,"VIP Commands");
  1597.         SendClientMessage(playerid,COLOR_WHITE,"/heal - /armour - /tune");
  1598.         SendClientMessage(playerid,COLOR_WHITE,"/day - /night - /color");
  1599.         return 1;
  1600.  
  1601. }
  1602. CMD:color(playerid,params[])
  1603. {
  1604.     if(PlayerInfo[playerid][VIP] < 1) return 0;
  1605.     new PlayerState = GetPlayerState(playerid);
  1606.     if(PlayerState == PLAYER_STATE_DRIVER)
  1607.     {
  1608.         ShowPlayerDialog(playerid,COLORCAR,DIALOG_STYLE_LIST,"Color Menu","Black\nWhite","Apply","");
  1609.     }
  1610.     if(PlayerState == PLAYER_STATE_ONFOOT)
  1611.     {
  1612.         ShowPlayerDialog(playerid,COLORCHAT,DIALOG_STYLE_LIST,"Color Menu","Blue\nPink\nRed\nYellow\nOrange\nAqua\nLime\nMaroon\nMagenta\nTeal\nWhite","Apply","");
  1613.     }
  1614.     return 1;
  1615. }
  1616. CMD:paintball(playerid,params[])
  1617.     {
  1618.     if(PB[playerid]==0)
  1619.     {
  1620.         if(!IsPlayerInRangeOfPoint(playerid, 10,2015.5741,1106.1957,10.8203)) return SendClientMessage(playerid,COLOR_GREY,"You're no where close to paintball.");
  1621.         new Random = random(sizeof(PBSpawn));
  1622.         if(GetPlayerWantedLevel(playerid) >= 1)return SendClientMessage(playerid,COLOR_GREY,"You're a suspect!");
  1623.         SetPlayerPos(playerid, PBSpawn[Random][0], PBSpawn[Random][1], PBSpawn[Random][2]);
  1624.         SetPlayerFacingAngle(playerid, PBSpawn[Random][3]);
  1625.         SetTimer("LoadingArea",5000,0);
  1626.         TogglePlayerControllable(playerid,0);
  1627.         GameTextForPlayer(playerid,"Loading Area...",5200,5);
  1628.     }
  1629.     else if(PB[playerid] == 1)
  1630.     {
  1631.         new string[128];
  1632.         SetPlayerPos(playerid,2015.5741,1106.1957,10.8203);
  1633.         SendClientMessage(playerid,COLOR_WHITE,"Thanks for playing paintball.");
  1634.         ResetPlayerWeapons(playerid);
  1635.         SetPlayerHealth(playerid,100);
  1636.         GetPlayerName(playerid,name,sizeof(name));
  1637.         format(string,sizeof(string),"%s has left paintball.",name);
  1638.         PB[playerid]=0;
  1639.         for(new i = 0; i < MAX_PLAYERS; i++)
  1640.         {
  1641.             if(PB[i] == 1)
  1642.             {
  1643.                 SendClientMessage(i,0x04B4AEAA,string);
  1644.                 return 1;
  1645.             }
  1646.         }
  1647.     }
  1648.     return 1;
  1649.     }
  1650.  
  1651. GetPName(playerid)
  1652. {
  1653.     new PName[MAX_PLAYER_NAME];
  1654.     GetPlayerName(playerid, PName, sizeof(PName));
  1655.     return PName;
  1656. }
  1657. forward KickPublic(playerid);
  1658. public KickPublic(playerid) { Kick(playerid); }
  1659.  
  1660. stock KickWithMessage(playerid)
  1661. {
  1662.     SetTimerEx("KickPublic", 300, 0, "d", playerid);   //Delay of 1 second before kicking the player so he recieves the message
  1663. }
  1664. forward BanPublic(playerid);
  1665. public BanPublic(playerid) { Ban(playerid); }
  1666.  
  1667. stock BanWithMessage(playerid)
  1668. {
  1669.     SetTimerEx("BanPublic", 300, 0, "d", playerid);   //Delay of 1 second before kicking the player so he recieves the message
  1670. }
  1671. public SaveIn(filename[],text[])
  1672. {
  1673.     new File:Lfile;
  1674.     new filepath[256];
  1675.     new string[256];
  1676.     new year,month,day;
  1677.     getdate(year,month,day);
  1678.     format(filepath,sizeof(filepath),"%s.txt",filename);
  1679.     Lfile = fopen(filepath,io_append);
  1680.     format(string,sizeof(string),"[%02d/%02d/%02d] %s\r\n",day,month,year,text);
  1681.     fwrite(Lfile,string);
  1682.     fclose(Lfile);
  1683.     return 1;
  1684. }
  1685. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  1686. {
  1687.     if(checkpointid == pblv)
  1688.     {
  1689.         ShowPlayerDialog(playerid,PBALL,DIALOG_STYLE_LIST,"Paintball","Join\nInformation\nCurrent Players","Okay","");
  1690.     }
  1691.     return 1;
  1692. }
  1693.  
  1694. public LoadingArea(playerid)
  1695. {
  1696.     new string[128];
  1697.     SendClientMessage(playerid,COLOR_YELLOW,"Type /paintball again in order to stop paintballing.");
  1698.     GivePlayerWeapon(playerid, 29, 2500);
  1699.     GetPlayerName(playerid,name,sizeof(name));
  1700.     format(string,sizeof(string),"%s has joined paintball.",name);
  1701.     PB[playerid]=1;
  1702.     for(new i = 0; i < MAX_PLAYERS; i++)
  1703.     {
  1704.         if(PB[i] == 1)
  1705.         {
  1706.             SendClientMessage(i,0x04B4AEAA,string);
  1707.             return 1;
  1708.         }
  1709.     }
  1710.     TogglePlayerControllable(playerid,1);
  1711.     return 1;
  1712.  
  1713. }
  1714. public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  1715. {
  1716.     if(pickupid == paintball)
  1717.     {
  1718.         SendClientMessage(playerid,COLOR_YELLOW,"Welcome to Paintball.");
  1719.         SendClientMessage(playerid,-1,"Type /paintball to start paintballing.");
  1720.         return 1;
  1721.     }
  1722.     return 1;
  1723. }
  1724. forward VIPCLOCK();
  1725. public VIPCLOCK()
  1726. {
  1727.     for(new i=0; i<MAX_PLAYERS; i++)
  1728.     {
  1729.         if(PlayerInfo[i][VIP] > 0)
  1730.         {
  1731.             if(IsPlayerConnected(i))
  1732.             {
  1733.                 if(gettime() > dini_Int(Pos(i),"VIPTIME"))
  1734.                 {
  1735.                     PlayerInfo[i][VIP] = 0;
  1736.                     SendClientMessage(i,COLOR_ORANGE,"Your VIP Subscribtion has been ended.");
  1737.                     GameTextForPlayer(i, "Thanks for donating!", 3000, 5);
  1738.                     SendClientMessage(i,COLOR_WHITE,"We're hoping you enjoyed being V.I.P");                }
  1739.             }
  1740.         }
  1741.     }
  1742.     return 1;
  1743. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement