Guest User

bAdministration

a guest
Jan 27th, 2014
939
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 70.84 KB | None | 0 0
  1. /*
  2. NAME: bAdministration
  3. DATE: 26/01/2014
  4. AUTHORIZATION: Blunt
  5.  
  6. */
  7.  
  8. //====================================================
  9.  
  10. #define FILTERSCRIPT
  11. #include <a_samp>
  12. #include <ZCMD>
  13. #include <YSI\y_ini>
  14. #include <streamer>
  15. #include <foreach>
  16. #include <sscanf2>
  17. #include <samp_addons>
  18.  
  19. //====================================================
  20.  
  21. #define COLOR_WHITE 0xFFFFFFAA
  22. #define COLOR_FADE 0xC8C8C8C8
  23. #define COLOR_GREY 0xAFAFAFAA
  24. #define COLOR_PURPLE 0xC2A2DAAA
  25. #define COLOR_YELLOW 0xDABB3E00
  26. #define COLOR_BLACK 0x000000AA
  27. #define COLOR_BLUE 0x1E90FFAA
  28. #define COLOR_PINK 0xFF1493AA
  29. #define COLOR_GREEN 0x006400AA
  30. #define COLOR_ORANGE 0xFF4500AA
  31. #define COLOR_RED 0xFF0000AA
  32. #define COLOR_SILVER 0x7BDDA5AA
  33. #define COLOR_LIGHTRED 0xFF6347AA
  34. #define COL_GREY "{AFAFAF}"
  35. #define COL_SILVER "{7BDDA5}"
  36.  
  37. //====================================================
  38.  
  39. #define PATH "/adminaccounts/%s.ini"
  40. #define PATH2 "/useraccounts/%s.ini"
  41. #define DIALOG_REGISTER 9999
  42. #define DIALOG_LOGIN 9998
  43. #define DIALOG_BUTTON_RIGHT 0
  44. #define DIALOG_BUTTON_LEFT 1
  45.  
  46. #define ALTCOMMAND:%1->%2; \
  47. COMMAND:%1(playerid, params[]) \
  48. return cmd_%2(playerid, params);
  49.  
  50. //====================================================
  51.  
  52. enum aInfo
  53. {
  54. aAdmin,
  55. aLoggedOn,
  56. aPassword[50]
  57. }
  58.  
  59. enum pInfo
  60. {
  61. pBanned,
  62. pBanReason[30]
  63. }
  64.  
  65. //====================================================
  66.  
  67. new AdminInfo[MAX_PLAYERS][aInfo];
  68. new PlayerInfo[MAX_PLAYERS][pInfo];
  69. new Spectate[MAX_PLAYERS];
  70. new Muted[MAX_PLAYERS];
  71. native WP_Hash(buffer[],len,const str[]);
  72.  
  73. //====================================================
  74.  
  75. forward LoadUser_user(playerid,name[],value[]);
  76. forward LoadUser2_user(playerid,name[],value[]);
  77.  
  78. //====================================================
  79.  
  80. stock AdminAccountPath(playerid) // PATH
  81. {
  82. new string[128],playername[MAX_PLAYER_NAME];
  83. GetPlayerName(playerid,playername,sizeof(playername));
  84. format(string,sizeof(string),PATH,playername);
  85. return string;
  86. }
  87.  
  88. stock UserAccountPath(playerid) // PATH 2
  89. {
  90. new string[128],playername[MAX_PLAYER_NAME];
  91. GetPlayerName(playerid,playername,sizeof(playername));
  92. format(string,sizeof(string),PATH2,playername);
  93. return string;
  94. }
  95.  
  96. stock GetName(playerid)
  97. {
  98. new Name[MAX_PLAYER_NAME];
  99. if(IsPlayerConnected(playerid))
  100. {
  101. GetPlayerName(playerid, Name, sizeof(Name));
  102. }
  103. return Name;
  104. }
  105.  
  106. ReturnUser(text[], playerid = INVALID_PLAYER_ID)
  107. {
  108. new pos = 0;
  109. while (text[pos] < 0x21)
  110. {
  111. if (text[pos] == 0) return INVALID_PLAYER_ID;
  112. pos++;
  113. }
  114. new userid = INVALID_PLAYER_ID;
  115. if (IsNumeric(text[pos]))
  116. {
  117. userid = strval(text[pos]);
  118. if (userid >=0 && userid < MAX_PLAYERS)
  119. {
  120. if(!IsPlayerConnected(userid))
  121. {
  122. userid = INVALID_PLAYER_ID;
  123. }
  124. else
  125. {
  126. return userid;
  127. }
  128. }
  129. }
  130. new len = strlen(text[pos]);
  131. new count = 0;
  132. new name[MAX_PLAYER_NAME];
  133. foreach (Player,i)
  134. {
  135. GetPlayerName(i, name, sizeof (name));
  136. if (strcmp(name, text[pos], true, len) == 0)
  137. {
  138. if (len == strlen(name))
  139. {
  140. return i;
  141. }
  142. else
  143. {
  144. count++;
  145. userid = i;
  146. }
  147. }
  148. }
  149. if (count != 1)
  150. {
  151. if (playerid != INVALID_PLAYER_ID)
  152. {
  153. if (count)
  154. {
  155. SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow earch");
  156. }
  157. else
  158. {
  159. SendClientMessage(playerid, 0xFF0000AA, "No matching user found");
  160. }
  161. }
  162. userid = INVALID_PLAYER_ID;
  163. }
  164. return userid;
  165. }
  166.  
  167.  
  168. IsNumeric(const string[])
  169. {
  170. for (new i = 0, j = strlen(string); i < j; i++)
  171. {
  172. if (string[i] > '9' || string[i] < '0') return 0;
  173. }
  174. return 1;
  175. }
  176.  
  177. stock TogglePlayerSpectatingEx(playerid,toggle)
  178. {
  179. Spectate[playerid] = toggle;
  180. return TogglePlayerSpectating(playerid, toggle);
  181. }
  182.  
  183. stock DisplayLoginDialog(playerid)
  184. {
  185. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "ADMINISTRATOR ACCOUNT", ""COL_SILVER"INFO: Please type in your password in order to login to your admin account.", "LOG-IN", "");
  186. }
  187.  
  188. stock DisplayRegisterDialog(playerid)
  189. {
  190. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "ADMINISTRATOR ACCOUNT", ""COL_SILVER"INFO: Please type in a password you would like to use for your admin account.", "REGISTER", "");
  191. }
  192.  
  193. stock DisplayInvalidPasswordDialog(playerid)
  194. {
  195. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "ADMINISTRATOR ACCOUNT", ""COL_SILVER"INFO: Invalid password. \nPlease type in the correct password for your admin account to log-in too.", "LOG-IN", "");
  196.  
  197. }
  198.  
  199. stock CallLogin(playerid)
  200. {
  201. new string[50];
  202. if(PlayerInfo[playerid][pBanned] == 1) // Checks if the player is banned
  203. {
  204. SendClientMessage(playerid, COLOR_LIGHTRED, "INFO: You have been IP banned for attempting to access a banned account.");
  205. format(string,sizeof(string), "BAN REASON:[ %s ]", PlayerInfo[playerid][pBanReason]);
  206. SendClientMessage(playerid, COLOR_WHITE, string);
  207. Ban(playerid);
  208.  
  209. }
  210. else
  211. {
  212. SendClientMessage(playerid, COLOR_WHITE, "INFO: You have been logged into your admin account.");
  213. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  214. AdminInfo[playerid][aLoggedOn] = 1; // Logged in
  215. }
  216. }
  217.  
  218. stock GetAdminLevelName(playerid)
  219. {
  220. new string[64];
  221. if (AdminInfo[playerid][aAdmin] == 0) string = ("None");
  222. if (AdminInfo[playerid][aAdmin] == 1) string = ("Un-registered Administrator");
  223. if (AdminInfo[playerid][aAdmin] == 2) string = ("Level 1 Moderator");
  224. if (AdminInfo[playerid][aAdmin] == 3) string = ("Level 2 General Administrator");
  225. if (AdminInfo[playerid][aAdmin] == 4) string = ("Level 3 General Administrator");
  226. if (AdminInfo[playerid][aAdmin] == 5) string = ("Senior Administrator");
  227. if (AdminInfo[playerid][aAdmin] == 6) string = ("Lead Administrator");
  228. return string;
  229. }
  230.  
  231. stock SendAdminMessage(color,string[])
  232. {
  233. foreach (Player,i)
  234. {
  235. if(AdminInfo[i][aAdmin] > 1)
  236. {
  237. SendClientMessage(i,color,string);
  238. }
  239. }
  240. }
  241.  
  242. stock WriteUserAccountData(playerid)
  243. {
  244. new INI:User = INI_Open(UserAccountPath(playerid));
  245. INI_SetTag(User, "data");
  246. INI_WriteInt(User,"Banned", 0);
  247. INI_WriteString(User,"BanReason","NOT BANNED");
  248. INI_Close(User);
  249. }
  250.  
  251. stock SaveUserAccountData(playerid)
  252. {
  253. new INI:File2 = INI_Open(UserAccountPath(playerid));
  254. INI_SetTag(File2,"data");
  255. INI_WriteInt(File2,"Banned",PlayerInfo[playerid][pBanned]);
  256. INI_WriteString(File2,"BanReason",PlayerInfo[playerid][pBanReason]);
  257. INI_Close(File2);
  258. }
  259.  
  260. stock SaveAdminAccountData(playerid)
  261. {
  262. new INI:File = INI_Open(AdminAccountPath(playerid));
  263. INI_SetTag(File,"data");
  264. INI_WriteInt(File,"Admin",AdminInfo[playerid][aAdmin]);
  265. INI_WriteInt(File,"LoggedOn",0);
  266. INI_WriteString(File,"Password",AdminInfo[playerid][aPassword]);
  267. INI_Close(File);
  268. }
  269.  
  270. //====================================================
  271.  
  272. public LoadUser_user(playerid,name[],value[])
  273. {
  274. INI_Int("Admin",AdminInfo[playerid][aAdmin]);
  275. INI_Int("LoggedOn",AdminInfo[playerid][aLoggedOn]);
  276. INI_String("Password",AdminInfo[playerid][aPassword], 50);
  277. return 1;
  278. }
  279.  
  280. public LoadUser2_user(playerid,name[],value[])
  281. {
  282. INI_Int("Banned",PlayerInfo[playerid][pBanned]);
  283. INI_String("BanReason",PlayerInfo[playerid][pBanReason], 30);
  284. return 1;
  285. }
  286. //====================================================
  287.  
  288.  
  289. public OnFilterScriptInit()
  290. {
  291. print("NAME: bAdministration");
  292. print("DATE CREATED: 26/01/2014");
  293. print("FILTERSCRIPT LOADED SUCCESSFULLY");
  294. return 1;
  295. }
  296.  
  297. public OnFilterScriptExit()
  298. {
  299. return 1;
  300. }
  301.  
  302. main()
  303. {
  304. }
  305.  
  306. //====================================================
  307.  
  308. public OnPlayerSpawn(playerid)
  309. {
  310. if(fexist(AdminAccountPath(playerid))) // If admin account exists
  311. {
  312. INI_ParseFile(AdminAccountPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  313. SendClientMessage(playerid, COLOR_WHITE, "ADMIN: You have an existing administration account. Please use /adminlogin to log in to the account.");
  314. }
  315. return 1;
  316. }
  317.  
  318. public OnPlayerConnect(playerid)
  319. {
  320. if(fexist(UserAccountPath(playerid))) // If user account exists
  321. {
  322. INI_ParseFile(UserAccountPath(playerid), "LoadUser2_%s", .bExtra = true, .extra = playerid);
  323. }
  324. else { WriteUserAccountData(playerid); }
  325. }
  326.  
  327. public OnPlayerDisconnect(playerid, reason)
  328. {
  329. if(AdminInfo[playerid][aLoggedOn] == 1)
  330. {
  331. SaveAdminAccountData(playerid);
  332. new string[50];
  333. format(string,sizeof(string),"ADMIN FILE SAVED SUCCESSFULLY: [%s]", GetName(playerid));
  334. print(string);
  335. }
  336. SaveUserAccountData(playerid);
  337. new string2[50];
  338. format(string2,sizeof(string2),"USER FILE SAVED SUCCESSFULLY: [%s]", GetName(playerid));
  339. print(string2);
  340. }
  341.  
  342. public OnPlayerText(playerid, text[])
  343. {
  344. if(Muted[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "WARNING: You are currently muted and unable to speak");
  345. return 1;
  346. }
  347.  
  348. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  349. {
  350. switch(dialogid)
  351. {
  352. case DIALOG_REGISTER:
  353. {
  354. switch(response)
  355. {
  356. case DIALOG_BUTTON_RIGHT: { }
  357. case DIALOG_BUTTON_LEFT:
  358. {
  359. new hash[50];
  360. WP_Hash(hash,sizeof(hash),inputtext);
  361. new INI:File = INI_Open(AdminAccountPath(playerid));
  362. INI_SetTag(File,"data");
  363. INI_WriteString(File,"Password",inputtext);
  364. INI_WriteInt(File,"LoggedOn",0);
  365. INI_WriteInt(File,"Admin", 2);
  366. INI_Close(File);
  367. SendClientMessage(playerid, COLOR_WHITE, "INFO: You have successfully registered an administration account. Use /adminlogin to login.");
  368. new string[50];
  369. format(string,sizeof(string),"FILE WRITTEN SUCCESSFULLY: [%s]", GetName(playerid));
  370. print(string);
  371. }
  372. }
  373. }
  374. case DIALOG_LOGIN:
  375. {
  376. new hash[50];
  377. WP_Hash(hash,sizeof(hash),inputtext);
  378. switch(response)
  379. {
  380. case DIALOG_BUTTON_RIGHT: { }
  381. case DIALOG_BUTTON_LEFT:
  382. {
  383. if(!strcmp(hash, AdminInfo[playerid][aPassword]))
  384. {
  385. INI_ParseFile(AdminAccountPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  386. CallLogin(playerid);
  387. }
  388. else { DisplayInvalidPasswordDialog(playerid); }
  389. }
  390. }
  391. }
  392. }
  393. return 1;
  394. }
  395.  
  396. //====================================================
  397.  
  398. COMMAND:ahelp(playerid, params[])
  399. {
  400. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  401. if (AdminInfo[playerid][aAdmin] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You do not have access to this command.");
  402. SendClientMessage(playerid, COLOR_WHITE, "____________________________________________________________________");
  403. SendClientMessage(playerid, COLOR_FADE, " bADMINISTRATION COMMANDS: ");
  404. if(AdminInfo[playerid][aAdmin] >= 1) // UNREGISTERED ADMINS + LEVEL 1 & 2s.
  405. {
  406. SendClientMessage(playerid, COLOR_FADE, "UNREGISTERED ADMIN COMMANDS: /adminregister");
  407. SendClientMessage(playerid, COLOR_FADE, "UNLOGGED IN ADMIN COMMANDS: /adminlogin");
  408. SendClientMessage(playerid, COLOR_FADE, "LEVEL 1 COMMANDS: /kick /spectate /warn /checkhealth /checkarmour /checkweapons ");
  409. SendClientMessage(playerid, COLOR_FADE, "LEVEL 1 COMMANDS: /setskin /setworld /setint /setpos /setcolor /a /getid");
  410. SendClientMessage(playerid, COLOR_FADE, "LEVEL 1 COMMANDS: /gotogrove /gotols /gotosf /gotolv /gotogas /gotoelcorona");
  411. SendClientMessage(playerid, COLOR_FADE, "LEVEL 1 COMMANDS: /gotomotel /gotobank /mute /unmute");
  412. }
  413. if(AdminInfo[playerid][aAdmin] >= 3) // LEVEL 3
  414. {
  415. SendClientMessage(playerid, COLOR_FADE, "LEVEL 2 COMMANDS: /ban /gethere /goto /spec /specoff /hack /shakeplayerscreen");
  416. SendClientMessage(playerid, COLOR_FADE, "LEVEL 2 COMMANDS: /getvehiclespeed /getvehiclehealth /getvehicleangle /getip");
  417. }
  418. if(AdminInfo[playerid][aAdmin] >= 5) // LEVEL 4
  419. {
  420. SendClientMessage(playerid, COLOR_FADE, "LEVEL 3 COMMANDS: /givegun /reconnect /clearplayerchat /clearallplayerschat");
  421. SendClientMessage(playerid, COLOR_FADE, "LEVEL 3 COMMANDS: /countallplayers /countallvehicles /countallpausedplayers /removeweapon");
  422. SendClientMessage(playerid, COLOR_FADE, "LEVEL 3 COMMANDS: /setplayermoney /crashplayer /explodeplayer /killplayer /explodevehicle");
  423. }
  424. if(AdminInfo[playerid][aAdmin] >= 6) // LEVEL 6
  425. {
  426. SendClientMessage(playerid, COLOR_FADE, "LEAD ADMIN COMMANDS: /jetpack /disablesprunkmachines /freezeall /unfreezeall /sendaudiomessagetoall");
  427. SendClientMessage(playerid, COLOR_FADE, "LEAD ADMIN COMMANDS: /changeserverpassword /changeservermap /changeserverwebsite /changeservername");
  428. SendClientMessage(playerid, COLOR_FADE, "LEAD ADMIN COMMANDS: /countallobjects /getallplayers /countallrconadmins /countallnpcs");
  429. SendClientMessage(playerid, COLOR_FADE, "LEAD ADMIN COMMANDS: /sendrconmessagetoserver /sendmessagetorconadmins /setadmin /setplayercolor");
  430. SendClientMessage(playerid, COLOR_FADE, "LEAD ADMIN COMMANDS: /muteallplayers /unmuteallplayers /spawnvehicle /spawnobject ");
  431. }
  432. SendClientMessage(playerid, COLOR_WHITE, "____________________________________________________________________");
  433. return 1;
  434. }
  435.  
  436. COMMAND:makemeadmin(playerid, params[])
  437. {
  438. if(IsPlayerAdmin(playerid))
  439. {
  440. AdminInfo[playerid][aAdmin] = 1;
  441. SendClientMessage(playerid, COLOR_SILVER, "INFO: Administration given, you can now use /adminregister to register yourself as an admin.");
  442. }
  443. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  444. return 1;
  445. }
  446.  
  447. COMMAND:adminlogin(playerid, params[])
  448. {
  449. if(AdminInfo[playerid][aLoggedOn] == 1) { SendClientMessage(playerid, COLOR_GREY, "INFO: You have already logged into your administration account."); }
  450. if(fexist(AdminAccountPath(playerid))) { DisplayLoginDialog(playerid); }
  451. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  452. return 1;
  453. }
  454.  
  455. COMMAND:adminregister(playerid, params[])
  456. {
  457. if(AdminInfo[playerid][aAdmin] >= 2) { SendClientMessage(playerid, COLOR_GREY, "INFO: You already have an existing administration account."); }
  458. if(AdminInfo[playerid][aAdmin] == 1) // Checks in un-registered admin
  459. {
  460. DisplayRegisterDialog(playerid);
  461. }
  462. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  463. return 1;
  464. }
  465.  
  466. COMMAND:admins(playerid, params[])
  467. {
  468. new string[128];
  469. SendClientMessage(playerid, COLOR_WHITE, "__________________________________________________");
  470. SendClientMessage(playerid, COLOR_WHITE, " ONLINE ADMINISTRATORS ");
  471. new found = 0;
  472. foreach (Player,i)
  473. {
  474. if(AdminInfo[i][aAdmin] >= 1)
  475. {
  476. if(AdminInfo[i][aAdmin] != 5)
  477. {
  478. format(string, sizeof(string), "ONLINE: %s (%s): %s [ID: %d]", GetAdminLevelName(i), GetName(i), i);
  479. SendClientMessage(playerid, COLOR_FADE, string);
  480. }
  481. found++;
  482. }
  483. }
  484. if(found == 0)
  485. {
  486. SendClientMessage(playerid, COLOR_FADE, "INFO: No admins online.");
  487. }
  488. SendClientMessage(playerid, COLOR_WHITE, "__________________________________________________");
  489. return 1;
  490. }
  491.  
  492. //====================================================
  493. /* LEVEL 1 COMMANDS */
  494. //====================================================
  495.  
  496. COMMAND:mute(playerid, params[])
  497. {
  498. new string[80], targetid;
  499. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /mute [PlayerID/PartOfName]");
  500. else
  501. {
  502. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  503. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
  504. if(AdminInfo[playerid][aAdmin] >= 2)
  505. {
  506. format(string,sizeof(string), "AdmCMD: %s %s muted %s", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid));
  507. SendAdminMessage(COLOR_BLUE,string);
  508. Muted[targetid] = 1;
  509. }
  510. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  511. }
  512. return 1;
  513. }
  514.  
  515. COMMAND:unmute(playerid, params[])
  516. {
  517. new string[80], targetid;
  518. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /unmute [PlayerID/PartOfName]");
  519. else
  520. {
  521. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  522. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
  523. if(Muted[targetid] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: This player is already unmuted.");
  524. if(AdminInfo[playerid][aAdmin] >= 2)
  525. {
  526. format(string,sizeof(string), "AdmCMD: %s %s unmuted %s", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid));
  527. SendAdminMessage(COLOR_BLUE,string);
  528. Muted[targetid] = 0;
  529. }
  530. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  531. }
  532. return 1;
  533. }
  534.  
  535. COMMAND:kick(playerid, params[])
  536. {
  537. new string[80], targetid, reason;
  538. if(sscanf(params, "us[80]", targetid, reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [PlayerID/PartOfName] [Reason]");
  539. else
  540. {
  541. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  542. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
  543. if(AdminInfo[playerid][aAdmin] >= 2)
  544. {
  545. format(string,sizeof(string), "ADMCMD: %s %s kicked %s for reason:[%s]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), reason);
  546. SendClientMessageToAll(COLOR_RED, string);
  547. Kick(targetid);
  548. }
  549. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  550. }
  551. return 1;
  552. }
  553.  
  554. COMMAND:getid(playerid, params[])
  555. {
  556. new targetid[128],targetid2,string[128];
  557. if(sscanf(params, "s[128]", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /getid [playerid/PartOfName]");
  558. else
  559. {
  560. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  561. targetid2 = ReturnUser(targetid);
  562. if(IsPlayerConnected(targetid2))
  563. {
  564. if(AdminInfo[playerid][aAdmin] >= 2)
  565. {
  566. format(string, sizeof(string), "ID: (%d) %s",targetid2,GetName(playerid));
  567. SendClientMessage(playerid, COLOR_GREY, string);
  568. }
  569. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  570. }
  571. }
  572. return 1;
  573. }
  574.  
  575. COMMAND:a(playerid, params[])
  576. {
  577. new message[128],string[128];
  578. if(sscanf(params, "s[128]", message)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /a [ADMINISTRATION CHAT]");
  579. else
  580. {
  581. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  582. if(AdminInfo[playerid][aAdmin] >= 2)
  583. {
  584. format(string, sizeof(string), "*ADMCHAT: %s %s: %s *", GetAdminLevelName(playerid), GetName(playerid), message);
  585. SendAdminMessage(COLOR_BLUE, string);
  586. }
  587. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  588. }
  589. return 1;
  590. }
  591.  
  592. COMMAND:checkhealth(playerid, params[])
  593. {
  594. new targetid,string[128];
  595. if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /checkhealth [playerid]");
  596. else
  597. {
  598. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  599. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  600. if(AdminInfo[playerid][aAdmin] >= 2)
  601. {
  602. new Float:shealth;
  603. GetPlayerHealth(targetid,shealth);
  604. format(string, sizeof(string), "INFO: %s Health is: %.2f.", GetName(targetid),shealth);
  605. SendClientMessage(playerid, COLOR_GREY, string);
  606. }
  607. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  608. }
  609. return 1;
  610. }
  611.  
  612. COMMAND:checkarmour(playerid, params[])
  613. {
  614. new targetid,string[128];
  615. if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /checkarmour [playerid]");
  616. else
  617. {
  618. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  619. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  620. if(AdminInfo[playerid][aAdmin] >= 2)
  621. {
  622. new Float:shealth;
  623. GetPlayerArmour(targetid,shealth);
  624. format(string, sizeof(string), "INFO: %s Armour is: %.2f.", GetName(targetid),shealth);
  625. SendClientMessage(playerid, COLOR_GREY, string);
  626. }
  627. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  628. }
  629. return 1;
  630. }
  631.  
  632. COMMAND:checkweapons(playerid, params[])
  633. {
  634. new targetid,string[128];
  635. if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /checkweapons [playerid]");
  636. else
  637. {
  638. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  639. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  640. if(AdminInfo[playerid][aAdmin] >= 2)
  641. {
  642. new sweapon, sammo;
  643. format(string, sizeof(string), "%s has the following weapons:", GetName(targetid));
  644. SendClientMessage(playerid, COLOR_GREY, string);
  645. for (new i=0; i<9; i++)
  646. {
  647. GetPlayerWeaponData(targetid, i, sweapon, sammo);
  648. if(sweapon != 0)
  649. {
  650. format(string, sizeof(string), "%d: %d (%d)", i, sweapon, sammo);
  651. SendClientMessage(playerid, COLOR_GREY, string);
  652. }
  653. }
  654. }
  655. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  656. }
  657. return 1;
  658. }
  659.  
  660. COMMAND:gotols(playerid, params[])
  661. {
  662. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  663. if(AdminInfo[playerid][aAdmin] >= 2)
  664. {
  665. SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
  666. if(IsPlayerInAnyVehicle(playerid))
  667. {
  668. SetVehiclePos(GetPlayerVehicleID(playerid),1529.6,-1691.2,13.3);
  669. }
  670. else
  671. {
  672. SetPlayerPos(playerid,1529.6,-1691.2,13.3);
  673. SetPlayerInterior(playerid,0);
  674. SetPlayerVirtualWorld(playerid,0);
  675. }
  676. }
  677. else
  678. {
  679. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  680. }
  681. return 1;
  682. }
  683.  
  684. COMMAND:gotolv(playerid, params[])
  685. {
  686. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  687. if(AdminInfo[playerid][aAdmin] >= 2)
  688. {
  689. SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
  690. if(IsPlayerInAnyVehicle(playerid))
  691. {
  692. SetVehiclePos(GetPlayerVehicleID(playerid),1699.2, 1435.1, 10.7);
  693. }
  694. else
  695. {
  696. SetPlayerPos(playerid,1699.2, 1435.1, 10.7);
  697. SetPlayerInterior(playerid,0);
  698. SetPlayerVirtualWorld(playerid,0);
  699. }
  700. }
  701. else
  702. {
  703. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  704. }
  705. return 1;
  706. }
  707.  
  708. COMMAND:gotosf(playerid, params[])
  709. {
  710. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  711. if(AdminInfo[playerid][aAdmin] >= 2)
  712. {
  713. SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
  714. if(IsPlayerInAnyVehicle(playerid))
  715. {
  716. SetVehiclePos(GetPlayerVehicleID(playerid),-1417.0,-295.8,14.1);
  717. }
  718. else
  719. {
  720. SetPlayerPos(playerid,-1417.0,-295.8,14.1);
  721. SetPlayerInterior(playerid,0);
  722. SetPlayerVirtualWorld(playerid,0);
  723. }
  724. }
  725. else
  726. {
  727. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  728. }
  729. return 1;
  730. }
  731.  
  732. COMMAND:gotogas(playerid, params[])
  733. {
  734. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  735. if(AdminInfo[playerid][aAdmin] >= 2)
  736. {
  737. SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
  738. if(IsPlayerInAnyVehicle(playerid))
  739. {
  740. SetVehiclePos(GetPlayerVehicleID(playerid),1943.5698,-1771.3066,19.5250);
  741. }
  742. else
  743. {
  744. SetPlayerPos(playerid,1943.5698,-1771.3066,19.5250);
  745. SetPlayerInterior(playerid,0);
  746. SetPlayerVirtualWorld(playerid,0);
  747. }
  748. }
  749. else
  750. {
  751. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  752. }
  753. return 1;
  754. }
  755.  
  756. COMMAND:gotoelcorona(playerid, params[])
  757. {
  758. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  759. if(AdminInfo[playerid][aAdmin] >= 2)
  760. {
  761. SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
  762. if(IsPlayerInAnyVehicle(playerid))
  763. {
  764. SetVehiclePos(GetPlayerVehicleID(playerid),1908.7719,-2020.0188,13.5469);
  765. }
  766. else
  767. {
  768. SetPlayerPos(playerid,1908.7719,-2020.0188,13.5469);
  769. SetPlayerInterior(playerid,0);
  770. SetPlayerVirtualWorld(playerid,0);
  771. }
  772. }
  773. else
  774. {
  775. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  776. }
  777. return 1;
  778. }
  779.  
  780. COMMAND:gotogrove(playerid, params[])
  781. {
  782. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  783. if(AdminInfo[playerid][aAdmin] >= 2)
  784. {
  785. SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
  786. if(IsPlayerInAnyVehicle(playerid))
  787. {
  788. SetVehiclePos(GetPlayerVehicleID(playerid),2529.5720,-1667.7911,15.1690);
  789. }
  790. else
  791. {
  792. SetPlayerPos(playerid,2529.5720,-1667.7911,15.1690);
  793. SetPlayerInterior(playerid,0);
  794. SetPlayerVirtualWorld(playerid,0);
  795. }
  796. }
  797. else
  798. {
  799. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  800. }
  801. return 1;
  802. }
  803.  
  804. COMMAND:gotomotel(playerid, params[])
  805. {
  806. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  807. if(AdminInfo[playerid][aAdmin] >= 2)
  808. {
  809. SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
  810. if(IsPlayerInAnyVehicle(playerid))
  811. {
  812. SetVehiclePos(GetPlayerVehicleID(playerid),2196.0056,-1139.6841,38.1016);
  813. }
  814. else
  815. {
  816. SetPlayerPos(playerid,2196.0056,-1139.6841,38.1016);
  817. SetPlayerInterior(playerid,0);
  818. SetPlayerVirtualWorld(playerid,0);
  819. }
  820. }
  821. else
  822. {
  823. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  824. }
  825. return 1;
  826. }
  827.  
  828. COMMAND:gotobank(playerid, params[])
  829. {
  830. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  831. if(AdminInfo[playerid][aAdmin] >= 2)
  832. {
  833. SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
  834. if(IsPlayerInAnyVehicle(playerid))
  835. {
  836. SetVehiclePos(GetPlayerVehicleID(playerid),1448.1796,-1010.7741,26.8438);
  837. }
  838. else
  839. {
  840. SetPlayerPos(playerid,1448.1796,-1010.7741,26.8438);
  841. SetPlayerInterior(playerid,0);
  842. SetPlayerVirtualWorld(playerid,0);
  843. }
  844. }
  845. else
  846. {
  847. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  848. }
  849. return 1;
  850. }
  851.  
  852. COMMAND:setskin(playerid, params[])
  853. {
  854. new type, targetid, string[40];
  855. if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setskin [PlayerID/PartOfName] [Skin ID]");
  856. else
  857. {
  858. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  859. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  860. if(AdminInfo[playerid][aAdmin] >= 2)
  861. {
  862. if(type < 0 || type > 299) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot use IDs under 0 or over 299");
  863. format(string,sizeof(string), "AdmCMD: %s %s has set %s to SKIN-ID: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
  864. SendAdminMessage(COLOR_BLUE, string);
  865. SendClientMessage(targetid, COLOR_WHITE, "INFO: Skin ID has been changed by an Administrator.");
  866. SetPlayerSkin(targetid, type);
  867. }
  868. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command."); }
  869. }
  870. return 1;
  871. }
  872.  
  873. COMMAND:setworld(playerid, params[])
  874. {
  875. new type, targetid, string[40];
  876. if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setworld [PlayerID/PartOfName] [World ID]");
  877. else
  878. {
  879. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  880. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  881. if(AdminInfo[playerid][aAdmin] >= 2)
  882. {
  883. if(type < 0 || type > 1000) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot use IDs under 0 or over 1000");
  884. format(string,sizeof(string), "AdmCMD: %s %s has set %s to WORLD-ID: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
  885. SendAdminMessage(COLOR_BLUE, string);
  886. SendClientMessage(targetid, COLOR_WHITE, "INFO: World ID has been changed by an Administrator.");
  887. SetPlayerVirtualWorld(targetid, type);
  888. }
  889. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command."); }
  890. }
  891. return 1;
  892. }
  893.  
  894. COMMAND:setint(playerid, params[])
  895. {
  896. new type, targetid, string[40];
  897. if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setint [PlayerID/PartOfName] [Interior ID]");
  898. else
  899. {
  900. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  901. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  902. if(AdminInfo[playerid][aAdmin] >= 2)
  903. {
  904. format(string,sizeof(string), "AdmCMD: %s %s has set %s to INTERIOR-ID: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
  905. SendAdminMessage(COLOR_BLUE, string);
  906. SendClientMessage(targetid, COLOR_WHITE, "INFO: Interior ID has been changed by an Administrator.");
  907. SetPlayerVirtualWorld(targetid, type);
  908. }
  909. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command."); }
  910. }
  911. return 1;
  912. }
  913.  
  914. COMMAND:setpos(playerid, params[])
  915. {
  916. new typeX, typeY, typeZ, targetid, string[40];
  917. if(sscanf(params, "ufff", targetid, typeX, typeY, typeZ)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setpos [PlayerID/PartOfName] [Coord X] [Coord Y] [Coord Z]");
  918. else
  919. {
  920. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  921. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  922. if(AdminInfo[playerid][aAdmin] >= 2)
  923. {
  924. format(string,sizeof(string), "AdmCMD: %s %s has set %s's COORDINATES to: X:[%d] Y:[%d] Z:[%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), typeX, typeY, typeZ);
  925. SendAdminMessage(COLOR_BLUE, string);
  926. SendClientMessage(targetid, COLOR_WHITE, "INFO: Position has been changed by an Administrator.");
  927. SetPlayerPos(targetid, typeX, typeY, typeZ);
  928. }
  929. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command."); }
  930. }
  931. return 1;
  932. }
  933.  
  934. //====================================================
  935. /* LEVEL 2 COMMANDS */
  936. //====================================================
  937.  
  938. COMMAND:shakeplayerscreen(playerid, params[])
  939. {
  940. new targetid, time, string[60];
  941. if(sscanf(params, "ui", targetid, time)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /shakeplayerscreen [PlayerID/PartOfName] [time]");
  942. else
  943. {
  944. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  945. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
  946. if(AdminInfo[playerid][aAdmin] >= 3)
  947. {
  948. format(string,sizeof(string), "AdmCMD: %s %s has shaken %s's screen for time: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), time);
  949. SendAdminMessage(COLOR_BLUE, string);
  950. SendClientMessage(targetid, COLOR_WHITE, "INFO: Youre screen has begun to shake. Reason:[Administrative command]");
  951. ShakePlayerScreen(targetid, time);
  952. }
  953. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  954. }
  955. return 1;
  956. }
  957.  
  958. COMMAND:getvehiclespeed(playerid, params[])
  959. {
  960. new vehicleid, string[50];
  961. if(sscanf(params, "u", vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /getvehiclespeed [VehicleID]");
  962. else
  963. {
  964. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  965. if(AdminInfo[playerid][aAdmin] >= 3)
  966. {
  967. GetVehicleSpeed(vehicleid);
  968. format(string,sizeof(string), "INFO: Vehicle speed. (VEHICLE ID:[%d] SPEED:[%d])",vehicleid, GetVehicleSpeed(vehicleid));
  969. SendClientMessage(playerid, COLOR_GREY, string);
  970. }
  971. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  972. }
  973. return 1;
  974. }
  975.  
  976. COMMAND:getvehicleangle(playerid, params[])
  977. {
  978. new vehicleid, string[50];
  979. if(sscanf(params, "u", vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /getvehicleangle [VehicleID]");
  980. else
  981. {
  982. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  983. if(AdminInfo[playerid][aAdmin] >= 3)
  984. {
  985. format(string,sizeof(string), "INFO: Vehicle angle. (VEHICLE ID:[%d] ANGLE:[%d])", vehicleid, GetVehiclesAngle(vehicleid));
  986. SendClientMessage(playerid, COLOR_GREY, string);
  987. }
  988. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  989. }
  990. return 1;
  991. }
  992.  
  993. COMMAND:getvehiclehealth(playerid, params[])
  994. {
  995. new vehicleid, string[50];
  996. if(sscanf(params, "u", vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /getvehiclehealth [VehicleID]");
  997. else
  998. {
  999. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  1000. if(AdminInfo[playerid][aAdmin] >= 3)
  1001. {
  1002. format(string,sizeof(string), "INFO: Vehicle angle. (VEHICLE ID:[%d] HEALTH:[%d])",vehicleid, GetVehiclesHealth(vehicleid));
  1003. SendClientMessage(playerid, COLOR_GREY, string);
  1004. }
  1005. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  1006. }
  1007. return 1;
  1008. }
  1009.  
  1010. COMMAND:ban(playerid, params[])
  1011. {
  1012. new string[80], targetid, reason;
  1013. if(sscanf(params, "us[80]", targetid, reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [PlayerID/PartOfName] [Reason]");
  1014. else
  1015. {
  1016. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  1017. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
  1018. if(AdminInfo[playerid][aAdmin] >= 3)
  1019. {
  1020. format(string,sizeof(string), "ADMCMD: %s %s banned %s for reason:[%s]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), reason);
  1021. SendClientMessageToAll(COLOR_RED, string);
  1022. SendClientMessage(targetid, COLOR_WHITE, "SERVER: You have been banned from this server.");
  1023. PlayerInfo[targetid][pBanned] = 1;
  1024. Kick(targetid);
  1025. }
  1026. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  1027. }
  1028. return 1;
  1029. }
  1030.  
  1031. COMMAND:getip(playerid, params[])
  1032. {
  1033. new string[80], targetid;
  1034. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [PlayerID/PartOfName]");
  1035. else
  1036. {
  1037. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  1038. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
  1039. if(AdminInfo[playerid][aAdmin] >= 3)
  1040. {
  1041. format(string,sizeof(string), "INFO: %s(IP:[%s])", GetName(targetid),GetPlayersIP(targetid));
  1042. SendClientMessage(targetid, COLOR_GREY, string);
  1043. }
  1044. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  1045. }
  1046. return 1;
  1047. }
  1048.  
  1049. COMMAND:hack(playerid, params[])
  1050. {
  1051. new targetid;
  1052. if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /hack [playerid]");
  1053. else
  1054. {
  1055. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1056. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1057. if(AdminInfo[playerid][aAdmin] >= 3)
  1058. {
  1059. new Float:health;
  1060. GetPlayerHealth(targetid,health);
  1061. SetPlayerHealth(targetid,health-1.0);
  1062. SendClientMessage(playerid,COLOR_YELLOW,"INFO: Players health has been -1 down.");
  1063. }
  1064. else
  1065. {
  1066. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  1067. }
  1068. }
  1069. return 1;
  1070. }
  1071.  
  1072. COMMAND:spec(playerid, params[])
  1073. {
  1074. new targetid;
  1075. if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /spec [playerid]");
  1076. else
  1077. {
  1078. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1079. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1080. if(AdminInfo[playerid][aAdmin] >= 3)
  1081. {
  1082. Spectate[playerid] = 0;
  1083. if (IsPlayerInAnyVehicle(targetid))
  1084. {
  1085. TogglePlayerSpectatingEx(playerid, 1);
  1086. PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid));
  1087. SetPlayerInterior(playerid,GetPlayerInterior(targetid));
  1088. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(targetid));
  1089. }
  1090. else
  1091. {
  1092. TogglePlayerSpectatingEx(playerid, 1);
  1093. PlayerSpectatePlayer(playerid, targetid);
  1094. SetPlayerInterior(playerid,GetPlayerInterior(targetid));
  1095. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(targetid));
  1096. }
  1097. }
  1098. else
  1099. {
  1100. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  1101. }
  1102. }
  1103. return 1;
  1104. }
  1105.  
  1106. COMMAND:specoff(playerid, params[])
  1107. {
  1108. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1109. if(AdminInfo[playerid][aAdmin] >= 3)
  1110. {
  1111. TogglePlayerSpectatingEx(playerid, 0);
  1112. SetPlayerPos(playerid,1642.2334,-2240.4983,13.4952);
  1113. SetPlayerFacingAngle(playerid, 0);
  1114. SetPlayerInterior(playerid,0);
  1115. }
  1116. else
  1117. {
  1118. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  1119. }
  1120. return 1;
  1121. }
  1122.  
  1123. COMMAND:gethere(playerid, params[])
  1124. {
  1125. new targetid;
  1126. if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /gethere [playerid]");
  1127. else
  1128. {
  1129. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1130. if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1131. if(AdminInfo[playerid][aAdmin] >= 3)
  1132. {
  1133. new Float:x,Float:y,Float:z;
  1134. GetPlayerPos(playerid,x,y,z);
  1135. SetPlayerPos(targetid,x,y,z);
  1136. SetPlayerVirtualWorld(targetid,GetPlayerVirtualWorld(playerid));
  1137. SetPlayerInterior(targetid,GetPlayerInterior(playerid));
  1138. SendClientMessage(targetid,COLOR_GREY,"INFO: You have been teleported.");
  1139. }
  1140. else
  1141. {
  1142. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  1143. }
  1144. }
  1145. return 1;
  1146. }
  1147.  
  1148. COMMAND:goto(playerid, params[])
  1149. {
  1150. new targetid;
  1151. if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /goto [playerid]");
  1152. else
  1153. {
  1154. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1155. if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1156. if(AdminInfo[playerid][aAdmin] >= 3)
  1157. {
  1158. new Float:x,Float:y,Float:z;
  1159. GetPlayerPos(targetid,x,y,z);
  1160. SetPlayerPos(playerid,x,y,z);
  1161. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(targetid));
  1162. SetPlayerInterior(playerid,GetPlayerInterior(targetid));
  1163. SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
  1164. }
  1165. else
  1166. {
  1167. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  1168. }
  1169. }
  1170. return 1;
  1171. }
  1172.  
  1173. //====================================================
  1174. /* LEVEL 3 COMMANDS */
  1175. //====================================================
  1176.  
  1177. COMMAND:givegun(playerid, params[])
  1178. {
  1179. new targetid,type,type2,string[128];
  1180. if(sscanf(params, "uii", targetid, type, type2)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /giveweapon [playerid] [weaponid] [ammo]");
  1181. else
  1182. {
  1183. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1184. if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1185. if(type < 0 || type > 50) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 50.");
  1186. if(type2 < 0 || type2 > 9999) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 9999.");
  1187. if(AdminInfo[playerid][aAdmin] >= 4)
  1188. {
  1189. GivePlayerWeapon(targetid,type,type2);
  1190. format(string, sizeof(string),"AdmCmd: %s %s has given %s weapon id: %d with %d bullets", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type, type2);
  1191. SendAdminMessage(COLOR_BLUE,string);
  1192. }
  1193. else
  1194. {
  1195. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  1196. }
  1197. }
  1198. return 1;
  1199. }
  1200.  
  1201. COMMAND:givecash(playerid, params[])
  1202. {
  1203. new targetid;
  1204. new type;
  1205. new string[256];
  1206. if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /givecash [playerid] [amount]");
  1207. else
  1208. {
  1209. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1210. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_FADE, "SERVER: Sorry this player is not currently connected");
  1211. if(type < 0 || type > 10000) return SendClientMessage(playerid, COLOR_FADE, "SERVER: Cannot go under $0 or above $10,000.");
  1212. if(AdminInfo[playerid][aAdmin] >= 4)
  1213. {
  1214. GivePlayerMoney(targetid, type);
  1215. format(string, sizeof(string), "AdmCMD: %s has given %s $%i", GetName(playerid), GetName(targetid), type);
  1216. SendAdminMessage(COLOR_BLUE, string);
  1217. format(string, sizeof(string), "SERVER: %s has given you $%i", GetName(playerid), type);
  1218. SendClientMessage(playerid, COLOR_WHITE, string);
  1219. }
  1220. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1221. }
  1222. return 1;
  1223. }
  1224.  
  1225. COMMAND:killplayer(playerid, params[])
  1226. {
  1227. new targetid,string[60];
  1228. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /killplayer [PlayerID/PartOfName]");
  1229. else
  1230. {
  1231. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_FADE, "SERVER: Sorry this player is not currently connected");
  1232. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1233. if(AdminInfo[playerid][aAdmin] >= 4)
  1234. {
  1235. format(string,sizeof(string), "AdmCMD: %s %s has force killed %s", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid));
  1236. SendAdminMessage(COLOR_BLUE, string);
  1237. SetPlayerHealth(targetid, 0);
  1238. }
  1239. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1240. }
  1241. return 1;
  1242. }
  1243.  
  1244. COMMAND:removeweapon(playerid, params[])
  1245. {
  1246. new type,targetid,string[60];
  1247. if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /removeweapon [PlayerID/PartOfName] [Weapon ID]");
  1248. else
  1249. {
  1250. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_FADE, "SERVER: Sorry this player is not currently connected");
  1251. if(type < 0 || type > 80) return SendClientMessage(playerid, COLOR_FADE, "SERVER: Cannot go under 1 or over 80");
  1252. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1253. if(AdminInfo[playerid][aAdmin] >= 4)
  1254. {
  1255. format(string,sizeof(string), "AdmCMD: %s %s has removed WEAPON-ID:[%d] from %s", GetAdminLevelName(playerid), GetName(playerid), type, GetName(targetid));
  1256. SendAdminMessage(COLOR_BLUE, string);
  1257. RemovePlayerWeapon(targetid,type);
  1258. }
  1259. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1260. }
  1261. return 1;
  1262. }
  1263.  
  1264. COMMAND:crashplayer(playerid, params[])
  1265. {
  1266. new targetid,string[128];
  1267. if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /crashplayer [PlayerID/PartOfName]");
  1268. else
  1269. {
  1270. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1271. if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1272. if(AdminInfo[playerid][aAdmin] >= 4)
  1273. {
  1274. CrashPlayer(targetid);
  1275. format(string, sizeof(string),"AdmCMD: %s %s has force crashed %s", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid));
  1276. SendAdminMessage(COLOR_BLUE,string);
  1277. SendClientMessage(targetid, COLOR_WHITE, "INFO: You have been force crashed by an Administrator.");
  1278. }
  1279. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1280. }
  1281. return 1;
  1282. }
  1283.  
  1284. COMMAND:explodeplayer(playerid, params[])
  1285. {
  1286. new targetid,string[128];
  1287. if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /explodeplayer [PlayerID/PartOfName]");
  1288. else
  1289. {
  1290. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1291. if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1292. if(AdminInfo[playerid][aAdmin] >= 4)
  1293. {
  1294. ExplodePlayer(targetid);
  1295. format(string, sizeof(string),"AdmCMD: %s %s has exploded %s", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid));
  1296. SendAdminMessage(COLOR_BLUE,string);
  1297. SendClientMessage(targetid, COLOR_WHITE, "INFO: You have been exploded by an Administrator.");
  1298. }
  1299. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1300. }
  1301. return 1;
  1302. }
  1303.  
  1304. COMMAND:explodevehicle(playerid, params[])
  1305. {
  1306. new vehicleid,string[128];
  1307. if(sscanf(params, "u", vehicleid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /explodevehicle [PlayerID/PartOfName]");
  1308. else
  1309. {
  1310. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1311. if(AdminInfo[playerid][aAdmin] >= 4)
  1312. {
  1313. ExplodeVehicle(vehicleid);
  1314. format(string, sizeof(string),"AdmCMD: %s %s has exploded VEHICLE-ID:[%d]", GetAdminLevelName(playerid), GetName(playerid), vehicleid);
  1315. SendAdminMessage(COLOR_BLUE,string);
  1316. }
  1317. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1318. }
  1319. return 1;
  1320. }
  1321.  
  1322. COMMAND:setplayermoney(playerid, params[])
  1323. {
  1324. new targetid,type,string[128];
  1325. if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setplayerarmour [PlayerID/PartOfName] [Armour]");
  1326. else
  1327. {
  1328. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1329. if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1330. if(type < 0 || type > 100) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 50.");
  1331. if(AdminInfo[playerid][aAdmin] >= 4)
  1332. {
  1333. SetPlayerMoney(targetid, type);
  1334. format(string, sizeof(string),"AdmCMD: %s %s has set %s's MONEY to: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
  1335. SendAdminMessage(COLOR_BLUE,string);
  1336. }
  1337. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1338. }
  1339. return 1;
  1340. }
  1341.  
  1342. COMMAND:countallplayers(playerid, params[])
  1343. {
  1344. new string[60];
  1345. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1346. if(AdminInfo[playerid][aAdmin] >= 4)
  1347. {
  1348. format(string,sizeof(string), "INFO: There is currently %d players on the server.", CountTotalPlayers());
  1349. SendClientMessage(playerid, COLOR_GREY, string);
  1350. }
  1351. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1352. return 1;
  1353. }
  1354.  
  1355. COMMAND:countallvehicles(playerid, params[])
  1356. {
  1357. new string[60];
  1358. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1359. if(AdminInfo[playerid][aAdmin] >= 4)
  1360. {
  1361. format(string,sizeof(string), "INFO: There is currently %d vehicles on the server.", CountTotalVehicles());
  1362. SendClientMessage(playerid, COLOR_GREY, string);
  1363. }
  1364. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1365. return 1;
  1366. }
  1367.  
  1368. COMMAND:countallpausedplayers(playerid, params[])
  1369. {
  1370. new string[60];
  1371. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1372. if(AdminInfo[playerid][aAdmin] >= 4)
  1373. {
  1374. format(string,sizeof(string), "INFO: There is currently %d vehicles on the server.", CountTotalPausedPlayers());
  1375. SendClientMessage(playerid, COLOR_GREY, string);
  1376. }
  1377. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1378. return 1;
  1379. }
  1380.  
  1381. COMMAND:clearplayerchat(playerid, params[])
  1382. {
  1383. new targetid;
  1384. if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /clearplayerchat [PlayerID/PartOfName]");
  1385. else
  1386. {
  1387. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1388. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1389. if(AdminInfo[playerid][aAdmin] >= 4)
  1390. {
  1391. ClearPlayersChat(targetid);
  1392. SendClientMessage(targetid, COLOR_WHITE, "INFO: Your chat has been cleared by an Administrator.");
  1393. SendClientMessage(playerid, COLOR_WHITE, "INFO: You have cleared that players chat box.");
  1394. }
  1395. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1396. }
  1397. return 1;
  1398. }
  1399.  
  1400. COMMAND:clearallplayerchat(playerid, params[])
  1401. {
  1402. new string[80];
  1403. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1404. if(AdminInfo[playerid][aAdmin] >= 4)
  1405. {
  1406. format(string,sizeof(string),"AdmCMD: %s %s has cleared all player chat boxes.");
  1407. SendClientMessageToAll(COLOR_WHITE, string);
  1408. foreach(Player, i)
  1409. {
  1410. ClearPlayersChat(i);
  1411. }
  1412. }
  1413. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1414. return 1;
  1415. }
  1416.  
  1417. COMMAND:setplayerhealth(playerid, params[])
  1418. {
  1419. new targetid,type,string[128];
  1420. if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setplayerhealth [PlayerID/PartOfName] [Health]");
  1421. else
  1422. {
  1423. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1424. if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1425. if(type < 0 || type > 100) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 50.");
  1426. if(AdminInfo[playerid][aAdmin] >= 4)
  1427. {
  1428. SetPlayerHealth(targetid, type);
  1429. format(string, sizeof(string),"AdmCMD: %s %s has set %s's HEALTH to: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
  1430. SendAdminMessage(COLOR_BLUE,string);
  1431. }
  1432. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1433. }
  1434. return 1;
  1435. }
  1436.  
  1437. COMMAND:setplayerarmour(playerid, params[])
  1438. {
  1439. new targetid,type,string[128];
  1440. if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setplayerarmour [PlayerID/PartOfName] [Armour]");
  1441. else
  1442. {
  1443. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1444. if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1445. if(type < 0 || type > 100) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 50.");
  1446. if(AdminInfo[playerid][aAdmin] >= 4)
  1447. {
  1448. SetPlayerArmour(targetid, type);
  1449. format(string, sizeof(string),"AdmCMD: %s %s has set %s's ARMOUR to: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
  1450. SendAdminMessage(COLOR_BLUE,string);
  1451. }
  1452. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1453. }
  1454. return 1;
  1455. }
  1456.  
  1457. //====================================================
  1458. /* LEVEL 4 COMMANDS */
  1459. //====================================================
  1460.  
  1461. COMMAND:getallplayers(playerid, params[])
  1462. {
  1463. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1464. if(AdminInfo[playerid][aAdmin] >= 5)
  1465. {
  1466. new Float:x,Float:y,Float:z;
  1467. GetPlayerPos(playerid,x,y,z);
  1468. foreach(Player, i)
  1469. {
  1470. SetPlayerPos(i, x, y, z);
  1471. SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid));
  1472. SetPlayerInterior(i,GetPlayerInterior(playerid));
  1473. SendClientMessage(i,COLOR_GREY,"INFO: You have been teleported.");
  1474. }
  1475. }
  1476. else
  1477. {
  1478. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  1479. }
  1480. return 1;
  1481. }
  1482.  
  1483. COMMAND:countallrconadmins(playerid, params[])
  1484. {
  1485. new string[60];
  1486. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1487. if(AdminInfo[playerid][aAdmin] >= 5)
  1488. {
  1489. format(string,sizeof(string), "INFO: There is currently %d RCON Administrators online.", CountTotalRCONAdmins());
  1490. SendClientMessage(playerid, COLOR_GREY, string);
  1491. }
  1492. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1493. return 1;
  1494. }
  1495.  
  1496. COMMAND:countallnps(playerid, params[])
  1497. {
  1498. new string[60];
  1499. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1500. if(AdminInfo[playerid][aAdmin] >= 5)
  1501. {
  1502. format(string,sizeof(string), "INFO: There is currently %d NPCs on the server.", CountTotalNPCs());
  1503. SendClientMessage(playerid, COLOR_GREY, string);
  1504. }
  1505. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1506. return 1;
  1507. }
  1508.  
  1509. COMMAND:countallobjects(playerid, params[])
  1510. {
  1511. new string[60];
  1512. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1513. if(AdminInfo[playerid][aAdmin] >= 5)
  1514. {
  1515. format(string,sizeof(string), "INFO: There is currently %d objects on the server.", CountTotalObjects());
  1516. SendClientMessage(playerid, COLOR_GREY, string);
  1517. }
  1518. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1519. return 1;
  1520. }
  1521.  
  1522. COMMAND:sendrconmessagetoserver(playerid, params[])
  1523. {
  1524. new message[60];
  1525. if(sscanf(params,"s[60]", message)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /sendrconmessagetoserver [SERVER MESSAGE]");
  1526. else
  1527. {
  1528. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1529. if(AdminInfo[playerid][aAdmin] >= 5)
  1530. {
  1531. SendServerRCONMessage(message);
  1532. }
  1533. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
  1534. }
  1535. return 1;
  1536. }
  1537.  
  1538. COMMAND:sendmessagetorconadmins(playerid, params[])
  1539. {
  1540. new message[60];
  1541. if(sscanf(params,"s[60]", message)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /sendmessagetorconadmins [MESSAGE]");
  1542. else
  1543. {
  1544. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1545. if(AdminInfo[playerid][aAdmin] >= 5)
  1546. {
  1547. SendMessageToRCONAdmins(COLOR_SILVER,message);
  1548. }
  1549. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
  1550. }
  1551. return 1;
  1552. }
  1553.  
  1554. COMMAND:changeservername(playerid, params[])
  1555. {
  1556. new newservername[60];
  1557. if(sscanf(params,"s[60]", newservername)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeservername [SERVER NAME]");
  1558. else
  1559. {
  1560. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1561. if(AdminInfo[playerid][aAdmin] >= 5)
  1562. {
  1563. ChangeServerName(newservername);
  1564. SendClientMessage(playerid, COLOR_WHITE, "INFO: You have successfully changed the server password.");
  1565. }
  1566. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
  1567. }
  1568. return 1;
  1569. }
  1570.  
  1571. COMMAND:changeserverpassword(playerid, params[])
  1572. {
  1573. new newpassword[60];
  1574. if(sscanf(params,"s[60]", newpassword)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeserverpassword [PASSWORD]");
  1575. else
  1576. {
  1577. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1578. if(AdminInfo[playerid][aAdmin] >= 5)
  1579. {
  1580. ChangeServerPassword(newpassword);
  1581. SendClientMessage(playerid, COLOR_WHITE, "INFO: You have successfully changed the server password.");
  1582. }
  1583. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
  1584. }
  1585. return 1;
  1586. }
  1587.  
  1588. COMMAND:changeservermap(playerid, params[])
  1589. {
  1590. new newmap[60];
  1591. if(sscanf(params,"s[60]", newmap)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeservermap [MAP NAME]");
  1592. else
  1593. {
  1594. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1595. if(AdminInfo[playerid][aAdmin] >= 5)
  1596. {
  1597. ChangeMapName(newmap);
  1598. SendClientMessage(playerid, COLOR_WHITE, "INFO: You have successfully changed the server map name.");
  1599. }
  1600. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
  1601. }
  1602. return 1;
  1603. }
  1604.  
  1605. COMMAND:changeserverwebsite(playerid, params[])
  1606. {
  1607. new newwebsite[60];
  1608. if(sscanf(params,"s[60]", newwebsite)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeserverwebsite [WEBSITE URL]");
  1609. else
  1610. {
  1611. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1612. if(AdminInfo[playerid][aAdmin] >= 5)
  1613. {
  1614. ChangeServerWebsite(newwebsite);
  1615. SendClientMessage(playerid, COLOR_WHITE, "INFO: You have successfully changed the server map name.");
  1616. }
  1617. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
  1618. }
  1619. return 1;
  1620. }
  1621.  
  1622. COMMAND:sendaudiomessagetoall(playerid, params[])
  1623. {
  1624. new audiomessage[60], string[60];
  1625. if(sscanf(params,"s[60]", audiomessage)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /sendaudiomessagetoall [MESSAGE]");
  1626. else
  1627. {
  1628. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1629. if(AdminInfo[playerid][aAdmin] >= 5)
  1630. {
  1631. foreach(Player, i)
  1632. {
  1633. SendClientAudioMessage(i, audiomessage, false, -1, "en");
  1634. }
  1635. format(string,sizeof(string),"AdmCMD: %s %s has sent an audio-message to all clients in the server. MESSAGE:[%s]", GetAdminLevelName(playerid), GetName(playerid), audiomessage);
  1636. SendAdminMessage(COLOR_BLUE, string);
  1637. }
  1638. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
  1639. }
  1640. return 1;
  1641. }
  1642.  
  1643. COMMAND:freezeall(playerid, params[])
  1644. {
  1645. new string[60];
  1646. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1647. if(AdminInfo[playerid][aAdmin] >= 5)
  1648. {
  1649. foreach(Player, i)
  1650. {
  1651. TogglePlayerControllable(i, false);
  1652. }
  1653. format(string, sizeof(string),"AdmCMD: %s %s has froze all players in the server.", GetAdminLevelName(playerid), GetName(playerid));
  1654. SendClientMessageToAll(COLOR_BLUE,string);
  1655. }
  1656. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
  1657. return 1;
  1658. }
  1659.  
  1660. COMMAND:unfreezeall(playerid, params[])
  1661. {
  1662. new string[60];
  1663. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1664. if(AdminInfo[playerid][aAdmin] >= 5)
  1665. {
  1666. foreach(Player, i)
  1667. {
  1668. TogglePlayerControllable(i, true);
  1669. }
  1670. format(string, sizeof(string),"AdmCMD: %s %s has un-froze all players in the server.", GetAdminLevelName(playerid), GetName(playerid));
  1671. SendClientMessageToAll(COLOR_BLUE,string);
  1672. }
  1673. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1674. return 1;
  1675. }
  1676.  
  1677. COMMAND:jetpack(playerid, params[])
  1678. {
  1679. new string[70];
  1680. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1681. if(AdminInfo[playerid][aAdmin] >= 5)
  1682. {
  1683. GivePlayerJetpack(playerid);
  1684. format(string, sizeof(string),"AdmCMD: %s %s has been given a JETPACK.", GetAdminLevelName(playerid), GetName(playerid));
  1685. SendAdminMessage(COLOR_BLUE,string);
  1686. }
  1687. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1688. return 1;
  1689. }
  1690.  
  1691. COMMAND:disablesprunkmachines(playerid, params[])
  1692. {
  1693. new string[70];
  1694. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1695. if(AdminInfo[playerid][aAdmin] >= 5)
  1696. {
  1697. DisableSprunkMachines();
  1698. format(string, sizeof(string),"AdmCMD: %s %s has destroyed all spunk machines in the server.", GetAdminLevelName(playerid), GetName(playerid));
  1699. SendAdminMessage(COLOR_BLUE,string);
  1700. SendClientMessage(playerid, COLOR_WHITE, "INFO: All sprunk machines have been destroyed. Restart the server to get them back.");
  1701. }
  1702. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1703. return 1;
  1704. }
  1705.  
  1706. COMMAND:setadmin(playerid, params[])
  1707. {
  1708. new targetid,type,string[128], string2[128];
  1709. if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setadmin [PlayerID/PartOfName] [0-5]");
  1710. else
  1711. {
  1712. if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1713. if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1714. if(type < 0 || type > 5) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 5.");
  1715. if(AdminInfo[playerid][aAdmin] >= 5)
  1716. {
  1717. SendClientMessage(playerid, COLOR_WHITE, "INFO: Administration level set.");
  1718. format(string2, sizeof(string2),"INFO: %s %s has set your admin level to %d", GetAdminLevelName(playerid), GetName(playerid), type);
  1719. SendClientMessage(COLOR_WHITE,targetid, string2);
  1720. AdminInfo[targetid][aAdmin] = type;
  1721. format(string, sizeof(string),"AdmCMD: %s %s has set %s's ADMIN-LEVEL:[%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
  1722. SendAdminMessage(COLOR_BLUE,string);
  1723. }
  1724. else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
  1725. }
  1726. return 1;
  1727. }
  1728.  
  1729. COMMAND:setplayercolor(playerid, params[])
  1730. {
  1731. new targetid, type, string[128];
  1732. if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setplayercolor [PlayerID/PartOfName] [color 0-10]");
  1733. else
  1734. {
  1735. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
  1736. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
  1737. if(type < 0 || type > 10) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 and over 10.");
  1738. if(AdminInfo[playerid][aAdmin] >= 4)
  1739. {
  1740. format(string,sizeof(string),"AdmCMD: %s %s has set %s's COLOR-ID:[%d]", GetAdminLevelName(playerid),GetName(playerid), GetName(targetid), type);
  1741. SendAdminMessage(COLOR_BLUE, string);
  1742. SetPlayerColor(targetid, type);
  1743. format(string, sizeof(string), "INFO: You have set %s[%d]'s color to ID: %d", GetName(targetid), targetid, type);
  1744. SendClientMessage(playerid, COLOR_WHITE, string);
  1745. format(string, sizeof(string), "INFO: Admin %s has set your name color to ID: %d", GetName(playerid), type);
  1746. SendClientMessage(targetid, COLOR_WHITE, string);
  1747. }
  1748. else
  1749. {
  1750. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
  1751. }
  1752. }
  1753. return 1;
  1754. }
  1755.  
  1756. COMMAND:muteallplayers(playerid, params[])
  1757. {
  1758. new string[80];
  1759. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  1760. if(AdminInfo[playerid][aAdmin] >= 2)
  1761. {
  1762. format(string,sizeof(string), "AdmCMD: %s %s muted all players", GetAdminLevelName(playerid), GetName(playerid));
  1763. SendAdminMessage(COLOR_BLUE,string);
  1764. foreach (Player, i)
  1765. {
  1766. Muted[i] = 1;
  1767. }
  1768. }
  1769. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  1770. return 1;
  1771. }
  1772.  
  1773. COMMAND:unmuteallplayers(playerid, params[])
  1774. {
  1775. new string[80];
  1776. if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
  1777. if(AdminInfo[playerid][aAdmin] >= 2)
  1778. {
  1779. format(string,sizeof(string), "AdmCMD: %s %s un-muted all players", GetAdminLevelName(playerid), GetName(playerid));
  1780. SendAdminMessage(COLOR_BLUE,string);
  1781. foreach (Player, i)
  1782. {
  1783. Muted[i] = 0;
  1784. }
  1785. }
  1786. else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
  1787. return 1;
  1788. }
  1789.  
  1790. COMMAND:spawnvehicle(playerid, params[])
  1791. {
  1792. new string[70], type, color;
  1793. if(sscanf(params, "ii", type, color)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /spawnvehicle [Vehicle ID] [Color ID]");
  1794. else
  1795. {
  1796. new Float:x,Float:y,Float:z;
  1797. GetPlayerPos(playerid, x, y, z);
  1798. format(string, sizeof(string), "AdmCMD: %s %s has spawned VEHICLE-ID: [%d]", GetAdminLevelName(playerid), GetName(playerid), type);
  1799. SendAdminMessage(COLOR_BLUE, string);
  1800. CreateVehicle(type, x, y, z, 0, color, 0, 0);
  1801. SendClientMessage(playerid, COLOR_WHITE, "INFO: Administrator vehicle created.");
  1802. }
  1803. return 1;
  1804. }
  1805.  
  1806. COMMAND:spawnobject(playerid, params[])
  1807. {
  1808. new string[70], type;
  1809. if(sscanf(params, "i", type)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /spawnobject [Object ID]");
  1810. else
  1811. {
  1812. new Float:x,Float:y,Float:z,Float:angle;
  1813. GetPlayerPos(playerid, x, y, z);
  1814. GetPlayerFacingAngle(playerid, angle);
  1815. format(string, sizeof(string), "AdmCMD: %s %s has spawned OBJECT-ID: [%d]", GetAdminLevelName(playerid), GetName(playerid), type);
  1816. SendAdminMessage(COLOR_BLUE, string);
  1817. CreateDynamicObject(type, x,y,z,angle,angle,angle, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 200.0);
  1818. SendClientMessage(playerid, COLOR_WHITE, "INFO: Administrator object created.");
  1819. }
  1820. return 1;
  1821. }
Advertisement
Add Comment
Please, Sign In to add comment