Guest User

Untitled

a guest
Feb 8th, 2013
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 56.25 KB | None | 0 0
  1.  
  2. /*******************************************************************************
  3. * SERVER NAME: Los Santos Life Cops n Robbers
  4. * SERVER VERSION: v1.0
  5. * SERVER DEVELOPER: Goldkiller & JerryBean
  6. *
  7. * INFORMATION: Los Santos Life Cops n Robbers is a gamemodewhich was created
  8. * on the 19.1.2013. This script contains lots of functions, commands, and
  9. * admin commands.
  10. *
  11. * Copyright 2013. Do not steal this Gamemode, if your using it, leave the
  12. * credits on.
  13. *
  14. * To do list:
  15. *
  16. *
  17. *******************************************************************************/
  18. //--[INCLUDES]--
  19. #include <a_samp>
  20. #include <zcmd>
  21. #include <YSI\y_ini>
  22. #include <sscanf>
  23. #include <OnPlayerAirBreak>
  24.  
  25. //-----[FORWARDS]-----
  26. forward loadaccount_user(playerid, name[], value[]);
  27. forward Unjail(playerid);
  28.  
  29. //-----[NATIVES]-----
  30. native WP_Hash(buffer[],len,const str[]);
  31.  
  32. //----------[OTHERS]--------
  33. new Question[MAX_PLAYERS][256];
  34. new bool:QuestionAsked[MAX_PLAYERS];
  35.  
  36. //-----[ADMIN DEFINES]-----
  37. #define dregister 2011
  38. #define dlogin 2012
  39. #define DIALOG_RULES 2013
  40. #define cmds 2014
  41. #define acmds 2015
  42. #define upd 2016
  43. #define credits 2017
  44. #define vipinfo 2018
  45. #define DIALOG_WEAPONS 2019
  46. #define UserPath "Adm/Users/%s.ini"
  47.  
  48. //-----[COLOR DEFINES FOR ADMIN/REG SYSTEM]-----
  49. #define COL_RULES "{FA0A36}"
  50. #define COL_WHITE "{FFFFFF}"
  51. #define COL_RED "{F81414}"
  52. #define COL_GREEN "{00FF22}"
  53. #define COL_LIGHTBLUE "{00CED1}"
  54.  
  55. //----[OTHER COLOR DEFINES]-----
  56. #define COL_RED "{F81414}"
  57. #define COL_GREEN "{00FF22}"
  58. #define COL_LIGHTBLUE "{00CED1}"
  59. #define GREY 0xAFAFAFAA
  60. #define GREEN 0x33AA33AA
  61. #define COLOR_WHITE 0xFFFFFFAA
  62. #define COLOR_RBLUE 0x4169FFAA
  63. #define YELLOW 0xFFFF00AA
  64. #define WHITE 0xFFFFFFAA
  65. #define LIGHTBLUE 0x33CCFFAA
  66. #define ORANGE 0xFF9900AA
  67. #define RED 0xFF0000FF
  68. #define COLOR_ERROR 0xFF6A6AFF
  69. #define COLOR_BOMB 0x96BD6AFF
  70. #define COL_WHITE "{FFFFFF}"
  71. #define COL_RED "{F81414}"
  72. #define COL_GREEN "{00FF22}"
  73. #define COL_LIGHTBLUE "{00CED1}"
  74. #define GREY 0xAFAFAFAA
  75. #define GREEN 0x33AA33AA
  76. #define COLOR_YELLOW 0xFFFF00AA
  77. #define YELLOW 0xFFFF00AA
  78. #define WHITE 0xFFFFFFAA
  79. #define COLOR_WHITE 0xFFFFFFAA
  80. #define LIGHTBLUE 0x33CCFFAA
  81. #define ORANGE 0xFF9900AA
  82. #define RED 0xFF0000FF
  83. #define BLUE 0x000060FF
  84. #define BLUE2 0x005F60FF
  85. #define Grey 0xC0C0C0FF
  86. #define COLOR_GRAD1 0xB4B5B7FF
  87.  
  88. //-----[ENUMS]-----
  89. enum PlayerInfo
  90. {
  91. Pass[129], //User's password
  92. Adminlevel, //User's admin level
  93. VIPlevel, //User's vip level
  94. Money, //User's money
  95. Scores, //User's scores
  96. Kills, //User's kills
  97. Deaths, //User's deaths
  98. }
  99. new pInfo[MAX_PLAYERS][PlayerInfo];
  100.  
  101. //-----[OTHER DEFINES]-----
  102. new JailTimer[MAX_PLAYERS];// for the timer
  103. new Jailed[MAX_PLAYERS];//for the players in jail
  104.  
  105. //-----[FORWARDS]-----
  106. forward RandomMessages();
  107.  
  108. //--[TEXTDRAWS]--
  109. new Text:Startup0;
  110. new Text:Startup1;
  111. new Text:Startup2;
  112. new Text:Startup3;
  113. new Text:Startup4;
  114. new Text:Startup5;
  115.  
  116. //--[3D TEXT]---
  117. new Text3D:admin;
  118.  
  119. //--[PM]---
  120.  
  121.  
  122. new randomMessages[][] = //Random server messages
  123. {
  124. "Always remember to follow the servers rules otherwise it may result in a punishment",
  125. "If you liked our server tell your friends about it",
  126. "Remember to add our server to your favourites. Our IP is ~Comming soon~",
  127. "Remember to visit our TeamSpeak 3 server. Our TS3 IP is ~Comming soon~",
  128. "Unsure of anything? Need help? Use /ask to ask a question to our online staff",
  129. "Spotted a hacker? /report in game them or report them on our forums",
  130. "Use /admins to see a list of our online staff",
  131. "Use /vips to see a list of our online V.I.P's",
  132. "Found a bug? Report it on our forums.",
  133. "Use /cmds to view a list of working commands!",
  134. "To see a list of latest updates, use /updates"
  135. };
  136.  
  137. //------[TEAM DEFINES]------
  138. #define TEAM_COPS 0
  139. #define TEAM_COLOR_COPS COLOR_BLUE
  140. #define TEAM_C.I.A 1
  141. #define TEAM_COLOR_C.I.A COLOR_BLUE
  142. #define TEAM_SWAT 2
  143. #define TEAM_COLOR_SWAT COLOR_AQUA
  144. #define TEAM_ARMY 3
  145. #define TEAM_COLOR_ARMY COLOR_PURPLE
  146. #define TEAM_MEDICS 4
  147. #define TEAM_COLOR_MEDICS COLOR_PINK
  148. #define TEAM_TAXI 5
  149. #define TEAM_COLOR_TAXI COLOR_GREEN
  150. #define TEAM_MECH 6
  151. #define TEAM_COLOR_MECH COLOR_WHITE
  152. #define TEAM_ CIV 7
  153. #define TEAM_COLOR_CIV COLOR_WHITE
  154.  
  155. //------[COLOR DEFINES]------
  156. /////////TEAM_COLORS/////////
  157. #define COLOR_BLUE 0x00FFFFFF ///Cops & C.I.A
  158. #define COLOR_AQUA 0x00FFFFFF ///SWAT
  159. #define COLOR_PURPLE 0xA200FFFF ///Army
  160. #define COLOR_PINK 0xECC8ECFF ///Medics
  161. #define COLOR_GREEN 0xECC8ECFF ///Taxi
  162.  
  163. //---------[COLORS]---------
  164. //////////OTHER_COLORS//////
  165. #define COLOR_GREY 0xAFAFAFAA
  166. #define COLOR_RED 0xAA3333AA
  167. #define COLOR_YELLOW 0xFFFF00AA
  168. #define COLOR_LIGHTBLUE 0x33CCFFAA
  169. #define COLOR_ORANGE 0xFF9900AA
  170. #define COLOR_RED 0xAA3333AA
  171. #define COLOR_LIME 0x10F441AA
  172. #define COLOR_MAGENTA 0xFF00FFFF
  173. #define COLOR_NAVY 0x000080AA
  174. #define COLOR_CRIMSON 0xDC143CAA
  175. #define COLOR_FLBLUE 0x6495EDAA
  176. #define COLOR_BISQUE 0xFFE4C4AA
  177. #define COLOR_BLACK 0x000000AA
  178. #define COLOR_CHARTREUSE 0x7FFF00AA
  179. #define COLOR_BROWN 0XA52A2AAA
  180. #define COLOR_CORAL 0xFF7F50AA
  181. #define COLOR_GOLD 0xB8860BAA
  182. #define COLOR_GREENYELLOW 0xADFF2FAA
  183. #define COLOR_INDIGO 0x4B00B0AA
  184. #define COLOR_IVORY 0xFFFF82AA
  185. #define COLOR_LAWNGREEN 0x7CFC00AA
  186. #define COLOR_SEAGREEN 0x20B2AAAA
  187. #define COLOR_LIMEGREEN 0x32CD32AA
  188. #define COLOR_MIDNIGHTBLUE 0X191970AA
  189. #define COLOR_MAROON 0x800000AA
  190. #define COLOR_OLIVE 0x808000AA
  191. #define COLOR_ORANGERED 0xFF4500AA
  192. #define COLOR_SPRINGGREEN 0x00FF7FAA
  193. #define COLOR_TOMATO 0xFF6347AA
  194. #define COLOR_YELLOWGREEN 0x9ACD32AA
  195. #define COLOR_MEDIUMAQUA 0x83BFBFAA
  196. #define COLOR_MEDIUMMAGENTA 0x8B008BAA
  197.  
  198. #if defined FILTERSCRIPT
  199.  
  200. public OnFilterScriptInit()
  201. {
  202. print("\n--------------------------------------");
  203. print(" Blank Filterscript by your name here");
  204. print("--------------------------------------\n");
  205. return 1;
  206. }
  207.  
  208. public OnFilterScriptExit()
  209. {
  210. return 1;
  211. }
  212.  
  213. #else
  214.  
  215. main()
  216. {
  217. print("-------------------------------------------");
  218. print("SERVER: Los Santos Life Cops n Robbers");
  219. print("VERSION: Mode v1.0");
  220. print("DEVELOPER: Goldkiller & JerryBean");
  221. print("BETA TESTERS: SilverKiller & JerryBean");
  222. print("-------------------------------------------");
  223. }
  224.  
  225. #endif
  226.  
  227. public OnGameModeInit()
  228. {
  229. Startup0 = TextDrawCreate(645.000000, 2.000000, "_");
  230. TextDrawBackgroundColor(Startup0, 255);
  231. TextDrawFont(Startup0, 1);
  232. TextDrawLetterSize(Startup0, 0.500000, 10.100002);
  233. TextDrawColor(Startup0, -1);
  234. TextDrawSetOutline(Startup0, 0);
  235. TextDrawSetProportional(Startup0, 1);
  236. TextDrawSetShadow(Startup0, 1);
  237. TextDrawUseBox(Startup0, 1);
  238. TextDrawBoxColor(Startup0, 255);
  239. TextDrawTextSize(Startup0, -5.000000, 0.000000);
  240.  
  241. Startup1 = TextDrawCreate(645.000000, 354.000000, "_");
  242. TextDrawBackgroundColor(Startup1, 255);
  243. TextDrawFont(Startup1, 1);
  244. TextDrawLetterSize(Startup1, 0.500000, 10.100002);
  245. TextDrawColor(Startup1, -1);
  246. TextDrawSetOutline(Startup1, 0);
  247. TextDrawSetProportional(Startup1, 1);
  248. TextDrawSetShadow(Startup1, 1);
  249. TextDrawUseBox(Startup1, 1);
  250. TextDrawBoxColor(Startup1, 255);
  251. TextDrawTextSize(Startup1, -5.000000, 0.000000);
  252.  
  253. Startup2 = TextDrawCreate(645.000000, 354.000000, "_");
  254. TextDrawBackgroundColor(Startup2, 255);
  255. TextDrawFont(Startup2, 1);
  256. TextDrawLetterSize(Startup2, 0.500000, 0.000000);
  257. TextDrawColor(Startup2, -1);
  258. TextDrawSetOutline(Startup2, 0);
  259. TextDrawSetProportional(Startup2, 1);
  260. TextDrawSetShadow(Startup2, 1);
  261. TextDrawUseBox(Startup2, 1);
  262. TextDrawBoxColor(Startup2, COLOR_LIGHTBLUE);
  263. TextDrawTextSize(Startup2, -5.000000, 0.000000);
  264.  
  265. Startup3 = TextDrawCreate(645.000000, 93.000000, "_");
  266. TextDrawBackgroundColor(Startup3, 255);
  267. TextDrawFont(Startup3, 1);
  268. TextDrawLetterSize(Startup3, 0.500000, 0.000000);
  269. TextDrawColor(Startup3, -1);
  270. TextDrawSetOutline(Startup3, 0);
  271. TextDrawSetProportional(Startup3, 1);
  272. TextDrawSetShadow(Startup3, 1);
  273. TextDrawUseBox(Startup3, 1);
  274. TextDrawBoxColor(Startup3, COLOR_LIGHTBLUE);
  275. TextDrawTextSize(Startup3, -5.000000, 0.000000);
  276.  
  277. Startup4 = TextDrawCreate(138.000000, 19.000000, "Los Santos Life");
  278. TextDrawBackgroundColor(Startup4, COLOR_LIGHTBLUE);
  279. TextDrawFont(Startup4, 2);
  280. TextDrawLetterSize(Startup4, 0.699999, 4.599997);
  281. TextDrawColor(Startup4, 255);
  282. TextDrawSetOutline(Startup4, 1);
  283. TextDrawSetProportional(Startup4, 1);
  284.  
  285. Startup5 = TextDrawCreate(92.000000, 73.000000, "This server may contain explicit content and may be considered only for adults");
  286. TextDrawBackgroundColor(Startup5, COLOR_LIGHTBLUE);
  287. TextDrawFont(Startup5, 2);
  288. TextDrawLetterSize(Startup5, 0.240000, 0.900000);
  289. TextDrawColor(Startup5, 255);
  290. TextDrawSetOutline(Startup5, 1);
  291. TextDrawSetProportional(Startup5, 1);
  292.  
  293. SetGameModeText("Cops and Robbers");
  294. //------------------------[PLAYER CLASS SELECTION]--------------------------
  295. /////////////////////////////////TEAM_COPS//////////////////////////////////
  296. AddPlayerClass(266, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
  297. AddPlayerClass(265, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
  298. AddPlayerClass(267, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
  299. AddPlayerClass(283, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
  300. AddPlayerClass(288, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
  301. AddPlayerClass(286, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
  302. AddPlayerClass(284, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
  303. //////////////////////////////////TEAM_C.I.A////////////////////////////////
  304. AddPlayerClass(165, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
  305. AddPlayerClass(166, 1576.9141,-1692.2262,6.2188,180.0963, 0, 0, 0, 0, 0, 0);
  306. //////////////////////////////////TEAM_SWAT///////////////////////////////////
  307. AddPlayerClass(285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  308. /////////////////////////////////TEAM_ARMY///////////////////////////////////
  309. AddPlayerClass(287, 2778.7278,-2410.4207,13.6359,180.4225, 0, 0, 0, 0, 0, 0);
  310. ////////////////////////////////TEAM_MEDICS//////////////////////////////////
  311. AddPlayerClass(276, 2027.7826,-1404.2111,17.2339,179.8795, 0, 0, 0, 0, 0, 0);
  312. AddPlayerClass(275, 2027.7826,-1404.2111,17.2339,179.8795, 0, 0, 0, 0, 0, 0);
  313. ///////////////////////////////TEAM_TAXI/////////////////////////////////////
  314. AddPlayerClass(261, 1770.8652,-1861.5470,13.5774,358.8449, 0, 0, 0, 0, 0, 0);
  315. AddPlayerClass(7, 1770.8652,-1861.5470,13.5774,358.8449, 0, 0, 0, 0, 0, 0);
  316. //////////////////////////////TEAM_MECH//////////////////////////////////////
  317. AddPlayerClass(50, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  318. //////////////////////////////TEAM_CIV///////////////////////////////////////
  319. AddPlayerClass(2, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  320. AddPlayerClass(3, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  321. AddPlayerClass(21, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  322. AddPlayerClass(22, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  323. AddPlayerClass(23, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  324. AddPlayerClass(29, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  325. AddPlayerClass(47, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  326. AddPlayerClass(48, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  327. AddPlayerClass(12, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  328. AddPlayerClass(24, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  329. AddPlayerClass(25, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  330. AddPlayerClass(26, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  331. AddPlayerClass(28, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  332. AddPlayerClass(86, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  333. AddPlayerClass(100, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  334. AddPlayerClass(103, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  335. AddPlayerClass(104, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  336. AddPlayerClass(106, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  337. AddPlayerClass(107, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  338. AddPlayerClass(108, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  339. AddPlayerClass(147, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  340. AddPlayerClass(149, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  341. AddPlayerClass(180, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  342. AddPlayerClass(188, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  343. AddPlayerClass(217, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  344. AddPlayerClass(223, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  345. AddPlayerClass(247, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  346. AddPlayerClass(248, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  347. AddPlayerClass(250, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  348. AddPlayerClass(254, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  349. AddPlayerClass(264, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  350. AddPlayerClass(46, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  351. AddPlayerClass(294, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  352. //Changing the way it runs
  353. UsePlayerPedAnims();
  354. ///Timer
  355. SetTimer("RandomMessages", 100000, true); //Time for Random Messages - Appears every 100 seceonds
  356. AntiDeAMX();
  357. return 1;
  358. }
  359.  
  360. public OnPlayerAirbreak(playerid)
  361. {
  362. new
  363. playername[24],
  364. string[128];
  365.  
  366. GetPlayerName(playerid, playername, sizeof(playername));
  367. if (IsPlayerInAnyVehicle(playerid))
  368. {
  369. format(string, sizeof(string), "AutoBan: %s(%d) was banned for vehicle airbreak.", playername, playerid);
  370. SendClientMessageToAll(0xF51B1BFF, string);
  371. }
  372. else
  373. {
  374. format(string, sizeof(string), "AutoBan: %s(%d) was banned for airbreak.", playername, playerid);
  375. SendClientMessageToAll(0xF51B1BFF, string);
  376. }
  377. Ban(playerid);
  378. return 1;
  379. }
  380.  
  381. new Filter[][] =
  382. {
  383. "MotherFucker",
  384. "Mofo",
  385. "pussy",
  386. "Asshole",
  387. "DickHead",
  388. "play.codw.co.uk:6654",
  389. "CODW",
  390. "codw",
  391. "s0beit",
  392. "sobeit",
  393. "hack",
  394. "cheat",
  395. "h@ck",
  396. "/rcon login",
  397. ".rcon login",
  398. "&rcon login",
  399. "7rcon login",
  400. "/Q"
  401. };
  402.  
  403.  
  404. public OnGameModeExit()
  405. {
  406. return 1;
  407. }
  408.  
  409. public OnPlayerRequestClass(playerid, classid)
  410. {
  411. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  412. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  413. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  414. return 1;
  415. }
  416.  
  417. public OnPlayerConnect(playerid)
  418. {
  419. SendClientMessage(playerid, 0xFFC400FF, "MOTD: Use /updates to viewer our newest server updates");
  420. new pname[MAX_PLAYER_NAME], string[128 + MAX_PLAYER_NAME];
  421. GetPlayerName(playerid, pname, sizeof(pname));
  422. format(string, sizeof(string), "* %s has joined the server", pname);
  423. SendClientMessageToAll(0xA8A8A8FF, string);
  424. TextDrawShowForPlayer(playerid,Startup0);
  425. TextDrawShowForPlayer(playerid,Startup1);
  426. TextDrawShowForPlayer(playerid,Startup2);
  427. TextDrawShowForPlayer(playerid,Startup3);
  428. TextDrawShowForPlayer(playerid,Startup4);
  429. TextDrawShowForPlayer(playerid,Startup5);
  430. PlayAudioStreamForPlayer(playerid, "http://mixconnect.com/disk2/mp3/1e1a51b28bdc93803dcbf.mp3");
  431. new name[MAX_PLAYER_NAME]; //Making a new variable called 'name'. name[MAX_PLAYER_NAME] is created so we can use it to get player's name.
  432. GetPlayerName(playerid,name,sizeof(name)); //Get player's name
  433. if(fexist(Path(playerid))) /* Check if the connected user is registered or not. fexist stands for file exist. So if file exist in the files(Path(playerid)),*/
  434. {// then
  435. INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid); //Will load user's data using INI_Parsefile.
  436. ShowPlayerDialog(playerid,dlogin, DIALOG_STYLE_PASSWORD,""COL_GREEN"Login",""COL_WHITE"This account is {00FF22}already registered.\n{FFFFFF}Please login by entering your password in below","Login","Quit");
  437. }
  438. else //If the connected user is not registered,
  439. {//then we will 'force' him to register :)
  440. ShowPlayerDialog(playerid,dregister, DIALOG_STYLE_PASSWORD,""COL_RED"Register",""COL_WHITE"This account is{F81414} not yet registered \n{FFFFFF}Please create an account by writing a password below","Register","Quit");
  441. return 1;
  442. }
  443. return 1;
  444. }
  445.  
  446. public RandomMessages()
  447. {
  448. new randomMsg = random(sizeof(randomMessages)); //create a variable "randomMsg" and give it the value of our array we've created ("randomMessages")
  449. SendClientMessageToAll(0xFF8400FF, randomMessages[randomMsg]); //Will send a Random Message to everybody on the server
  450. }
  451.  
  452.  
  453. public OnPlayerDisconnect(playerid, reason)
  454. {
  455. QuestionAsked[playerid] = false;
  456. format(Question[playerid], 256, " ");
  457. new pname[MAX_PLAYER_NAME], string[128 + MAX_PLAYER_NAME];
  458. GetPlayerName(playerid, pname, sizeof(pname));
  459. switch(reason)
  460. {
  461. case 0:
  462. format(string, sizeof(string), "* %s has left the server. (Lost Connection)", pname);
  463. case 1:
  464. format(string, sizeof(string), "* %s has left the server. (Leaving)", pname);
  465. case 2:
  466. format(string, sizeof(string), "* %s has left the server. (Kicked/Banned)", pname);
  467. }
  468. SendClientMessageToAll(0xA8A8A8FF, string);
  469. //Same as OnDialogResponse, we will save their stats inside of their user's account
  470. if(fexist(Path(playerid)))//Will check if the file is exit or not inside of User's folder that we have created.
  471. {
  472. new INI:file = INI_Open(Path(playerid)); //will open their file
  473. INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
  474. INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]); //If you've set his/her admin level, then his/her admin level will be saved inside of his/her account
  475. INI_WriteInt(file,"VIPLevel",pInfo[playerid][VIPlevel]);//As explained above
  476. INI_WriteInt(file,"Money",GetPlayerMoney(playerid));//We will save his money inside of his account
  477. INI_WriteInt(file,"Scores",GetPlayerScore(playerid));//We will save his score inside of his account
  478. INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);//As explained above
  479. INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);//As explained above
  480. INI_Close(file);//Now after we've done saving their data, we now need to close the file
  481. return 1;
  482. }
  483. return 1;
  484. }
  485.  
  486. public OnPlayerSpawn(playerid)
  487. {
  488. TextDrawHideForPlayer(playerid, Startup0);
  489. TextDrawHideForPlayer(playerid, Startup1);
  490. TextDrawHideForPlayer(playerid, Startup2);
  491. TextDrawHideForPlayer(playerid, Startup3);
  492. TextDrawHideForPlayer(playerid, Startup4);
  493. TextDrawHideForPlayer(playerid, Startup5);
  494. StopAudioStreamForPlayer(playerid);
  495. return 1;
  496. }
  497.  
  498. public OnPlayerDeath(playerid, killerid, reason)
  499. {
  500. SendDeathMessage(killerid, playerid, reason);
  501. pInfo[killerid][Kills]++;
  502. pInfo[killerid][Kills]++;
  503. return 1;
  504. }
  505.  
  506. public OnVehicleSpawn(vehicleid)
  507. {
  508. return 1;
  509. }
  510.  
  511. public OnVehicleDeath(vehicleid, killerid)
  512. {
  513. return 1;
  514. }
  515.  
  516. public OnPlayerText(playerid, text[])
  517. {
  518. new string[128];
  519. format(string, sizeof(string), "%s[%d]: %s", GetName(playerid), playerid, text);
  520. SendClientMessageToAll(-1, string);
  521. for(new d; d<sizeof(Filter); d++)
  522. if(strfind(text,Filter[d],true) != -1)
  523. {
  524. SendClientMessage(playerid,RED,"Bad word.Don't use those words in chat.");
  525. SendClientMessage(playerid,RED,"If you have seen a hacker/rulebreaker/cheater,use /report (id) (reason)");
  526. return 0;
  527. }
  528. return 0;
  529. }
  530.  
  531. public OnPlayerCommandText(playerid, cmdtext[])
  532. {
  533. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  534. {
  535. // Do something here
  536. return 1;
  537. }
  538. return 0;
  539. }
  540.  
  541. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  542. {
  543. return 1;
  544. }
  545.  
  546. public OnPlayerExitVehicle(playerid, vehicleid)
  547. {
  548. return 1;
  549. }
  550.  
  551. public OnPlayerStateChange(playerid, newstate, oldstate)
  552. {
  553. return 1;
  554. }
  555.  
  556. public OnPlayerEnterCheckpoint(playerid)
  557. {
  558. return 1;
  559. }
  560.  
  561. public OnPlayerLeaveCheckpoint(playerid)
  562. {
  563. return 1;
  564. }
  565.  
  566. public OnPlayerEnterRaceCheckpoint(playerid)
  567. {
  568. return 1;
  569. }
  570.  
  571. public OnPlayerLeaveRaceCheckpoint(playerid)
  572. {
  573. return 1;
  574. }
  575.  
  576. public OnRconCommand(cmd[])
  577. {
  578. return 1;
  579. }
  580.  
  581. public OnPlayerRequestSpawn(playerid)
  582. {
  583. return 1;
  584. }
  585.  
  586. public OnObjectMoved(objectid)
  587. {
  588. return 1;
  589. }
  590.  
  591. public OnPlayerObjectMoved(playerid, objectid)
  592. {
  593. return 1;
  594. }
  595.  
  596. public OnPlayerPickUpPickup(playerid, pickupid)
  597. {
  598. return 1;
  599. }
  600.  
  601. public OnVehicleMod(playerid, vehicleid, componentid)
  602. {
  603. return 1;
  604. }
  605.  
  606. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  607. {
  608. return 1;
  609. }
  610.  
  611. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  612. {
  613. return 1;
  614. }
  615.  
  616. public OnPlayerSelectedMenuRow(playerid, row)
  617. {
  618. return 1;
  619. }
  620.  
  621. public OnPlayerExitedMenu(playerid)
  622. {
  623. return 1;
  624. }
  625.  
  626. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  627. {
  628. return 1;
  629. }
  630.  
  631. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  632. {
  633. return 1;
  634. }
  635.  
  636. public OnRconLoginAttempt(ip[], password[], success)
  637. {
  638. return 1;
  639. }
  640.  
  641. public OnPlayerUpdate(playerid)
  642. {
  643. new weap = GetPlayerWeapon(playerid);
  644. new player[MAX_PLAYER_NAME];
  645. new str[128];
  646. if(weap == 36) //Heat Seeking Rocket Launcher
  647. {
  648. GetPlayerName(playerid,player,sizeof(player));
  649. format(str,sizeof(str),"[Anti-WeaponHack] %s: Weapon Hack Detected!",player);
  650. SendClientMessageToAll(0xFF4500AA,str);
  651. format(str,sizeof(str),"Player ''%s'' has been Banned from the server. (Reason: Weapon Hack Detected!)",player);
  652. SendClientMessageToAll(0xFF0000FF,str);
  653. ShowPlayerDialog(playerid,5,DIALOG_STYLE_MSGBOX, "You Have Been Banned", "{FFFFFF}You've been {FF0000}Banned{FFFFFF}\nReason: Weapon Hack Detected!", "OK", "OK");
  654. Ban(playerid);
  655. }
  656. //The Other Forbidden Weapon is: MINIGUN (id 38)
  657. if(weap == 38)
  658. {
  659. GetPlayerName(playerid,player,sizeof(player));
  660. format(str,sizeof(str),"[Anti-WeaponHack] %s: Weapon Hack Detected!",player);
  661. SendClientMessageToAll(0xFF4500AA,str);
  662. format(str,sizeof(str),"Player ''%s'' has been Banned from the server. (Reason: Weapon Hack Detected!)",player);
  663. SendClientMessageToAll(0xFF0000FF,str);
  664. ShowPlayerDialog(playerid,7,DIALOG_STYLE_MSGBOX, "You Have Been Banned", "{FFFFFF}You've been {FF0000}Banned{FFFFFF}\nReason: Weapon Hack Detected!", "OK", "OK");
  665. Ban(playerid);
  666. }
  667. //The Other Forbidden Weapon is: Satchel Charge, Detonator (id 39; 40)
  668. if(weap == 39)
  669. {
  670. GetPlayerName(playerid,player,sizeof(player));
  671. format(str,sizeof(str),"[Anti-WeaponHack] %s: Weapon Hack Detected!",player);
  672. SendClientMessageToAll(0xFF4500AA,str);
  673. format(str,sizeof(str),"Player ''%s'' has been Banned from the server. (Reason: Weapon Hack Detected!)",player);
  674. SendClientMessageToAll(0xFF0000FF,str);
  675. ShowPlayerDialog(playerid,11,DIALOG_STYLE_MSGBOX, "You Have Been Banned", "{FFFFFF}You've been {FF0000}Banned{FFFFFF}\nReason: Weapon Hack Detected!", "OK", "OK");
  676. Ban(playerid);
  677. }
  678. if(weap == 40)
  679. {
  680. GetPlayerName(playerid,player,sizeof(player));
  681. format(str,sizeof(str),"[Anti-WeaponHack] %s: Weapon Hack Detected!",player);
  682. SendClientMessageToAll(0xFF4500AA,str);
  683. format(str,sizeof(str),"Player ''%s'' has been Banned from the server. (Reason: Weapon Hack Detected!)",player);
  684. SendClientMessageToAll(0xFF0000FF,str);
  685. ShowPlayerDialog(playerid,13,DIALOG_STYLE_MSGBOX, "You Have Been Banned", "{FFFFFF}You've been {FF0000}Banned{FFFFFF}\nReason: Weapon Hack Detected!", "OK", "OK");
  686. Ban(playerid);
  687. }
  688. //The Other Forbidden Weapon is: Thermal Googles (id 45)
  689. if(weap == 45)
  690. {
  691. GetPlayerName(playerid,player,sizeof(player));
  692. format(str,sizeof(str),"[Anti-WeaponHack] %s: Weapon Hack Detected!",player);
  693. SendClientMessageToAll(0xFF4500AA,str);
  694. format(str,sizeof(str),"Player ''%s'' has been Banned from the server. (Reason: Weapon Hack Detected!)",player);
  695. SendClientMessageToAll(0xFF0000FF,str);
  696. ShowPlayerDialog(playerid,25,DIALOG_STYLE_MSGBOX, "You Have Been Banned", "{FFFFFF}You've been {FF0000}Banned{FFFFFF}\nReason: Weapon Hack Detected!", "OK", "OK");
  697. Ban(playerid);
  698. }
  699. //Anti-Jetpack Hack (ADDED IN VERSION 2)
  700. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
  701. {
  702. GetPlayerName(playerid,player,sizeof(player));
  703. format(str,sizeof(str),"[Anti-Jetpack] %s: Jetpack Hack Detected!",player);
  704. SendClientMessageToAll(0xFF4500AA,str);
  705. format(str,sizeof(str),"Player ''%s'' has been Kicked from the server. (Reason: Jetpack Hack Detected!)",player);
  706. SendClientMessageToAll(0xFF0000FF,str);
  707. ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX, "You Have Been Kicked!", "{FFFFFF}You've been {FF0000}kicked{FFFFFF}!\nReason: Jetpack Hack Detected!", "OK", "OK");
  708. Kick(playerid);
  709. }
  710. return 1;
  711. }
  712.  
  713.  
  714. public OnPlayerStreamIn(playerid, forplayerid)
  715. {
  716. return 1;
  717. }
  718.  
  719. public OnPlayerStreamOut(playerid, forplayerid)
  720. {
  721. return 1;
  722. }
  723.  
  724. public OnVehicleStreamIn(vehicleid, forplayerid)
  725. {
  726. return 1;
  727. }
  728.  
  729. public OnVehicleStreamOut(vehicleid, forplayerid)
  730. {
  731. return 1;
  732. }
  733.  
  734. public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
  735. {
  736. if(!success )
  737. return SendClientMessage( playerid, 0xFF0000FF, "Unknown Command. Use /cmds to view a list of working commands!" );
  738. return 1;
  739. }
  740.  
  741. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  742. {
  743. if(dialogid == DIALOG_WEAPONS && response==1)
  744. {
  745. switch(listitem)
  746. {
  747. case 0:
  748. {
  749. GivePlayerWeapon(playerid, 1, 0);
  750. }
  751. case 1:
  752. {
  753. GivePlayerWeapon(playerid, 4, 0);
  754. }
  755. case 2:
  756. {
  757. GivePlayerWeapon(playerid, 8, 0);
  758. }
  759. case 3:
  760. {
  761. GivePlayerWeapon(playerid, 9, 0);
  762. }
  763. case 4:
  764. {
  765. GivePlayerWeapon(playerid, 15, 0);
  766. }
  767. case 5:
  768. {
  769. GivePlayerWeapon(playerid, 16, 100);
  770. }
  771. case 6:
  772. {
  773. GivePlayerWeapon(playerid, 17, 50);
  774. }
  775. case 7:
  776. {
  777. GivePlayerWeapon(playerid, 18, 50);
  778. }
  779. case 8:
  780. {
  781. GivePlayerWeapon(playerid, 24, 9000);
  782. }
  783. case 9:
  784. {
  785. GivePlayerWeapon(playerid, 26, 9000);
  786. }
  787. case 10:
  788. {
  789. GivePlayerWeapon(playerid, 27, 9000);
  790. }
  791. case 11:
  792. {
  793. GivePlayerWeapon(playerid, 31, 9000);
  794. }
  795. case 12:
  796. {
  797. GivePlayerWeapon(playerid, 32, 9000);
  798. }
  799. case 13:
  800. {
  801. GivePlayerWeapon(playerid, 34, 9000);
  802. }
  803. case 14:
  804. {
  805. GivePlayerWeapon(playerid, 28, 9000);
  806. }
  807. case 15:
  808. {
  809. GivePlayerWeapon(playerid, 38, 9000);
  810. }
  811. case 16:
  812. {
  813. GivePlayerWeapon(playerid, 35, 9000);
  814. }
  815. case 17:
  816. {
  817. GivePlayerWeapon(playerid, 36, 9000);
  818. }
  819. case 18:
  820. {
  821. GivePlayerWeapon(playerid, 37, 9000);
  822. }
  823. }
  824. }
  825. if(dialogid == vipinfo)
  826. {
  827. if(!response)
  828. {
  829. }
  830. else if(response == 0)
  831. {
  832. }
  833. }
  834. if(dialogid == credits)
  835. {
  836. if(!response)
  837. {
  838. }
  839. else if(response == 0)
  840. {
  841. }
  842. }
  843. if(dialogid == upd)
  844. {
  845. if(!response)
  846. {
  847. }
  848. else if(response == 0)
  849. {
  850. }
  851. }
  852. if(dialogid == cmds)
  853. {
  854. if(!response)
  855. {
  856. }
  857. else if(response == 0)
  858. {
  859. }
  860. }
  861. if(dialogid == acmds)
  862. {
  863. if(!response)
  864. {
  865. }
  866. else if(response == 0)
  867. {
  868. }
  869. }
  870. if(dialogid == DIALOG_RULES)
  871. {
  872. if(!response)
  873. {
  874. }
  875. else if(response == 0)
  876. {
  877. }
  878. }
  879. if(dialogid == dregister) //If dialog id is a register dialog
  880. {//then
  881. if(!response) return Kick(playerid); //If they clicked the second button "Quit", we will kick them.
  882. if(response) //if they clicked the first button "Register"
  883. {//then
  884. if(!strlen(inputtext)) //If they didn't enter any password
  885. {// then we will tell to them to enter the password to register
  886. ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
  887. return 1;
  888. }
  889. //If they have entered a correct password for his/her account...
  890. new hashpass[129]; //Now we will create a new variable to hash his/her password
  891. WP_Hash(hashpass,sizeof(hashpass),inputtext);//We will use whirlpool to hash their inputted text
  892. new INI:file = INI_Open(Path(playerid)); // we will open a new file for them to save their account inside of Scriptfiles/Users folder
  893. INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
  894. INI_WriteString(file,"Password",hashpass);//This will write a hashed password into user's account
  895. INI_WriteInt(file,"AdminLevel",0); //Write an integer inside of user's account called "AdminLevel". We will set his level to 0 after he registered.
  896. INI_WriteInt(file,"VIPLevel",0);//As explained above
  897. INI_WriteInt(file,"Money",0);//Write an integer inside of user's account called "Money". We will set their money to 0 after he registered
  898. INI_WriteInt(file,"Scores",0);//Write an integer inside of user's account called "Scores". We will set their score to 0 after he registered
  899. INI_WriteInt(file,"Kills",0);//As explained above
  900. INI_WriteInt(file,"Deaths",0);//As explained above
  901. INI_Close(file);//Now after we've done saving their data, we now need to close the file
  902. SendClientMessage(playerid,-1,"You successfuly created an account!");//Tell to them that they have successfully registered a new account
  903. return 1;
  904. }
  905. }
  906. if(dialogid == dlogin) //If dialog id is a login dialog
  907. {//then
  908. if(!response) return Kick(playerid); //If they clicked the second button "Quit", we will kick them.
  909. if(response) //if they clicked the first button "Register"
  910. {//then
  911. new hashpass[129]; //Will create a new variable to hash his/her password
  912. WP_Hash(hashpass,sizeof(hashpass),inputtext); //Will hash inputted password
  913. if(!strcmp(hashpass,pInfo[playerid][Pass])) //If they have insert their correct password
  914. {//then
  915. INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);//We will load his account's data from user's path
  916. SetPlayerScore(playerid,pInfo[playerid][Scores]);//We will get their score inside of his user's account and we will set it here
  917. GivePlayerMoney(playerid,pInfo[playerid][Money]);//As explained above
  918. SendClientMessage(playerid,-1,"You have successfully logged in");//Tell them that they've successfully logged in
  919. }
  920. else //If they've entered an incorrect password
  921. {//then
  922. ShowPlayerDialog(playerid,dlogin, DIALOG_STYLE_PASSWORD,""COL_GREEN"Login",""COL_RED"You have entered an{F81414} incorrect password.\n"COL_WHITE"Please try again","Login","Quit");
  923. return 1;
  924. }
  925. }
  926. }
  927. return 1;
  928. }
  929.  
  930. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  931. {
  932. return 1;
  933. }
  934.  
  935. stock GetName(playerid)
  936. {
  937. new
  938. name[24];
  939. GetPlayerName(playerid, name, sizeof(name));
  940. return name;
  941. }
  942.  
  943. stock SendMessageToAdmins(color,const msg[])
  944. {
  945. for (new i=0; i<MAX_PLAYERS; i++)
  946. {
  947. if(IsPlayerConnected(i)) if(pInfo[i][Adminlevel] > 1) SendClientMessage(i,color,msg);
  948. }
  949. }
  950.  
  951. AntiDeAMX()
  952. {
  953. new a[][] =
  954. {
  955. "Unarmed (Fist)",
  956. "Brass K"
  957. };
  958. #pragma unused a
  959. }
  960.  
  961. stock PlayerName(playerid)
  962. {
  963. new Name[MAX_PLAYER_NAME + 1];
  964. GetPlayerName(playerid, Name, MAX_PLAYER_NAME + 1);
  965. return Name;
  966. }
  967.  
  968.  
  969. stock Path(playerid)
  970. {
  971. new str[128],name[MAX_PLAYER_NAME];
  972. GetPlayerName(playerid,name,sizeof(name));
  973. format(str,sizeof(str),UserPath,name);
  974. return str;
  975. }
  976.  
  977. public loadaccount_user(playerid, name[], value[])
  978. {
  979. INI_String("Password", pInfo[playerid][Pass],129); /*we will use INI_String to load user's password.
  980. ("Password",.. will load user's password inside of user's path. 'pInfo[playerid][Pass]',...We have defined our user's variable above called, pInfo. Now it's time to use it here to load user's password. '129',... 129 is a length of a hashed user's password. Whirlpool will hash 128 characters + NULL*/
  981. INI_Int("AdminLevel",pInfo[playerid][Adminlevel]);/*We will use INI_Int to load user's admin level. INI_Int stands for INI_Integer. This load an admin level. */
  982. INI_Int("VIPLevel",pInfo[playerid][VIPlevel]);//As explained above
  983. INI_Int("Money",pInfo[playerid][Money]); //As explained above
  984. INI_Int("Scores",pInfo[playerid][Scores]);//As explained above
  985. INI_Int("Kills",pInfo[playerid][Kills]);//As explained above
  986. INI_Int("Deaths",pInfo[playerid][Deaths]);//As explained above
  987. return 1;
  988. }
  989.  
  990. public Unjail(playerid)
  991. {
  992. if(Jailed[playerid] == 0) return 0;
  993. new playerName[24], String[128];
  994. GetPlayerName(playerid, playerName, sizeof(playerName));
  995. format(String, sizeof(String), "%s {FFFFFF}has been automatically released from Admin jail.", playerName);
  996. SendClientMessageToAll(0x009DFFFF, String);
  997. Jailed[playerid] = 0;
  998. SetPlayerInterior(playerid, 0);
  999. SetPlayerVirtualWorld(playerid, 0);
  1000. SpawnPlayer(playerid);
  1001. SetPlayerHealth(playerid, 100);
  1002. KillTimer(JailTimer[playerid]);
  1003. return 1;
  1004. }
  1005. /*///////////////////////////////////////////////////////////////////////////////////////////////
  1006. * Notes for ZCMD: *
  1007. * *
  1008. * USAGE COLOR: *
  1009. * *
  1010. * SendClientMessage(playerid, 0x009DFFFF, "USAGE:{0xFFFFFFFF} /me [action]") *
  1011. * *
  1012. *////////////////////////////////////////////////////////////////////////////////////////////////
  1013.  
  1014. /*///////////////////////////////////////
  1015. * Admin Commands *
  1016. * *
  1017. *////////////////////////////////////////
  1018.  
  1019. CMD:test(playerid,params[])
  1020. {
  1021. if(pInfo[playerid][Adminlevel] < 3)return SendClientMessage(playerid, -1, " You are not allowed to use this command");
  1022. SendClientMessage(playerid, -1, "This is a test command");
  1023. return 1;
  1024. }
  1025.  
  1026. CMD:announce(playerid,params[])
  1027. {
  1028. new text[128];
  1029. if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1030. if(sscanf(params, "s[128]", text))SendClientMessage(playerid, RED, "Usage: /announce [Text]");
  1031. new KickMessage[128];
  1032. format(KickMessage, sizeof(KickMessage), "%s",text);
  1033. GameTextForAll(KickMessage,10000, 3);
  1034. return 1;
  1035. }
  1036. COMMAND:a(playerid,params[])
  1037. {
  1038. new text[128];
  1039. if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1040. if(sscanf(params, "s[128]", text))SendClientMessage(playerid, RED, "Usage: /ask [Text]");
  1041. new Name[MAX_PLAYER_NAME], KickMessage[128];
  1042. GetPlayerName(playerid, Name, sizeof(Name));
  1043. format(KickMessage, sizeof(KickMessage), "[ADMIN MESSAGE]: %s(%d): %s", Name,playerid,text);
  1044. SendMessageToAdmins(YELLOW,KickMessage);
  1045. return 1;
  1046. }
  1047.  
  1048. CMD:setlevel(playerid,params[])
  1049. {
  1050. new id;
  1051. new level;
  1052. if(pInfo[playerid][Adminlevel] < 6) SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1053. else if(sscanf(params, "ui", id, level))SendClientMessage(playerid, RED, "Usage: /makeadmin [id/name] [level]");
  1054. else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,RED,"Error: Player is not connected!");
  1055. else if(!IsPlayerConnected(id)) return SendClientMessage(playerid,RED,"Player is not connected!");
  1056. SendClientMessage(id,RED,"You have received an admin level.");
  1057. pInfo[id][Adminlevel] = level;
  1058. return 1;
  1059. }
  1060.  
  1061. CMD:heal(playerid, params[])
  1062. {
  1063. if(pInfo[playerid][Adminlevel] < 2)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1064. SetPlayerHealth(playerid, 100);
  1065. SendClientMessage(playerid, 0x008080FF, "You have healed yourself");
  1066. return 1;
  1067. }
  1068.  
  1069. CMD:armour(playerid, params[])
  1070. {
  1071. if(pInfo[playerid][Adminlevel] < 2)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1072. SetPlayerArmour(playerid, 100);
  1073. SendClientMessage(playerid, 0x008080FF, "You have given yourself armour!");
  1074. return 1;
  1075. }
  1076.  
  1077. CMD:pgoto(playerid, params[])
  1078. {
  1079. if(pInfo[playerid][Adminlevel] < 2)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1080. new ID;
  1081. new pn[MAX_PLAYER_NAME];
  1082. new an[MAX_PLAYER_NAME];
  1083. new str[128];
  1084. if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /goto [ID]"); //This is a long line, "sscanf" is the plugin that search the missing params, "params" is the param that define params LOL, "u" is the PARAM that define the MISSING ID, ID is the param for the targetid
  1085. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: This player is not connected");//Same as !IsPlayerAdmin, but instead of "playerid" we put "ID" because it's the targetid
  1086. GetPlayerName(playerid, an, MAX_PLAYER_NAME);//Define the playerid's param
  1087. GetPlayerName(ID, pn, MAX_PLAYER_NAME);//Define the ID's param
  1088. new Float:x; //Defining float X
  1089. new Float:y; //Same
  1090. new Float:z; //Same
  1091. GetPlayerPos(ID, x, y, z); //This line get the "ID" position
  1092. SetPlayerPos(playerid, x+1, y+1, z); //This line set the "playerid" position from "ID" position, with some changes(x+1, y+1);
  1093. format(str, sizeof(str), "You have been teleported to %s", pn); //Showed before, this is the line that give the message to playerid)
  1094. SendClientMessage(playerid, 0x00FF00AA, str); //This line give the message to playerid
  1095. if(IsPlayerInAnyVehicle(playerid)) //Mhh, let's give you a question, what should this callback do?
  1096. {
  1097. GetPlayerPos(ID, x, y, z);
  1098. SetVehiclePos(playerid, x+1, y+1, z); //And this one? :D
  1099. }
  1100. return 1;
  1101. }
  1102.  
  1103. CMD:gethere(playerid,params[])
  1104. {
  1105. if(pInfo[playerid][Adminlevel] < 3)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1106. new targetid, Float:x, Float:y, Float:z;//defines floats and [U]targetid(same which we did as id above)[/U]
  1107. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x009DFFFF,"USAGE:{FFFFFF} /gethere [ID]");
  1108. if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} This player is not connected");
  1109. GetPlayerPos(playerid, x, y, z);//gets player pos PLAYER POS not targetid
  1110. SetPlayerPos(targetid, x+1, y+1, z);//gets the TARGETID player to the PLAYERID x+1,y+1 and z remains same as it defines height
  1111. return 1;
  1112. }
  1113.  
  1114. CMD:acmds(playerid,params[])
  1115. {
  1116. if(pInfo[playerid][Adminlevel] < 2)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1117. ShowPlayerDialog(playerid,acmds,DIALOG_STYLE_MSGBOX,"{FFD000}Admin Commands"," Level 1: /kick, /onduty, /offduty, /slap\n Level 2: /cc, /ban, /heal, /armour\n Level 3: ~Comming soon~\n Level 4: ~Comming soon~\n Level 5: ~Comming soon~\n Level 6: ~Comming soon~","Ok","");
  1118. return 1;
  1119. }
  1120.  
  1121. CMD:kick(playerid, params[])
  1122. {
  1123. new id, reason[128];
  1124. if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1125. else if(sscanf(params, "us", id, reason))SendClientMessage(playerid, 0x009DFFFF,"USAGE:{FFFFFF} /kick [Name/ID] [Reason]");
  1126. else if(IsPlayerAdmin(id))SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot kick the Head Admin");
  1127. else if(id==playerid)SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot kick yourself!");
  1128. else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} This player is not connected");
  1129. else {
  1130. new Name[MAX_PLAYER_NAME], KickMessage[128];
  1131. new Name2[MAX_PLAYER_NAME];
  1132. GetPlayerName(playerid, Name, sizeof(Name));
  1133. GetPlayerName(id, Name2, sizeof(Name2));
  1134. format(KickMessage, sizeof(KickMessage), "Admin %s(%d) has kicked %s(%d). Reason: %s", Name, playerid, Name2, id, reason);
  1135. SendClientMessageToAll(0xF51B1BFF, KickMessage);
  1136. Kick(id);
  1137. }
  1138. return 1;
  1139. }
  1140.  
  1141. CMD:ban(playerid, params[])
  1142. {
  1143. new id, reason[50], banned[MAX_PLAYER_NAME];
  1144. if(pInfo[playerid][Adminlevel] < 2)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1145. if(sscanf(params, "uz", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /ban [playerid] [reason(optional)]");
  1146. GetPlayerName(id, banned, sizeof(banned));
  1147. BanEx(id, reason);
  1148. return 1;
  1149. }
  1150.  
  1151. CMD:onduty(playerid, params[])
  1152. {
  1153. if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1154. Create3DTextLabel("Admin ON duty \n Do not kill", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
  1155. Attach3DTextLabelToPlayer(admin, playerid, 0.0, 0.0, 0.7);
  1156. SendClientMessage(playerid, 0x008080FF, "You are now on Admin duty");
  1157. new string[64], pName[MAX_PLAYER_NAME];
  1158. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  1159. format(string,sizeof string,"*Admin %s is now on duty!",pName);
  1160. SendClientMessageToAll(0xFF9500FF,string);
  1161. return 1;
  1162. }
  1163.  
  1164. CMD:offduty(playerid, params[])
  1165. {
  1166. if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1167. DeletePlayer3DTextLabel(playerid, PlayerText3D:admin);
  1168. SendClientMessage(playerid, 0x008080FF, "You are now off Admin duty");
  1169. new string[64], pName[MAX_PLAYER_NAME];
  1170. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  1171. format(string,sizeof string,"*Admin %s is now off duty!",pName);
  1172. SendClientMessageToAll(0xFF9500FF,string);
  1173. return 1;
  1174. }
  1175.  
  1176. CMD:answer(playerid, params[])
  1177. {
  1178. new ID, string[256], string2[256];
  1179. if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1180. if (sscanf(params, "us[256]", ID, string)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /answer [ID] [Answer]");
  1181. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected!");
  1182. if(QuestionAsked[ID] != true) return SendClientMessage(playerid, COLOR_RED, "ERROR: This player has not asked a question!");
  1183. QuestionAsked[ID] = false;
  1184. format(string2, sizeof(string2), "ANSWER: %s", string);
  1185. SendClientMessage(ID, COLOR_GREEN, string2);
  1186. return 1;
  1187. }
  1188.  
  1189. CMD:aweapons(playerid, params[])
  1190. {
  1191. if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1192. ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Admin Weapons", "Brass Knuckles\nKnife\nKatana\nChainsaw\nCane\nGrenade\nTear Gas\nMolotov Cocktail\nDesert Eagle\nSawnoff\nCombat Shotgun\nM4\nAK-47\nTec 9\nSniper\nUzi\nMinigun\nRPG\nRocket Launcher\nFlamethrower", "Ok", "Close");
  1193. return 1;
  1194. }
  1195.  
  1196. CMD:jail(playerid,params[])
  1197. {
  1198. if(pInfo[playerid][Adminlevel] < 2)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1199. new id,time,reason[100],plname[MAX_PLAYER_NAME],GPlayerName[MAX_PLAYER_NAME], szString[128];
  1200. if(sscanf(params,"dds",id,time,reason)) return SendClientMessage(playerid, -1, "USAGE: /jail <playerid> <time> <reason>");
  1201. if(Jailed[id] == 1) return SendClientMessage(playerid, 0x8B0000FF, "ERROR: Player is already jailed.");
  1202. GetPlayerName(id, plname, sizeof(plname));
  1203. GetPlayerName(playerid, GPlayerName, sizeof(GPlayerName));
  1204. format(szString, sizeof(szString), "Admin Jail: %s(%d) has been jailed for %d minutes. Reason: %s", plname, id, time, reason);
  1205. SendClientMessageToAll(0xF51B1BFF, szString);
  1206. SetPlayerInterior(id, 3);
  1207. SetPlayerVirtualWorld(id, 10);
  1208. SetPlayerFacingAngle(id, 360.0);
  1209. SetPlayerPos(id, 197.5662, 175.4800, 1004.0);
  1210. SetPlayerHealth(id, 9999999999.0);
  1211. ResetPlayerWeapons(id);
  1212. Jailed[id] = 1;
  1213. JailTimer[id] = SetTimerEx("Unjail",time*60000, false, "i", id);
  1214. return 1;
  1215. }
  1216.  
  1217. CMD:unjail(playerid,params[])
  1218. {
  1219. if(pInfo[playerid][Adminlevel] < 2)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1220. new id;
  1221. if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_BLUE, "USAGE: /unjail <playerid>");//sscanf routine
  1222. if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected.");//checks if the targetid is connected
  1223. if(Jailed[id] == 0) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not jailed.");//checks if the id is jailed and if he isnt it will send an error.
  1224. new name[MAX_PLAYER_NAME];
  1225. GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  1226. format(name, sizeof(name), "Admin Unjail: %s has been unjailed by an Admin", name);
  1227. SendClientMessageToAll(0xF51B1BFF, name);
  1228. Jailed[id] = 0;
  1229. SetPlayerInterior(id, 0);
  1230. SetPlayerVirtualWorld(id, 0);
  1231. SpawnPlayer(id);
  1232. SetPlayerHealth(id, 100);
  1233. KillTimer(JailTimer[id]);
  1234. return 1;
  1235. }
  1236.  
  1237. CMD:slap(playerid,params[])
  1238. {
  1239. if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, 0xFF0000FF, "You are not authorised to use this command");
  1240. new id;
  1241. if(sscanf(params,"d",id)) return SendClientMessage(playerid, 0x009DFFFF,"USAGE:{FFFFFF} /slap [ID]");
  1242. if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot slap yourself!");
  1243. new name[MAX_PLAYER_NAME], reason[128];
  1244. GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  1245. format(reason, sizeof(reason), "Admin Slap: %s has been slapped by an admin.", name, reason);
  1246. SendClientMessageToAll(0xF51B1BFF,reason);
  1247.  
  1248. new Float:Pos[3];
  1249. GetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
  1250. SetPlayerPos(id,Pos[0],Pos[1],Pos[2]+05.0);
  1251. PlayerPlaySound(id,1130,Pos[0],Pos[1],Pos[2]+03.0);
  1252.  
  1253. return 1;
  1254. }
  1255.  
  1256. COMMAND:setvip(playerid,params[])
  1257. {
  1258. new id;
  1259. if(pInfo[playerid][Adminlevel] < 5) return SendClientMessage(playerid,ORANGE,"You need to be level 5 to use this command!");
  1260. if (sscanf(params, "us",id)) return SendClientMessage(playerid, RED, "Usage: /makevip <ID> ");
  1261. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,GREY,"Invalid ID");
  1262. SendClientMessage(id,LIGHTBLUE,"You have become VIP");
  1263. pInfo[id][VIPlevel] ++;
  1264. return 1;
  1265. }
  1266.  
  1267. CMD:cc(playerid, params[])
  1268. {
  1269. if(pInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,ORANGE,"You need to be level 5 to use this command!");
  1270. else
  1271. {
  1272. for(new i = 0; i < 50; i++) SendClientMessageToAll(COLOR_WHITE," ");
  1273. new string[64], pName[MAX_PLAYER_NAME];
  1274. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  1275. format(string,sizeof string,"*Admin %s has cleared the chat!",pName);
  1276. SendClientMessageToAll(0xFF9500FF,string);
  1277. }
  1278. return 1;
  1279. }
  1280.  
  1281. /*///////////////////////////////////////
  1282. * Player Commands *
  1283. * *
  1284. *////////////////////////////////////////
  1285.  
  1286. CMD:rules(playerid,params[])
  1287. {
  1288. ShowPlayerDialog(playerid,DIALOG_RULES,DIALOG_STYLE_MSGBOX,"{FFD000}Server Rules"," 1. Do not go around killing people without a reason.\n 2. Do not bug abuse\n 3. Do not team with hackers, report them as soon as possible\n 4. Do not advertise other servers or websites.\n 5. Do not scam other players in this server\n 6. You may not hack or cheat in this server\n 7. Always respect Admins and other players in this server\n 8. Always speak English in the main chat.","Ok","");
  1289. return 1;
  1290. }
  1291.  
  1292. CMD:cmds(playerid,params[])
  1293. {
  1294. ShowPlayerDialog(playerid,cmds,DIALOG_STYLE_MSGBOX,"{FFD000}Main Commands"," /me, /rules, /updates, /pm, /vipinfo, /credits.","Ok","");
  1295. return 1;
  1296. }
  1297.  
  1298. CMD:me(playerid, params[])
  1299. {
  1300. new name[MAX_PLAYER_NAME], str[128];
  1301. GetPlayerName(playerid, name, sizeof(name));
  1302. if(isnull(params))
  1303. return SendClientMessage(playerid, 0x009DFFFF,"USAGE:{FFFFFF} /me [Text]");
  1304. format(str,sizeof(str),"*%s %s",name, params);
  1305. SendClientMessageToAll(0xF090CEFF, str);
  1306. return 1;
  1307. }
  1308.  
  1309. CMD:updates(playerid, params[])
  1310. {
  1311. ShowPlayerDialog(playerid,upd,DIALOG_STYLE_MSGBOX,"{FFD000}Latest server updates"," 26.01.2013 - Added /me, /cmds, /acmds, /rules, /credits commands","Ok","");
  1312. return 1;
  1313. }
  1314.  
  1315. CMD:credits(playerid, params[])
  1316. {
  1317. ShowPlayerDialog(playerid,credits,DIALOG_STYLE_MSGBOX,"{FFD000}Credits"," Goldkiller - Server creator\n SilverKiller - Tester","Close","");
  1318. return 1;
  1319. }
  1320.  
  1321. CMD:vipinfo(playerid, params[])
  1322. {
  1323. ShowPlayerDialog(playerid,vipinfo,DIALOG_STYLE_MSGBOX,"{FFD000}VIP Information","Tired of being treated normally? Well we can fix that for you\n You donate to us - You will access lots of new features.\n Donate now at ~comming soon~","Ok","");
  1324. return 1;
  1325. }
  1326.  
  1327. CMD:pm(playerid, params[])
  1328. {
  1329. new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
  1330. if(sscanf(params, "us", id, str2))
  1331. {
  1332. SendClientMessage(playerid, 0x009DFFFF,"USAGE:{FFFFFF} /pm [ID] [Message]");
  1333. return 1;
  1334. }
  1335. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} This player is not connected");
  1336. if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot send a PM yourself!");
  1337.  
  1338. {
  1339. GetPlayerName(playerid, Name1, sizeof(Name1));
  1340. GetPlayerName(id, Name2, sizeof(Name2));
  1341. format(str, sizeof(str), "PM {FFF700}to %s(%d): %s", Name2, id, str2);
  1342. SendClientMessage(playerid, 0x3FE312FF, str);
  1343. format(str, sizeof(str), "PM {FFF700}from %s(%d): %s", Name1, playerid, str2);
  1344. SendClientMessage(id, 0xFF0000FF, str);
  1345. }
  1346. return 1;
  1347. }
  1348.  
  1349. CMD:admins(playerid, params[])
  1350. {
  1351. new count = 0, string[256];
  1352. SendClientMessage(playerid, 0x0AFF1FFF,"-----|Current online Admins|------");
  1353. for(new i = 0; i < MAX_PLAYERS; i ++)
  1354. {
  1355. if(IsPlayerConnected(i))
  1356. {
  1357. if(pInfo[i][Adminlevel] == 1)
  1358. {
  1359. format(string, sizeof(string),"Admin Rank 1 |{FFFFFF} [%d] %s", i, PlayerName(i));
  1360. SendClientMessage(playerid, 0x00B3FFFF, string);
  1361. count++;
  1362. }
  1363. if(pInfo[i][Adminlevel] == 2)
  1364. {
  1365. format(string, sizeof(string),"Admin Rank 2 |{FFFFFF} (%d) %s", i, PlayerName(i));
  1366. SendClientMessage(playerid, 0x00B3FFFF, string);
  1367. count++;
  1368. }
  1369. if(pInfo[i][Adminlevel] == 3)
  1370. {
  1371. format(string, sizeof(string),"Admin Rank 3 |{FFFFFF} (%d) %s", i, PlayerName(i));
  1372. SendClientMessage(playerid, 0x00B3FFFF, string);
  1373. count++;
  1374. }
  1375. if(pInfo[i][Adminlevel] == 4)
  1376. {
  1377. format(string, sizeof(string),"Admin Rank 4 |{FFFFFF} (%d) %s", i, PlayerName(i));
  1378. SendClientMessage(playerid, 0x00B3FFFF, string);
  1379. count++;
  1380. }
  1381. if(pInfo[i][Adminlevel] == 5)
  1382. {
  1383. format(string, sizeof(string),"Senior Admin |{FFFFFF} (%d) %s", i, PlayerName(i));
  1384. SendClientMessage(playerid, 0x00B3FFFF, string);
  1385. count++;
  1386. }
  1387. if(pInfo[i][Adminlevel] == 6)
  1388. {
  1389. format(string, sizeof(string),"Head Admin |{FFFFFF} (%d) %s", i, PlayerName(i));
  1390. SendClientMessage(playerid, 0xFF0505FF, string);
  1391. count++;
  1392. }
  1393. }
  1394. }
  1395. if(count == 0)
  1396. {
  1397. SendClientMessage(playerid, 0x00B3FFFF,"----|There are currently no Admins online|----");
  1398. }
  1399. return 1;
  1400. }
  1401.  
  1402. CMD:vips(playerid, params[])
  1403. {
  1404. new count = 0, string[256];
  1405. SendClientMessage(playerid, 0x0AFF1FFF,"--|Current online V.I.P's|--");
  1406. for(new i = 0; i < MAX_PLAYERS; i ++)
  1407. {
  1408. if(IsPlayerConnected(i))
  1409. {
  1410. if(pInfo[i][VIPlevel] == 1)
  1411. {
  1412. format(string, sizeof(string),"Silver VIP:{FFFFFF} (%d) %s", i, PlayerName(i));
  1413. SendClientMessage(playerid, 0x00B3FFFF, string);
  1414. count++;
  1415. }
  1416. if(pInfo[i][VIPlevel] == 2)
  1417. {
  1418. format(string, sizeof(string),"Bronze VIP:{FFFFFF} (%d) %s", i, PlayerName(i));
  1419. SendClientMessage(playerid, 0x00B3FFFF, string);
  1420. count++;
  1421. }
  1422. if(pInfo[i][VIPlevel] == 3)
  1423. {
  1424. format(string, sizeof(string),"Gold VIP:{FFFFFF} (%d) %s", i, PlayerName(i));
  1425. SendClientMessage(playerid, 0x00B3FFFF, string);
  1426. count++;
  1427. }
  1428. }
  1429. }
  1430. if(count == 0)
  1431. {
  1432. SendClientMessage(playerid, 0x00B3FFFF,"---|There are currently no online V.I.P's|---");
  1433. }
  1434. return 1;
  1435. }
  1436.  
  1437. CMD:report(playerid, params[])
  1438. {
  1439. new id, reason[128];
  1440. if(sscanf(params, "us", id, reason))return SendClientMessage(playerid, RED, "Usage: /report [id/name][reason]");
  1441. if(id==playerid) return SendClientMessage(playerid,RED,"Error: You can not report yourself!");
  1442. if(!IsPlayerConnected(id))return SendClientMessage(playerid,RED,"Player is not connected!");
  1443. if(id==INVALID_PLAYER_ID) return SendClientMessage(playerid,RED,"Error: Player is not connected!");
  1444. SendClientMessage(playerid,COLOR_BLUE,"Your report has been sent to online admins!");
  1445. new Name[MAX_PLAYER_NAME], KickMessage[128];
  1446. new Name2[MAX_PLAYER_NAME];
  1447. GetPlayerName(playerid, Name, sizeof(Name));
  1448. GetPlayerName(id, Name2, sizeof(Name2));
  1449. format(KickMessage, sizeof(KickMessage), "%s(%d) has reported player %s(%d) | Reason: %s", Name, playerid, Name2, id, reason);
  1450. SendMessageToAdmins(COLOR_RED, reason);
  1451. return 1;
  1452. }
  1453.  
  1454. CMD:ask(playerid, params[])
  1455. {
  1456. if (sscanf(params, "s[256]", Question[playerid])) return SendClientMessage(playerid, 0x009DFFFF,"USAGE:{FFFFFF} /pm [ID] [Message]");
  1457. if(QuestionAsked[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "ERROR: Wait for the response of your previous question!");
  1458. new string[128], string2[256], name[MAX_PLAYER_NAME];
  1459. GetPlayerName(playerid, name, sizeof(name));
  1460. format(string2, sizeof(string2), "QUESTION: %s", Question[playerid]);
  1461. SendMessageToAdmins(COLOR_GREEN, string2);
  1462. format(string, sizeof(string), "INFO: %s has asked a question, use /answer %d to answer it!", name, playerid);
  1463. SendMessageToAdmins(COLOR_GREEN, string);
  1464. QuestionAsked[playerid] = true;
  1465. return 1;
  1466. }
  1467.  
  1468. CMD:disarm(playerid, params[])
  1469. {
  1470. ResetPlayerWeapons(playerid);
  1471. return 1;
  1472. }
  1473.  
  1474. CMD:akill(playerid, params[])
  1475. {
  1476. new playerToKill;
  1477. if(playerToKill==playerid) return SendClientMessage(playerid,RED,"Error: You cannot kill yourself.");
  1478. SetPlayerHealth(playerToKill, 0);
  1479. return 1;
  1480. }
  1481.  
  1482. CMD:restart(playerid, params[])
  1483. {
  1484. GameTextForAll("~r~THE SERVER IS RESTARTING",10000,5);
  1485. for(new i = 0; i < 50; i++) SendClientMessageToAll(COLOR_WHITE," ");
  1486. SendRconCommand("gmx");
  1487. return 1;
  1488. }
Advertisement
Add Comment
Please, Sign In to add comment