Advertisement
Guest User

BesAdmin V1.2 Version Released.

a guest
Mar 1st, 2015
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 54.90 KB | None | 0 0
  1. // BesAdmin System Script v1.2 Version of it .
  2. // BesAdmin v1.0 was released and went succesfully so i started working on v1.2 with a bunch of new and advanced and most beautiful features.
  3. // Hope you enjoy it.
  4. // Credits will be listed below.
  5. // Credits to KUSH for his registration system
  6. // Credits to the owner of KickEx include as i copied his for my BannEx.
  7. // Credits to gtakillerIV for his offline BAN and UNBAN Tutorial
  8. // Original Filterscript by BeesSi. Feel free to edit it and rerelease.
  9. #include <a_samp>
  10. #include <YSI\y_ini>
  11. #include <zcmd>
  12. #include <sscanf2>
  13. #include <foreach>
  14. #include <streamer>
  15. #include <KickEx>
  16.  
  17. // Includes down here belongs to BeesSi
  18. #include <BannEx>
  19.  
  20.  
  21. /*               Defines            */
  22. #define DIALOG_REGISTER 1
  23. #define DIALOG_LOGIN 2
  24. #define DIALOG_SUCCESS_1 3
  25. #define DIALOG_SUCCESS_2 4
  26. #define PATH "/Users/%s.ini"
  27. #define COL_WHITE "{FFFFFF}"
  28. forward SendAdminMessage(color, string[]);
  29. forward BroadCast(color,string[]);
  30. #define COL_RED "{F81414}"
  31. #define COL_GREEN "{00FF22}"
  32. #pragma tabsize 0
  33. #define COL_LIGHTBLUE "{00CED1}"
  34. #define TEAM_HIT_COLOR 0xFFFFFF00
  35. #define COLOR_BRIGHTRED 0xFF0000AA
  36. #define COLOR_TWWHITE 0xFFFFFFAA
  37. #define DIALOG_SHOW_INFO 13337
  38. #define DIALOG_ADMIN_HELP 11637
  39. #define DIALOG_SHOW_INFO1 124
  40. #define DIALOG_SHOW_INFO2 125
  41. #define COLOR_TWYELLOW 0xFFFF00AA
  42. #define COLOR_TWPINK 0xE75480AA
  43. #define COLOR_TWRED 0xFF0000AA
  44. #define COLOR_TWBROWN 0x654321AA
  45. #define COLOR_TWGRAY 0x808080AA
  46. #define COLOR_TWOLIVE 0x808000AA
  47. #define COLOR_TWPURPLE 0x800080AA
  48. #define COLOR_TWTAN 0xD2B48CAA
  49. #define COLOR_TWAQUA 0x00FFFFAA
  50. #define COLOR_SILVER_VIP 0xC8BCB7FF
  51. #define COLOR_BRONZE_VIP 0xAD5297FF
  52. #define COLOR_GOLD_VIP 0xF9FF00FF
  53. #define COLOR_TWORANGE 0xFF8C00AA
  54. #define COLOR_TWAZURE 0x007FFFAA
  55. #define COLOR_TWGREEN 0x008000AA
  56. #define COLOR_TWBLUE 0x0000FFAA
  57. #define COLOR_TWBLACK 0x000000AA
  58. #define GetVehicleName(%0) VehicleName[GetVehicleModel(%0)-400]
  59. #define COLOR_HTWWHITE "FFFFFF"
  60. #define COLOR_HTWYELLOW "FFFF00"
  61. #define COLOR_HTWPINK "E75480"
  62. #define COLOR_HTWRED "FF0000"
  63. #define COLOR_HTWBROWN "654321"
  64. #define COLOR_HTWGRAY "808080"
  65. #define COLOR_HTWOLIVE "808000"
  66. #define COLOR_HTWPURPLE "800080"
  67. #define COLOR_HTWTAN "D2B48C"
  68. #define COLOR_HTWAQUA "00FFFF"
  69. #define COLOR_HTWORANGE "FF8C00"
  70. #define COLOR_HTWAZURE "007FFF"
  71. #define COLOR_HTWGREEN "008000"
  72. #define COLOR_VIP_CHAT 0xF50AD2FF
  73. #define COLOR_HTWBLUE "0000FF"
  74. #define COLOR_HTWBLACK "000000"
  75. new JetPack[MAX_PLAYER_NAME];
  76. new playersonline=0;
  77. new CreatedCars[100];
  78. #define COLOR_ORANGE 0xFF8000FF
  79. #define COLOR_GRAD1 0xB4B5B7FF
  80. #define COLOR_GRAD2 0xBFC0C2FF
  81. #define COLOR_GRAD3 0xCBCCCEFF
  82. #define COLOR_GRAD4 0xD8D8D8FF
  83. #define COLOR_GRAD5 0xE3E3E3FF
  84. #define COLOR_GRAD6 0xF0F0F0FF
  85. #define COLOR_HACHAT 0x642EFAAA
  86. #define COLOR_GREY 0xAFAFAFAA
  87. #define COLOR_GREEN 0x33AA33AA
  88. #define COLOR_RED 0xFF0000FF
  89. #define COLOR_GRAVE 0xFF0000FF
  90. #define COLOR_REALRED 0xFF0606FF
  91. #define COLOR_LIGHTRED 0xFF6347AA
  92. #define COLOR_LIGHTBLUE 0x33CCFFAA
  93. #define COLOR_LIGHTGREEN 0x9ACD32AA
  94. #define COLOR_LIME 0xB7FF00AA
  95. #define COLOR_YELLOW 0xFFFF00AA
  96. #define COLOR_VIP 0xC93CCE00
  97. #define COLOR_YELLOW2 0xF5DEB3AA
  98. #define COLOR_WHITE 0xFFFFFFAA
  99. #define COLOR_FADE1 0xE6E6E6E6
  100. #define COLOR_FADE2 0xC8C8C8C8
  101. #define COLOR_FADE3 0xAAAAAAAA
  102. #define COLOR_FADE4 0x8C8C8C8C
  103. #define COLOR_FADE5 0x6E6E6E6E
  104. #define COLOR_PURPLE 0xC2A2DAAA
  105. #define COLOR_PINK 0xFF66FFAA
  106. #define COLOR_DBLUE 0x2641FEAA
  107. #define COLOR_ALLDEPT 0xFF8282AA
  108. #define COLOR_BLACK 0x000000AA
  109. #define TEAM_SFPD   0x0099FF00
  110. #define TEAM_SASD   0xCC993300
  111. #define TEAM_LAJS   0xFF8C00AA
  112. #define COLOR_NEWS 0xFFA500AA
  113. #define COLOR_OOC 0xE0FFFFAA
  114. #define COLOR_NG 0x9ACD3200
  115. #define COLOR_USCG 0x9ACD3200
  116. #define COLOR_TR2 0xCC000000
  117. #define COLOR_TR 0x56B9B900
  118. #define COLOR_FBI 0x8D8DFFFF
  119. #define PUBLICRADIO_COLOR 0x6DFB6DFF
  120. #define TEAM_CYAN 1
  121. #define TEAM_BLUE 2
  122. #define TEAM_GREEN 3
  123. #define TEAM_ORANGE 4
  124. #define TEAM_COR 5
  125. #define TEAM_BAR 6
  126. #define TEAM_TAT 7
  127. #define TEAM_CUN 8
  128. #define TEAM_STR 9
  129. #define TEAM_HIT 10
  130. #define TEAM_ADMIN 11
  131. #define OBJECTIVE_COLOR 0x64000064
  132. #define PAINTBALL_TEAM_RED 0xFF780000
  133. #define PAINTBALL_TEAM_BLUE 0x56B9B900
  134. #define WANTED_COLOR 0xFF0000FF
  135. #define FIND_COLOR 0xB90000FF
  136. #define TACTICAL1 0xCAD6A3FF
  137. #define TACTICAL2 0xFF9A00FF
  138. #define COLOR_1RED 0xFF0000FF
  139. #define COLOR_1GREY 0xC0C0C0FF
  140. #define COLOR_1GREEN 0x008000FF
  141. #define COLOR_1YELLOW 0xFFFF00FF
  142. #define COLOR_1WHITE 0xFFFFFFFF
  143. #define COLOR_1BLUE 0x0000FFFF
  144. #define MIN_VEHI_ID     400
  145. #define MAX_VEHI_ID     611
  146. new Float:TelePos[MAX_PLAYERS][6];
  147. new Float: fVehSpeed[MAX_PLAYERS];
  148. new Spectate[MAX_PLAYERS];
  149. new Spectating[MAX_PLAYERS];
  150. new GettingSpectated[MAX_PLAYERS];
  151. new aDuty[MAX_PLAYERS];
  152. new Godmode[MAX_PLAYERS];
  153.  
  154. static const VehicleName[212][] = {
  155.     "Landstalker","Bravura","Buffalo","Linerunner","Perennial","Sentinel","Dumper","Firetruck","Trashmaster","Stretch",
  156.     "Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi",
  157.     "Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator",
  158.     "Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RC Bandit", "Romero",
  159.     "Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed",
  160.     "Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
  161.     "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler",
  162.     "ZR-350","Walton","Regina","Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper",
  163.     "Rancher","FBI Rancher","Virgo","Greenwood","Jetmax","Hotring Racer","Sandking","Blista Compact","Police Maverick",
  164.     "Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT",
  165.     "Elegant","Journey","Bike","Mountain Bike","Beagle","Cropduster","Stuntplane","Tanker","Road Train","Nebula","Majestic",
  166.     "Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV-1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
  167.     "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent",
  168.     "Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility",
  169.     "Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger",
  170.     "Flash","Tahoma","Savanna","Bandito","Freight","Trailer","Kart","Mower","Duneride","Sweeper","Broadway",
  171.     "Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer","Emperor","Wayfarer",
  172.     "Euros","Hotdog","Club","Trailer","Trailer","Andromada","Dodo","RCCam","Launch","Police Car (LAPD)","Police Car (SFPD)",
  173.     "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A",
  174.     "Luggage Trailer B","Stair Trailer","Boxville","Farm Plow","Utility Trailer"
  175. };
  176.  
  177. new Float:AJailSpawns[][3] = {
  178. {1838.160,-1722.138,5202.585}, // Jail 1
  179. {1838.160,-1722.138,5202.585}, // jail 2
  180. {1838.160,-1722.138,5202.585}, // jail 3
  181. {1838.160,-1722.138,5202.585}, // jail 4
  182. {1838.160,-1722.138,5202.585}, // jail 5
  183. {1838.160,-1722.138,5202.585}, // jail 6
  184. {1838.160,-1722.138,5202.585}, // jail 7
  185. {1838.160,-1722.138,5202.585}, // jail 8
  186. {1838.160,-1722.138,5202.585}, // jail 9
  187. {1838.160,-1722.138,5202.585}, // jail 10
  188. {1838.160,-1722.138,5202.585}, // jail 11
  189. {1838.160,-1722.138,5202.585}, // jail 12
  190. {1838.160,-1722.138,5202.585}, // jail 13
  191. {1838.160,-1722.138,5202.585}, // jail 14
  192. {1838.160,-1722.138,5202.585}, // jail 15
  193. {1838.160,-1722.138,5202.585}  // jail 16
  194. };
  195.  
  196.  
  197. enum pInfo
  198. {
  199.     pPassword,
  200.     pAdmin,
  201.     pMoney,
  202.     pVW,
  203.     pBanned,
  204.     pVip,
  205.     pJailed,
  206.     pPrisonedBy[MAX_PLAYER_NAME],
  207.     pPrisonReason[128],
  208.     pJailTime,
  209.     pInt,
  210.     pChar,
  211.     pModel,
  212.     pWarns,
  213.     BannedIP[22]
  214. }
  215. new PlayerInfo[MAX_PLAYERS][pInfo];
  216.  
  217. public OnFilterScriptInit()
  218. {
  219.     for(new i = 0; i < sizeof(CreatedCars); i++)
  220.     {
  221.         CreatedCars[i] = INVALID_VEHICLE_ID;
  222.     }
  223.     return 1;
  224. }
  225.  
  226. forward GivePlayerCash(playerid, money);
  227. public GivePlayerCash(playerid, money)
  228. {
  229.     SetPVarInt(playerid, "Cash", GetPVarInt(playerid, "Cash")+money);
  230.     GivePlayerMoney(playerid, money);
  231.     return 1;
  232. }
  233.  
  234. forward Player_StreamPrep(iPlayer, Float: fPosX, Float: fPosY, Float: fPosZ, iTime);
  235. public Player_StreamPrep(iPlayer, Float: fPosX, Float: fPosY, Float: fPosZ, iTime) {
  236.     switch(GetPVarInt(iPlayer, "StreamPrep")) {
  237.         case 0: {
  238.  
  239.             TogglePlayerControllable(iPlayer, false);
  240.             GameTextForPlayer(iPlayer, "~w~Collecting position...", iTime * 2, 3);
  241.             SetPVarInt(iPlayer, "StreamPrep", 1);
  242.             SetTimerEx("Player_StreamPrep", iTime / 2, false, "ifffi", iPlayer, fPosX, fPosY, fPosZ, iTime);
  243.         }
  244.         case 1: {
  245.  
  246.             if(GetPlayerState(iPlayer) == PLAYER_STATE_DRIVER)
  247.                 SetVehiclePos(GetPlayerVehicleID(iPlayer), fPosX, fPosY, fPosZ + 2.0);
  248.  
  249.             else
  250.                 SetPlayerPos(iPlayer, fPosX, fPosY, fPosZ + 0.5);
  251.  
  252.             //GameTextForPlayer(iPlayer, "~w~Streaming objects...", iTime * 2, 3);
  253.             SetPVarInt(iPlayer, "StreamPrep", 2);
  254.             SetTimerEx("Player_StreamPrep", iTime / 2, false, "ifffi", iPlayer, fPosX, fPosY, fPosZ, iTime);
  255.         }
  256.         default: {
  257.             GameTextForPlayer(iPlayer, "~r~Loaded!", 1000, 3);
  258.             TogglePlayerControllable(iPlayer, true);
  259.  
  260.             if(GetPlayerState(iPlayer) == PLAYER_STATE_DRIVER)
  261.                 SetVehiclePos(GetPlayerVehicleID(iPlayer), fPosX, fPosY, fPosZ);
  262.  
  263.             else
  264.                 SetPlayerPos(iPlayer, fPosX, fPosY, fPosZ);
  265.  
  266.             if(GetPVarType(iPlayer, "MedicCall")) {
  267.                 ClearAnimations(iPlayer);
  268.                 ApplyAnimation(iPlayer, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
  269.             }
  270.             DeletePVar(iPlayer, "StreamPrep");
  271.         }
  272.     }
  273.     SetCameraBehindPlayer(iPlayer);
  274.     Streamer_UpdateEx(iPlayer, fPosX, fPosY, fPosZ);
  275. }
  276.  
  277. public OnFilterScriptExit()
  278. {
  279.     return 1;
  280. }
  281.  
  282. public OnPlayerRequestClass(playerid, classid)
  283. {
  284.     if(PlayerInfo[playerid][pBanned] == 1)
  285. {
  286.     Ban(playerid);
  287. }
  288.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  289.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  290.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  291.  
  292.     return 1;
  293. }
  294.  
  295. public OnPlayerConnect(playerid)
  296. {
  297.     if(fexist(UserPath(playerid)))
  298.     {
  299.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  300.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
  301.     }
  302.     else
  303.     {
  304.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
  305.     }
  306.     new string[520];
  307.     playersonline++;
  308.     new Name[MAX_PLAYER_NAME];
  309.     GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
  310.     format(string,sizeof string,"{00FFFF}%s{FF0000} (ID: {00FFFF}%d{FF0000}) has joined the server!.There are currently {00FFFF}%d {FF0000}players online.",Name, playerid, playersonline);
  311.     SendClientMessageToAll(COLOR_GREEN, string);
  312.     return 1;
  313. }
  314.  
  315. public OnPlayerDisconnect(playerid, reason)
  316. {
  317.     new INI:File = INI_Open(UserPath(playerid));
  318.     INI_SetTag(File,"data");
  319.     INI_WriteInt(File,"Money",GetPlayerMoney(playerid));
  320.     INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  321.     INI_WriteInt(File,"pVW",PlayerInfo[playerid][pVW]);
  322.     INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
  323.     INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVip]);
  324.     INI_WriteInt(File,"Jailed",PlayerInfo[playerid][pJailed]);
  325.     INI_WriteInt(File,"Jail Time",PlayerInfo[playerid][pJailTime]);
  326.     INI_WriteInt(File,"Prisoned By",PlayerInfo[playerid][pPrisonedBy]);
  327.     INI_WriteInt(File,"Prison Reason",PlayerInfo[playerid][pPrisonReason]);
  328.     INI_WriteInt(File,"Int",PlayerInfo[playerid][pInt]);
  329.     INI_WriteInt(File,"Warnings",PlayerInfo[playerid][pWarns]);
  330.     INI_Close(File);
  331.     new string[128];
  332.     playersonline--;
  333.     new pName[MAX_PLAYER_NAME];
  334.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  335.     format(string, sizeof(string), "{04FBE2}%s {B004FB}has left the server. See you soon.", pName);
  336.     SendClientMessageToAll(COLOR_GREEN, string);
  337.     return 1;
  338. }
  339.  
  340. public OnPlayerSpawn(playerid)
  341. {
  342.     return 1;
  343. }
  344.  
  345. forward LoadUser_data(playerid,name[],value[]);
  346. public LoadUser_data(playerid,name[],value[])
  347. {
  348.     INI_Int("Password",PlayerInfo[playerid][pPassword]);
  349.     INI_Int("pVW",PlayerInfo[playerid][pVW]);
  350.     INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  351.     INI_Int("Money",PlayerInfo[playerid][pMoney]);
  352.     INI_Int("Banned", PlayerInfo[playerid][pBanned]);
  353.     INI_Int("VIP", PlayerInfo[playerid][pVip]);
  354.     INI_Int("Jailed", PlayerInfo[playerid][pJailed]);
  355.     INI_Int("Jail Time", PlayerInfo[playerid][pJailTime]);
  356.     INI_Int("Prisoned By", PlayerInfo[playerid][pPrisonedBy]);
  357.     INI_Int("Prison Reason", PlayerInfo[playerid][pPrisonReason]);
  358.     INI_Int("Int", PlayerInfo[playerid][pInt]);
  359.     INI_Int("Warnings", PlayerInfo[playerid][pWarns]);
  360.     return 1;
  361. }
  362.  
  363. public OnPlayerDeath(playerid, killerid, reason)
  364. {
  365.     return 1;
  366. }
  367.  
  368. public OnVehicleSpawn(vehicleid)
  369. {
  370.     return 1;
  371. }
  372.  
  373. public OnVehicleDeath(vehicleid, killerid)
  374. {
  375.     return 1;
  376. }
  377.  
  378. public OnPlayerText(playerid, text[])
  379. {
  380.     if(PlayerInfo[playerid][pVip] == 1)
  381.     {
  382.     new string[128];
  383.     format(string, sizeof(string), "[Silver VIP] {FFFFFF}%s {FC9C0C}says: {00FFFF}%s", GetName(playerid), text);
  384.     SendClientMessageToAll(COLOR_SILVER_VIP, string);
  385.     }
  386.     else if(PlayerInfo[playerid][pVip] == 2)
  387.     {
  388.     new string[128];
  389.     format(string, sizeof(string), "[Bronze VIP] {FFFFFF}%s {FC9C0C}says: {00FFFF}%s", GetName(playerid), text);
  390.     SendClientMessageToAll(COLOR_BRONZE_VIP, string);
  391.     }
  392.     else if(PlayerInfo[playerid][pVip] == 3)
  393.     {
  394.     new string[128];
  395.     format(string, sizeof(string), "[GOLD VIP] {FFFFFF}%s {FC9C0C}says: {00FFFF}%s", GetName(playerid), text);
  396.     SendClientMessageToAll(COLOR_GOLD_VIP, string);
  397.     }
  398.     else
  399.     {
  400.     new string[128];
  401.     format(string, sizeof(string), "{FFFFFF}%s {FC9C0C}says: {00FFFF}%s", GetName(playerid), text);
  402.     SendClientMessageToAll(COLOR_RED, string);
  403.     }
  404.     return 0;
  405. }
  406.  
  407. public OnPlayerCommandText(playerid, cmdtext[])
  408. {
  409.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  410.     {
  411.         // Do something here
  412.         return 1;
  413.     }
  414.     return 0;
  415. }
  416.  
  417. /*---------STOCKS----------*/
  418. stock GetName(playerid)
  419. {
  420.     new
  421.         pName[MAX_PLAYER_NAME];
  422.  
  423.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  424.     return pName;
  425. }
  426.  
  427. stock ErrorMessages(playerid, errorID)
  428. {
  429. if(errorID == 1)  return SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command.");
  430. return 1;
  431. }
  432.  
  433. stock IsInvalidSkin(skin)
  434. {
  435.     #define MAX_BAD_SKINS   15
  436.     new badSkins[MAX_BAD_SKINS] =
  437.     {
  438.         1, 3, 4, 5, 6, 8, 42, 65, 74, 86,
  439.         119, 149, 208, 273, 289
  440.     };
  441.  
  442.     for (new i = 0; i < MAX_BAD_SKINS; i++)
  443.     {
  444.         if (skin == badSkins[i] || skin < 0 || skin >= 300 ) return true;
  445.     }
  446.  
  447.     return false;
  448. }
  449.  
  450. stock CreateVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, playerid = INVALID_PLAYER_ID)
  451. {
  452.     new string[128];
  453.     format(string, sizeof(string), "(%d, %f, %f, %f, %f, %d, %d, %d) (%s)", modelid, x, y, z, angle, color1, color2, respawn_delay, GetPlayerNameEx(playerid));
  454.  
  455.     new id = CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay);
  456.  
  457.     format(string, sizeof(string), "-> [%d]", id);
  458.     return id;
  459. }
  460.  
  461. public BroadCast(color,string[])
  462. {
  463.     SendClientMessageToAll(color, string);
  464.     return 1;
  465. }
  466.  
  467. IsNumeric(const string[])
  468. {
  469.     for (new i = 0, j = strlen(string); i < j; i++)
  470.     {
  471.         if (string[i] > '9' || string[i] < '0') return 0;
  472.     }
  473.     return 1;
  474. }
  475.  
  476. GetVehicleModelIDFromName(vname[])
  477. {
  478.     for(new i = 0; i < 211; i++)
  479.     {
  480.         if ( strfind(VehicleName[i], vname, true) != -1 )
  481.             return i + MIN_VEHI_ID;
  482.     }
  483.     return -1;
  484. }
  485.  
  486. stock ABroadCastEx(color,string[])
  487. {
  488.     foreach(Player, i)
  489.     {
  490.         if (PlayerInfo[i][pAdmin] >= 2)
  491.         {
  492.             SendClientMessage(i, color, string);
  493.             //printf("%s", string);
  494.         }
  495.     }
  496.     return 1;
  497. }
  498.  
  499. stock VBroadCast(color,string[])
  500. {
  501.     foreach(Player, i)
  502.     {
  503.         if((PlayerInfo[i][pVip] >= 1 || PlayerInfo[i][pAdmin] >= 3))
  504.         {
  505.             SendClientMessage(i, color, string);
  506.             //printf("%s", string);
  507.         }
  508.     }
  509.     return 1;
  510. }
  511.  
  512. stock ABroadCast(color,string[],level)
  513. {
  514.     foreach(Player, i)
  515.     {
  516.         if (PlayerInfo[i][pAdmin] >= level)
  517.         {
  518.             SendClientMessage(i, color, string);
  519.             //printf("%s", string);
  520.         }
  521.     }
  522.     return 1;
  523. }
  524. stock Error(playerid, text[])
  525. {
  526.     return SendClientMessage(playerid, COLOR_GRAD2, text);
  527. }
  528.  
  529. stock Syntax(playerid, command[], params[])
  530. {
  531.     new string[128];
  532.     format(string, sizeof(string), "USAGE: /%s %s", command, params);
  533.     return SendClientMessage(playerid, COLOR_GRAD2, string);
  534. }
  535.  
  536. stock IsAdmin(playerid)
  537. {
  538.     if(PlayerInfo[playerid][pAdmin] >= 1)
  539.         return 1;
  540.     else
  541.         return 0;
  542. }
  543.  
  544. stock UserPath(playerid)
  545. {
  546.     new string[128],playername[MAX_PLAYER_NAME];
  547.     GetPlayerName(playerid,playername,sizeof(playername));
  548.     format(string,sizeof(string),PATH,playername);
  549.     return string;
  550. }
  551.  
  552. stock GetPlayerNameEx(playerid)
  553. {
  554.      new pName[25];
  555.      GetPlayerName(playerid, pName, sizeof(pName));
  556.      return pName;
  557. }
  558.  
  559. stock udb_hash(buf[]) {
  560.     new length=strlen(buf);
  561.     new s1 = 1;
  562.     new s2 = 0;
  563.     new n;
  564.     for (n=0; n<length; n++)
  565.     {
  566.        s1 = (s1 + buf[n]) % 65521;
  567.        s2 = (s2 + s1)     % 65521;
  568.     }
  569.     return (s2 << 16) + s1;
  570. }
  571.  
  572. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  573. {
  574.     return 1;
  575. }
  576.  
  577. public OnPlayerExitVehicle(playerid, vehicleid)
  578. {
  579.     return 1;
  580. }
  581.  
  582. public OnPlayerStateChange(playerid, newstate, oldstate)
  583. {
  584.     return 1;
  585. }
  586.  
  587. public OnPlayerEnterCheckpoint(playerid)
  588. {
  589.     return 1;
  590. }
  591.  
  592. public OnPlayerLeaveCheckpoint(playerid)
  593. {
  594.     return 1;
  595. }
  596.  
  597. public OnPlayerEnterRaceCheckpoint(playerid)
  598. {
  599.     return 1;
  600. }
  601.  
  602. public OnPlayerLeaveRaceCheckpoint(playerid)
  603. {
  604.     return 1;
  605. }
  606.  
  607. public OnRconCommand(cmd[])
  608. {
  609.     return 1;
  610. }
  611.  
  612. public OnPlayerRequestSpawn(playerid)
  613. {
  614.     return 1;
  615. }
  616.  
  617. public OnObjectMoved(objectid)
  618. {
  619.     return 1;
  620. }
  621.  
  622. public OnPlayerObjectMoved(playerid, objectid)
  623. {
  624.     return 1;
  625. }
  626.  
  627. public OnPlayerPickUpPickup(playerid, pickupid)
  628. {
  629.     return 1;
  630. }
  631.  
  632. public OnVehicleMod(playerid, vehicleid, componentid)
  633. {
  634.     return 1;
  635. }
  636.  
  637. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  638. {
  639.     return 1;
  640. }
  641.  
  642. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  643. {
  644.     return 1;
  645. }
  646.  
  647. public OnPlayerSelectedMenuRow(playerid, row)
  648. {
  649.     return 1;
  650. }
  651.  
  652. public OnPlayerExitedMenu(playerid)
  653. {
  654.     return 1;
  655. }
  656.  
  657. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  658. {
  659.     return 1;
  660. }
  661.  
  662. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  663. {
  664.     return 1;
  665. }
  666.  
  667. public OnRconLoginAttempt(ip[], password[], success)
  668. {
  669.     return 1;
  670. }
  671.  
  672. public OnPlayerUpdate(playerid)
  673. {
  674.     return 1;
  675. }
  676.  
  677. public OnPlayerStreamIn(playerid, forplayerid)
  678. {
  679.     return 1;
  680. }
  681.  
  682. public OnPlayerStreamOut(playerid, forplayerid)
  683. {
  684.     return 1;
  685. }
  686.  
  687. public OnVehicleStreamIn(vehicleid, forplayerid)
  688. {
  689.     return 1;
  690. }
  691.  
  692. public OnVehicleStreamOut(vehicleid, forplayerid)
  693. {
  694.     return 1;
  695. }
  696.  
  697. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  698. {
  699.     switch( dialogid )
  700.     {
  701.         case DIALOG_REGISTER:
  702.         {
  703.             if (!response) return Kick(playerid);
  704.             if(response)
  705.             {
  706.                 new IP[22];
  707.                 GetPlayerIp(playerid, IP, sizeof(IP));
  708.                 if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""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");
  709.                 new INI:File = INI_Open(UserPath(playerid));
  710.                 INI_SetTag(File,"data");
  711.                 INI_WriteInt(File,"Password",udb_hash(inputtext));
  712.                 INI_WriteInt(File,"Money",0);
  713.                 INI_WriteInt(File,"pVW",0);
  714.                 INI_WriteString(File, "Ip", IP);
  715.                 INI_WriteInt(File,"Admin",0);
  716.                 INI_Close(File);
  717.             }
  718.         }
  719.  
  720.         case DIALOG_LOGIN:
  721.         {
  722.             if ( !response ) return Kick ( playerid );
  723.             if( response )
  724.             {
  725.                 if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
  726.                 {
  727.                     INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  728.                     GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
  729.                     ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
  730.                 }
  731.                 else
  732.                 {
  733.                     ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
  734.                 }
  735.                 return 1;
  736.             }
  737.         }
  738.     }
  739.     return 1;
  740. }
  741.  
  742. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  743. {
  744.     return 1;
  745. }
  746.  
  747. CMD:setadmin(playerid, params[])
  748. {
  749.     new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
  750.     if(PlayerInfo[playerid][pAdmin] >= 4)
  751.     {
  752.         if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadmin [id] [level]");
  753.         if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Player was not found.");
  754.         if (admlvl > 4 || admlvl < 0) return SendClientMessage(playerid, COLOR_GREY,"Invalid Level , Available : 1-4");
  755.         PlayerInfo[id][pAdmin] = admlvl;
  756.         GetPlayerName(id, victimname, sizeof(victimname));
  757.         GetPlayerName(playerid, adminname, sizeof(adminname));
  758.         new string[128];
  759.         format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has made %s a level %d admin", adminname, victimname, admlvl);
  760.         ABroadCast(COLOR_YELLOW, string, 2);
  761.         format(string,128,"%s has set your admin level to %i",adminname, admlvl);
  762.         SendClientMessage(id,0xFF0000C8,string);
  763.         return 1;
  764.     }
  765.     return SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command");
  766. }
  767.  
  768. CMD:setvip(playerid, params[])
  769. {
  770.     new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], viplevel, id;
  771.     if(PlayerInfo[playerid][pAdmin] >= 3)
  772.     {
  773.     if (sscanf(params, "ui", id, viplevel)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /setvip [playerid] [VIP Level(0-3)]");
  774.     if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
  775.     if (viplevel > 3 || viplevel < 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid VIP Level");
  776.     PlayerInfo[id][pVip] = viplevel;
  777.     GetPlayerName(id, victimname, sizeof(victimname));
  778.     GetPlayerName(playerid, adminname, sizeof(adminname));
  779.     new str[128];
  780.     format(str, sizeof(str), "{AA3333}AdmWarning{FFFF00}: %s has set %s's vip level to %d", adminname, victimname, viplevel);
  781.     ABroadCast(COLOR_YELLOW, str, 2);
  782.     format(str, sizeof(str), "%s has set your vip level to %d", adminname, viplevel);
  783.     SendClientMessage(id, COLOR_RED, str);
  784.     return 1;
  785.     }
  786.     return ErrorMessages(playerid, 1);
  787. }
  788.  
  789. CMD:rconadmin(playerid, params[])
  790. {
  791.     new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
  792.     if(IsPlayerAdmin(playerid))
  793.     {
  794.         if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /rconadmin [id] [level]");
  795.         if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Player was not found.");
  796.         if (admlvl > 4 || admlvl < 0) return SendClientMessage(playerid, COLOR_GREY,"Invalid Level , Available : 1-4");
  797.         PlayerInfo[id][pAdmin] = admlvl;
  798.         GetPlayerName(id, victimname, sizeof(victimname));
  799.         GetPlayerName(playerid, adminname, sizeof(adminname));
  800.         new string[128];
  801.         format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has made %s a level %d admin with the rcon password", adminname, victimname, admlvl);
  802.         ABroadCast(COLOR_YELLOW, string, 2);
  803.         format(string,128,"%s has set your admin level to %i",adminname, admlvl);
  804.         SendClientMessage(id,0xFF0000C8,string);
  805.         return 1;
  806.     }
  807.     return SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command");
  808. }
  809.  
  810. forward LoadIP_data(playerid, name[], value[]);
  811. public LoadIP_data(playerid, name[], value[]) //Creating a new Public function for use later.
  812. {
  813.     INI_String("Ip", PlayerInfo[ playerid ][ BannedIP ], 33); //Loading the string "Ip", and assigning it to our string "BannedIP", with the maximum size of 33.
  814.     return 1; //Returning 1 for it to work.
  815. }
  816.  
  817. CMD:a(playerid, params[])
  818. {
  819.     if(PlayerInfo[playerid][pAdmin] >= 1)
  820.     {
  821.         if(!isnull(params))
  822.         {
  823.             new szMessage[128];
  824.             if(PlayerInfo[playerid][pAdmin] == 1)
  825.             {
  826.                 SendClientMessage(playerid, COLOR_GREY, "Junior Admins can't use the admin chat.");
  827.                 format(szMessage, sizeof(szMessage), "Junior Admin %s has tried to use /a : %s", GetPlayerNameEx(playerid), params);
  828.                 ABroadCastEx(COLOR_GREEN, szMessage);
  829.             }
  830.             else if(PlayerInfo[playerid][pAdmin] == 2)
  831.             {
  832.                 format(szMessage, sizeof(szMessage), "*{B300FF} General Admin {00FFFF}%s: {FFFFFF}%s", GetPlayerNameEx(playerid), params);
  833.                 ABroadCast(COLOR_GREEN, szMessage, 2);
  834.             }
  835.             else if(PlayerInfo[playerid][pAdmin] == 3)
  836.             {
  837.                 format(szMessage, sizeof(szMessage), "*{DFF709} Head Admin {00FFFF}%s: {FFFFFF}%s", GetPlayerNameEx(playerid), params);
  838.                 ABroadCast(COLOR_GREEN, szMessage, 2);
  839.             }
  840.             else if(PlayerInfo[playerid][pAdmin] == 4)
  841.             {
  842.             format(szMessage, sizeof(szMessage), "*{FF0000} Director {00FFFF}%s: {FFFFFF}%s", GetPlayerNameEx(playerid), params);
  843.             ABroadCast(COLOR_GREEN, szMessage, 2);
  844.             }
  845.             else SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/a)dmin [admin chat]");
  846.             }
  847.     return 1;
  848.     }
  849.     return 1;
  850.     }
  851.  
  852.  
  853. public SendAdminMessage(color, string[])
  854. {
  855.     foreach(Player, i)
  856.     {
  857.             if(PlayerInfo[i][pAdmin] >= 1)
  858.             {
  859.                 SendClientMessage(i, color, string);
  860.             }
  861.     }
  862. }
  863.  
  864. CMD:am(playerid, params[])
  865. {
  866.     if(IsAdmin(playerid))
  867.     {
  868.         new toid, message[128];
  869.         if(sscanf(params, "is[128]", toid, message)) return Syntax(playerid, "[a]dmin[m]essage", "[playerid] [message]");
  870.         if(strlen(message) > 128) return Error(playerid, "Your message cannot be longer than 128 characters.");
  871.         if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
  872.         new string[128];
  873.         format(string, sizeof(string), "Admin message from %s: %s", GetPlayerNameEx(playerid), message);
  874.         SendClientMessage(toid, COLOR_GREEN, string);
  875.         format(string, sizeof(string), "Admin %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
  876.         SendAdminMessage(COLOR_GREEN,string);
  877.     }
  878.     else
  879.     {
  880.         new message[80];
  881.         if(sscanf(params, "s[80]", message)) return Syntax(playerid, "[a]dmin[m]essage", "[message]");
  882.         if(strlen(message) > 80) return Error(playerid, "Your message cannot be longer than 80 characters.");
  883.         //if(strfind(message, "Falling", true) != -1) return Error(playerid, "Type (/falling) and a administrative person will be there to assist you right away!");
  884.         new string[128];
  885.         format(string, sizeof(string), "Admin message from %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
  886.         SendAdminMessage(COLOR_GREEN,string);
  887.         format(string, sizeof(string), "Your message, %s, has been sent.", message);
  888.         SendClientMessage(playerid, COLOR_GREEN, string);
  889.         format(string, sizeof(string), "Player %s [%d] > Admins: %s", GetPlayerNameEx(playerid), playerid, message);
  890.     }
  891.     return 1;
  892. }
  893.  
  894. CMD:god(playerid, params[])
  895. {
  896.   if(PlayerInfo[playerid][pAdmin] >= 1)
  897.   {
  898.             switch(Godmode[playerid]) {
  899.                 case 0: {
  900.                     Godmode[playerid] = 1;
  901.                     new string[128];
  902.                     SetPlayerHealth(playerid, 500000);
  903.                     SetPlayerArmour(playerid, 500000);
  904.                     new pName[MAX_PLAYER_NAME];
  905.                     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  906.                     format(string, sizeof(string), "(GODMODE): %s!", pName);
  907.                     SetPlayerChatBubble(playerid,string,COLOR_WHITE,60.0,10000000000000);
  908.                     SendClientMessage(playerid, COLOR_RED, "You just activated god mode");
  909.                 }
  910.                 case 1: {
  911.                     Godmode[playerid] = 0;
  912.                     SetPlayerHealth(playerid, 100);
  913.                     SetPlayerArmour(playerid, 100);
  914.                     SendClientMessage(playerid, COLOR_RED, "You just deactivated god mode");
  915.                     SetPlayerChatBubble(playerid,"GODMODE: OFF" ,COLOR_WHITE,60.0,1);
  916.  
  917.             }
  918.         }
  919. }
  920.   else return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command");
  921.   {
  922.   return 1;
  923.   }
  924. }
  925.  
  926. CMD:ah(playerid, params[])
  927. {
  928.     new str[2000];
  929.     if (PlayerInfo[playerid][pAdmin] >= 1)
  930.     {
  931.         strcat(str, "*** {04FBCA}Junior Admin {FFFFFF}*** /ah, /am, /a, /god, /aduty, /veh, /o, /kick, /jail, /jetpack\n");
  932.     }
  933.     if (PlayerInfo[playerid][pAdmin] >= 2)
  934.     {
  935.         strcat(str, "*** {B300FF}General Admin {FFFFFF}*** /gotoid, /get, /spec, /slap, /freeze, /unfreeze, /setskin\n");
  936.     }
  937.     if (PlayerInfo[playerid][pAdmin] >= 3)
  938.     {
  939.         strcat(str, "*** {DFF709}Head Admin {FFFFFF}*** /ban, /oban, /unban, /setvip, /givemoney\n");
  940.     }
  941.     if (PlayerInfo[playerid][pAdmin] >= 4)
  942.     {
  943.         strcat(str, "*** {FF0000}Director {FFFFFF}*** All CMD's Below and /setadmin\n");
  944.     }
  945.     if (PlayerInfo[playerid][pAdmin] >= 1)
  946.     {
  947.         ShowPlayerDialog(playerid, DIALOG_ADMIN_HELP, DIALOG_STYLE_MSGBOX, "{33AA33}Administration Commands", str, "Ok", "Cancel");
  948.     }
  949.     return 1;
  950. }
  951.  
  952. CMD:ban(playerid, params[])
  953. {
  954.     new id, reason[50], string[128], banned[MAX_PLAYER_NAME];
  955.     if(PlayerInfo[playerid][pAdmin] >= 3)
  956.     {
  957.     if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [playerid] [reason(optional)]");
  958.     GetPlayerName(id, banned, sizeof(banned));
  959.     format(string, sizeof(string), "AdmCmd: %s has been banned by %s, reason: %s", banned, GetName(playerid), reason);
  960.     SendClientMessageToAll(0xFF0000C8, string);
  961.     new str[3600];
  962.     new year, month, day;
  963.     getdate(year, month, day);
  964.     format(str,128,"{FFFFFF}You have been banned by {00FFF2}%s {FFFFFF}for {7C44EB}%s {FFFFFF}on [%d/%d/%d].\nIf you think you were banned unfairly please appeal at www.Your-Web.com.\nIf you think you were bugged please relog.\nTake a screenshot of this and post at the appeal , you are required to do this.",GetName(playerid), reason, day, month, year);
  965.     ShowPlayerDialog(id, DIALOG_SHOW_INFO2, DIALOG_STYLE_MSGBOX, "{FF0000}Banned", str, "Ok", "Cancel");
  966.     SetPlayerChatBubble(id,"Banned Player" ,COLOR_RED,60.0,999999999999999);
  967.     SendClientMessage(id, COLOR_GREY, "Server closed connection");
  968.     TogglePlayerControllable(id,0);
  969.     PlayerInfo[id][pBanned] = 1;
  970.     }
  971.     else SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command");
  972.     return 1;
  973. }
  974.  
  975. CMD:kick(playerid, params[])
  976. {
  977.     new id, reason[50], string[128], kicked[MAX_PLAYER_NAME];
  978.     if(PlayerInfo[playerid][pAdmin] >= 1)
  979.     {
  980.     if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason(optional)]");
  981.     GetPlayerName(id, kicked, sizeof(kicked));
  982.     format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", kicked, GetName(playerid), reason);
  983.     SendClientMessageToAll(0xFF0000C8, string);
  984.     new str[3600];
  985.     new year, month, day;
  986.     getdate(year, month, day);
  987.     format(str,128,"{FFFFFF}You have been kicked by {00FFF2}%s {FFFFFF}for {7C44EB}%s {FFFFFF}on [%d/%d/%d]",GetName(playerid), reason, day, month, year);
  988.     ShowPlayerDialog(id, DIALOG_SHOW_INFO2, DIALOG_STYLE_MSGBOX, "{FF0000}Kicked", str, "Ok", "Cancel");
  989.     KickEx(id, reason);
  990.     }
  991.     else SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command");
  992.     return 1;
  993. }
  994.  
  995. CMD:gotoid(playerid, params[])
  996. {
  997.     new giveplayerid;
  998.  
  999.     if(sscanf(params, "u", giveplayerid))
  1000.         return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotoid [playerid/partofname]");
  1001.  
  1002.     new Float:plocx,Float:plocy,Float:plocz;
  1003.     if(IsPlayerConnected(giveplayerid))
  1004.     {
  1005.         if(PlayerInfo[playerid][pAdmin] >= 2)
  1006.         {
  1007.             if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING)
  1008.             {
  1009.                 SendClientMessage(playerid, COLOR_GREY, "That player is spectating someone.");
  1010.                 return 1;
  1011.             }
  1012.             if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
  1013.             {
  1014.                 SendClientMessage(playerid, COLOR_GREY, "You can't do this while spectating.");
  1015.                 return 1;
  1016.             }
  1017.             GetPlayerPos(giveplayerid, plocx, plocy, plocz);
  1018.             Streamer_UpdateEx(playerid, plocx, plocy, plocz);
  1019.  
  1020.             if(GetPlayerState(playerid) == 2)
  1021.             {
  1022.                 new tmpcar = GetPlayerVehicleID(playerid);
  1023.                 SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
  1024.                 TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
  1025.                 fVehSpeed[playerid] = 0.0;
  1026.             }
  1027.             else
  1028.             {
  1029.                 SetPlayerPos(playerid,plocx,plocy+2, plocz);
  1030.             }
  1031.  
  1032.             SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  1033.             SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  1034.             new giveplayeridvw = GetPlayerVirtualWorld(giveplayerid);
  1035.             PlayerInfo[playerid][pVW] = giveplayeridvw;
  1036.  
  1037.             SendClientMessage(playerid, COLOR_WHITE, "You have been teleported!");
  1038.         }
  1039.         else
  1040.         {
  1041.             SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use that command!");
  1042.         }
  1043.  
  1044.     }
  1045.     else SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
  1046.     return 1;
  1047. }
  1048.  
  1049. CMD:get(playerid, params[])
  1050. {
  1051.     new giveplayerid;
  1052.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gethere [playerid/partofname]");
  1053.  
  1054.     new Float:plocx,Float:plocy,Float:plocz;
  1055.     if(IsPlayerConnected(giveplayerid))
  1056.     {
  1057.         if(PlayerInfo[playerid][pAdmin] >= 2)
  1058.         {
  1059.             if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING)
  1060.             {
  1061.                 SendClientMessage(playerid, COLOR_GREY, "That player is spectating someone.");
  1062.                 return 1;
  1063.             }
  1064.             GetPlayerPos(playerid, plocx, plocy, plocz);
  1065.             Streamer_UpdateEx(giveplayerid, plocx, plocy, plocz);
  1066.             SetPVarInt(playerid, "BeingTeleported", 1);
  1067.  
  1068.             if(GetPlayerState(giveplayerid) == 2)
  1069.             {
  1070.                 TelePos[giveplayerid][0] = 0.0;
  1071.                 TelePos[giveplayerid][1] = 0.0;
  1072.                 fVehSpeed[giveplayerid] = 0.0;
  1073.                 new tmpcar = GetPlayerVehicleID(giveplayerid);
  1074.                 SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
  1075.                 LinkVehicleToInterior(GetPlayerVehicleID(giveplayerid), GetPlayerInterior(playerid));
  1076.                 SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
  1077.                 SetVehicleVirtualWorld(GetPlayerVehicleID(giveplayerid), GetPlayerVirtualWorld(playerid));
  1078.                 SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
  1079.             }
  1080.             else
  1081.             {
  1082.                 SetPlayerPos(giveplayerid,plocx,plocy+2, plocz);
  1083.             }
  1084.  
  1085.             SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
  1086.             SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
  1087.             new playeridvw = GetPlayerVirtualWorld(playerid);
  1088.             PlayerInfo[giveplayerid][pVW] = playeridvw;
  1089.  
  1090.             SendClientMessage(giveplayerid, COLOR_WHITE, "You have been teleported!");
  1091.         }
  1092.         else
  1093.         {
  1094.             SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use that command!");
  1095.         }
  1096.  
  1097.     }
  1098.     else SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
  1099.     return 1;
  1100. }
  1101.  
  1102. CMD:spec(playerid, params[])
  1103. {
  1104.     if(PlayerInfo[playerid][pAdmin] < 1)
  1105.     {
  1106.         SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use that command!");
  1107.         return 1;
  1108.     }
  1109.     if(strcmp(params, "off", true) == 0)
  1110.     {
  1111.         if(Spectating[playerid] > 0 && PlayerInfo[playerid][pAdmin] >= 1)
  1112.         {
  1113.             GettingSpectated[Spectate[playerid]] = 999;
  1114.             Spectating[playerid] = 0;
  1115.             Spectate[playerid] = 999;
  1116.             SetPVarInt(playerid, "SpecOff", 1);
  1117.             TogglePlayerSpectating(playerid, false);
  1118.             SetCameraBehindPlayer(playerid);
  1119.             return 1;
  1120.         }
  1121.         else
  1122.         {
  1123.             SendClientMessage(playerid, COLOR_GREY, "You're not spectating anyone.");
  1124.             return 1;
  1125.         }
  1126.     }
  1127.     if(strcmp(params, "o", true) == 0)
  1128.     {
  1129.         if(Spectating[playerid] > 0 && PlayerInfo[playerid][pAdmin] >= 1)
  1130.         {
  1131.             GettingSpectated[Spectate[playerid]] = 999;
  1132.             Spectating[playerid] = 0;
  1133.             Spectate[playerid] = 999;
  1134.             SetPVarInt(playerid, "SpecOff", 1);
  1135.             TogglePlayerSpectating(playerid, false);
  1136.             SetCameraBehindPlayer(playerid);
  1137.             return 1;
  1138.         }
  1139.         else
  1140.         {
  1141.             SendClientMessage(playerid, COLOR_GREY, "You're not spectating anyone.");
  1142.             return 1;
  1143.         }
  1144.     }
  1145.  
  1146.     new giveplayerid;
  1147.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spec (player/off)");
  1148.     if(IsPlayerConnected(giveplayerid))
  1149.     {
  1150.         if(Spectating[playerid] == 0)
  1151.         {
  1152.             new Float: pPositions[ 3 ];
  1153.             GetPlayerPos(playerid, pPositions[0], pPositions[1], pPositions[2]);
  1154.             SetPVarFloat(playerid, "SpecPosX", pPositions[0]);
  1155.             SetPVarFloat(playerid, "SpecPosY", pPositions[1]);
  1156.             SetPVarFloat(playerid, "SpecPosZ", pPositions[2]);
  1157.             SetPVarInt(playerid, "SpecInt", GetPlayerInterior(playerid));
  1158.             SetPVarInt(playerid, "SpecVW", GetPlayerVirtualWorld(playerid));
  1159.             if(IsPlayerInAnyVehicle(giveplayerid))
  1160.             {
  1161.                 TogglePlayerSpectating(playerid, true);
  1162.                 new carid = GetPlayerVehicleID(giveplayerid);
  1163.                 PlayerSpectateVehicle(playerid, carid);
  1164.                 SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  1165.                 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  1166.             }
  1167.             else
  1168.             {
  1169.                 TogglePlayerSpectating(playerid, true);
  1170.                 PlayerSpectatePlayer(playerid, giveplayerid);
  1171.                 SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  1172.                 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  1173.             }
  1174.             GettingSpectated[giveplayerid] = playerid;
  1175.             Spectate[playerid] = giveplayerid;
  1176.             Spectating[playerid] = 1;
  1177.         }
  1178.         else
  1179.         {
  1180.             if(IsPlayerInAnyVehicle(giveplayerid))
  1181.             {
  1182.                 TogglePlayerSpectating(playerid, true);
  1183.                 new carid = GetPlayerVehicleID(giveplayerid);
  1184.                 PlayerSpectateVehicle(playerid, carid);
  1185.                 SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  1186.                 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  1187.             }
  1188.             else
  1189.             {
  1190.                 TogglePlayerSpectating(playerid, true);
  1191.                 PlayerSpectatePlayer(playerid, giveplayerid);
  1192.                 SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  1193.                 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  1194.             }
  1195.             GettingSpectated[Spectate[playerid]] = 999;
  1196.             GettingSpectated[giveplayerid] = playerid;
  1197.             Spectate[playerid] = giveplayerid;
  1198.             Spectating[playerid] = 1;
  1199.         }
  1200.     }
  1201.     else
  1202.     {
  1203.         SendClientMessage(playerid, COLOR_WHITE, "Invalid Player");
  1204.     }
  1205.     return 1;
  1206. }
  1207.  
  1208. CMD:aduty(playerid, params[]) {
  1209.     if(PlayerInfo[playerid][pAdmin] >= 1)
  1210.     {
  1211.             new string[128];
  1212.             switch(aDuty[playerid]) {
  1213.                 case 0: {
  1214.                     aDuty[playerid] = 1;
  1215.                     SetPlayerHealth(playerid, 500000);
  1216.                     SetPlayerArmour(playerid, 500000);
  1217.                     format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s is now on administrative duty.", GetPlayerNameEx(playerid));
  1218.                     BroadCast(COLOR_GREEN, "   An administrative team member is now on duty.");
  1219.                     SetPlayerChatBubble(playerid,"Admin Duty" ,COLOR_GREEN,60.0,999999999999999);
  1220.                     SetPlayerColor(playerid,COLOR_GREEN);
  1221.                     ABroadCast(COLOR_YELLOW, string, 4);
  1222.                 }
  1223.                 case 1: {
  1224.                     aDuty[playerid] = 0;
  1225.                     SetPlayerHealth(playerid, 100);
  1226.                     SetPlayerArmour(playerid, 100);
  1227.                     format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s is now off administrative duty.", GetPlayerNameEx(playerid));
  1228.                     SetPlayerColor(playerid,TEAM_HIT_COLOR);
  1229.                     SetPlayerChatBubble(playerid,"Admin Duty OFF" ,COLOR_GREEN,60.0,1);
  1230.                     ABroadCast(COLOR_YELLOW, string, 4);
  1231.             }
  1232.         }
  1233.     }
  1234.     else
  1235.     {
  1236.         return Error(playerid, "You are not authorized to use this command.");
  1237.     }
  1238.     return 1;
  1239. }
  1240.  
  1241. CMD:oban(playerid, params[])
  1242. {
  1243.  if(PlayerInfo[playerid][pAdmin] >= 3)
  1244.     {
  1245.     new targetname[24], filestring[79];
  1246.     if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /oban [Player's Name]");
  1247.     format(filestring, sizeof(filestring), "/Users/%s.ini", targetname);
  1248.     if(!fexist(filestring)) return SendClientMessage(playerid, -COLOR_GREY, "Player was not found!");
  1249.     else
  1250.     {
  1251.         new INI:File = INI_Open(filestring);
  1252.         INI_SetTag(File, "data");
  1253.         INI_WriteInt(File, "Banned", 1);
  1254.         INI_Close(File);
  1255.         new done[128];
  1256.         new string[128];
  1257.         format(done, sizeof(done), "You have offline banned %s", targetname);
  1258.         format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has offline banned %s's account.", GetPlayerNameEx(playerid), targetname);
  1259.         ABroadCast(COLOR_YELLOW, string, 4);
  1260.         SendClientMessage(playerid,-1 , done);
  1261.      }
  1262. }
  1263.     return 1;
  1264. }
  1265.  
  1266. CMD:unban(playerid, params[])
  1267. {
  1268.     if(PlayerInfo[playerid][pAdmin] >= 3)
  1269.     {
  1270.     new tname[24];
  1271.     if(sscanf(params, "s[24]", tname)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /unban [Player Name] ");
  1272.     new filestring[79];
  1273.     format(filestring, sizeof(filestring), "/Users/%s.ini", tname);
  1274.     if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_GREY, "Invalid Offline Player.");
  1275.     else
  1276.     {
  1277.         new INI:File = INI_Open(filestring);
  1278.         INI_SetTag(File, "data");
  1279.         INI_WriteInt(File, "Banned",0);
  1280.         INI_Close(File);
  1281.         INI_ParseFile(filestring, "LoadIP_%s", .bExtra = true , .extra = playerid);
  1282.         new cmdstring[44];
  1283.         format(cmdstring, sizeof(cmdstring), "unbanip %s", PlayerInfo[playerid][BannedIP]);
  1284.         SendRconCommand(cmdstring);
  1285.         SendRconCommand("reloadbans");
  1286.         new done[128];
  1287.         format(done, sizeof(done),"You have successfully unbanned %s", tname);
  1288.         SendClientMessage(playerid, -1,done);
  1289.         new string[128];
  1290.         format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has unbanned %s's account.", GetPlayerNameEx(playerid), tname);
  1291.         ABroadCast(COLOR_YELLOW, string, 4);
  1292.     }
  1293. }
  1294.     return 1;
  1295. }
  1296.  
  1297. CMD:veh(playerid, params[]) {
  1298.     if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pVip] >= 1) {
  1299.  
  1300.         new iColors[2], vName[32];
  1301.  
  1302.         if(!sscanf(params, "s[32]ii", vName, iColors[0], iColors[1]))
  1303.         {
  1304.             new idx;
  1305.             if (!IsNumeric(vName))
  1306.             {
  1307.                 idx = GetVehicleModelIDFromName(vName);
  1308.             }
  1309.             else
  1310.             {
  1311.                 idx = strval(vName);
  1312.             }
  1313.  
  1314.             if( idx != -1 )
  1315.             {
  1316.                 if(idx > MIN_VEHI_ID && idx < MAX_VEHI_ID)
  1317.                 {
  1318.                     if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) {
  1319.                         SendClientMessage(playerid, COLOR_GRAD2, "Invalid colour specified (IDs start at 0, and end at 255).");
  1320.                     }
  1321.                     else for(new iIterator; iIterator < sizeof(CreatedCars); iIterator++) if(CreatedCars[iIterator] == INVALID_VEHICLE_ID) {
  1322.  
  1323.                         new
  1324.                             Float: fVehPos[4], string[128];
  1325.  
  1326.                         GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
  1327.                         GetPlayerFacingAngle(playerid, fVehPos[3]);
  1328.                         CreatedCars[iIterator] = CreateVehicleEx(idx, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
  1329.                         LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
  1330.  
  1331.                         format(string, sizeof(string), "Successfully spawned a %s (Vehicle Model: %d, Vehicle ID: %d, Color 1: %d, Color 2: %d)", VehicleName[idx - MIN_VEHI_ID], idx, CreatedCars[iIterator], iColors[0], iColors[1]);
  1332.                         return SendClientMessage(playerid, COLOR_GREY, string);
  1333.                     }
  1334.                 }
  1335.                 else
  1336.                 {
  1337.                     SendClientMessage(playerid, COLOR_GRAD2, "  Invalid Model Name/ID");
  1338.                 }
  1339.             }
  1340.             else
  1341.             {
  1342.                 SendClientMessage(playerid, COLOR_GRAD2, "  Invalid Model Name/ID!");
  1343.             }
  1344.         }
  1345.         else
  1346.         {
  1347.             SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [Model ID/Name] [color 1] [color 2]");
  1348.             return 1;
  1349.         }
  1350.     }
  1351.     else SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1352.     return 1;
  1353. }
  1354.  
  1355. CMD:o(playerid, params[])
  1356. {
  1357.     new string[258];
  1358.     if(PlayerInfo[playerid][pAdmin] >= 1)
  1359.     {
  1360.     if(isnull(params))
  1361.         return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/o) [Text]");
  1362.     }
  1363.     else SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1364.     {
  1365.     if(PlayerInfo[playerid][pAdmin] == 1)
  1366.     {
  1367.     format(string, sizeof(string), "[OOC] {B7B748}Junior Admin: {FF0000}%s: {FFFFFF}%s", GetName(playerid), params);
  1368.     SendClientMessageToAll(COLOR_RED, string);
  1369.     }
  1370.     if(PlayerInfo[playerid][pAdmin] == 2)
  1371.     {
  1372.     format(string, sizeof(string), "[OOC] {B7B748}General Admin: {FF0000}%s: {FFFFFF}%s", GetName(playerid), params);
  1373.     SendClientMessageToAll(COLOR_RED, string);
  1374.     }
  1375.     if(PlayerInfo[playerid][pAdmin] == 3)
  1376.     {
  1377.     format(string, sizeof(string), "[OOC] {B7B748}Head Admin: {FF0000}%s: {FFFFFF}%s", GetName(playerid), params);
  1378.     SendClientMessageToAll(COLOR_RED, string);
  1379.     }
  1380.     if(PlayerInfo[playerid][pAdmin] == 4)
  1381.     {
  1382.     format(string, sizeof(string), "[OOC] {B7B748}Director: {FF0000}%s: {FFFFFF}%s", GetName(playerid), params);
  1383.     SendClientMessageToAll(COLOR_RED, string);
  1384.     }
  1385. }
  1386.     return 1;
  1387.     }
  1388.  
  1389. CMD:akill(playerid, params[])
  1390. {
  1391.     new id;
  1392.     if(PlayerInfo[playerid][pAdmin] >= 1)
  1393.     {
  1394.     if(sscanf(params, "u", id))return SendClientMessage(playerid, COLOR_GREY, "USAGE: /akill [playerid]");
  1395.     SetPlayerHealth(id, 0);
  1396.     new string[128];
  1397.     format(string, sizeof(string), "Admin %s has killed you!", GetName(playerid));
  1398.     SendClientMessage(id, COLOR_RED, string);
  1399.     }
  1400.     else ErrorMessages(playerid, 1);
  1401.     return 1;
  1402.  }
  1403.  
  1404.  CMD:kill(playerid, params[])
  1405.  {
  1406.     SendClientMessage(playerid, COLOR_GREY, "This command has been removed due to abuse..");
  1407.     return 1;
  1408. }
  1409.  
  1410. /*
  1411. CMD:cpanel(playerid, params[]_
  1412. {
  1413.     if(PlayerInfo[playerid][pAdmin] >= 1)
  1414.     {
  1415.     ShowPlayerDialog(playerid, , DIALOG_STYLE_LIST, "Administration Control Panel", "", "OK", "Cancel");
  1416.  
  1417. */
  1418.  
  1419. CMD:v(playerid, params[])
  1420. {
  1421.     new string[512];
  1422.     if(!isnull(params))
  1423.     {
  1424.     SendClientMessage(playerid, COLOR_GREY, "USAGE: /v(ip) [Text]");
  1425.     }
  1426.     if(PlayerInfo[playerid][pVip] == 1) format(string, sizeof(string), "[[VIP Chat]] {C0C0C0}Silver Vip, {FF8040}%s : {FFFFFF}%s", GetName(playerid), params);
  1427.     else if(PlayerInfo[playerid][pVip] == 2) format(string, sizeof(string), "[[VIP Chat]] {8000FF}Bronze Vip, {FF8040}%s : {FFFFFF}%s", GetName(playerid), params);
  1428.     else if(PlayerInfo[playerid][pVip] == 3) format(string, sizeof(string), "[[VIP Chat]] {FFFF00}Gold Vip, {FF8040}%s : {FFFFFF}%s", GetName(playerid), params);
  1429.     else if(PlayerInfo[playerid][pAdmin] == 3) format(string, sizeof(string), "[[VIP Chat]] {ABFC03}Head Admin, {FF8040}%s : {FFFFFF}%s", GetName(playerid), params);
  1430.     else if(PlayerInfo[playerid][pAdmin] == 4) format(string, sizeof(string), "[[VIP Chat]] {FF0000}Director, {FF8040}%s : {FFFFFF}%s", GetName(playerid), params);
  1431.     VBroadCast(COLOR_VIP_CHAT, string);
  1432.     return 1;
  1433. }
  1434.  
  1435. CMD:vh(playerid, params[])
  1436. {
  1437.         new str[520];
  1438.         if(PlayerInfo[playerid][pVip] >= 1)
  1439.         {
  1440.         strcat(str, "*** {04FBCA}Silver VIP {FFFFFF}*** /veh\n");
  1441.         if(PlayerInfo[playerid][pVip] >= 2)
  1442.         {
  1443.         strcat(str, "*** {B300FF}Bronze VIP {FFFFFF}*** \n");
  1444.         }
  1445.         if(PlayerInfo[playerid][pVip] >= 3)
  1446.         {
  1447.         strcat(str, "*** {DFF709}GOLD VIP {FFFFFF}*** \n");
  1448.         }
  1449.         ShowPlayerDialog(playerid, DIALOG_SHOW_INFO, DIALOG_STYLE_MSGBOX, "{33AA33}VIP Commands", str, "Okay", "Cancel");
  1450.         }
  1451.         return 1;
  1452.         }
  1453.  
  1454. CMD:slap(playerid, params[])
  1455. {
  1456.     if (PlayerInfo[playerid][pAdmin] >=2)
  1457.     {
  1458.         new string[128], giveplayerid;
  1459.         if(sscanf(params, "i", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /slap [playerid]");
  1460.  
  1461.         new Float:shealth;
  1462.         new Float:slx, Float:sly, Float:slz;
  1463.  
  1464.         if(IsPlayerConnected(giveplayerid))
  1465.         {
  1466.  
  1467.             GetPlayerHealth(giveplayerid, shealth);
  1468.             SetPlayerHealth(giveplayerid, shealth-5);
  1469.             GetPlayerPos(giveplayerid, slx, sly, slz);
  1470.             SetPlayerPos(giveplayerid, slx, sly, slz+5);
  1471.             PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
  1472.             format(string, sizeof(string), "AdmCmd: %s was slapped by %s",GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
  1473.             ABroadCast(COLOR_LIGHTRED,string,2);
  1474.  
  1475.         }
  1476.     }
  1477.     else
  1478.     {
  1479.         SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1480.     }
  1481.     return 1;
  1482. }
  1483.  
  1484. CMD:jail(playerid, params[])
  1485. {
  1486.     new string[128], giveplayerid, minutes, reason[64];
  1487.     if(sscanf(params, "ids[64]", giveplayerid, minutes, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [playerid] [minutes] [reason]");
  1488.  
  1489.     if(minutes < 0 || minutes > 30) return SendClientMessage(playerid, COLOR_WHITE, "You can't jail for more than 30 minutes.");
  1490.     if (PlayerInfo[playerid][pAdmin] >= 1)
  1491.     {
  1492.         if(IsPlayerConnected(giveplayerid))
  1493.         {
  1494.  
  1495.             if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
  1496.             {
  1497.                 SendClientMessage(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
  1498.                 return 1;
  1499.             }
  1500.             if (GetPlayerState(giveplayerid) == 2)
  1501.             {
  1502.                 new Float:slx, Float:sly, Float:slz;
  1503.                 GetPlayerPos(giveplayerid, slx, sly, slz);
  1504.                 SetPlayerPos(giveplayerid, slx, sly, slz+5);
  1505.             }
  1506.             ResetPlayerWeapons(giveplayerid);
  1507.             new year, month,day;
  1508.             getdate(year, month, day);
  1509.             format(string, sizeof(string), "AdmCmd: %s has been jailed by %s, reason: %s", GetName(giveplayerid), GetName(playerid), reason);
  1510.             SendClientMessageToAll(COLOR_LIGHTRED, string);
  1511.             ResetPlayerWeapons(giveplayerid);
  1512.             PlayerInfo[giveplayerid][pJailed] = 1000;
  1513.             PlayerInfo[giveplayerid][pJailTime] = minutes*60;
  1514.             SetPlayerInterior(giveplayerid, 1);
  1515.             PlayerInfo[giveplayerid][pInt] = 1;
  1516.             new rand = random(sizeof(AJailSpawns));
  1517.             //Player_StreamPrep(giveplayerid, 1839.437,-1721.748,5202.700, 4000);
  1518.             Player_StreamPrep(giveplayerid, AJailSpawns[rand][0],AJailSpawns[rand][1],AJailSpawns[rand][2], 4000);
  1519.             SetPlayerFacingAngle(giveplayerid, 0);
  1520.             TogglePlayerControllable(giveplayerid, 1);
  1521.             //SetPlayerPos(giveplayerid, 1839.437,-1721.748,5202.700);
  1522.             SetPlayerPos(giveplayerid, AJailSpawns[rand][0], AJailSpawns[rand][1], AJailSpawns[rand][2]);
  1523.             PlayerInfo[giveplayerid][pVW] = 0;
  1524.             SetPlayerVirtualWorld(giveplayerid, 0);
  1525.             format(string, sizeof(string), "You are jailed for %d minutes.   Bail: Unable", minutes);
  1526.             SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
  1527.             format(PlayerInfo[giveplayerid][pPrisonedBy], 24, "%s", GetPlayerNameEx(playerid));
  1528.             format(PlayerInfo[giveplayerid][pPrisonReason], 128, "[OOC][JAIL] %s", reason);
  1529.         }
  1530.     }
  1531.     else
  1532.     {
  1533.         SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1534.     }
  1535.     return 1;
  1536. }
  1537.  
  1538. CMD:freeze(playerid, params[])
  1539. {
  1540.     if (PlayerInfo[playerid][pAdmin] >= 2)
  1541.     {
  1542.         new string[128], giveplayerid;
  1543.         if(sscanf(params, "i", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /freeze [playerid]");
  1544.  
  1545.         if(IsPlayerConnected(giveplayerid))
  1546.         {
  1547.             if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
  1548.             {
  1549.                 SendClientMessage(playerid, COLOR_GRAD2, "You can't freeze a higher admin.");
  1550.                 return 1;
  1551.             }
  1552.  
  1553.             TogglePlayerControllable(giveplayerid, 0);
  1554.             SetPVarInt(giveplayerid, "IsFrozen", 1);
  1555.             format(string, sizeof(string), "AdmCmd: %s was frozen by %s",GetPlayerNameEx(giveplayerid),GetPlayerNameEx(playerid));
  1556.             ABroadCast(COLOR_LIGHTRED,string,2);
  1557.         }
  1558.     }
  1559.     else
  1560.     {
  1561.         SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1562.     }
  1563.     return 1;
  1564. }
  1565.  
  1566. CMD:unfreeze(playerid, params[])
  1567. {
  1568.     if (PlayerInfo[playerid][pAdmin] >= 2)
  1569.     {
  1570.         new string[128], giveplayerid;
  1571.         if(sscanf(params, "i", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unfreeze [playerid]");
  1572.  
  1573.  
  1574.         if(IsPlayerConnected(giveplayerid))
  1575.         {
  1576.             DeletePVar(giveplayerid, "IsFrozen");
  1577.             TogglePlayerControllable(giveplayerid, 1);
  1578.             format(string, sizeof(string), "AdmCmd: %s was unfrozen by %s.",GetPlayerNameEx(giveplayerid),GetPlayerNameEx(playerid));
  1579.             ABroadCast(COLOR_LIGHTRED,string,2);
  1580.         }
  1581.         else
  1582.         {
  1583.             SendClientMessage(playerid, COLOR_WHITE, "Invalid player specified.");
  1584.         }
  1585.  
  1586.     }
  1587.     else
  1588.     {
  1589.         SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1590.     }
  1591.     return 1;
  1592. }
  1593. CMD:givemoney(playerid, params[])
  1594. {
  1595.     if (PlayerInfo[playerid][pAdmin] >= 3)
  1596.     {
  1597.         new string[128], giveplayerid, money;
  1598.         if(sscanf(params, "id", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid] [money]");
  1599.  
  1600.         if(IsPlayerConnected(giveplayerid))
  1601.         {
  1602.             GivePlayerCash(giveplayerid, money);
  1603.             format(string, sizeof(string), "Admin %s has gave you %d money, say thank you to him.", GetPlayerNameEx(playerid), money);
  1604.             SendClientMessage(giveplayerid, COLOR_WHITE, string);
  1605.             format(string, sizeof(string), "AdmCmd: %s has gave %d money to %s.", GetPlayerNameEx(playerid), money, GetPlayerNameEx(giveplayerid));
  1606.             ABroadCast(COLOR_LIGHTRED, string, 2);
  1607.         }
  1608.     }
  1609.     else
  1610.     {
  1611.         SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1612.     }
  1613.     return 1;
  1614. }
  1615.  
  1616. CMD:setskin(playerid, params[])
  1617. {
  1618.     if (PlayerInfo[playerid][pAdmin] >= 2)
  1619.     {
  1620.         new string[128], giveplayerid, skinid;
  1621.         if(sscanf(params, "id", giveplayerid, skinid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [playerid] [skinid]");
  1622.  
  1623.         if(IsPlayerConnected(giveplayerid))
  1624.         {
  1625.             if(!IsInvalidSkin(skinid))
  1626.             {
  1627.                 if(GetPlayerSkin(giveplayerid) == skinid)
  1628.                 {
  1629.                     SendClientMessage( playerid, COLOR_WHITE, "The player you're trying to change skins of already is using the skin you're trying to set." );
  1630.                 }
  1631.                 else
  1632.                 {
  1633.                     PlayerInfo[giveplayerid][pChar] = skinid;
  1634.                     PlayerInfo[giveplayerid][pModel] = skinid;
  1635.                     format(string, sizeof(string), "Your skin has been changed to ID %d by Administrator %s.", skinid, GetPlayerNameEx(playerid));
  1636.                     SendClientMessage(giveplayerid, COLOR_WHITE, string);
  1637.                     format(string, sizeof(string), "You have given %s skin ID %d.", GetPlayerNameEx(giveplayerid), skinid);
  1638.                     SendClientMessage(playerid, COLOR_WHITE, string);
  1639.                     SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pChar]);
  1640.                 }
  1641.             }
  1642.             else
  1643.             {
  1644.                 SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID!");
  1645.             }
  1646.         }
  1647.     }
  1648.     else
  1649.     {
  1650.         SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1651.     }
  1652.     return 1;
  1653. }
  1654.  
  1655. CMD:jetpack(playerid, params[])
  1656. {
  1657.     if(PlayerInfo[playerid][pAdmin] >= 1) {
  1658.         JetPack[playerid] = 1;
  1659.         SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  1660.         return 1;
  1661.     }
  1662.     new plo, string[128];
  1663.     if(sscanf(params, "i", plo)) {
  1664.         SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jetpack [playerid]");
  1665.         return 1;
  1666.     }
  1667.     if (IsPlayerConnected(plo)) {
  1668.         if(plo != INVALID_PLAYER_ID) {
  1669.             if (PlayerInfo[playerid][pAdmin] >= 4) {
  1670.                 SendClientMessage(plo, COLOR_GRAD1, "Enjoy your new jetpack!");
  1671.                 JetPack[plo] = 1;
  1672.                 SetPlayerSpecialAction(plo, SPECIAL_ACTION_USEJETPACK);
  1673.                 format(string, sizeof(string), "AdmCmd: %s has recieved a jetpack from %s.", GetPlayerNameEx(plo), GetPlayerNameEx(playerid));
  1674.                 ABroadCast(COLOR_LIGHTRED, string, 2);
  1675.             }
  1676.             else {
  1677.                 SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1678.             }
  1679.         }
  1680.     }
  1681.     else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
  1682.     return 1;
  1683. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement