Guest User

ESSENTIALS BY SELLIZE

a guest
Jan 24th, 2013
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.47 KB | None | 0 0
  1. // SA:MP Essentials
  2. // Scripted by scratch from Sellize
  3. // Credits to all include makers and helpers @ SA:MP forums!
  4. // Editing this script is not allowed
  5. // Neither is claiming it as your script
  6. // Started at 19 Januari 2013, 18:34
  7. // First released at 24 Januari 2013 17:45
  8.  
  9. #define FILTERSCRIPT
  10.  
  11. // CONFIGURATION!!! TO DISABLE COMMAND PUT "//" IN FRONT OF ONE OF THE #DEFINE LINES!!!
  12.  
  13.  
  14. #define ESSENTIALS // Shows a dialog in-game when you type /essentials, this shows all the commands and features!
  15. #define RANDOMCARS // This function will have standard cars parked all over the map. (45 Vehicles in total)
  16. #define MUTE // Admins in the RCON system will be able to /mute people, this makes them unable to speak.
  17. //#define CANTMUTEADMINS // If you put // in front of this, /mute 'ing admins will be enabled.
  18. #define UNMUTE // Admins in the RCON system will be able to /unmute people, this will make players able to speak if they were /mute 'd
  19. //#define CANTJAILADMINS // If you put // in front of this, /jail 'ing admins will be enabled.
  20. #define JAIL // Admins in the RCON system will be able to /jail people, this will teleport them to a jail and remove their weapons, if players try to kill players in jail they will get kicked. (Player commands within essentials cannot be used in jail!)
  21. #define UNJAIL // Admins in the RCON system will be able to /unjail people, this will release them from jail. (will be released in las venturas)
  22. #define KICK // Admins in the RCON system will be able to /kick people, this will remove them from the game. (They can rejoin if they want to)
  23. //#define CANTKICKADMINS // If you put // in front of this, kicking admins will be enabled.
  24. #define BAN // Admins in the RCON system will be able to /ban people, this will remove the player from the server FOREVER!, until you remove the player from the samp.ban file!
  25. //#define CANTBANADMINS // If you put // in front of this, banning admins will be enabled.
  26. #define FREEZE // Admins in the RCON system will be able to /freeze people, this will not allow them to move anymore until you /unfreeze them
  27. #define UNFREEZE // Makes players able to move again.
  28. //#define CANTFREEZEADMINS // If you put // in front of this, admins cant be frozen
  29. #define SAY // Admins in the RCON system will be able to /say [TEXT] this will send a message to all players saying "BROADCAST: [YOUR TEXT HERE]" in a colour.
  30. #define CC // Admins in the RCON system will be able to /cc, this will clear all players chat.
  31. #define KILL // Admins in the RCON system will be able to /kill people, this will kill them and send a message to all.
  32. //#define CANTKILLADMINS // If you put // in front of this, admins won't be able to /kill on other admins.
  33. #define GIVEMONEY // Admins in the RCON system will be able to /givemoney [PLAYER] [AMOUNT]
  34. #define RESTART // Admins in the RCON system will be able to /restart, this reloads everything!
  35. #define GOD // Admins in the RCON system will be able to /god and /ungod, /god will make the admin unable to get hurt and /ungod does the reversed thing.
  36. #define CARE // Players can /care and /nocare this will say to all players: with /care > "[NAME] cares about it!" with /nocare > "[NAME] doesn't care about it!"
  37.  
  38. // END OF CONFIG
  39.  
  40. #define COLOR_GREY 0xAFAFAFAA
  41. #define COLOR_GREEN 0x33AA33AA
  42. #define COLOR_RED 0xAA3333AA
  43. #define COLOR_YELLOW 0xFFFF00AA
  44. #define COLOR_WHITE 0xFFFFFFAA
  45. #define COLOR_BLUE 0x0000BBAA
  46. #define COLOR_RED 0xAA3333AA
  47. #define COLOR_GOLD 0xB8860BAA
  48. #define COLOR_PINK 0xFFC0CBAA
  49.  
  50. #include <a_samp>
  51. #include <zcmd>
  52. #include <sscanf2>
  53. #include <YSI\y_ini>
  54.  
  55. #if defined FILTERSCRIPT
  56.  
  57. enum PlayerInfo
  58. {
  59. isMuted,
  60. isJailed,
  61. isFrozen,
  62. isAlive,
  63. hasGod,
  64. spam,
  65. }
  66.  
  67. new Info[MAX_PLAYERS][PlayerInfo];
  68.  
  69. public OnFilterScriptInit()
  70. {
  71. print("--------------------------------------------------");
  72. print(" ESSENTIALS LOADED CORRECTLY ");
  73. print("---------------------------------------------------");
  74. print("-------------------------------------------------");
  75. print("ESSENTIALS CAN BE CONFIGURATED IN THE .PWN FILE");
  76. print("-------------------------------------------------");
  77. print("-------------------------------------------------");
  78. print(" ESSENTIALS MADE BY SELLIZE ");
  79. print("--------------------------------------------------");
  80. #if defined JAIL
  81. CreateObject(11292,265.3999939,2587.8000488,16.8999996,0.0000000,0.0000000,0.0000000); //object(gasstatiohut) (1)
  82. CreateObject(3785,269.7000122,2588.3999023,17.1000004,0.0000000,0.0000000,0.0000000); //object(bulkheadlight) (1)
  83. CreateObject(7317,249.1999969,2576.3000488,21.3999996,0.0000000,0.0000000,0.0000000); //object(plantbox17) (1)
  84. CreateObject(2991,265.8999939,2587.5000000,19.1000004,0.0000000,0.0000000,0.0000000); //object(imy_bbox) (1)
  85. CreateObject(2991,267.7000122,2591.0000000,16.1000004,0.0000000,0.0000000,0.0000000); //object(imy_bbox) (2)
  86. #endif
  87. #if defined RANDOMCARS
  88. AddStaticVehicle(562,2076.3420,1507.1365,10.3315,178.0549,35,1); // essentials1
  89. AddStaticVehicle(419,2135.7805,1397.6664,10.6177,359.7794,47,76); // essentials2
  90. AddStaticVehicle(498,2352.2129,1404.7930,10.8928,270.1334,13,120); // essentials3
  91. AddStaticVehicle(573,2465.1206,1335.8137,11.4704,1.3210,115,43); // essentials4
  92. AddStaticVehicle(481,2478.6504,1289.0098,10.3114,149.0521,3,3); // essentials5
  93. AddStaticVehicle(555,2672.8865,1179.1145,10.5034,270.2951,58,1); // essentials6
  94. AddStaticVehicle(438,2805.8154,1345.6074,10.7530,89.7501,6,76); // essentials7
  95. AddStaticVehicle(438,2852.2629,1348.4885,10.8123,268.3759,6,76); // essentials8
  96. AddStaticVehicle(438,2840.2073,1348.9343,10.7705,295.9094,6,76); // essentials7
  97. AddStaticVehicle(576,2651.5073,1082.9829,10.4280,269.1299,68,96); // essentials9
  98. AddStaticVehicle(487,2550.0645,1174.2910,18.8872,270.4692,29,42); // essentials10
  99. AddStaticVehicle(463,2460.4607,928.6866,10.3603,90.3377,84,84); // essentials11
  100. AddStaticVehicle(526,2142.6851,1006.3648,10.5869,89.8890,9,39); // essentials12
  101. AddStaticVehicle(439,2122.6997,988.5297,10.7161,176.9899,8,17); // essentials13
  102. AddStaticVehicle(420,2198.7556,938.1807,10.5971,357.8827,6,1); // essentials14
  103. AddStaticVehicle(533,2100.1528,890.3764,10.5220,178.2881,74,1); // essentials15
  104. AddStaticVehicle(498,1952.2552,1322.9238,9.2496,356.0905,20,117); // essentials16
  105. AddStaticVehicle(583,1844.8402,1251.3842,10.3636,89.3609,1,1); // essentials17
  106. AddStaticVehicle(555,1709.2524,1408.2841,10.2500,15.2477,60,1); // essentials18
  107. AddStaticVehicle(555,1712.7219,1461.7023,10.4394,345.9824,60,1); // essentials19
  108. AddStaticVehicle(534,1641.8912,1311.2672,10.5456,90.6802,42,42); // essentials20
  109. AddStaticVehicle(592,1303.0885,1439.2594,12.0144,268.8132,1,1); // essentials21
  110. AddStaticVehicle(563,1577.0405,1622.0687,11.5947,70.9491,1,6); // essentials22
  111. AddStaticVehicle(490,1562.0889,1091.7340,10.8713,178.9885,0,0); // essentials23
  112. AddStaticVehicle(462,1538.7113,1019.8416,10.4088,172.4570,13,13); // essentials24
  113. AddStaticVehicle(609,1461.4705,975.1558,10.3958,180.8562,36,36); // essentials25
  114. AddStaticVehicle(533,1414.1530,717.7057,10.5293,89.2962,83,1); // essentials26
  115. AddStaticVehicle(542,1461.4896,786.4048,10.5634,359.9397,31,93); // essentials27
  116. AddStaticVehicle(452,1630.4631,571.8348,-0.6134,262.2390,1,5); // essentials28
  117. AddStaticVehicle(454,1640.0247,586.9659,0.1721,180.5831,26,26); // essentials29
  118. AddStaticVehicle(403,1685.8708,764.3357,11.4258,357.7859,37,1); // essentials30
  119. AddStaticVehicle(500,580.8259,888.6886,-43.6253,173.2484,40,84); // essentials31
  120. AddStaticVehicle(579,811.3173,854.4554,10.7703,28.0341,42,42); // essentials32
  121. AddStaticVehicle(556,612.8759,1229.7980,12.0938,295.1430,1,1); // essentials33
  122. AddStaticVehicle(535,-30.0134,1072.3058,19.5041,94.1575,31,1); // essentials34
  123. AddStaticVehicle(534,-139.2301,1122.8721,19.4773,274.7690,7,7); // essentials35
  124. AddStaticVehicle(555,-200.3200,1033.9960,19.3405,181.8243,22,1); // essentials36
  125. AddStaticVehicle(470,-210.9079,996.5825,19.5998,272.4576,43,0); // essentials37
  126. AddStaticVehicle(587,-334.1616,1063.7302,19.4672,85.4457,40,1); // essentials38
  127. AddStaticVehicle(505,-360.6803,1187.2305,19.8858,0.3301,14,123); // essentials39
  128. AddStaticVehicle(459,-218.7389,1214.5675,19.7845,359.2943,28,28); // essentials40
  129. AddStaticVehicle(461,-73.1774,1212.7241,19.3320,269.9608,43,1); // essentials41
  130. AddStaticVehicle(609,249.0349,1395.7588,10.6552,86.1884,36,36); // essentials42
  131. AddStaticVehicle(470,116.5693,1889.9487,18.2945,182.5043,43,0); // essentials43
  132. AddStaticVehicle(470,235.4967,1925.5096,17.6314,307.4719,43,0); // essentials45
  133. AddStaticVehicle(425,198.7946,1880.6339,18.1760,87.6568,43,0); // essentials45
  134. #endif
  135. return 1;
  136. }
  137.  
  138. public OnFilterScriptExit()
  139. {
  140. return 1;
  141. }
  142.  
  143. #endif
  144.  
  145. public OnPlayerRequestClass(playerid, classid)
  146. {
  147. return 1;
  148. }
  149.  
  150. public OnPlayerConnect(playerid)
  151. {
  152. Info[playerid][isMuted] = 0;
  153. Info[playerid][isJailed] = 0;
  154. Info[playerid][isAlive] = 0;
  155. return 1;
  156. }
  157.  
  158. public OnPlayerDisconnect(playerid, reason)
  159. {
  160. return 1;
  161. }
  162.  
  163. public OnPlayerSpawn( playerid )
  164. {
  165. Info[playerid][isAlive] = 1;
  166. if (Info[playerid][isJailed] == 1)
  167. {
  168. SetPlayerPos(playerid,263.2274,2588.5564,16.6940);
  169. ResetPlayerWeapons(playerid);
  170. }
  171. return 1;
  172. }
  173.  
  174. public OnPlayerDeath(playerid, killerid, reason)
  175. {
  176. Info[playerid][isAlive] = 0;
  177. return 1;
  178. }
  179.  
  180. public OnVehicleSpawn(vehicleid)
  181. {
  182. return 1;
  183. }
  184.  
  185. public OnVehicleDeath(vehicleid, killerid)
  186. {
  187. return 1;
  188. }
  189.  
  190. public OnPlayerText(playerid, text[])
  191. {
  192. if (Info[playerid][isMuted] > 0) {
  193. SendClientMessage(playerid, COLOR_RED, "NOTICE: You have been muted by an admin.");
  194. return 0;
  195. }
  196. return 1;
  197. }
  198.  
  199. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  200. {
  201. return 1;
  202. }
  203.  
  204. public OnPlayerExitVehicle(playerid, vehicleid)
  205. {
  206. return 1;
  207. }
  208.  
  209. public OnPlayerStateChange(playerid, newstate, oldstate)
  210. {
  211. return 1;
  212. }
  213.  
  214. public OnPlayerEnterCheckpoint(playerid)
  215. {
  216. return 1;
  217. }
  218.  
  219. public OnPlayerLeaveCheckpoint(playerid)
  220. {
  221. return 1;
  222. }
  223.  
  224. public OnPlayerEnterRaceCheckpoint(playerid)
  225. {
  226. return 1;
  227. }
  228.  
  229. public OnPlayerLeaveRaceCheckpoint(playerid)
  230. {
  231. return 1;
  232. }
  233.  
  234. public OnRconCommand(cmd[])
  235. {
  236. return 1;
  237. }
  238.  
  239. public OnPlayerRequestSpawn(playerid)
  240. {
  241. return 1;
  242. }
  243.  
  244. public OnObjectMoved(objectid)
  245. {
  246. return 1;
  247. }
  248.  
  249. public OnPlayerObjectMoved(playerid, objectid)
  250. {
  251. return 1;
  252. }
  253.  
  254. public OnPlayerPickUpPickup(playerid, pickupid)
  255. {
  256. return 1;
  257. }
  258.  
  259. public OnVehicleMod(playerid, vehicleid, componentid)
  260. {
  261. return 1;
  262. }
  263.  
  264. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  265. {
  266. return 1;
  267. }
  268.  
  269. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  270. {
  271. return 1;
  272. }
  273.  
  274. public OnPlayerSelectedMenuRow(playerid, row)
  275. {
  276. return 1;
  277. }
  278.  
  279. public OnPlayerExitedMenu(playerid)
  280. {
  281. return 1;
  282. }
  283.  
  284. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  285. {
  286. return 1;
  287. }
  288.  
  289. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  290. {
  291. return 1;
  292. }
  293.  
  294. public OnRconLoginAttempt(ip[], password[], success)
  295. {
  296. return 1;
  297. }
  298.  
  299. public OnPlayerUpdate(playerid)
  300. {
  301. return 1;
  302. }
  303.  
  304. public OnPlayerStreamIn(playerid, forplayerid)
  305. {
  306. return 1;
  307. }
  308.  
  309. public OnPlayerStreamOut(playerid, forplayerid)
  310. {
  311. return 1;
  312. }
  313.  
  314. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  315. {
  316. if(Info[playerid][isJailed] == 1)
  317. {
  318. SetPlayerHealth(playerid, 100.0);
  319. }
  320. if(Info[playerid][hasGod] == 1)
  321. {
  322. SetPlayerHealth(playerid, 100.0);
  323. }
  324. return 1;
  325. }
  326.  
  327. public OnVehicleStreamIn(vehicleid, forplayerid)
  328. {
  329. return 1;
  330. }
  331.  
  332. public OnVehicleStreamOut(vehicleid, forplayerid)
  333. {
  334. return 1;
  335. }
  336.  
  337. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  338. {
  339. return 1;
  340. }
  341.  
  342. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  343. {
  344. return 1;
  345. }
  346.  
  347. CMD:mute(playerid, params[])
  348. {
  349. #if defined MUTE
  350. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  351. new ID;
  352. if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /mute [Playerid/Name]");
  353. if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player not found.");
  354. if (Info[ID][isMuted] > 0) return SendClientMessage(playerid, COLOR_RED, "NOTICE: User was already muted.");
  355. #if defined CANTMUTEADMINS
  356. if (!IsPlayerAdmin(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You can not mute an admin.");
  357. #endif
  358. new string[128];
  359. format(string,sizeof(string),"%s has been muted by %s!", PlayerName(ID), PlayerName(playerid));
  360. SendClientMessageToAll(COLOR_BLUE, string);
  361. Info[ID][isMuted] = 1;
  362. #else
  363. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  364. #endif
  365. return 1;
  366. }
  367.  
  368. stock PlayerName(playerid)
  369. {
  370. new name[24];
  371. GetPlayerName(playerid, name, sizeof(name));
  372. return name;
  373. }
  374.  
  375. CMD:unmute(playerid, params[])
  376. {
  377. #if defined UNMUTE
  378. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  379. new ID;
  380. if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /unmute [Playerid/Name]");
  381. if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player not found.");
  382. if (Info[ID][isMuted] < 1) return SendClientMessage(playerid, COLOR_RED, "NOTICE: User is not muted.");
  383. new string[128];
  384. format(string,sizeof(string),"%s has been unmuted by %s!", PlayerName(ID), PlayerName(playerid));
  385. SendClientMessageToAll(COLOR_BLUE, string);
  386. Info[ID][isMuted] = 0;
  387. #else
  388. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  389. #endif
  390. return 1;
  391. }
  392.  
  393. CMD:jail(playerid, params[])
  394. {
  395. #if defined JAIL
  396. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  397. new ID;
  398. if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /jail [Playerid/Name]");
  399. if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player not found.");
  400. #if defined CANTJAILADMINS
  401. if (!IsPlayerAdmin(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You can not jail an admin.");
  402. #endif
  403. if (Info[ID][isJailed] > 0) return SendClientMessage(playerid, COLOR_RED, "NOTICE: User is already in jail.");
  404. new string[128];
  405. format(string,sizeof(string),"%s has been jailed by %s!", PlayerName(ID), PlayerName(playerid));
  406. SendClientMessageToAll(COLOR_BLUE, string);
  407. Info[ID][isJailed] = 1;
  408. SetPlayerPos(ID,263.2274,2588.5564,16.6940);
  409. SendClientMessage(ID, COLOR_RED, "NOTICE: You have been admin-jailed and your weapons have been taken away!");
  410. ResetPlayerWeapons(ID);
  411. #else
  412. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  413. #endif
  414. return 1;
  415. }
  416.  
  417. CMD:unjail(playerid, params[])
  418. {
  419. #if defined UNJAIL
  420. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  421. new ID;
  422. if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /unjail [Playerid/Name]");
  423. if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player not found.");
  424. if (Info[ID][isJailed] < 1) return SendClientMessage(playerid, COLOR_RED, "NOTICE: User is not in jail.");
  425. if (Info[ID][isAlive] < 1) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player is not alive.");
  426. new string[128];
  427. format(string,sizeof(string),"%s has been unjailed by %s!", PlayerName(ID), PlayerName(playerid));
  428. SendClientMessageToAll(COLOR_BLUE, string);
  429. Info[ID][isJailed] = 0;
  430. SetPlayerPos(ID,2096.2583,1160.8707,11.6484);
  431. SendClientMessage(ID, COLOR_RED, "NOTICE: You have been released from the admin-jail.");
  432. #else
  433. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  434. #endif
  435. return 1;
  436. }
  437.  
  438. CMD:kick(playerid, params[])
  439. {
  440. #if defined KICK
  441. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  442. new ID;
  443. if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /kick [Playerid/Name]");
  444. if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player not found.");
  445. #if defined CANTKICKADMINS
  446. if (!IsPlayerAdmin(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You can not kick an admin.");
  447. #endif
  448. new string[128];
  449. format(string,sizeof(string),"%s has been kicked by %s!", PlayerName(ID), PlayerName(playerid));
  450. SendClientMessageToAll(COLOR_BLUE, string);
  451. Kick(ID);
  452. #else
  453. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  454. #endif
  455. return 1;
  456. }
  457.  
  458. CMD:ban(playerid, params[])
  459. {
  460. #if defined BAN
  461. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  462. new ID;
  463. if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /ban [Playerid/Name]");
  464. if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player not found.");
  465. #if defined CANTBANADMINS
  466. if (!IsPlayerAdmin(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You can not ban an admin.");
  467. #endif
  468. new string[128];
  469. format(string,sizeof(string),"%s has been banned by %s!", PlayerName(ID), PlayerName(playerid));
  470. SendClientMessageToAll(COLOR_BLUE, string);
  471. BanEx(ID,"Banned by RCON admin! (Through the Essentials FS)");
  472. #else
  473. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  474. #endif
  475. return 1;
  476. }
  477.  
  478. CMD:freeze(playerid, params[])
  479. {
  480. #if defined FREEZE
  481. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  482. new ID;
  483. if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /freeze [Playerid/Name]");
  484. if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player not found.");
  485. if (Info[ID][isAlive] < 1) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player is not alive.");
  486. #if defined CANTFREEZEADMINS
  487. if (!IsPlayerAdmin(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You can not freeze an admin.");
  488. #endif
  489. if (Info[ID][isFrozen] > 0) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player is already frozen.");
  490. new string[128];
  491. format(string,sizeof(string),"%s has been frozen by %s!", PlayerName(ID), PlayerName(playerid));
  492. SendClientMessageToAll(COLOR_BLUE, string);
  493. Info[ID][isFrozen] = 1;
  494. TogglePlayerControllable(ID,0);
  495. SendClientMessage(ID, COLOR_RED, "NOTICE: You have been frozen!");
  496. #else
  497. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  498. #endif
  499. return 1;
  500. }
  501.  
  502. CMD:unfreeze(playerid, params[])
  503. {
  504. #if defined UNFREEZE
  505. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  506. new ID;
  507. if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /unfreeze [Playerid/Name]");
  508. if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player not found.");
  509. if (Info[ID][isFrozen] < 1) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player is not frozen.");
  510. if (Info[ID][isAlive] < 1) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player is not alive.");
  511. new string[128];
  512. format(string,sizeof(string),"%s has been unfrozen by %s!", PlayerName(ID), PlayerName(playerid));
  513. SendClientMessageToAll(COLOR_BLUE, string);
  514. Info[ID][isFrozen] = 0;
  515. TogglePlayerControllable(ID,1);
  516. SendClientMessage(ID, COLOR_RED, "NOTICE: You have been unfrozen!");
  517. #else
  518. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  519. #endif
  520. return 1;
  521. }
  522.  
  523. CMD:broadcast(playerid,params[0])
  524. {
  525. #if defined SAY
  526. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  527. if (isnull(params)) {
  528. SendClientMessage(playerid, COLOR_BLUE, "USAGE: /broadcast [text]");
  529. return 1;
  530. }
  531. else {
  532. new string[128];
  533. format(string, sizeof(string), "{E61717}[BROADCAST]:{0CE859} %s", params[0]);
  534. SendClientMessageToAll(-1, string);
  535. #else
  536. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  537. #endif
  538. return 1;
  539. }
  540. }
  541.  
  542. CMD:cc(playerid, params[])
  543. {
  544. #if defined CC
  545. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  546. SendClientMessageToAll(COLOR_RED, "");
  547. SendClientMessageToAll(COLOR_RED, "");
  548. SendClientMessageToAll(COLOR_RED, "");
  549. SendClientMessageToAll(COLOR_RED, "");
  550. SendClientMessageToAll(COLOR_RED, "");
  551. SendClientMessageToAll(COLOR_RED, "");
  552. SendClientMessageToAll(COLOR_RED, "");
  553. SendClientMessageToAll(COLOR_RED, "");
  554. SendClientMessageToAll(COLOR_RED, "");
  555. SendClientMessageToAll(COLOR_BLUE, "NOTICE: Chat cleared by an admin.");
  556. #else
  557. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  558. #endif
  559. return 1;
  560. }
  561.  
  562. CMD:kill(playerid, params[])
  563. {
  564. #if defined KILL
  565. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  566. new ID;
  567. if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /kill [Playerid/Name]");
  568. if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player not found.");
  569. if (Info[ID][isAlive] < 1) return SendClientMessage(playerid, COLOR_RED, "NOTICE: Player is not alive.");
  570. #if defined CANTKILLADMINS
  571. if (!IsPlayerAdmin(ID)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You can not kill an admin.");
  572. #endif
  573. new string[128];
  574. format(string,sizeof(string),"%s has been admin-killed by %s!", PlayerName(ID), PlayerName(playerid));
  575. SendClientMessageToAll(COLOR_BLUE, string);
  576. SetPlayerHealth(ID, 0);
  577. SendClientMessage(ID, COLOR_RED, "NOTICE: You have been admin-killed!");
  578. #else
  579. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  580. #endif
  581. return 1;
  582. }
  583.  
  584. CMD:restart(playerid, params[])
  585. {
  586. #if defined RESTART
  587. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  588. new string[128];
  589. format(string,sizeof(string),"NOTICE: Server restart by %s!",PlayerName(playerid));
  590. SendClientMessageToAll(COLOR_GREEN, string);
  591. SendRconCommand("gmx");
  592. #else
  593. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  594. #endif
  595. return 1;
  596. }
  597.  
  598. CMD:god(playerid, params[])
  599. {
  600. #if defined GOD
  601. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  602. Info[playerid][hasGod] = 1;
  603. SendClientMessage(playerid, COLOR_RED, "NOTICE: You have enabled godmode!");
  604. #else
  605. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  606. #endif
  607. return 1;
  608. }
  609.  
  610. CMD:ungod(playerid, params[])
  611. {
  612. #if defined GOD
  613. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  614. Info[playerid][hasGod] = 0;
  615. SendClientMessage(playerid, COLOR_RED, "NOTICE: You have disabled godmode!");
  616. #else
  617. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  618. #endif
  619. return 1;
  620. }
  621.  
  622. CMD:essentials(playerid, params[])
  623. {
  624. #if defined ESSENTIALS
  625. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOTICE: You are not logged in as an admin.");
  626. SendClientMessage(playerid, COLOR_RED, "NOTICE: Essentials dialog opened!");
  627. ShowPlayerDialog(playerid, 19925, DIALOG_STYLE_MSGBOX, "Essentials admin help", "Commands: mute unmute jail unjail kick ban freeze unfreeze broadcast cc kill restart god ungod essentials. More to be added", "Ok", "Ok");
  628. #else
  629. SendClientMessage(playerid, COLOR_RED, "NOTICE: This command has been disabled!");
  630. #endif
  631. return 1;
  632. }
Advertisement
Add Comment
Please, Sign In to add comment