Advertisement
Guest User

Adm - Admin System by Hellhound v1.2

a guest
Jan 1st, 2012
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.87 KB | None | 0 0
  1. /*
  2. ^ +--- ^ ^
  3. / \ | | |\ /|
  4. /___\ | | | \ / |
  5. / \ +--- | V |
  6. Admin Menu
  7. ______________________________________
  8.  
  9. Created by: Hellhound(C)2011
  10.  
  11. Correct Version: v1.2
  12.  
  13. Special Thanks:
  14. BlueDarco, matraka, Kalcor
  15.  
  16. License:
  17. 1. Do not remove Credits / Claim the Script as your own / Re-release without my (Hellhound) permission* / Sell it
  18. 2. Do not use that script for any Bad / Offensive / Evil / Wicked / Unkind Reasons.
  19.  
  20. * You are not allowed to change *Command Engine* / *Streaming Engine* / *File/INI Engine* / *Audio Engine* and Re-Realese.
  21.  
  22. If you agree those rules Change the '0' to '1': */
  23. new Agree = 1;
  24. /* If you Agreed, You are free to use that filterscript as long as you follow the License
  25.  
  26. Have a nice day, Hellhound */
  27.  
  28. #include <a_samp>
  29. #include <dutils>
  30. #include <Dini>
  31. #include <cpstream>
  32.  
  33. #define Green 0x33FF3300
  34. #define Green_dark 0x33AA3300
  35. #define Cyan 0x33CCCC00
  36. #define Blue 0x3300FF00
  37. #define Red 0xFF000000
  38. #define White 0xFFFFFF00
  39. #define Black 0x00000000
  40. #define Gray 0x99999900
  41. #define Yellow 0xFFFF0000
  42. #define Gold 0xFFCC0000
  43. #define Error 0x99000000
  44.  
  45. #pragma unused ret_memcpy
  46.  
  47. #define Spawn_Delay 60000 /* Time for the created vehicles to respawn if there in no Driver */
  48. /**********************************************/
  49. /******** DONT TOUCH THOSE DEFINES ************/
  50. #define Dialog_Kick_ID 1 /***/
  51. #define Dialog_Kill_ID 2 /***/
  52. #define Dialog_Car 3 /***/
  53. #define Dialog_Car_Color 4 /***/
  54. #define Dialog_Car_Mods 5 /***/
  55. #define Dialog_CheckP 6 /***/
  56. #define Dialog_CheckP_D 7 /***/
  57. #define Dialog_PickUp 8 /***/
  58. #define Dialog_PickUp_D 9 /***/
  59. #define Dialog_Fill 10 /***/
  60. #define Dialog_God 11 /***/
  61. #define Dialog_Freeze 12 /***/
  62. #define Dialog_UnFreeze 13 /***/
  63. #define Dialog_Slap 14 /***/
  64. #define Dialog_TPto 15 /***/
  65. #define Dialog_TPu 16 /***/
  66. #define Dialog_Make_Adm 17 /***/
  67. #define Dialog_Remove_Adm 18 /***/
  68. #define Dialog_Adm_List 19 /***/
  69. #define Dialog_Say 20 /***/
  70. /***/
  71. #define MapIcon_CheckP 99 /***/
  72. /**********************************************/
  73. /**********************************************/
  74. new pt;
  75. new ptEx = 0;
  76.  
  77. new pu;
  78. new Text3D:put;
  79. new puEx = 0;
  80.  
  81. public OnFilterScriptInit()
  82. {
  83. #if !defined Agree
  84. print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  85. print("ADM - Add 'new Agree = 1;' in the script");
  86. print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  87. SendRconCommand("exit");
  88. #endif
  89. #if defined Agree
  90. if(Agree == 0)
  91. {
  92. print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  93. print(" ADM ");
  94. print(" ");
  95. print("You didn't agreed the License, Find 'new Agree = 0' and change it to '1'");
  96. print("GAMEMODE - EXITING");
  97. print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  98. SendRconCommand("exit");
  99. }
  100. if(Agree == 1)
  101. {
  102. print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  103. print("ADM Loaded - By 'Hellhound'");
  104. print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  105. }
  106. #endif
  107. return 1;
  108. }
  109.  
  110. public OnFilterScriptExit()
  111. {
  112. return 1;
  113. }
  114.  
  115. public OnPlayerConnect(playerid)
  116. {
  117. return 1;
  118. }
  119.  
  120. public OnPlayerDisconnect(playerid, reason)
  121. {
  122. return 1;
  123. }
  124.  
  125. public OnPlayerSpawn(playerid)
  126. {
  127. return 1;
  128. }
  129.  
  130. public OnPlayerDeath(playerid, killerid, reason)
  131. {
  132. return 1;
  133. }
  134.  
  135. public OnVehicleSpawn(vehicleid)
  136. {
  137. return 1;
  138. }
  139.  
  140. public OnVehicleDeath(vehicleid, killerid)
  141. {
  142. return 1;
  143. }
  144.  
  145. public OnPlayerText(playerid, text[])
  146. {
  147. return 1;
  148. }
  149.  
  150. public OnPlayerCommandText(playerid, cmdtext[])
  151. {
  152. new cmd[256], idx;
  153. cmd = strtok(cmdtext, idx);
  154. if(strcmp(cmd, "/Adm", true) == 0)
  155. {
  156. if(!IsAdm(playerid) || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "{999999} You are not authorised to use this command");
  157. new AdmInfo[500];
  158. format(AdmInfo, sizeof(AdmInfo), "{FF0000}Kick a Player\n{FF0000}Kill a Player\n{33FF33}Create Vehicle\n{33FF33}Change Vehicle Colour\n{33FF33}Vehicle Mods\n{33FF33}Create Point\n{FF0000}Destroy Point\n{33FF33}Create PickUp-Text\n{FF0000}Destroy PickUp-Text\n{33FF33}100% Health and Armor\n{33FF33}God-Mode\n{FF0000}Freeze\n{33FF33}UnFreeze\n{FF0000}Slap\n{33FF33}Teleport to player\n{33FF33}Teleport to you\n{33CCCC}Make Admin\n{33CCCC}Remove Admin\n{33FF33}Admin List\n{33FF33}Say / Announce");
  159. ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "{FF0000}Ad{FFFFFF}min {FF0000}M{FFFFFF}enu", AdmInfo, "Action", "Cancel");
  160. return 1;
  161. }
  162. return 0;
  163. }
  164.  
  165. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  166. {
  167. return 1;
  168. }
  169.  
  170. public OnPlayerExitVehicle(playerid, vehicleid)
  171. {
  172. return 1;
  173. }
  174.  
  175. public OnPlayerStateChange(playerid, newstate, oldstate)
  176. {
  177. return 1;
  178. }
  179.  
  180. public OnPlayerEnterCheckpoint(playerid)
  181. {
  182. return 1;
  183. }
  184.  
  185. public OnPlayerLeaveCheckpoint(playerid)
  186. {
  187. return 1;
  188. }
  189.  
  190. public OnPlayerEnterRaceCheckpoint(playerid)
  191. {
  192. return 1;
  193. }
  194.  
  195. public OnPlayerLeaveRaceCheckpoint(playerid)
  196. {
  197. return 1;
  198. }
  199.  
  200. public OnRconCommand(cmd[])
  201. {
  202. return 1;
  203. }
  204.  
  205. public OnPlayerRequestSpawn(playerid)
  206. {
  207. return 1;
  208. }
  209.  
  210. public OnObjectMoved(objectid)
  211. {
  212. return 1;
  213. }
  214.  
  215. public OnPlayerObjectMoved(playerid, objectid)
  216. {
  217. return 1;
  218. }
  219.  
  220. public OnPlayerPickUpPickup(playerid, pickupid)
  221. {
  222. return 1;
  223. }
  224.  
  225. public OnVehicleMod(playerid, vehicleid, componentid)
  226. {
  227. return 1;
  228. }
  229.  
  230. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  231. {
  232. return 1;
  233. }
  234.  
  235. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  236. {
  237. return 1;
  238. }
  239.  
  240. public OnPlayerSelectedMenuRow(playerid, row)
  241. {
  242. return 1;
  243. }
  244.  
  245. public OnPlayerExitedMenu(playerid)
  246. {
  247. return 1;
  248. }
  249.  
  250. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  251. {
  252. return 1;
  253. }
  254.  
  255. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  256. {
  257. return 1;
  258. }
  259.  
  260. public OnRconLoginAttempt(ip[], password[], success)
  261. {
  262. return 1;
  263. }
  264.  
  265. public OnPlayerUpdate(playerid)
  266. {
  267. return 1;
  268. }
  269.  
  270. public OnPlayerStreamIn(playerid, forplayerid)
  271. {
  272. return 1;
  273. }
  274.  
  275. public OnPlayerStreamOut(playerid, forplayerid)
  276. {
  277. return 1;
  278. }
  279.  
  280. public OnVehicleStreamIn(vehicleid, forplayerid)
  281. {
  282. return 1;
  283. }
  284.  
  285. public OnVehicleStreamOut(vehicleid, forplayerid)
  286. {
  287. return 1;
  288. }
  289.  
  290. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  291. {
  292. if(dialogid == 0)
  293. {
  294. if(!response) return 0;
  295. if(listitem == 0)
  296. {
  297. ShowPlayerDialog(playerid, Dialog_Kick_ID, DIALOG_STYLE_INPUT, "{FF0000}Kick a Player", "Choose player ID", "Kick", "Cancel");
  298. return 1;
  299. }
  300. if(listitem == 1)
  301. {
  302. ShowPlayerDialog(playerid, Dialog_Kill_ID, DIALOG_STYLE_INPUT, "{FF0000}Kill a Player", "Choose player ID", "Kill", "Cancel");
  303. return 1;
  304. }
  305. if(listitem == 2)
  306. {
  307. ShowPlayerDialog(playerid, Dialog_Car, DIALOG_STYLE_INPUT, "{FF0000}Create Vehicle", "Choose Vehicle ID", "Create", "Cancel");
  308. return 1;
  309. }
  310. if(listitem == 3)
  311. {
  312. ShowPlayerDialog(playerid, Dialog_Car_Color, DIALOG_STYLE_INPUT, "{FF0000}Set Vehicle Color", "Choose Vehicle Color ID", "Change", "Cancel");
  313. return 1;
  314. }
  315. if(listitem == 4)
  316. {
  317. ShowPlayerDialog(playerid, Dialog_Car_Mods, DIALOG_STYLE_LIST, "{FF0000}Set Vehicle Mods", "{FFFF00}Gold Rims\n{FF0000}Nitro\n{33FF33}Hydraulics", "Add", "Cancel");
  318. return 1;
  319. }
  320. if(listitem == 5)
  321. {
  322. ShowPlayerDialog(playerid, Dialog_CheckP, DIALOG_STYLE_MSGBOX, "{FF0000}Create Point", "{FFFF00}Are you sure you want to Create a Point?\n{FF0000}NOTE: The Point will be created in the Place you are correcly Standing.", "Create", "Cancel");
  323. return 1;
  324. }
  325. if(listitem == 6)
  326. {
  327. ShowPlayerDialog(playerid, Dialog_CheckP_D, DIALOG_STYLE_MSGBOX, "{FF0000}Destroy Point", "{FFFF00}Are you sure you want to Destroy a Point?", "Destroy", "Cancel");
  328. return 1;
  329. }
  330. if(listitem == 7)
  331. {
  332. ShowPlayerDialog(playerid, Dialog_PickUp, DIALOG_STYLE_INPUT, "{FF0000}Create PickUp-Text", "{FFFF00}Are you sure you want to Create a PickUp-Text?\n{FF0000}NOTE: The PiccUp-Text will be created in the Place you are correcly Standing.\n\n{33FF33}Write down the text that will be in the PickUp-Text", "Create", "Cancel");
  333. return 1;
  334. }
  335. if(listitem == 8)
  336. {
  337. ShowPlayerDialog(playerid, Dialog_PickUp_D, DIALOG_STYLE_MSGBOX, "{FF0000}Destroy PickUp-Text", "{FFFF00}Are you sure you want to Destroy a PickUp-Text?", "Destroy", "Cancel");
  338. return 1;
  339. }
  340. if(listitem == 9)
  341. {
  342. ShowPlayerDialog(playerid, Dialog_Fill, DIALOG_STYLE_INPUT, "{FF0000}100 Health and Armour", "{FFFF00}Choose player ID to Fill him with:\n\n{33CCCC}* {FFFFFF}100 Health\n\n{33CCCC}* {FFFFFF}100 Armour", "Process", "Cancel");
  343. return 1;
  344. }
  345. if(listitem == 10)
  346. {
  347. ShowPlayerDialog(playerid, Dialog_God, DIALOG_STYLE_INPUT, "{FF0000}God-Mode", "{FFFF00}Choose player ID to give him God-Mode", "Process", "Cancel");
  348. return 1;
  349. }
  350. if(listitem == 11)
  351. {
  352. ShowPlayerDialog(playerid, Dialog_Freeze, DIALOG_STYLE_INPUT, "{FF0000}Freeze", "{FFFF00}Choose player ID to freeze", "Freeze", "Cancel");
  353. return 1;
  354. }
  355. if(listitem == 12)
  356. {
  357. ShowPlayerDialog(playerid, Dialog_UnFreeze, DIALOG_STYLE_INPUT, "{FF0000}UnFreeze", "{FFFF00}Choose player ID to unfreeze", "UnFreeze", "Cancel");
  358. return 1;
  359. }
  360. if(listitem == 13)
  361. {
  362. ShowPlayerDialog(playerid, Dialog_Slap, DIALOG_STYLE_INPUT, "{FF0000}Slap", "{FFFF00}Choose player ID to slap", "Slap", "Cancel");
  363. return 1;
  364. }
  365. if(listitem == 14)
  366. {
  367. ShowPlayerDialog(playerid, Dialog_TPto, DIALOG_STYLE_INPUT, "{FF0000}Teleport to player", "{FFFF00}Choose player ID to teleport to his location.", "Teleport", "Cancel");
  368. return 1;
  369. }
  370. if(listitem == 15)
  371. {
  372. ShowPlayerDialog(playerid, Dialog_TPu, DIALOG_STYLE_INPUT, "{FF0000}Teleport to you", "{FFFF00}Choose player ID to teleport to you.", "Teleport", "Cancel");
  373. return 1;
  374. }
  375. if(listitem == 16)
  376. {
  377. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "{999999} You are not authorised to use this command");
  378. ShowPlayerDialog(playerid, Dialog_Make_Adm, DIALOG_STYLE_INPUT, "{FF0000}Make Admin", "{FFFF00}Choose player ID to Make Admin", "Promote", "Cancel");
  379. return 1;
  380. }
  381. if(listitem == 17)
  382. {
  383. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "{999999} You are not authorised to use this command");
  384. ShowPlayerDialog(playerid, Dialog_Remove_Adm, DIALOG_STYLE_INPUT, "{FF0000}Remove Admin", "{FFFF00}Choose player ID to Remove Admin", "Remove", "Cancel");
  385. return 1;
  386. }
  387. if(listitem == 18)
  388. {
  389. for(new i = 0; i < MAX_PLAYERS; i++)
  390. {
  391. new DInfo[500];
  392. if(IsAdm(i) || IsPlayerAdmin(i))
  393. {
  394. new Admins[128], pName[128];
  395. GetPlayerName(i, pName, sizeof(pName));
  396. new AdmStr[128];
  397. if(IsPlayerAdmin(i) && IsAdm(i))
  398. {
  399. AdmStr = "{FF0000}RCON {33CCCC}Admin";
  400. }
  401. if(IsPlayerAdmin(i) && !IsAdm(i))
  402. {
  403. AdmStr = "{FF0000}RCON {33CCCC}Admin {FFFFFF}[{33FF33}Off-Duty{FFFFFF}]";
  404. }
  405. if(IsAdm(i) && !IsPlayerAdmin(i))
  406. {
  407. AdmStr = "{33FF33}Regular {33CCCC}Admin";
  408. }
  409. format(Admins, sizeof(Admins), "%s: {FFFF00}%s\n",AdmStr,pName);
  410. format(DInfo, sizeof(DInfo), "{33AA33}Admins Online:\n\n%s", Admins);
  411. }
  412. ShowPlayerDialog(playerid, Dialog_Adm_List, DIALOG_STYLE_MSGBOX, "{FF0000}Admin List", DInfo, "Close", "");
  413. }
  414. return 1;
  415. }
  416. if(listitem == 19)
  417. {
  418. ShowPlayerDialog(playerid, Dialog_Say, DIALOG_STYLE_INPUT, "{FF0000}Say", "{FFFF00}Write down Announce Text:", "Send", "Cancel");
  419. return 1;
  420. }
  421. }
  422. if(dialogid == Dialog_Kick_ID)
  423. {
  424. if(!response) return 0;
  425. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  426. new aN[128], str[128], pN[128];
  427. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  428. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s has been kicked by %s", pN, aN);
  429. SendClientMessageToAll(White, str);
  430. Kick(strval(inputtext));
  431. return 1;
  432. }
  433. if(dialogid == Dialog_Kill_ID)
  434. {
  435. if(!response) return 0;
  436. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  437. new aN[128], str[128], pN[128];
  438. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  439. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s has been killed by %s", pN, aN);
  440. SendClientMessageToAll(White, str);
  441. SetPlayerHealth(strval(inputtext), 0.0);
  442. return 1;
  443. }
  444. if(dialogid == Dialog_Car)
  445. {
  446. if(!response) return 0;
  447. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Red, "You can't create a Vehicle while in Vehicle");
  448. if(strval(inputtext) < 400 || strval(inputtext) > 611) return SendClientMessage(playerid, Red, "Invalid Vehicle ID");
  449. new Float:X,Float:Y,Float:Z,Float:A;
  450. GetPlayerPos(playerid, X,Y,Z);
  451. GetPlayerFacingAngle(playerid, A);
  452. new Veh;
  453. Veh = AddStaticVehicleEx ( strval(inputtext), X, Y, Z, A, 0, 0, Spawn_Delay );
  454. PutPlayerInVehicle(playerid, Veh, 0);
  455. SendClientMessage(playerid, White, "{33FF33}Car Created");
  456. return 1;
  457. }
  458. if(dialogid == Dialog_Car_Color)
  459. {
  460. if(!response) return 0;
  461. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Red, "You need to be in vehicle");
  462. if(strval(inputtext) < 0 || strval(inputtext) > 126) return SendClientMessage(playerid, Red, "Invalid Vehicle Color ID");
  463. ChangeVehicleColor(GetPlayerVehicleID(playerid), strval(inputtext), strval(inputtext));
  464. SendClientMessage(playerid, White, "{FFFF00}Car Color Changed.");
  465. return 1;
  466. }
  467. if(dialogid == Dialog_Car_Mods)
  468. {
  469. if(!response) return 0;
  470. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Red, "You need to be in vehicle");
  471. if(listitem == 0)
  472. {
  473. SendClientMessage(playerid, White, "{FFFF00}Gold Rims{FFFFFF} Added!");
  474. AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
  475. return 1;
  476. }
  477. if(listitem == 1)
  478. {
  479. SendClientMessage(playerid, White, "{FF0000}Nitro{FFFFFF} Added!");
  480. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  481. return 1;
  482. }
  483. if(listitem == 2)
  484. {
  485. SendClientMessage(playerid, White, "{33FF33}Hydraulics{FFFFFF} Added!");
  486. AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
  487. return 1;
  488. }
  489. return 1;
  490. }
  491. if(dialogid == Dialog_CheckP)
  492. {
  493. if(!response) return 0;
  494. if(ptEx == 1) return SendClientMessage(playerid, Red, "A checkpoint already exists, Destroy it first.");
  495. new Float:X,Float:Y,Float:Z;
  496. new pname[128], str[128];
  497. GetPlayerPos(playerid, X,Y,Z);
  498. GetPlayerName(playerid, pname, sizeof(pname));
  499. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}Admin %s, Created a point at %f, %f, %f", pname, X,Y,Z);
  500. SendClientMessageToAll(White, str);
  501. pt = CPS_AddCheckpoint(X,Y,Z,3,40);
  502. for(new i = 0; i < MAX_PLAYERS; i++)
  503. {
  504. SetPlayerMapIcon( i, MapIcon_CheckP, X, Y, Z, 33, 0, MAPICON_GLOBAL );
  505. }
  506. ptEx = 1;
  507. return 1;
  508. }
  509. if(dialogid == Dialog_CheckP_D)
  510. {
  511. if(!response) return 0;
  512. if(ptEx == 0) return SendClientMessage(playerid, Red, "There are no points to be destroyed");
  513. new pname[128], str[128];
  514. GetPlayerName(playerid, pname, sizeof(pname));
  515. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}Admin %s, Destroyed the Existing point", pname);
  516. SendClientMessageToAll(White, str);
  517. CPS_RemoveCheckpoint(pt);
  518. for(new i = 0; i < MAX_PLAYERS; i++)
  519. {
  520. RemovePlayerMapIcon( i, MapIcon_CheckP );
  521. }
  522. ptEx = 0;
  523. return 1;
  524. }
  525. if(dialogid == Dialog_PickUp)
  526. {
  527. if(!response) return 0;
  528. if(puEx == 1) return SendClientMessage(playerid, Red, "A PickUp-Text already exists, Destroy it first.");
  529. puEx = 1;
  530. new Float:X,Float:Y,Float:Z;
  531. new pname[128], str[128], txtP[128];
  532. GetPlayerPos(playerid, X,Y,Z);
  533. GetPlayerName(playerid, pname, sizeof(pname));
  534. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}Admin %s, Created a PickUp-Text at %f, %f, %f", pname, X,Y,Z);
  535. SendClientMessageToAll(White, str);
  536. pu = CreatePickup(1239, 1, X, Y, Z, GetPlayerVirtualWorld(playerid));
  537. format(txtP, sizeof(txtP), "{FF0000}%s\n{33FF33}- PickUp-Text", inputtext);
  538. put = Create3DTextLabel(txtP,Yellow,X,Y,Z,40.0,GetPlayerVirtualWorld(playerid), 1);
  539. return 1;
  540. }
  541. if(dialogid == Dialog_PickUp_D)
  542. {
  543. if(!response) return 0;
  544. if(puEx == 0) return SendClientMessage(playerid, Red, "There are no PickUp-Texts to be destroyed");
  545. puEx = 0;
  546. new pname[128], str[128];
  547. GetPlayerName(playerid, pname, sizeof(pname));
  548. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}Admin %s, Destroyed the Existing PickUp-Text", pname);
  549. SendClientMessageToAll(White, str);
  550. Delete3DTextLabel(put);
  551. DestroyPickup(pu);
  552. return 1;
  553. }
  554. if(dialogid == Dialog_Fill)
  555. {
  556. if(!response) return 0;
  557. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  558. new aN[128], str[128], pN[128];
  559. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  560. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s has been filled with Health and Armour by %s", pN, aN);
  561. SendClientMessageToAll(White, str);
  562. SetPlayerHealth(strval(inputtext), 100.0);
  563. SetPlayerArmour(strval(inputtext), 100.0);
  564. return 1;
  565. }
  566. if(dialogid == Dialog_God)
  567. {
  568. if(!response) return 0;
  569. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  570. new aN[128], str[128], pN[128];
  571. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  572. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s has been God-Moded by %s", pN, aN);
  573. SendClientMessageToAll(White, str);
  574. SetPlayerHealth(strval(inputtext), 100000.0);
  575. SetPlayerArmour(strval(inputtext), 100000.0);
  576. return 1;
  577. }
  578. if(dialogid == Dialog_Freeze)
  579. {
  580. if(!response) return 0;
  581. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  582. new aN[128], str[128], pN[128];
  583. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  584. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s was frozen by %s", pN, aN);
  585. SendClientMessageToAll(White, str);
  586. TogglePlayerControllable(strval(inputtext), 0);
  587. return 1;
  588. }
  589. if(dialogid == Dialog_UnFreeze)
  590. {
  591. if(!response) return 0;
  592. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  593. new aN[128], str[128], pN[128];
  594. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  595. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s was unfrozen by %s", pN, aN);
  596. SendClientMessageToAll(White, str);
  597. TogglePlayerControllable(strval(inputtext), 1);
  598. return 1;
  599. }
  600. if(dialogid == Dialog_Slap)
  601. {
  602. if(!response) return 0;
  603. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  604. new aN[128], str[128], pN[128];
  605. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  606. format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s was slapped by %s", pN, aN);
  607. SendClientMessageToAll(White, str);
  608. new Float:X,Float:Y,Float:Z;
  609. GetPlayerPos(strval(inputtext), X,Y,Z);
  610. SetPlayerPos(strval(inputtext), X,Y,Z+5);
  611. new Float:H;
  612. GetPlayerHealth(playerid, H);
  613. SetPlayerHealth(playerid, H-20);
  614. return 1;
  615. }
  616. if(dialogid == Dialog_TPto)
  617. {
  618. if(!response) return 0;
  619. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  620. new aN[128], Amsg[128], pN[128];
  621. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  622. new Float:X,Float:Y,Float:Z;
  623. GetPlayerPos(strval(inputtext), X,Y,Z);
  624. SetPlayerPos(playerid, X+5,Y,Z+2);
  625. format(Amsg, sizeof(Amsg), "{33FF33}You have been Teleported to {FF0000}%s", pN);
  626. SendClientMessage(playerid, White, Amsg);
  627. return 1;
  628. }
  629. if(dialogid == Dialog_TPu)
  630. {
  631. if(!response) return 0;
  632. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  633. new aN[128], Amsg[128], pN[128];
  634. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  635. new Float:X,Float:Y,Float:Z;
  636. GetPlayerPos(playerid, X,Y,Z);
  637. SetPlayerPos(strval(inputtext), X+5,Y,Z);
  638. format(Amsg, sizeof(Amsg), "{33FF33}You have been Teleported to {FF0000}%s", pN);
  639. SendClientMessage(strval(inputtext), White, Amsg);
  640. return 1;
  641. }
  642. if(dialogid == Dialog_Make_Adm)
  643. {
  644. if(!response) return 0;
  645. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "{999999} You are not authorised to use this command");
  646. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  647. new pFile[100], aN[128], Amsg[128], Pmsg[128], pN[128];
  648. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  649. format(pFile, sizeof(pFile), "Adm/Admins/%s.ini", pN);
  650. if(dini_Exists(pFile) && dini_Int(pFile, "Level") == 1) return SendClientMessage(playerid, White, "{FF0000}The player is already an admin");
  651. format(Pmsg, sizeof(Pmsg), "{33FF33}The admin {FF0000}%s {33FF33}made you Admin.", aN);
  652. SendClientMessage(strval(inputtext), White, Pmsg);
  653. format(Amsg, sizeof(Amsg), "{33FF33}You made {FF0000}%s {33FF33}an Admin.", pN);
  654. SendClientMessage(playerid, White, Amsg);
  655. dini_Create(pFile);
  656. dini_IntSet(pFile, "Level", 1);
  657. return 1;
  658. }
  659. if(dialogid == Dialog_Remove_Adm)
  660. {
  661. if(!response) return 0;
  662. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "{999999} You are not authorised to use this command");
  663. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
  664. new pFile[100], aN[128], Amsg[128], Pmsg[128], pN[128];
  665. GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
  666. format(pFile, sizeof(pFile), "Adm/Admins/%s.ini", pN);
  667. if(!dini_Exists(pFile)) return SendClientMessage(playerid, White, "{FF0000}The player is not an admin");
  668. if(dini_Exists(pFile) && dini_Int(pFile, "Level") == 0) return SendClientMessage(playerid, White, "{FF0000}The player is not an admin");
  669. format(Pmsg, sizeof(Pmsg), "{33FF33}The admin {FF0000}%s {33FF33}Demote you from Admin.", aN);
  670. SendClientMessage(strval(inputtext), White, Pmsg);
  671. format(Amsg, sizeof(Amsg), "{33FF33}You Demote {FF0000}%s {33FF33} from being an Admin.", pN);
  672. SendClientMessage(playerid, White, Amsg);
  673. dini_Remove(pFile);
  674. return 1;
  675. }
  676. if(dialogid == Dialog_Say)
  677. {
  678. if(IsAdm(playerid) || IsPlayerAdmin(playerid))
  679. {
  680. new pName[128], str[128];
  681. GetPlayerName(playerid, pName, sizeof(pName));
  682. if(IsPlayerAdmin(playerid) && IsAdm(playerid))
  683. {
  684. format(str, sizeof(str), "{FF0000}RCON Admin {00FFFF}%s: {FFFF00}%s", pName, inputtext);
  685. }
  686. if(IsPlayerAdmin(playerid) && !IsAdm(playerid))
  687. {
  688. format(str, sizeof(str), "[{00AAFF}Off-Duty{FFFFFF}] {FF0000}RCON Admin {FFFF00}%s:{00FFFF} %s", pName, inputtext);
  689. }
  690. if(IsAdm(playerid) && !IsPlayerAdmin(playerid))
  691. {
  692. format(str, sizeof(str), "{33FF33}Regular Admin {FFFF00}%s:{00FFFF} %s", pName, inputtext);
  693. }
  694. SendClientMessageToAll(White, str);
  695. }
  696. return 1;
  697. }
  698. return 1;
  699. }
  700.  
  701. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  702. {
  703. return 1;
  704. }
  705.  
  706. stock IsAdm(playerid)
  707. {
  708. new pFile[100], name[128];
  709. GetPlayerName(playerid, name, sizeof(name));
  710. format(pFile, sizeof(pFile), "Adm/Admins/%s.ini", name);
  711. if(!dini_Exists(pFile)) return false;
  712. if(dini_Exists(pFile) && dini_Int(pFile, "Level") == 0) return false;
  713. else return true;
  714. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement