Advertisement
Guest User

BesAdmin System Script.

a guest
Feb 28th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 38.29 KB | None | 0 0
  1. // Filterscript powered by BeesSi
  2. // Credits to KUSH for his registration system
  3. // Credits to the owner of KickEx include as i copied his for my BannEx.
  4. // Credits to gtakillerIV for his offline BAN and UNBAN Tutorial
  5. // All the credits will be listed here .
  6. // Original Filterscript by BeesSi. Feel free to edit it and rerelease.
  7. #include <a_samp>
  8. #include <YSI\y_ini>
  9. #include <zcmd>
  10. #include <sscanf2>
  11. #include <foreach>
  12. #include <streamer>
  13. #include <KickEx>
  14.  
  15. // Includes down here belongs to BeesSi
  16. #include <BannEx>
  17.  
  18.  
  19. /*               Defines            */
  20. #define DIALOG_REGISTER 1
  21. #define DIALOG_LOGIN 2
  22. #define DIALOG_SUCCESS_1 3
  23. #define DIALOG_SUCCESS_2 4
  24. #define PATH "/Users/%s.ini"
  25. #define COL_WHITE "{FFFFFF}"
  26. forward SendAdminMessage(color, string[]);
  27. forward BroadCast(color,string[]);
  28. #define COL_RED "{F81414}"
  29. #define COL_GREEN "{00FF22}"
  30. #pragma tabsize 0
  31. #define COL_LIGHTBLUE "{00CED1}"
  32. #define TEAM_HIT_COLOR 0xFFFFFF00
  33. #define COLOR_BRIGHTRED 0xFF0000AA
  34. #define COLOR_TWWHITE 0xFFFFFFAA
  35. #define DIALOG_SHOW_INFO 13337
  36. #define DIALOG_SHOW_INFO1 124
  37. #define DIALOG_SHOW_INFO2 125
  38. #define COLOR_TWYELLOW 0xFFFF00AA
  39. #define COLOR_TWPINK 0xE75480AA
  40. #define COLOR_TWRED 0xFF0000AA
  41. #define COLOR_TWBROWN 0x654321AA
  42. #define COLOR_TWGRAY 0x808080AA
  43. #define COLOR_TWOLIVE 0x808000AA
  44. #define COLOR_TWPURPLE 0x800080AA
  45. #define COLOR_TWTAN 0xD2B48CAA
  46. #define COLOR_TWAQUA 0x00FFFFAA
  47. #define COLOR_TWORANGE 0xFF8C00AA
  48. #define COLOR_TWAZURE 0x007FFFAA
  49. #define COLOR_TWGREEN 0x008000AA
  50. #define COLOR_TWBLUE 0x0000FFAA
  51. #define COLOR_TWBLACK 0x000000AA
  52. #define GetVehicleName(%0) VehicleName[GetVehicleModel(%0)-400]
  53. #define COLOR_HTWWHITE "FFFFFF"
  54. #define COLOR_HTWYELLOW "FFFF00"
  55. #define COLOR_HTWPINK "E75480"
  56. #define COLOR_HTWRED "FF0000"
  57. #define COLOR_HTWBROWN "654321"
  58. #define COLOR_HTWGRAY "808080"
  59. #define COLOR_HTWOLIVE "808000"
  60. #define COLOR_HTWPURPLE "800080"
  61. #define COLOR_HTWTAN "D2B48C"
  62. #define COLOR_HTWAQUA "00FFFF"
  63. #define COLOR_HTWORANGE "FF8C00"
  64. #define COLOR_HTWAZURE "007FFF"
  65. #define COLOR_HTWGREEN "008000"
  66. #define COLOR_HTWBLUE "0000FF"
  67. #define COLOR_HTWBLACK "000000"
  68. new playersonline=0;
  69. new CreatedCars[100];
  70. #define COLOR_ORANGE 0xFF8000FF
  71. #define COLOR_GRAD1 0xB4B5B7FF
  72. #define COLOR_GRAD2 0xBFC0C2FF
  73. #define COLOR_GRAD3 0xCBCCCEFF
  74. #define COLOR_GRAD4 0xD8D8D8FF
  75. #define COLOR_GRAD5 0xE3E3E3FF
  76. #define COLOR_GRAD6 0xF0F0F0FF
  77. #define COLOR_HACHAT 0x642EFAAA
  78. #define COLOR_GREY 0xAFAFAFAA
  79. #define COLOR_GREEN 0x33AA33AA
  80. #define COLOR_RED 0xFF0000
  81. #define COLOR_GRAVE 0xFF0000FF
  82. #define COLOR_REALRED 0xFF0606FF
  83. #define COLOR_LIGHTRED 0xFF6347AA
  84. #define COLOR_LIGHTBLUE 0x33CCFFAA
  85. #define COLOR_LIGHTGREEN 0x9ACD32AA
  86. #define COLOR_LIME 0xB7FF00AA
  87. #define COLOR_YELLOW 0xFFFF00AA
  88. #define COLOR_VIP 0xC93CCE00
  89. #define COLOR_YELLOW2 0xF5DEB3AA
  90. #define COLOR_WHITE 0xFFFFFFAA
  91. #define COLOR_FADE1 0xE6E6E6E6
  92. #define COLOR_FADE2 0xC8C8C8C8
  93. #define COLOR_FADE3 0xAAAAAAAA
  94. #define COLOR_FADE4 0x8C8C8C8C
  95. #define COLOR_FADE5 0x6E6E6E6E
  96. #define COLOR_PURPLE 0xC2A2DAAA
  97. #define COLOR_PINK 0xFF66FFAA
  98. #define COLOR_DBLUE 0x2641FEAA
  99. #define COLOR_ALLDEPT 0xFF8282AA
  100. #define COLOR_BLACK 0x000000AA
  101. #define TEAM_SFPD   0x0099FF00
  102. #define TEAM_SASD   0xCC993300
  103. #define TEAM_LAJS   0xFF8C00AA
  104. #define COLOR_NEWS 0xFFA500AA
  105. #define COLOR_OOC 0xE0FFFFAA
  106. #define COLOR_NG 0x9ACD3200
  107. #define COLOR_USCG 0x9ACD3200
  108. #define COLOR_TR2 0xCC000000
  109. #define COLOR_TR 0x56B9B900
  110. #define COLOR_FBI 0x8D8DFFFF
  111. #define PUBLICRADIO_COLOR 0x6DFB6DFF
  112. #define TEAM_CYAN 1
  113. #define TEAM_BLUE 2
  114. #define TEAM_GREEN 3
  115. #define TEAM_ORANGE 4
  116. #define TEAM_COR 5
  117. #define TEAM_BAR 6
  118. #define TEAM_TAT 7
  119. #define TEAM_CUN 8
  120. #define TEAM_STR 9
  121. #define TEAM_HIT 10
  122. #define TEAM_ADMIN 11
  123. #define OBJECTIVE_COLOR 0x64000064
  124. #define PAINTBALL_TEAM_RED 0xFF780000
  125. #define PAINTBALL_TEAM_BLUE 0x56B9B900
  126. #define WANTED_COLOR 0xFF0000FF
  127. #define FIND_COLOR 0xB90000FF
  128. #define TACTICAL1 0xCAD6A3FF
  129. #define TACTICAL2 0xFF9A00FF
  130. #define COLOR_1RED 0xFF0000FF
  131. #define COLOR_1GREY 0xC0C0C0FF
  132. #define COLOR_1GREEN 0x008000FF
  133. #define COLOR_1YELLOW 0xFFFF00FF
  134. #define COLOR_1WHITE 0xFFFFFFFF
  135. #define COLOR_1BLUE 0x0000FFFF
  136. #define MIN_VEHI_ID     400
  137. #define MAX_VEHI_ID     611
  138. new Float:TelePos[MAX_PLAYERS][6];
  139. new Float: fVehSpeed[MAX_PLAYERS];
  140. new Spectate[MAX_PLAYERS];
  141. new Spectating[MAX_PLAYERS];
  142. new GettingSpectated[MAX_PLAYERS];
  143. new aDuty[MAX_PLAYERS];
  144. new Godmode[MAX_PLAYERS];
  145.  
  146. static const VehicleName[212][] = {
  147.     "Landstalker","Bravura","Buffalo","Linerunner","Perennial","Sentinel","Dumper","Firetruck","Trashmaster","Stretch",
  148.     "Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi",
  149.     "Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator",
  150.     "Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RC Bandit", "Romero",
  151.     "Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed",
  152.     "Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
  153.     "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler",
  154.     "ZR-350","Walton","Regina","Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper",
  155.     "Rancher","FBI Rancher","Virgo","Greenwood","Jetmax","Hotring Racer","Sandking","Blista Compact","Police Maverick",
  156.     "Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT",
  157.     "Elegant","Journey","Bike","Mountain Bike","Beagle","Cropduster","Stuntplane","Tanker","Road Train","Nebula","Majestic",
  158.     "Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV-1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
  159.     "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent",
  160.     "Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility",
  161.     "Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger",
  162.     "Flash","Tahoma","Savanna","Bandito","Freight","Trailer","Kart","Mower","Duneride","Sweeper","Broadway",
  163.     "Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer","Emperor","Wayfarer",
  164.     "Euros","Hotdog","Club","Trailer","Trailer","Andromada","Dodo","RCCam","Launch","Police Car (LAPD)","Police Car (SFPD)",
  165.     "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A",
  166.     "Luggage Trailer B","Stair Trailer","Boxville","Farm Plow","Utility Trailer"
  167. };
  168.  
  169.  
  170. enum pInfo
  171. {
  172.     pPassword,
  173.     pAdmin,
  174.     pMoney,
  175.     pVW,
  176.     pBanned,
  177.     BannedIP[22]
  178. }
  179. new PlayerInfo[MAX_PLAYERS][pInfo];
  180.  
  181. public OnFilterScriptInit()
  182. {
  183.     for(new i = 0; i < sizeof(CreatedCars); i++)
  184.     {
  185.         CreatedCars[i] = INVALID_VEHICLE_ID;
  186.     }
  187.     return 1;
  188. }
  189.  
  190. public OnFilterScriptExit()
  191. {
  192.     return 1;
  193. }
  194.  
  195. public OnPlayerRequestClass(playerid, classid)
  196. {
  197.     if(PlayerInfo[playerid][pBanned] == 1)
  198. {
  199.     Ban(playerid);
  200. }
  201.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  202.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  203.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  204.  
  205.     return 1;
  206. }
  207.  
  208. public OnPlayerConnect(playerid)
  209. {
  210.     if(fexist(UserPath(playerid)))
  211.     {
  212.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  213.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
  214.     }
  215.     else
  216.     {
  217.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
  218.     }
  219.     new string[520];
  220.     playersonline++;
  221.     new Name[MAX_PLAYER_NAME];
  222.     GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
  223.     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);
  224.     SendClientMessageToAll(COLOR_GREEN, string);
  225.     return 1;
  226. }
  227.  
  228. public OnPlayerDisconnect(playerid, reason)
  229. {
  230.     new INI:File = INI_Open(UserPath(playerid));
  231.     INI_SetTag(File,"data");
  232.     INI_WriteInt(File,"Money",GetPlayerMoney(playerid));
  233.     INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  234.     INI_WriteInt(File,"pVW",PlayerInfo[playerid][pVW]);
  235.     INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
  236.     INI_Close(File);
  237.     new string[128];
  238.     playersonline--;
  239.     new pName[MAX_PLAYER_NAME];
  240.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  241.     format(string, sizeof(string), "{04FBE2}%s {B004FB}has left the server. See you soon.", pName);
  242.     SendClientMessageToAll(COLOR_GREEN, string);
  243.     return 1;
  244. }
  245.  
  246. public OnPlayerSpawn(playerid)
  247. {
  248.     return 1;
  249. }
  250.  
  251. forward LoadUser_data(playerid,name[],value[]);
  252. public LoadUser_data(playerid,name[],value[])
  253. {
  254.     INI_Int("Password",PlayerInfo[playerid][pPassword]);
  255.     INI_Int("pVW",PlayerInfo[playerid][pVW]);
  256.     INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  257.     INI_Int("Money",PlayerInfo[playerid][pMoney]);
  258.     INI_Int("Banned", PlayerInfo[playerid][pBanned]);
  259.     return 1;
  260. }
  261.  
  262. public OnPlayerDeath(playerid, killerid, reason)
  263. {
  264.     return 1;
  265. }
  266.  
  267. public OnVehicleSpawn(vehicleid)
  268. {
  269.     return 1;
  270. }
  271.  
  272. public OnVehicleDeath(vehicleid, killerid)
  273. {
  274.     return 1;
  275. }
  276.  
  277. public OnPlayerText(playerid, text[])
  278. {
  279.     return 1;
  280. }
  281.  
  282. public OnPlayerCommandText(playerid, cmdtext[])
  283. {
  284.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  285.     {
  286.         // Do something here
  287.         return 1;
  288.     }
  289.     return 0;
  290. }
  291.  
  292. /*---------STOCKS----------*/
  293. stock GetName(playerid)
  294. {
  295.     new
  296.         pName[MAX_PLAYER_NAME];
  297.  
  298.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  299.     return pName;
  300. }
  301.  
  302. stock ErrorMessages(playerid, errorID)
  303. {
  304. if(errorID == 1)  return SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command.");
  305. return 1;
  306. }
  307.  
  308. stock CreateVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, playerid = INVALID_PLAYER_ID)
  309. {
  310.     new string[128];
  311.     format(string, sizeof(string), "(%d, %f, %f, %f, %f, %d, %d, %d) (%s)", modelid, x, y, z, angle, color1, color2, respawn_delay, GetPlayerNameEx(playerid));
  312.  
  313.     new id = CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay);
  314.  
  315.     format(string, sizeof(string), "-> [%d]", id);
  316.     return id;
  317. }
  318.  
  319. public BroadCast(color,string[])
  320. {
  321.     SendClientMessageToAll(color, string);
  322.     return 1;
  323. }
  324.  
  325. IsNumeric(const string[])
  326. {
  327.     for (new i = 0, j = strlen(string); i < j; i++)
  328.     {
  329.         if (string[i] > '9' || string[i] < '0') return 0;
  330.     }
  331.     return 1;
  332. }
  333.  
  334. GetVehicleModelIDFromName(vname[])
  335. {
  336.     for(new i = 0; i < 211; i++)
  337.     {
  338.         if ( strfind(VehicleName[i], vname, true) != -1 )
  339.             return i + MIN_VEHI_ID;
  340.     }
  341.     return -1;
  342. }
  343.  
  344. stock ABroadCastEx(color,string[])
  345. {
  346.     foreach(Player, i)
  347.     {
  348.         if (PlayerInfo[i][pAdmin] >= 2)
  349.         {
  350.             SendClientMessage(i, color, string);
  351.             //printf("%s", string);
  352.         }
  353.     }
  354.     return 1;
  355. }
  356.  
  357. stock ABroadCast(color,string[],level)
  358. {
  359.     foreach(Player, i)
  360.     {
  361.         if (PlayerInfo[i][pAdmin] >= level)
  362.         {
  363.             SendClientMessage(i, color, string);
  364.             //printf("%s", string);
  365.         }
  366.     }
  367.     return 1;
  368. }
  369. stock Error(playerid, text[])
  370. {
  371.     return SendClientMessage(playerid, COLOR_GRAD2, text);
  372. }
  373.  
  374. stock Syntax(playerid, command[], params[])
  375. {
  376.     new string[128];
  377.     format(string, sizeof(string), "USAGE: /%s %s", command, params);
  378.     return SendClientMessage(playerid, COLOR_GRAD2, string);
  379. }
  380.  
  381. stock IsAdmin(playerid)
  382. {
  383.     if(PlayerInfo[playerid][pAdmin] >= 1)
  384.         return 1;
  385.     else
  386.         return 0;
  387. }
  388.  
  389. stock UserPath(playerid)
  390. {
  391.     new string[128],playername[MAX_PLAYER_NAME];
  392.     GetPlayerName(playerid,playername,sizeof(playername));
  393.     format(string,sizeof(string),PATH,playername);
  394.     return string;
  395. }
  396.  
  397. stock GetPlayerNameEx(playerid)
  398. {
  399.      new pName[25];
  400.      GetPlayerName(playerid, pName, sizeof(pName));
  401.      return pName;
  402. }
  403.  
  404. stock udb_hash(buf[]) {
  405.     new length=strlen(buf);
  406.     new s1 = 1;
  407.     new s2 = 0;
  408.     new n;
  409.     for (n=0; n<length; n++)
  410.     {
  411.        s1 = (s1 + buf[n]) % 65521;
  412.        s2 = (s2 + s1)     % 65521;
  413.     }
  414.     return (s2 << 16) + s1;
  415. }
  416.  
  417. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  418. {
  419.     return 1;
  420. }
  421.  
  422. public OnPlayerExitVehicle(playerid, vehicleid)
  423. {
  424.     return 1;
  425. }
  426.  
  427. public OnPlayerStateChange(playerid, newstate, oldstate)
  428. {
  429.     return 1;
  430. }
  431.  
  432. public OnPlayerEnterCheckpoint(playerid)
  433. {
  434.     return 1;
  435. }
  436.  
  437. public OnPlayerLeaveCheckpoint(playerid)
  438. {
  439.     return 1;
  440. }
  441.  
  442. public OnPlayerEnterRaceCheckpoint(playerid)
  443. {
  444.     return 1;
  445. }
  446.  
  447. public OnPlayerLeaveRaceCheckpoint(playerid)
  448. {
  449.     return 1;
  450. }
  451.  
  452. public OnRconCommand(cmd[])
  453. {
  454.     return 1;
  455. }
  456.  
  457. public OnPlayerRequestSpawn(playerid)
  458. {
  459.     return 1;
  460. }
  461.  
  462. public OnObjectMoved(objectid)
  463. {
  464.     return 1;
  465. }
  466.  
  467. public OnPlayerObjectMoved(playerid, objectid)
  468. {
  469.     return 1;
  470. }
  471.  
  472. public OnPlayerPickUpPickup(playerid, pickupid)
  473. {
  474.     return 1;
  475. }
  476.  
  477. public OnVehicleMod(playerid, vehicleid, componentid)
  478. {
  479.     return 1;
  480. }
  481.  
  482. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  483. {
  484.     return 1;
  485. }
  486.  
  487. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  488. {
  489.     return 1;
  490. }
  491.  
  492. public OnPlayerSelectedMenuRow(playerid, row)
  493. {
  494.     return 1;
  495. }
  496.  
  497. public OnPlayerExitedMenu(playerid)
  498. {
  499.     return 1;
  500. }
  501.  
  502. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  503. {
  504.     return 1;
  505. }
  506.  
  507. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  508. {
  509.     return 1;
  510. }
  511.  
  512. public OnRconLoginAttempt(ip[], password[], success)
  513. {
  514.     return 1;
  515. }
  516.  
  517. public OnPlayerUpdate(playerid)
  518. {
  519.     return 1;
  520. }
  521.  
  522. public OnPlayerStreamIn(playerid, forplayerid)
  523. {
  524.     return 1;
  525. }
  526.  
  527. public OnPlayerStreamOut(playerid, forplayerid)
  528. {
  529.     return 1;
  530. }
  531.  
  532. public OnVehicleStreamIn(vehicleid, forplayerid)
  533. {
  534.     return 1;
  535. }
  536.  
  537. public OnVehicleStreamOut(vehicleid, forplayerid)
  538. {
  539.     return 1;
  540. }
  541.  
  542. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  543. {
  544.     switch( dialogid )
  545.     {
  546.         case DIALOG_REGISTER:
  547.         {
  548.             if (!response) return Kick(playerid);
  549.             if(response)
  550.             {
  551.                 new IP[22];
  552.                 GetPlayerIp(playerid, IP, sizeof(IP));
  553.                 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");
  554.                 new INI:File = INI_Open(UserPath(playerid));
  555.                 INI_SetTag(File,"data");
  556.                 INI_WriteInt(File,"Password",udb_hash(inputtext));
  557.                 INI_WriteInt(File,"Money",0);
  558.                 INI_WriteInt(File,"pVW",0);
  559.                 INI_WriteString(File, "Ip", IP);
  560.                 INI_WriteInt(File,"Admin",0);
  561.                 INI_Close(File);
  562.             }
  563.         }
  564.  
  565.         case DIALOG_LOGIN:
  566.         {
  567.             if ( !response ) return Kick ( playerid );
  568.             if( response )
  569.             {
  570.                 if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
  571.                 {
  572.                     INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  573.                     GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
  574.                     ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
  575.                 }
  576.                 else
  577.                 {
  578.                     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");
  579.                 }
  580.                 return 1;
  581.             }
  582.         }
  583.     }
  584.     return 1;
  585. }
  586.  
  587. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  588. {
  589.     return 1;
  590. }
  591.  
  592. CMD:setadmin(playerid, params[])
  593. {
  594.     new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
  595.     if(PlayerInfo[playerid][pAdmin] >= 4)
  596.     {
  597.         if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadmin [id] [level]");
  598.         if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player was not found.");
  599.         if (admlvl > 4 || admlvl < 0) return SendClientMessage(playerid, COLOR_RED,"Invalid Level , Available : 1-4");
  600.         PlayerInfo[id][pAdmin] = admlvl;
  601.         GetPlayerName(id, victimname, sizeof(victimname));
  602.         GetPlayerName(playerid, adminname, sizeof(adminname));
  603.         new string[128];
  604.         format(string, sizeof(string), "%s has made %s a level %d admin", adminname, victimname, admlvl);
  605.         ABroadCast(COLOR_YELLOW, string, 2);
  606.         format(string,128,"%s has set your admin level to %i",adminname, admlvl);
  607.         SendClientMessage(id,0xFF0000C8,string);
  608.         return 1;
  609.     }
  610.     return SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command");
  611. }
  612.  
  613. CMD:rconadmin(playerid, params[])
  614. {
  615.     new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
  616.      if(IsPlayerAdmin(playerid))
  617.     {
  618.         if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /rconadmin [id] [level]");
  619.         if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player was not found.");
  620.         if (admlvl > 4 || admlvl < 0) return SendClientMessage(playerid, COLOR_RED,"Invalid Level , Available : 1-4");
  621.         PlayerInfo[id][pAdmin] = admlvl;
  622.         GetPlayerName(id, victimname, sizeof(victimname));
  623.         GetPlayerName(playerid, adminname, sizeof(adminname));
  624.         new string[128];
  625.         format(string, sizeof(string), "%s has made %s a level %d admin with the rcon password", adminname, victimname, admlvl);
  626.         ABroadCast(COLOR_YELLOW, string, 2);
  627.         format(string,128,"%s has set your admin level to %i with the rcon password",adminname, admlvl);
  628.         SendClientMessage(id,0xFF0000C8,string);
  629.         return 1;
  630.     }
  631.     return SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command");
  632. }
  633.  
  634. forward LoadIP_data(playerid, name[], value[]);
  635. public LoadIP_data(playerid, name[], value[]) //Creating a new Public function for use later.
  636. {
  637.     INI_String("Ip", PlayerInfo[ playerid ][ BannedIP ], 33); //Loading the string "Ip", and assigning it to our string "BannedIP", with the maximum size of 33.
  638.     return 1; //Returning 1 for it to work.
  639. }
  640.  
  641. CMD:a(playerid, params[])
  642. {
  643.     if(PlayerInfo[playerid][pAdmin] >= 1)
  644.     {
  645.         if(!isnull(params))
  646.         {
  647.             new szMessage[128];
  648.             if(PlayerInfo[playerid][pAdmin] == 1)
  649.             {
  650.                 SendClientMessage(playerid, COLOR_GREY, "Junior Admins can't use the admin chat.");
  651.                 format(szMessage, sizeof(szMessage), "Junior Admin %s has tried to use /a : %s", GetPlayerNameEx(playerid), params);
  652.                 ABroadCastEx(COLOR_GREEN, szMessage);
  653.             }
  654.             else if(PlayerInfo[playerid][pAdmin] == 2)
  655.             {
  656.                 format(szMessage, sizeof(szMessage), "*{B300FF} General Admin {00FFFF}%s: {FFFFFF}%s", GetPlayerNameEx(playerid), params);
  657.                 ABroadCast(COLOR_GREEN, szMessage, 2);
  658.             }
  659.             else if(PlayerInfo[playerid][pAdmin] == 3)
  660.             {
  661.                 format(szMessage, sizeof(szMessage), "*{DFF709} Head Admin {00FFFF}%s: {FFFFFF}%s", GetPlayerNameEx(playerid), params);
  662.                 ABroadCast(COLOR_GREEN, szMessage, 2);
  663.             }
  664.             else if(PlayerInfo[playerid][pAdmin] == 4)
  665.             {
  666.             format(szMessage, sizeof(szMessage), "*{FF0000} Director {00FFFF}%s: {FFFFFF}%s", GetPlayerNameEx(playerid), params);
  667.             ABroadCast(COLOR_GREEN, szMessage, 2);
  668.             }
  669.             else SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/a)dmin [admin chat]");
  670.             }
  671.     return 1;
  672.     }
  673.     return 1;
  674.     }
  675.  
  676.  
  677. public SendAdminMessage(color, string[])
  678. {
  679.     foreach(Player, i)
  680.     {
  681.             if(PlayerInfo[i][pAdmin] >= 1)
  682.             {
  683.                 SendClientMessage(i, color, string);
  684.             }
  685.     }
  686. }
  687.  
  688. CMD:am(playerid, params[])
  689. {
  690.     if(IsAdmin(playerid))
  691.     {
  692.         new toid, message[128];
  693.         if(sscanf(params, "is[128]", toid, message)) return Syntax(playerid, "[a]dmin[m]essage", "[playerid] [message]");
  694.         if(strlen(message) > 128) return Error(playerid, "Your message cannot be longer than 128 characters.");
  695.         if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
  696.         new string[128];
  697.         format(string, sizeof(string), "Admin message from %s: %s", GetPlayerNameEx(playerid), message);
  698.         SendClientMessage(toid, COLOR_GREEN, string);
  699.         format(string, sizeof(string), "Admin %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
  700.         SendAdminMessage(COLOR_GREEN,string);
  701.     }
  702.     else
  703.     {
  704.         new message[80];
  705.         if(sscanf(params, "s[80]", message)) return Syntax(playerid, "[a]dmin[m]essage", "[message]");
  706.         if(strlen(message) > 80) return Error(playerid, "Your message cannot be longer than 80 characters.");
  707.         //if(strfind(message, "Falling", true) != -1) return Error(playerid, "Type (/falling) and a administrative person will be there to assist you right away!");
  708.         new string[128];
  709.         format(string, sizeof(string), "Admin message from %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
  710.         SendAdminMessage(COLOR_GREEN,string);
  711.         format(string, sizeof(string), "Your message, %s, has been sent.", message);
  712.         SendClientMessage(playerid, COLOR_GREEN, string);
  713.         format(string, sizeof(string), "Player %s [%d] > Admins: %s", GetPlayerNameEx(playerid), playerid, message);
  714.     }
  715.     return 1;
  716. }
  717.  
  718. CMD:god(playerid, params[])
  719. {
  720.   if(PlayerInfo[playerid][pAdmin] >= 1)
  721.   {
  722.             switch(Godmode[playerid]) {
  723.                 case 0: {
  724.                     Godmode[playerid] = 1;
  725.                     new string[128];
  726.                     SetPlayerHealth(playerid, 500000);
  727.                     SetPlayerArmour(playerid, 500000);
  728.                     new pName[MAX_PLAYER_NAME];
  729.                     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  730.                     format(string, sizeof(string), "(GODMODE): %s!", pName);
  731.                     SetPlayerChatBubble(playerid,string,COLOR_WHITE,60.0,10000000000000);
  732.                     SendClientMessage(playerid, COLOR_RED, "You just activated god mode");
  733.                 }
  734.                 case 1: {
  735.                     Godmode[playerid] = 0;
  736.                     SetPlayerHealth(playerid, 100);
  737.                     SetPlayerArmour(playerid, 100);
  738.                     SendClientMessage(playerid, COLOR_RED, "You just deactivated god mode");
  739.                     SetPlayerChatBubble(playerid,"GODMODE: OFF" ,COLOR_WHITE,60.0,1);
  740.  
  741.             }
  742.         }
  743. }
  744.   else return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command");
  745.   {
  746.   return 1;
  747.   }
  748. }
  749.  
  750. CMD:ah(playerid, params[])
  751. {
  752.         new str[1200];
  753.         if(IsPlayerAdmin(playerid))
  754.         if(PlayerInfo[playerid][pAdmin] >= 1)
  755.         {
  756.         strcat(str, "*** {04FBCA}Junior Admin {FFFFFF}*** /ah, /am, /a, /god, /aduty, /veh, /o, kick\n");
  757.         if(PlayerInfo[playerid][pAdmin] >= 2)
  758.         {
  759.         strcat(str, "*** {B300FF}General Admin {FFFFFF}*** /gotoid, /get, /spec\n");
  760.         }
  761.         if(PlayerInfo[playerid][pAdmin] >= 3)
  762.         {
  763.         strcat(str, "*** {DFF709}Head Admin {FFFFFF}*** /ban, /oban, /unban\n");
  764.         }
  765.         if(PlayerInfo[playerid][pAdmin] >= 4) {
  766.         strcat(str, "*** {FF0000}Director {FFFFFF}*** All CMD's Below and /setadmin\n");
  767.         }
  768.         if (PlayerInfo[playerid][pAdmin] >= 1)
  769.     {
  770.         ShowPlayerDialog(playerid, DIALOG_SHOW_INFO, DIALOG_STYLE_MSGBOX, "{33AA33}Administration Commands", str, "Ok", "Cancel");
  771.     }
  772.         return 1;
  773.         }
  774.      return 1;
  775. }
  776.  
  777.      
  778. CMD:ban(playerid, params[])
  779. {
  780.     new id, reason[50], string[128], banned[MAX_PLAYER_NAME];
  781.     if(PlayerInfo[playerid][pAdmin] >= 3)
  782.     {
  783.     if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [playerid] [reason(optional)]");
  784.     GetPlayerName(id, banned, sizeof(banned));
  785.     format(string, sizeof(string), "AdmCmd: %s has been banned by %s, reason: %s", banned, GetName(playerid), reason);
  786.     SendClientMessageToAll(0xFF0000C8, string);
  787.     new str[3500];
  788.     new year, month, day;
  789.     getdate(year, month, day);
  790.     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);
  791.     ShowPlayerDialog(id, DIALOG_SHOW_INFO2, DIALOG_STYLE_MSGBOX, "{FF0000}Banned", str, "Ok", "Cancel");
  792.     SetPlayerChatBubble(id,"Banned Player" ,COLOR_RED,60.0,999999999999999);
  793.     SendClientMessage(id, COLOR_GREY, "Server Closed Connection");
  794.     TogglePlayerControllable(id,0);
  795.     PlayerInfo[id][pBanned] = 1;
  796.     }
  797.     else SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command");
  798.     return 1;
  799. }
  800.  
  801. CMD:kick(playerid, params[])
  802. {
  803.     new id, reason[50], string[128], kicked[MAX_PLAYER_NAME];
  804.     if(PlayerInfo[playerid][pAdmin] >= 1)
  805.     {
  806.     if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason(optional)]");
  807.     GetPlayerName(id, kicked, sizeof(kicked));
  808.     format(string, sizeof(string), "AdmCmd: %s has been kicked by %s, reason: %s", kicked, GetName(playerid), reason);
  809.     SendClientMessageToAll(0xFF0000C8, string);
  810.     new stringg[128];
  811.     format(stringg, sizeof(stringg), "You have been kicked by %s for %s", GetName(playerid), reason);
  812.     ShowPlayerDialog(id, DIALOG_SHOW_INFO2, DIALOG_STYLE_MSGBOX, "Kicked", stringg, "Ok", "Cancel");
  813.     KickEx(id, reason);
  814.     }
  815.     else SendClientMessage(playerid,COLOR_GREY,"You are not authorized to use this command");
  816.     return 1;
  817. }
  818.  
  819. CMD:gotoid(playerid, params[])
  820. {
  821.     new giveplayerid;
  822.  
  823.     if(sscanf(params, "u", giveplayerid))
  824.         return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotoid [playerid/partofname]");
  825.  
  826.     new Float:plocx,Float:plocy,Float:plocz;
  827.     if(IsPlayerConnected(giveplayerid))
  828.     {
  829.         if(PlayerInfo[playerid][pAdmin] >= 2)
  830.         {
  831.             if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING)
  832.             {
  833.                 SendClientMessage(playerid, COLOR_GREY, "That player is spectating someone.");
  834.                 return 1;
  835.             }
  836.             if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
  837.             {
  838.                 SendClientMessage(playerid, COLOR_GREY, "You can't do this while spectating.");
  839.                 return 1;
  840.             }
  841.             GetPlayerPos(giveplayerid, plocx, plocy, plocz);
  842.             Streamer_UpdateEx(playerid, plocx, plocy, plocz);
  843.  
  844.             if(GetPlayerState(playerid) == 2)
  845.             {
  846.                 new tmpcar = GetPlayerVehicleID(playerid);
  847.                 SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
  848.                 TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
  849.                 fVehSpeed[playerid] = 0.0;
  850.             }
  851.             else
  852.             {
  853.                 SetPlayerPos(playerid,plocx,plocy+2, plocz);
  854.             }
  855.  
  856.             SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  857.             SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  858.             new giveplayeridvw = GetPlayerVirtualWorld(giveplayerid);
  859.             PlayerInfo[playerid][pVW] = giveplayeridvw;
  860.  
  861.             SendClientMessage(playerid, COLOR_WHITE, "You have been teleported!");
  862.         }
  863.         else
  864.         {
  865.             SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use that command!");
  866.         }
  867.  
  868.     }
  869.     else SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
  870.     return 1;
  871. }
  872.  
  873. CMD:get(playerid, params[])
  874. {
  875.     new giveplayerid;
  876.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gethere [playerid/partofname]");
  877.  
  878.     new Float:plocx,Float:plocy,Float:plocz;
  879.     if(IsPlayerConnected(giveplayerid))
  880.     {
  881.         if(PlayerInfo[playerid][pAdmin] >= 2)
  882.         {
  883.             if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING)
  884.             {
  885.                 SendClientMessage(playerid, COLOR_GREY, "That player is spectating someone.");
  886.                 return 1;
  887.             }
  888.             GetPlayerPos(playerid, plocx, plocy, plocz);
  889.             Streamer_UpdateEx(giveplayerid, plocx, plocy, plocz);
  890.             SetPVarInt(playerid, "BeingTeleported", 1);
  891.  
  892.             if(GetPlayerState(giveplayerid) == 2)
  893.             {
  894.                 TelePos[giveplayerid][0] = 0.0;
  895.                 TelePos[giveplayerid][1] = 0.0;
  896.                 fVehSpeed[giveplayerid] = 0.0;
  897.                 new tmpcar = GetPlayerVehicleID(giveplayerid);
  898.                 SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
  899.                 LinkVehicleToInterior(GetPlayerVehicleID(giveplayerid), GetPlayerInterior(playerid));
  900.                 SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
  901.                 SetVehicleVirtualWorld(GetPlayerVehicleID(giveplayerid), GetPlayerVirtualWorld(playerid));
  902.                 SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
  903.             }
  904.             else
  905.             {
  906.                 SetPlayerPos(giveplayerid,plocx,plocy+2, plocz);
  907.             }
  908.  
  909.             SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
  910.             SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
  911.             new playeridvw = GetPlayerVirtualWorld(playerid);
  912.             PlayerInfo[giveplayerid][pVW] = playeridvw;
  913.  
  914.             SendClientMessage(giveplayerid, COLOR_WHITE, "You have been teleported!");
  915.         }
  916.         else
  917.         {
  918.             SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use that command!");
  919.         }
  920.  
  921.     }
  922.     else SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");
  923.     return 1;
  924. }
  925.  
  926. CMD:spec(playerid, params[])
  927. {
  928.     if(PlayerInfo[playerid][pAdmin] < 1)
  929.     {
  930.         SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use that command!");
  931.         return 1;
  932.     }
  933.     if(strcmp(params, "off", true) == 0)
  934.     {
  935.         if(Spectating[playerid] > 0 && PlayerInfo[playerid][pAdmin] >= 1)
  936.         {
  937.             GettingSpectated[Spectate[playerid]] = 999;
  938.             Spectating[playerid] = 0;
  939.             Spectate[playerid] = 999;
  940.             SetPVarInt(playerid, "SpecOff", 1);
  941.             TogglePlayerSpectating(playerid, false);
  942.             SetCameraBehindPlayer(playerid);
  943.             return 1;
  944.         }
  945.         else
  946.         {
  947.             SendClientMessage(playerid, COLOR_GREY, "You're not spectating anyone.");
  948.             return 1;
  949.         }
  950.     }
  951.     if(strcmp(params, "o", true) == 0)
  952.     {
  953.         if(Spectating[playerid] > 0 && PlayerInfo[playerid][pAdmin] >= 1)
  954.         {
  955.             GettingSpectated[Spectate[playerid]] = 999;
  956.             Spectating[playerid] = 0;
  957.             Spectate[playerid] = 999;
  958.             SetPVarInt(playerid, "SpecOff", 1);
  959.             TogglePlayerSpectating(playerid, false);
  960.             SetCameraBehindPlayer(playerid);
  961.             return 1;
  962.         }
  963.         else
  964.         {
  965.             SendClientMessage(playerid, COLOR_GREY, "You're not spectating anyone.");
  966.             return 1;
  967.         }
  968.     }
  969.  
  970.     new giveplayerid;
  971.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spec (player/off)");
  972.     if(IsPlayerConnected(giveplayerid))
  973.     {
  974.         if(Spectating[playerid] == 0)
  975.         {
  976.             new Float: pPositions[ 3 ];
  977.             GetPlayerPos(playerid, pPositions[0], pPositions[1], pPositions[2]);
  978.             SetPVarFloat(playerid, "SpecPosX", pPositions[0]);
  979.             SetPVarFloat(playerid, "SpecPosY", pPositions[1]);
  980.             SetPVarFloat(playerid, "SpecPosZ", pPositions[2]);
  981.             SetPVarInt(playerid, "SpecInt", GetPlayerInterior(playerid));
  982.             SetPVarInt(playerid, "SpecVW", GetPlayerVirtualWorld(playerid));
  983.             if(IsPlayerInAnyVehicle(giveplayerid))
  984.             {
  985.                 TogglePlayerSpectating(playerid, true);
  986.                 new carid = GetPlayerVehicleID(giveplayerid);
  987.                 PlayerSpectateVehicle(playerid, carid);
  988.                 SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  989.                 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  990.             }
  991.             else
  992.             {
  993.                 TogglePlayerSpectating(playerid, true);
  994.                 PlayerSpectatePlayer(playerid, giveplayerid);
  995.                 SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  996.                 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  997.             }
  998.             GettingSpectated[giveplayerid] = playerid;
  999.             Spectate[playerid] = giveplayerid;
  1000.             Spectating[playerid] = 1;
  1001.         }
  1002.         else
  1003.         {
  1004.             if(IsPlayerInAnyVehicle(giveplayerid))
  1005.             {
  1006.                 TogglePlayerSpectating(playerid, true);
  1007.                 new carid = GetPlayerVehicleID(giveplayerid);
  1008.                 PlayerSpectateVehicle(playerid, carid);
  1009.                 SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  1010.                 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  1011.             }
  1012.             else
  1013.             {
  1014.                 TogglePlayerSpectating(playerid, true);
  1015.                 PlayerSpectatePlayer(playerid, giveplayerid);
  1016.                 SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  1017.                 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
  1018.             }
  1019.             GettingSpectated[Spectate[playerid]] = 999;
  1020.             GettingSpectated[giveplayerid] = playerid;
  1021.             Spectate[playerid] = giveplayerid;
  1022.             Spectating[playerid] = 1;
  1023.         }
  1024.     }
  1025.     else
  1026.     {
  1027.         SendClientMessage(playerid, COLOR_WHITE, "Invalid Player");
  1028.     }
  1029.     return 1;
  1030. }
  1031.  
  1032. CMD:aduty(playerid, params[]) {
  1033.     if(PlayerInfo[playerid][pAdmin] >= 1)
  1034.     {
  1035.             new string[128];
  1036.             switch(aDuty[playerid]) {
  1037.                 case 0: {
  1038.                     aDuty[playerid] = 1;
  1039.                     SetPlayerHealth(playerid, 500000);
  1040.                     SetPlayerArmour(playerid, 500000);
  1041.                     format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s is now on administrative duty.", GetPlayerNameEx(playerid));
  1042.                     BroadCast(COLOR_GREEN, "   An administrative team member is now on duty.");
  1043.                     SetPlayerChatBubble(playerid,"Admin Duty" ,COLOR_GREEN,60.0,999999999999999);
  1044.                     SetPlayerColor(playerid,COLOR_GREEN);
  1045.                     ABroadCast(COLOR_YELLOW, string, 4);
  1046.                 }
  1047.                 case 1: {
  1048.                     aDuty[playerid] = 0;
  1049.                     SetPlayerHealth(playerid, 100);
  1050.                     SetPlayerArmour(playerid, 100);
  1051.                     format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s is now off administrative duty.", GetPlayerNameEx(playerid));
  1052.                     SetPlayerColor(playerid,TEAM_HIT_COLOR);
  1053.                     SetPlayerChatBubble(playerid,"Admin Duty OFF" ,COLOR_GREEN,60.0,1);
  1054.                     ABroadCast(COLOR_YELLOW, string, 4);
  1055.             }
  1056.         }
  1057.     }
  1058.     else
  1059.     {
  1060.         return Error(playerid, "You are not authorized to use this command.");
  1061.     }
  1062.     return 1;
  1063. }
  1064.  
  1065. CMD:oban(playerid, params[])
  1066. {
  1067.  if(PlayerInfo[playerid][pAdmin] >= 3)
  1068.     {
  1069.     new targetname[24], filestring[79];
  1070.     if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /oban [Player's Name]");
  1071.     format(filestring, sizeof(filestring), "/Users/%s.ini", targetname);
  1072.     if(!fexist(filestring)) return SendClientMessage(playerid, -COLOR_GREY, "Player was not found!");
  1073.     else
  1074.     {
  1075.         new INI:File = INI_Open(filestring);
  1076.         INI_SetTag(File, "data");
  1077.         INI_WriteInt(File, "Banned", 1);
  1078.         INI_Close(File);
  1079.         new done[128];
  1080.         new string[128];
  1081.         format(done, sizeof(done), "You have offline banned %s", targetname);
  1082.         format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has offline banned %s's account.", GetPlayerNameEx(playerid), targetname);
  1083.         ABroadCast(COLOR_YELLOW, string, 4);
  1084.         SendClientMessage(playerid,-1 , done);
  1085.      }
  1086. }
  1087.     return 1;
  1088. }
  1089.  
  1090. CMD:unban(playerid, params[])
  1091. {
  1092.     if(PlayerInfo[playerid][pAdmin] >= 3)
  1093.     {
  1094.     new tname[24];
  1095.     if(sscanf(params, "s[24]", tname)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /unban [Player Name] ");
  1096.     new filestring[79];
  1097.     format(filestring, sizeof(filestring), "/Users/%s.ini", tname);
  1098.     if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_GREY, "Invalid Offline Player.");
  1099.     else
  1100.     {
  1101.         new INI:File = INI_Open(filestring);
  1102.         INI_SetTag(File, "data");
  1103.         INI_WriteInt(File, "Banned",0);
  1104.         INI_Close(File);
  1105.         INI_ParseFile(filestring, "LoadIP_%s", .bExtra = true , .extra = playerid);
  1106.         new cmdstring[44];
  1107.         format(cmdstring, sizeof(cmdstring), "unbanip %s", PlayerInfo[playerid][BannedIP]);
  1108.         SendRconCommand(cmdstring);
  1109.         SendRconCommand("reloadbans");
  1110.         new done[128];
  1111.         format(done, sizeof(done),"You have successfully unbanned %s", tname);
  1112.         SendClientMessage(playerid, -1,done);
  1113.         new string[128];
  1114.         format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has unbanned %s's account.", GetPlayerNameEx(playerid), tname);
  1115.         ABroadCast(COLOR_YELLOW, string, 4);
  1116.     }
  1117. }
  1118.     return 1;
  1119. }
  1120.  
  1121. CMD:veh(playerid, params[]) {
  1122.     if (PlayerInfo[playerid][pAdmin] >= 1) {
  1123.  
  1124.         new iColors[2], vName[32];
  1125.  
  1126.         if(!sscanf(params, "s[32]ii", vName, iColors[0], iColors[1]))
  1127.         {
  1128.             new idx;
  1129.             if (!IsNumeric(vName))
  1130.             {
  1131.                 idx = GetVehicleModelIDFromName(vName);
  1132.             }
  1133.             else
  1134.             {
  1135.                 idx = strval(vName);
  1136.             }
  1137.  
  1138.             if( idx != -1 )
  1139.             {
  1140.                 if(idx > MIN_VEHI_ID && idx < MAX_VEHI_ID)
  1141.                 {
  1142.                     if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) {
  1143.                         SendClientMessage(playerid, COLOR_GRAD2, "Invalid colour specified (IDs start at 0, and end at 255).");
  1144.                     }
  1145.                     else for(new iIterator; iIterator < sizeof(CreatedCars); iIterator++) if(CreatedCars[iIterator] == INVALID_VEHICLE_ID) {
  1146.  
  1147.                         new
  1148.                             Float: fVehPos[4], string[128];
  1149.  
  1150.                         GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
  1151.                         GetPlayerFacingAngle(playerid, fVehPos[3]);
  1152.                         CreatedCars[iIterator] = CreateVehicleEx(idx, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
  1153.                         LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
  1154.  
  1155.                         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]);
  1156.                         return SendClientMessage(playerid, COLOR_GREY, string);
  1157.                     }
  1158.                 }
  1159.                 else
  1160.                 {
  1161.                     SendClientMessage(playerid, COLOR_GRAD2, "  Invalid Model Name/ID");
  1162.                 }
  1163.             }
  1164.             else
  1165.             {
  1166.                 SendClientMessage(playerid, COLOR_GRAD2, "  Invalid Model Name/ID!");
  1167.             }
  1168.         }
  1169.         else
  1170.         {
  1171.             SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [Model ID/Name] [color 1] [color 2]");
  1172.             return 1;
  1173.         }
  1174.     }
  1175.     else SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1176.     return 1;
  1177. }
  1178.  
  1179. CMD:o(playerid, params[])
  1180. {
  1181.     new string[258];
  1182.     if(PlayerInfo[playerid][pAdmin] >= 1)
  1183.     {
  1184.     if(isnull(params))
  1185.         return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/o) [Text]");
  1186.     }
  1187.     else SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1188.     {
  1189.     if(PlayerInfo[playerid][pAdmin] == 1)
  1190.     {
  1191.     format(string, sizeof(string), "{B7B748}Junior Admin: {FF0000}%s: {FFFFFF}%s", GetName(playerid), params);
  1192.     SendClientMessageToAll(COLOR_RED, string);
  1193.     }
  1194.     if(PlayerInfo[playerid][pAdmin] == 2)
  1195.     {
  1196.     format(string, sizeof(string), "{B7B748}General Admin: {FF0000}%s: {FFFFFF}%s", GetName(playerid), params);
  1197.     SendClientMessageToAll(COLOR_RED, string);
  1198.     }
  1199.     if(PlayerInfo[playerid][pAdmin] == 3)
  1200.     {
  1201.     format(string, sizeof(string), "{B7B748}Head Admin: {FF0000}%s: {FFFFFF}%s", GetName(playerid), params);
  1202.     SendClientMessageToAll(COLOR_RED, string);
  1203.     }
  1204.     if(PlayerInfo[playerid][pAdmin] == 4)
  1205.     {
  1206.     format(string, sizeof(string), "[OOC]{B7B748}Director: {FF0000}%s: {FFFFFF}%s", GetName(playerid), params);
  1207.     SendClientMessageToAll(COLOR_RED, string);
  1208.     }
  1209. }
  1210.     return 1;
  1211.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement