Guest User

Untitled

a guest
Jun 6th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 81.38 KB | None | 0 0
  1. // .:--------------------------------------------------------------:.
  2. // .:==============================================================:.
  3. // { Blank Y_INI Gamemode created for SA:MP by Kingunit }
  4. // { Please do not remove the credits and re-release it }
  5. // { This gamemode is created by Kingunit on 24/08/2011 }
  6. // { This Blank Y_INI Gamemode is using ZCMD and SSCANF }
  7. // { Other credits are going to SSCANF and ZCMD and Y_INI }
  8. // { Special credits to Kush, For things out his Tutorial }
  9. // { Credits for Roleplay Edit of Kingunit's script goes to iNorton }
  10. //
  11. // .:==============================================================:.
  12. // .:--------------------------------------------------------------:.
  13.  
  14.  
  15. //-----[Main includes]-----
  16. #include <a_samp>
  17. #include <YSI\y_ini>
  18. #include <zcmd>
  19. #include <sscanf2>
  20. #include <irc>
  21. #include <foreach>
  22. #pragma tabsize 0
  23.  
  24. //-----[IRC Settings]-----
  25. #define IRC_SERVER "irc.crystalirc.net"
  26. #define IRC_PORT (6667)
  27. #define IRC_CHANNEL "#Warehouse"
  28.  
  29. #define BOT_1_NICKNAME "SA-MP Bot[1]"
  30. #define BOT_1_REALNAME "SA-MP Bot[1]"
  31. #define BOT_1_USERNAME "SA-MP Bot[1]"
  32.  
  33. #define MAX_BOTS (1)
  34.  
  35. new gBotID[MAX_BOTS], gGroupID;
  36.  
  37. //-----[INI includes]-----
  38. #define DIALOG_REGISTER 1
  39. #define DIALOG_LOGIN 2
  40. #define PATH "/Users/%s.ini"
  41.  
  42. //-----[Color defines]-----
  43. #define COLOR_WHITE 0xFFFFFFFF
  44. #define COLOR_GREEN 0x33AA33AA
  45. #define COLOR_RED 0xA10000AA
  46. #define COLOR_YELLOW 0xFFFF00AA
  47. #define COLOR_GREY 0xAFAFAFAA
  48. #define COLOR_SYNTAX 0x33CCFFAA
  49. #define COLOR_ERROR 0xFF3300AA
  50. #define LIME 0x88AA62FF
  51. #define WHITE 0xFFFFFFAA
  52. #define RULE 0xFBDF89AA
  53. #define ORANGE 0xDB881AAA
  54. #define COLOR_YELLOW3 0xFFFF00FF
  55.  
  56. #define GREY 0xAFAFAFAA
  57. #define GREEN 0x9FFF00FF
  58. #define RED 0xA10000AA
  59. #define YELLOW 0xFFFF00AA
  60. #define WHITE 0xFFFFFFAA
  61. #define COLOR_ME 0x9370DBFF
  62.  
  63. //-----[0.3c Color defines]-----
  64. #define COL_EASY "{FFF1AF}"
  65. #define COL_DGREEN "{0E8C00}"
  66. #define COL_LOGIN "{98E090}"
  67. #define COL_WHITE "{FFFFFF}"
  68. #define COL_BLACK "{0E0101}"
  69. #define COL_GREY "{C3C3C3}"
  70. #define COL_GREEN "{6EF83C}"
  71. #define COL_RED "{F81414}"
  72. #define COL_YELLOW "{F3FF02}"
  73. #define COL_ORANGE "{F9B857}"
  74. #define COL_LIME "{B7FF00}"
  75. #define COL_CYAN "{00FFEE}"
  76. #define COL_LBLUE "{298ACF}"
  77. #define COL_BLUE "{0049FF}"
  78. #define COL_MAGENTA "{F300FF}"
  79. #define COL_VIOLET "{B700FF}"
  80. #define COL_PINK "{FF00EA}"
  81. #define COL_MARONE "{A90202}"
  82. #define COL_CMD "{B8FF02}"
  83. #define COL_PARAM "{3FCD02}"
  84. #define COL_SERVER "{AFE7FF}"
  85. #define COL_VALUE "{A3E4FF}"
  86. #define COL_RULE "{F9E8B7}"
  87. #define COL_RULE2 "{FBDF89}"
  88. #define COL_RWHITE "{FFFFFF}"
  89. #define COL_LGREEN "{9FE4AA}"
  90. #define COL_LRED "{DA7272}"
  91. #define COL_LRED2 "{C77D87}"
  92. #define COL_DYELLOW "{FAFA52}"
  93. #define COL_BROWN "{8C703F}"
  94. #define COL_SBLACK "{474747}"
  95. #define COL_SGREY "{ADADAD}"
  96. #define COL_DGREY "{616161}"
  97. #define COL_SBLUE "{3660D1}"
  98. //Colors for Local Chat
  99. #define COLOR_FADE1 0xFFFFFFFF
  100. #define COLOR_FADE2 0xC8C8C8C8
  101. #define COLOR_FADE3 0xAAAAAAAA
  102. #define COLOR_FADE4 0x8C8C8C8C
  103. #define COLOR_FADE5 0x6E6E6E6E
  104. #define COLOR_WHITE 0xFFFFFFFF
  105. new bool:
  106. ooc;
  107. forward ABroadCast(color,const string[],level);
  108. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  109. forward ProxDetectorS(Float:radi, playerid, targetid);
  110.  
  111. new Text3D:Admin[ MAX_PLAYERS ], AdminDuty[ MAX_PLAYERS ],
  112. checkinv = 0;
  113. new PlayerNeedsHelp[MAX_PLAYERS];
  114.  
  115. new
  116. Float:g_EventPosition[4],
  117. g_EventWeapon = -1,
  118. g_EventReward = 0,
  119. g_EventPlayers = 0,
  120. pInEvent[MAX_PLAYERS] = 0,
  121. g_EventOpen = 0;
  122. //-----[Enum Playerinfo]-----
  123. enum pInfo
  124. {
  125. Password,
  126. Cash,
  127. Kills,
  128. Deaths,
  129. Adminlevel
  130. }
  131. new PlayerInfo[MAX_PLAYERS][pInfo];
  132. #define DIALOG_QUIZ 5550
  133. #define DIALOG_QUIZ1 5551
  134. #define DIALOG_QUIZ2 5552
  135. #define DIALOG_QUIZ3 5553
  136. #define DIALOG_QUIZ4 5554
  137. new QuizAnswers[MAX_PLAYERS];
  138.  
  139. main() { }
  140.  
  141. public OnGameModeInit()
  142. {
  143. DisableInteriorEnterExits();
  144. UsePlayerPedAnims();
  145. gBotID[0] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_1_NICKNAME, BOT_1_REALNAME, BOT_1_USERNAME);
  146. IRC_SetIntData(gBotID[0], E_IRC_CONNECT_DELAY, 20);
  147. gGroupID = IRC_CreateGroup();
  148.  
  149. SetGameModeText("BLANK");
  150. AddPlayerClass(299, 1743.1090,-1863.6298,13.5748,18.0448,0,0,0,0,0,0);
  151. LoadStaticVehiclesFromFile("vehicles.ini");
  152. return 1;
  153. }
  154.  
  155. public OnGameModeExit()
  156. {
  157. IRC_Quit(gBotID[0], "SA-MP bot exiting");
  158. IRC_DestroyGroup(gGroupID);
  159.  
  160. return 1;
  161. }
  162.  
  163. public OnPlayerRequestClass(playerid, classid)
  164. {
  165. SetPlayerPos(playerid, 1743.1090,-1863.6298,13.5748);
  166. SpawnPlayer(playerid);
  167. return 1;
  168. }
  169.  
  170. public OnPlayerConnect(playerid)
  171. {
  172. new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
  173. GetPlayerName(playerid, pname, sizeof(pname));
  174. format(string, sizeof(string), "[JOIN] %s has joined the server", pname);
  175. SendClientMessageToAll(COLOR_GREY, string);
  176.  
  177. for(new chat = 0; chat <= 100; chat++)
  178. {
  179. SendClientMessage(playerid,COLOR_WHITE," ");
  180. }
  181.  
  182. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"==========================================================================================================");
  183. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN" » Welcome to Ultimate RolePlay. ");
  184. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN" » Version: 3 Last updated: 04/12/11, Server Developer: Mike ");
  185. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"==========================================================================================================");
  186.  
  187. if(fexist(UserPath(playerid)))
  188. {
  189. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  190. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Login", "\t\t"#COL_EASY"Ultimate "#COL_DGREEN"Roleplay "#COL_EASY"(V3)\n\n"#COL_WHITE"Welcome back, \nPlease enter your password below to start the game!", "Login", "Exit");
  191. }
  192. else
  193. {
  194. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Register" , "\t\t"#COL_EASY"Ultimate"#COL_DGREEN"Roleplay "#COL_EASY"(V1)\n\n"#COL_WHITE"You are not registered in our database!, \nPlease enter a password below to register your account!", "Register", "Exit");
  195. }
  196.  
  197. new joinMsg[128], name[MAX_PLAYER_NAME];
  198. GetPlayerName(playerid, name, sizeof(name));
  199. format(joinMsg, sizeof(joinMsg), "02[%d] 03*** %s has joined the server!", playerid, name);
  200. IRC_GroupSay(gGroupID, IRC_CHANNEL, joinMsg);
  201. return 1;
  202. }
  203.  
  204. public OnPlayerDisconnect(playerid, reason)
  205. {
  206.  
  207. new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
  208. GetPlayerName(playerid, pname, sizeof(pname));
  209. switch(reason)
  210. {
  211. case 0: format(string, sizeof(string), "[LEFT] %s has left the server. (Timeout)", pname);
  212. case 1: format(string, sizeof(string), "[LEFT] %s has left the server. (Leaving)", pname);
  213. case 2: format(string, sizeof(string), "[LEFT] %s has left the server. (Kicked/Banned)", pname);
  214. }
  215. SendClientMessageToAll(COLOR_GREY, string);
  216.  
  217. new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
  218. switch(reason)
  219. {
  220. case 0: reasonMsg = "Timeout";
  221. case 1: reasonMsg = "Leaving";
  222. case 2: reasonMsg = "Kicked";
  223. }
  224. GetPlayerName(playerid, name, sizeof(name));
  225. format(leaveMsg, sizeof(leaveMsg), "02[%d] 03*** %s has left the server! (%s)", playerid, name, reasonMsg);
  226. IRC_GroupSay(gGroupID, IRC_CHANNEL, leaveMsg);
  227.  
  228. new INI:File = INI_Open(UserPath(playerid));
  229. INI_SetTag(File,"data");
  230. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  231. INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
  232. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
  233. INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
  234. INI_Close(File);
  235. return 1;
  236. }
  237. public OnPlayerSpawn(playerid)
  238. {
  239. return 1;
  240. }
  241.  
  242. public OnPlayerDeath(playerid, killerid, reason)
  243. {
  244. new msg[128], killerName[MAX_PLAYER_NAME], reasonMsg[32], playerName[MAX_PLAYER_NAME];
  245. GetPlayerName(killerid, killerName, sizeof(killerName));
  246. GetPlayerName(playerid, playerName, sizeof(playerName));
  247. if (killerid != INVALID_PLAYER_ID)
  248. {
  249. switch (reason)
  250. {
  251. case 0: reasonMsg = "Unarmed";
  252. case 1: reasonMsg = "Brass Knuckles";
  253. case 2: reasonMsg = "Golf Club";
  254. case 3: reasonMsg = "Night Stick";
  255. case 4: reasonMsg = "Knife";
  256. case 5: reasonMsg = "Baseball Bat";
  257. case 6: reasonMsg = "Shovel";
  258. case 7: reasonMsg = "Pool Cue";
  259. case 8: reasonMsg = "Katana";
  260. case 9: reasonMsg = "Chainsaw";
  261. case 10: reasonMsg = "Dildo";
  262. case 11: reasonMsg = "Dildo";
  263. case 12: reasonMsg = "Vibrator";
  264. case 13: reasonMsg = "Vibrator";
  265. case 14: reasonMsg = "Flowers";
  266. case 15: reasonMsg = "Cane";
  267. case 22: reasonMsg = "Pistol";
  268. case 23: reasonMsg = "Silenced Pistol";
  269. case 24: reasonMsg = "Desert Eagle";
  270. case 25: reasonMsg = "Shotgun";
  271. case 26: reasonMsg = "Sawn-off Shotgun";
  272. case 27: reasonMsg = "Combat Shotgun";
  273. case 28: reasonMsg = "MAC-10";
  274. case 29: reasonMsg = "MP5";
  275. case 30: reasonMsg = "AK-47";
  276. case 31: reasonMsg = "M4";
  277. case 32: reasonMsg = "TEC-9";
  278. case 33: reasonMsg = "Country Rifle";
  279. case 34: reasonMsg = "Sniper Rifle";
  280. case 37: reasonMsg = "Fire";
  281. case 38: reasonMsg = "Minigun";
  282. case 41: reasonMsg = "Spray Can";
  283. case 42: reasonMsg = "Fire Extinguisher";
  284. case 49: reasonMsg = "Vehicle Collision";
  285. case 50: reasonMsg = "Vehicle Collision";
  286. case 51: reasonMsg = "Explosion";
  287. default: reasonMsg = "Unknown";
  288. }
  289. format(msg, sizeof(msg), "04*** %s killed %s. (%s)", killerName, playerName, reasonMsg);
  290. }
  291. else
  292. {
  293. switch (reason)
  294. {
  295. case 53: format(msg, sizeof(msg), "04*** %s died! (Drowned)", playerName);
  296. case 54: format(msg, sizeof(msg), "04*** %s died! (Collision)", playerName);
  297. default: format(msg, sizeof(msg), "04*** %s died!", playerName);
  298. }
  299. }
  300. IRC_GroupSay(gGroupID, IRC_CHANNEL, msg);
  301.  
  302. PlayerInfo[killerid][Kills]++;
  303. PlayerInfo[playerid][Deaths]++;
  304.  
  305. if(pInEvent[playerid] == 1) {
  306. g_EventPlayers--;
  307. pInEvent[playerid] = 0;
  308. if(g_EventPlayers == 1) {
  309. foreach(Player, i) {
  310. if(pInEvent[i] == 1) {
  311. new string[128], player_Name[MAX_PLAYER_NAME];
  312. GetPlayerRame(i, player_Name, sizeof(player_Name));
  313. format(string, sizeof(string), ""#COL_BROWN"[EVENT]"#COL_EASY" %s has won the LMS event and has collected $%d!", player_Name, g_EventReward);
  314. SendClientMessageToAll(-1, string);
  315. GivePlayerMoney(i, g_EventReward);
  316. pInEvent[i] = 0;
  317. g_EventOpen = 0, g_EventPlayers = 0, g_EventReward = 0, g_EventWeapon = 0;
  318. SpawnPlayer(i);
  319. }
  320. }
  321. }
  322. }
  323. return 1;
  324. }
  325.  
  326. public OnVehicleSpawn(vehicleid)
  327. {
  328. return 1;
  329. }
  330.  
  331. public OnVehicleDeath(vehicleid, killerid)
  332. {
  333. return 1;
  334. }
  335.  
  336. public OnPlayerText(playerid, text[])
  337. {
  338. new pname[MAX_PLAYER_NAME], str[128];
  339. GetPlayerName(playerid, pname, sizeof(pname));
  340. strreplace(pname, '_', ' ');
  341. format(str, sizeof(str), "%s says: %s", pname, text);
  342. ProxDetector(30.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  343. return 0;
  344. }
  345.  
  346. public OnPlayerCommandText(playerid, cmdtext[])
  347. {
  348. if (strcmp("/me", cmdtext, true, 10) == 0)
  349. {
  350. if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "ERROR: USAGE: /me [action]");
  351. new str[128];
  352. GetPlayerName(playerid, str, sizeof(str));
  353. format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
  354. SendClientMessageToAll(0xFFFF00AA, str);
  355. return 1;
  356.  
  357. }
  358. if (strcmp("/do", cmdtext, true, 10) == 0)
  359. {
  360.  
  361. if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "ERROR: USAGE: /do [thing]");
  362. new str[128];
  363. GetPlayerName(playerid, str, sizeof(str));
  364. format(str, sizeof(str), "%s ((%s))", cmdtext[4], str);
  365. SendClientMessageToAll(0xFFFF00AA, str);
  366. return 1;
  367.  
  368. }
  369. return 0;
  370. }
  371.  
  372. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  373. {
  374. return 1;
  375. }
  376.  
  377. public OnPlayerExitVehicle(playerid, vehicleid)
  378. {
  379. return 1;
  380. }
  381.  
  382. public OnPlayerStateChange(playerid, newstate, oldstate)
  383. {
  384. return 1;
  385. }
  386.  
  387. public OnPlayerEnterCheckpoint(playerid)
  388. {
  389. return 1;
  390. }
  391.  
  392. public OnPlayerLeaveCheckpoint(playerid)
  393. {
  394. return 1;
  395. }
  396.  
  397. public OnPlayerEnterRaceCheckpoint(playerid)
  398. {
  399. return 1;
  400. }
  401.  
  402. public OnPlayerLeaveRaceCheckpoint(playerid)
  403. {
  404. return 1;
  405. }
  406.  
  407. public OnRconCommand(cmd[])
  408. {
  409. return 1;
  410. }
  411.  
  412. public OnPlayerRequestSpawn(playerid)
  413. {
  414. return 1;
  415. }
  416.  
  417. public OnObjectMoved(objectid)
  418. {
  419. return 1;
  420. }
  421.  
  422. public OnPlayerObjectMoved(playerid, objectid)
  423. {
  424. return 1;
  425. }
  426.  
  427. public OnPlayerPickUpPickup(playerid, pickupid)
  428. {
  429. return 1;
  430. }
  431.  
  432. public OnVehicleMod(playerid, vehicleid, componentid)
  433. {
  434. return 1;
  435. }
  436.  
  437. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  438. {
  439. return 1;
  440. }
  441.  
  442. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  443. {
  444. return 1;
  445. }
  446.  
  447. public OnPlayerSelectedMenuRow(playerid, row)
  448. {
  449. return 1;
  450. }
  451.  
  452. public OnPlayerExitedMenu(playerid)
  453. {
  454. return 1;
  455. }
  456.  
  457. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  458. {
  459. return 1;
  460. }
  461.  
  462. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  463. {
  464. return 1;
  465. }
  466.  
  467. public OnRconLoginAttempt(ip[], password[], success)
  468. {
  469. return 1;
  470. }
  471.  
  472. public OnPlayerUpdate(playerid)
  473. {
  474. return 1;
  475. }
  476.  
  477. public OnPlayerStreamIn(playerid, forplayerid)
  478. {
  479. return 1;
  480. }
  481.  
  482. public OnPlayerStreamOut(playerid, forplayerid)
  483. {
  484. return 1;
  485. }
  486.  
  487. public OnVehicleStreamIn(vehicleid, forplayerid)
  488. {
  489. return 1;
  490. }
  491.  
  492. public OnVehicleStreamOut(vehicleid, forplayerid)
  493. {
  494. return 1;
  495. }
  496.  
  497. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  498. {
  499. switch( dialogid )
  500. {
  501. case DIALOG_REGISTER:
  502. {
  503. if (!response) return Kick(playerid);
  504. if(response)
  505. {
  506. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""#COL_ORANGE":: "#COL_WHITE"Register" , "\t\t"#COL_EASY"Blank Gamemode "#COL_DGREEN"Y_INI "#COL_EASY"(V3)\n\n"#COL_RED"You have entered a invalid password\n"#COL_WHITE"You are not registered, \nPlease enter a password below to register your account!", "Register", "Exit");
  507. new INI:File = INI_Open(UserPath(playerid));
  508. INI_SetTag(File,"data");
  509. INI_WriteInt(File,"Password",udb_hash(inputtext));
  510. INI_WriteInt(File,"Cash",0);
  511. INI_WriteInt(File,"Kills",0);
  512. INI_WriteInt(File,"Deaths",0);
  513. INI_WriteInt(File,"Adminlevel",0);
  514. INI_Close(File);
  515. ShowPlayerDialog(playerid,DIALOG_QUIZ,DIALOG_STYLE_LIST,"What does RP stands for?"," Real Pussy \n Role Play \n Real Money","Select","Leave Game");
  516.  
  517. }
  518. }
  519.  
  520. case DIALOG_LOGIN:
  521. {
  522. if ( !response ) return Kick ( playerid );
  523. if( response )
  524. {
  525. if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
  526. {
  527. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  528. GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
  529. SetSpawnInfo(playerid, 28,0,1743.1090,-1863.6298,13.5748,18.0448,0,0,0,0,0,0);
  530. }
  531. else
  532. {
  533. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Login", "\t\t"#COL_EASY"Blank Gamemode "#COL_DGREEN"Y_INI "#COL_EASY"(V3)\n\n"#COL_RED"You have entered a invalid password\n"#COL_WHITE"Welcome back, \nPlease enter your password below to start the game!", "Login", "Exit");
  534. }
  535. return 1;
  536. }
  537. }
  538. }
  539. if(dialogid == DIALOG_QUIZ) // If first dialog shows up
  540. {
  541. if(!response) return Kick(playerid); // If he click "Leave Game" he will be kicked.
  542. if(response) // If he click first button
  543. {
  544. if(listitem == 0) // If he choose first answer, wich is: Real Pussy
  545. {
  546. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  547. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  548. ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"It is LOL a frequently used word in role play server?"," Yes \n No, it's a NON-RP word \n LOL I like this word!","Select","Leave Game");
  549. // Second question will show up
  550. }
  551. if(listitem == 1) // If he choose 2nd answers, which is: Role Play (correct one)
  552. {
  553. SendClientMessage(playerid, -1,"That's the correct answer"); // He will get a message that he answered correct
  554. ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"It is LOL a frequently used word in role play server?"," Yes \n No, it's a NON-RP word \n LOL I like this word!","Select","Leave Game");
  555. // Second question will show up
  556. }
  557. if(listitem == 2)
  558. {
  559. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  560. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  561. ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"It is LOL a frequently used word in role play server?"," Yes \n No, it's a NON-RP word \n LOL I like this word!","Select","Leave Game");
  562. // Second question will show up
  563. }
  564. }
  565. }
  566. if(dialogid == DIALOG_QUIZ1) // If second dialog shows up
  567. {
  568. if(!response) return Kick(playerid); // If he press second button he get kicked
  569. if(response) // If he press first button
  570. {
  571. if(listitem == 0) // If he choose first answer wich is: Yes
  572. {
  573. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  574. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  575. ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Which /me is used correct?"," /me laughs \n /me rofl \n /me wtf","Select","Leave Game");
  576. // Next dialog will show up
  577. }
  578. if(listitem == 1) // If he choose first answer wich is: No, it's a NON-RP word (correct one)
  579. {
  580. SendClientMessage(playerid, -1,"That's the correct answer"); // He will get a message that he answered correct
  581. ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Which /me is used correct?"," /me laughs \n /me rofl \n /me wtf","Select","Leave Game");
  582. // Next dialog will show up
  583. }
  584. if(listitem == 2)
  585. {
  586. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  587. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  588. ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Which /me is used correct?"," /me laughs \n /me rofl \n /me wtf","Select","Leave Game");
  589. // Next dialog will show up
  590. }
  591. }
  592. }
  593. if(dialogid == DIALOG_QUIZ2) // If 3rd dialog shows up
  594. {
  595. if(!response) return Kick(playerid); // If he click second button he get kicked
  596. if(response) // If he click first button
  597. {
  598. if(listitem == 0) // If he choose first answer wich is: /me laugs (correct one)
  599. {
  600. SendClientMessage(playerid, -1,"That's the correct answer");
  601. ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game");
  602. // Next dialog will show up
  603. }
  604. if(listitem == 1)
  605. {
  606. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  607. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  608. ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game");
  609. // Next dialog will show up
  610. }
  611. if(listitem == 2)
  612. {
  613. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  614. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  615. ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game");
  616. // Next dialog will show up
  617. }
  618. if(QuizAnswers[playerid] >= 3) // If he reached 3 wrong answers
  619. {
  620. SendClientMessage(playerid, -1,"Sorry mate, you answered 3 times wrong.Maybe another time");
  621. Kick(playerid); // He will be kicked
  622. }
  623. }
  624. }
  625. if(dialogid == DIALOG_QUIZ3) // If 4rd dialog shows up
  626. {
  627. if(!response) return Kick(playerid); // If he click second button he get kicked
  628. if(response) // If he click first button
  629. {
  630. if(listitem == 0) // If he choose first answer wich is: Information Centre
  631. {
  632. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  633. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  634. ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"What OOC stands for?"," Out of Chat \n Out of Character \n Ow ow cool","Select","Leave Game");
  635. // Next dialog will show up
  636. }
  637. if(listitem == 1) // If he choose first answer wich is: In Character (correct one)
  638. {
  639. SendClientMessage(playerid, -1,"That's the correct answer!");
  640. ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"What OOC stands for?"," Out of Chat \n Out of Character \n Ow ow cool","Select","Leave Game");
  641. // Next dialog will show up
  642. }
  643. if(listitem == 2) // If he choose first answer wich is: I'm Cool
  644. {
  645. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  646. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  647. ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"What OOC stands for?"," Out of Chat \n Out of Character \n Ow ow cool","Select","Leave Game");
  648. // Next dialog will show up
  649. }
  650. if(QuizAnswers[playerid] >= 3) // If he reached 3 wrong answers or more
  651. {
  652. SendClientMessage(playerid, -1,"Sorry mate, you answered 3 times wrong.Maybe another time");
  653. Kick(playerid); // He will be kicked
  654. }
  655. }
  656. }
  657. if(dialogid == DIALOG_QUIZ4)
  658. {
  659. if(!response) return Kick(playerid); // If he click second button he get kicked
  660. if(response) // If he click first button
  661. {
  662. if(listitem == 0) // If he choose first answers wich is: Out of Chat
  663. {
  664. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  665. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  666. }
  667. if(listitem == 1) // If he choose second answers wich is: Out of Character (correct one)
  668. {
  669. SendClientMessage(playerid, -1,"That's the correct answer");
  670. }
  671. if(listitem == 2) // If he choose 3rd answer wich is: Ow ow cool
  672. {
  673. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  674. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  675. }
  676. if(QuizAnswers[playerid] >= 3) // If he reached 3 wrong answers or more
  677. {
  678. SendClientMessage(playerid, -1,"Sorry mate, you answered 3 times wrong.Maybe another time");
  679. Kick(playerid); // He will be kicked
  680. }
  681. else // If he didn't have at least 3 wrong answers
  682. {
  683. SendClientMessage(playerid, -1,"Congratulations, you have passed the RP quiz!");
  684. }
  685. SpawnPlayer(playerid);
  686. // After the quiz is finish,the player will be spawned, you can change here.
  687. }
  688. }
  689. return 1;
  690. }
  691.  
  692. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  693. {
  694. return 1;
  695. }
  696.  
  697. //-----[LoadUser Data]-----
  698. forward LoadUser_data(playerid,name[],value[]);
  699. public LoadUser_data(playerid,name[],value[])
  700. {
  701. INI_Int("Password",PlayerInfo[playerid][Password]);
  702. INI_Int("Cash",PlayerInfo[playerid][Cash]);
  703. INI_Int("Kills",PlayerInfo[playerid][Kills]);
  704. INI_Int("Deaths",PlayerInfo[playerid][Deaths]);
  705. INI_Int("Adminlevel",PlayerInfo[playerid][Adminlevel]);
  706. return 1;
  707. }
  708.  
  709. //-----[Userpatch]-----
  710. stock UserPath(playerid)
  711. {
  712. new string[128],playername[MAX_PLAYER_NAME];
  713. GetPlayerName(playerid,playername,sizeof(playername));
  714. format(string,sizeof(string),PATH,playername);
  715. return string;
  716. }
  717.  
  718. //-----[Hash function. Thanxx to Dracoblue]-----
  719. stock udb_hash(buf[]) {
  720. new length=strlen(buf);
  721. new s1 = 1;
  722. new s2 = 0;
  723. new n;
  724. for (n=0; n<length; n++)
  725. {
  726. s1 = (s1 + buf[n]) % 65521;
  727. s2 = (s2 + s1) % 65521;
  728. }
  729. return (s2 << 16) + s1;
  730. }
  731.  
  732. //-----[INV Explosion]-----
  733. forward Explosion(playerid, adminid);
  734. public Explosion(playerid, adminid) {
  735. if(checkinv == 1)
  736. {
  737. new Float:health;
  738. GetPlayerHealth(playerid,health);
  739. if(health == 100)
  740. {
  741. SendClientMessage(adminid,COLOR_YELLOW,"Invulnerability check result : [POSITIVE]");
  742. checkinv = 0;
  743. }
  744. else if(health != 100)
  745. {
  746. SendClientMessage(adminid,COLOR_YELLOW,"Invulnerability check result : [NEGATIVE]");
  747. checkinv = 0;
  748. }
  749. }
  750. return 1;
  751. }
  752.  
  753. //-----[Removing underscore]-----
  754. stock GetPlayerRame( giveplayer, name[ ], len )
  755. {
  756. GetPlayerRame( giveplayer, name, len );
  757. for(new i = 0; i < len; i++ )
  758. {
  759. if ( name[ i ] == '_' )
  760. name[ i ] = ' ';
  761. }
  762. }
  763.  
  764. //-----[Callbacks]-----
  765. public IRC_OnConnect(botid, ip[], port)
  766. {
  767. printf("*** IRC_OnConnect: Bot ID %d connected to %s:%d", botid, ip, port);
  768. IRC_JoinChannel(botid, IRC_CHANNEL);
  769. IRC_AddToGroup(gGroupID, botid);
  770. return 1;
  771. }
  772.  
  773. public IRC_OnDisconnect(botid, ip[], port, reason[])
  774. {
  775. printf("*** IRC_OnDisconnect: Bot ID %d disconnected from %s:%d (%s)", botid, ip, port, reason);
  776. IRC_RemoveFromGroup(gGroupID, botid);
  777. return 1;
  778. }
  779.  
  780. public IRC_OnConnectAttempt(botid, ip[], port)
  781. {
  782. printf("*** IRC_OnConnectAttempt: Bot ID %d attempting to connect to %s:%d...", botid, ip, port);
  783. return 1;
  784. }
  785.  
  786. public IRC_OnConnectAttemptFail(botid, ip[], port, reason[])
  787. {
  788. printf("*** IRC_OnConnectAttemptFail: Bot ID %d failed to connect to %s:%d (%s)", botid, ip, port, reason);
  789. return 1;
  790. }
  791.  
  792. public IRC_OnReceiveRaw(botid, message[])
  793. {
  794. new File:file;
  795. if (!fexist("irc_log.txt"))
  796. {
  797. file = fopen("irc_log.txt", io_write);
  798. }
  799. else
  800. {
  801. file = fopen("irc_log.txt", io_append);
  802. }
  803. if (file)
  804. {
  805. fwrite(file, message);
  806. fwrite(file, "\r\n");
  807. fclose(file);
  808. }
  809. return 1;
  810. }
  811.  
  812. //-----[Unfreeze LMS]-----
  813. //-----[Unfreezeplayer]-----
  814. forward UnfreezeLMS(playerid);
  815. public UnfreezeLMS(playerid)
  816. {
  817. foreach(Player, i)
  818. {
  819. if(pInEvent[i] == 1)
  820. {
  821. if(g_EventOpen == 1)
  822. {
  823. TogglePlayerControllable(i, 1);
  824. GameTextForPlayer(i, "~r~Be the Last Man Standing!", 2000, 3);
  825. }
  826. }
  827. }
  828. return 1;
  829. }
  830.  
  831. // .:-----------------------------------------------------------------------:.
  832. // .:=======================================================================:.
  833. // { This is the start of ZCMD commands. }
  834. // { Date: 04/12/11 using ZCMD and SSCANF }
  835. // { Last Updated: 25/08/11 By: iNorton }
  836. //
  837. // .:-----------------------------------------------------------------------:.
  838. // .:=======================================================================:.
  839.  
  840. //-----[Commands]-----
  841. CMD:commands(playerid, params[])
  842. {
  843. SendClientMessage(playerid,COLOR_WHITE, ".:: Commands ::.");
  844. SendClientMessage(playerid,COLOR_WHITE, "[Communication]: /pm - /o(oc) - /me - /env - /s(hout) - /b - /low - /w(hisper) - /report - /helpme ");
  845. SendClientMessage(playerid,COLOR_WHITE, "[OTHER]: /rules - /kill - /pay");
  846. return 1;
  847. }
  848.  
  849. //-----[Rules]-----
  850. CMD:rules(playerid, params[])
  851. {
  852. SendClientMessage(playerid,COLOR_WHITE, ".:: Server Rules::.");
  853. SendClientMessage(playerid,COLOR_WHITE, "Do not hack on the server.");
  854. SendClientMessage(playerid,COLOR_WHITE, "Do not ask for a Administrator rank.");
  855. return 1;
  856. }
  857.  
  858. //-----[Kill]-----
  859. CMD:kill(playerid, params[])
  860. {
  861. SetPlayerHealth(playerid, 0.0);
  862. SendClientMessage(playerid, GREEN, "[INFO]: You committed a suicide!");
  863. return 1;
  864. }
  865.  
  866. //-----[PM]-----
  867. COMMAND:pm(playerid, params[])
  868. {
  869. new str[128],id,pname[MAX_PLAYER_NAME], Message[128];
  870. if(sscanf(params, "us[128]", id, Message))SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /pm [PlayerID/PartOfName] [Message]");
  871. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Player not connected!");
  872. else
  873. {
  874. GetPlayerName(id, str, 24);
  875. format(str, sizeof(str), "PM To %s(%d): %s", str, id, Message);
  876. GetPlayerName(id, str, 24);
  877. format(str, sizeof(str), "PM To %s(%d): %s", str, id, Message);
  878. SendClientMessage(playerid, COLOR_GREEN, str);
  879. GetPlayerName(playerid, pname, sizeof(pname));
  880. format(str, sizeof(str), "PM From %s(%d): %s", pname, playerid, Message);
  881. SendClientMessage(id, COLOR_GREEN, str);
  882. }
  883. return 1;
  884. }
  885.  
  886. //-----[Adminhelp]-----
  887. CMD:ah(playerid, params[])
  888. {
  889. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  890. SendClientMessage(playerid,COLOR_GREEN, "===============[ Administrator Commands ]===============");
  891. SendClientMessage(playerid,COLOR_GREEN, "Administrator (1): /kick - /slap - /apm - /freeze - /unfreeze - /adminduty - /a(chat) - /sendtols");
  892. SendClientMessage(playerid,COLOR_GREEN, "Administrator (2): /goto - /gethere - /respawn - /freezeall - /unfreezeall - /inv - /ban - /setskin, - /enableooc - /disableooc - /vrespawn");
  893. SendClientMessage(playerid,COLOR_GREEN, "Administrator (3): /explode - /cc - /sethp - /givegun - /healall ");
  894. SendClientMessage(playerid,COLOR_GREEN, "Administrator (4): /jetpack - /removejet - /veh - /givemoney");
  895. SendClientMessage(playerid,COLOR_GREEN, "Administrator (5): /gmx - /addveh ");
  896. SendClientMessage(playerid,COLOR_GREEN, "========================================================");
  897. return 1;
  898. }
  899.  
  900. //-----[Slap]-----
  901. CMD:slap(playerid, params[])
  902. {
  903. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  904. new targetid;
  905. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /slap [PlayerID/PartOfName]");
  906. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  907. else
  908. {
  909. new Float:SLX, Float:SLY, Float:SLZ;
  910. GetPlayerPos(targetid, SLX, SLY, SLZ);
  911. SetPlayerPos(targetid, SLX, SLY, SLZ+5);
  912. PlayerPlaySound(targetid, 1130, SLX, SLY, SLZ+5);
  913. new string[128];
  914. new pName[24], pTame[24];
  915. GetPlayerName(playerid,pName,24);
  916. GetPlayerName(targetid,pTame,24);
  917. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been slapped by Administrator %s.",pTame,pName);
  918. SendClientMessageToAll(COLOR_RED, string);
  919. }
  920. return 1;
  921. }
  922.  
  923. //-----[Adminhelp]-----
  924. CMD:kick(playerid, params[])
  925. {
  926. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  927. new targetid, reason[64], string[128];
  928. if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /kick [PlayerID/PartOfName] [Reason]");
  929. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  930. {
  931. new pTargetName[24], pName[24];
  932. GetPlayerName(playerid,pName,24);
  933. GetPlayerName(targetid,pTargetName,24);
  934. format(string, sizeof(string), ""#COL_YELLOW"[SERVER]"#COL_LRED" Administrator %s has kicked %s: Reason: %s", pName, pTargetName, reason);
  935. SendClientMessageToAll(COLOR_RED,string);
  936. Kick(targetid);
  937. }
  938. return 1;
  939. }
  940.  
  941. //-----[Server GMX]-----
  942. CMD:gmx(playerid, params[])
  943. {
  944. if(PlayerInfo[playerid][Adminlevel] < 5) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  945. {
  946. new string[256];
  947. new pName[24];
  948. GetPlayerName(playerid,pName,24);
  949. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" Administrator %s has commenced a server restart.",pName);
  950.  
  951. new INI:File = INI_Open(UserPath(playerid));
  952. INI_SetTag(File,"data");
  953. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  954. INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
  955. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
  956. INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
  957. INI_Close(File);
  958.  
  959. SendClientMessageToAll(COLOR_RED, string);
  960. GameTextForAll("Server Restarting",3000,0);
  961. SetTimer("Gmx",3000,false);
  962. SendRconCommand("gmx");
  963. }
  964. return 1;
  965. }
  966.  
  967. //-----[Ban]-----
  968. CMD:ban(playerid, params[])
  969. {
  970. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  971. new targetid, reason[64], string[128];
  972. if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /ban [PlayerID/PartOfName] [Reason]");
  973. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  974. {
  975. new pTargetName[24], pName[24];
  976. GetPlayerName(playerid,pName,24);
  977. GetPlayerName(targetid,pTargetName,24);
  978. format(string, sizeof(string), ""#COL_YELLOW"[SERVER]"#COL_LRED" Admin %s has IP banned %s: %s", pName, pTargetName, reason);
  979. SendClientMessageToAll(COLOR_RED,string);
  980. Ban(targetid);
  981. }
  982. return 1;
  983. }
  984.  
  985. //----[Explode]-----
  986. CMD:explode(playerid, params[])
  987. {
  988. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  989. new targetid;
  990. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /explode [PlayerID/PartOfName]");
  991. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  992. else
  993. {
  994. new Float:SLX, Float:SLY, Float:SLZ;
  995. GetPlayerPos(targetid, SLX, SLY,SLZ);
  996. CreateExplosion(SLX, SLY, SLZ, 11, 0.25);
  997. new string[128];
  998. new pName[24], pTame[24];
  999. GetPlayerName(playerid,pName,24);
  1000. GetPlayerName(targetid,pTame,24);
  1001. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been exploded by Administrator %s.",pTame,pName);
  1002. SendClientMessageToAll(COLOR_RED, string);
  1003. }
  1004. return 1;
  1005. }
  1006.  
  1007. //-----[INV]-----
  1008. CMD:inv(playerid, params[])
  1009. {
  1010. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1011. new targetid;
  1012. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /inv [PlayerID/PartOfName]");
  1013. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1014. else
  1015. {
  1016. if(IsPlayerInAnyVehicle(targetid) == 1)
  1017. {
  1018. RemovePlayerFromVehicle(targetid);
  1019. }
  1020. TogglePlayerControllable(targetid, 1);
  1021. SetPlayerArmour(targetid,0);
  1022. SetPlayerHealth(targetid,100);
  1023. checkinv = 1;
  1024. new Float:x,Float:y,Float:z;
  1025. GetPlayerPos(targetid,x,y,z);
  1026. CreateExplosion(x, y, z, 12, 2.0);
  1027. SetTimerEx("Explosion",500,0,"ii", targetid, playerid);
  1028. SetPlayerArmour(targetid,99);
  1029. SetPlayerHealth(targetid,99);
  1030. }
  1031. return 1;
  1032. }
  1033.  
  1034. //-----[Admin PM]-----
  1035. COMMAND:apm(playerid, params[])
  1036. {
  1037. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1038. new str[128],id,pname[MAX_PLAYER_NAME], Message[128];
  1039. if(sscanf(params, "us[128]", id, Message))SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /apm [PlayerID/PartOfName] [Message]");
  1040. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_ERROR, "Player not connected!");
  1041. else
  1042. {
  1043. GetPlayerName(id, str, 24);
  1044. format(str, sizeof(str), "[ADMIN] %s(%d): %s", str, id, Message);
  1045. GetPlayerName(id, str, 24);
  1046. format(str, sizeof(str), "[ADMIN] %s(%d): %s", str, id, Message);
  1047. SendClientMessage(playerid, COLOR_YELLOW, str);
  1048. GetPlayerName(playerid, pname, sizeof(pname));
  1049. format(str, sizeof(str), "[ADMIN] %s(%d): %s", pname, playerid, Message);
  1050. SendClientMessage(id, COLOR_YELLOW, str);
  1051. }
  1052. return 1;
  1053. }
  1054.  
  1055. //-----[Make admin]-----
  1056. COMMAND:makeadmin(playerid, params[])
  1057. {
  1058. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1059. new id, lvl;
  1060. if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /makeadmin [PlayerID/PartOfName] [Level]");
  1061. else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Invalid ID");
  1062. else if(lvl > 5) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Administrator level cannot be higher then 5!");
  1063. else
  1064. {
  1065. PlayerInfo[id][Adminlevel] = lvl;
  1066. }
  1067. return 1;
  1068. }
  1069.  
  1070. //-----[Freeze]-----
  1071. CMD:freeze(playerid, params[])
  1072. {
  1073. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1074. new targetid, string[128];
  1075. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /freeze [PlayerID/PartOfName]");
  1076. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1077. new pTargetName[24], pName[24];
  1078. GetPlayerName(playerid,pName,24);
  1079. GetPlayerName(targetid,pTargetName,24);
  1080. format(string, sizeof(string), ""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been frozen by Administrator %s.",pTargetName, pName);
  1081. SendClientMessageToAll(COLOR_RED,string);
  1082. TogglePlayerControllable(targetid, 0);
  1083. return 1;
  1084. }
  1085.  
  1086. //-----[Unfreeze]-----
  1087. CMD:unfreeze(playerid, params[])
  1088. {
  1089. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1090. new targetid, string[128];
  1091. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /unfreeze [PlayerID/PartOfName]");
  1092. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1093. new pTargetName[24], pName[24];
  1094. GetPlayerName(playerid,pName,24);
  1095. GetPlayerName(targetid,pTargetName,24);
  1096. format(string, sizeof(string), ""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been unfrozen by Administrator %s.",pTargetName, pName);
  1097. SendClientMessageToAll(COLOR_RED,string);
  1098. TogglePlayerControllable(targetid, 1);
  1099. return 1;
  1100. }
  1101.  
  1102. //-----[Adminduty]-----
  1103. CMD:adminduty(playerid, params[])
  1104. {
  1105. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1106. if( AdminDuty[ playerid ] == 0 )
  1107. {
  1108. AdminDuty[ playerid ] = 1;
  1109. Admin[ playerid ] = Create3DTextLabel("ADMIN DUTY",0x5CD6CAFF,30.0,40.0,50.0,10.0,0);
  1110. Attach3DTextLabelToPlayer( Admin[ playerid ], playerid, 0.0, 0.0, 0.3);
  1111. new string[128];
  1112. new pName[24], pTame[24];
  1113. GetPlayerName(playerid,pName,24);
  1114. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" Administrator %s is on Admin Duty.",pName,pTame);
  1115. SendClientMessageToAll(COLOR_WHITE, string);
  1116. }
  1117. else
  1118. {
  1119. AdminDuty[ playerid ] = 0;
  1120. Delete3DTextLabel( Admin[ playerid ] );
  1121. new string[128];
  1122. new pName[24], pTame[24];
  1123. GetPlayerName(playerid,pName,24);
  1124. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" Administrator %s is off Admin Duty.",pName,pTame);
  1125. SendClientMessageToAll(COLOR_WHITE, string);
  1126. }
  1127. return 1;
  1128. }
  1129.  
  1130. //-----[Freeze All]-----
  1131. CMD:freezeall(playerid, params[])
  1132. {
  1133. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1134. new string[128];
  1135. new pName[24], pTame[24];
  1136. GetPlayerName(playerid,pName,24);
  1137. format(string,sizeof string,""#COL_ORANGE"[SERVER]"#COL_LRED" Administrator %s has frozen everyone.",pName,pTame);
  1138. SendClientMessageToAll(COLOR_RED, string);
  1139. for(new i=0; i<MAX_PLAYERS; i++)
  1140. {
  1141. if(IsPlayerConnected(i))
  1142. {
  1143. TogglePlayerControllable(i,0);
  1144. }
  1145. }
  1146. return 1;
  1147. }
  1148.  
  1149. //-----[Unfreeze All]-----
  1150. CMD:unfreezeall(playerid, params[])
  1151. {
  1152. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1153. new string[128];
  1154. new pName[24], pTame[24];
  1155. GetPlayerName(playerid,pName,24);
  1156. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" Administrator %s has unfrozen everyone.",pName,pTame);
  1157. SendClientMessageToAll(COLOR_RED, string);
  1158. for(new i=0; i<MAX_PLAYERS; i++)
  1159. {
  1160. if(IsPlayerConnected(i))
  1161. {
  1162. TogglePlayerControllable(i,1);
  1163. }
  1164. }
  1165. return 1;
  1166. }
  1167.  
  1168. //-----[Jetpack]-----
  1169. CMD:jetpack(playerid, params[])
  1170. {
  1171. if(IsPlayerConnected(playerid))
  1172. {
  1173. if(PlayerInfo[playerid][Adminlevel] < 4)
  1174. {
  1175. SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1176. return 1;
  1177. }
  1178. if(!IsPlayerInAnyVehicle(playerid))
  1179. {
  1180. SetPlayerSpecialAction(playerid, 2);
  1181. SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ADMIN]"#COL_LRED" Jetpack spawned. Dont forget to remove it with /removejet.");
  1182. }
  1183. }
  1184. return 1;
  1185. }
  1186. //-----[Remove Jetpack]-----
  1187. CMD:removejet(playerid, params[])
  1188. {
  1189. if(IsPlayerConnected(playerid))
  1190. {
  1191. if(PlayerInfo[playerid][Adminlevel] < 4)
  1192. {
  1193. SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1194. return 1;
  1195. }
  1196. if(!IsPlayerInAnyVehicle(playerid))
  1197. {
  1198. SetPlayerSpecialAction(playerid, 0);
  1199. SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ADMIN]"#COL_LRED" Your jetpack has been removed.");
  1200. }
  1201. }
  1202. return 1;
  1203. }
  1204.  
  1205. //-----[Goto]-----
  1206. CMD:goto(playerid, params[])
  1207. {
  1208. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1209. new targetid, string[128];
  1210. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /goto [PlayerID/PartOfName]");
  1211. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1212. else
  1213. {
  1214. new pName[24];
  1215. GetPlayerName(targetid,pName,128);
  1216. format(string, sizeof(string), ""#COL_YELLOW"[ADMIN]"#GREEN" You succesfully teleported to [%d] %s.",targetid, pName);
  1217. SendClientMessage(playerid,COLOR_RED,string);
  1218. SetPlayerInterior(playerid,GetPlayerInterior(targetid));
  1219. new Float:TPX, Float:TPY, Float:TPZ;
  1220. GetPlayerPos(targetid, TPX, TPY, TPZ);
  1221. SetPlayerPos(playerid, TPX, TPY, TPZ+1);
  1222. }
  1223. return 1;
  1224. }
  1225.  
  1226. //-----[Respawn]-----
  1227. CMD:respawn(playerid, params[])
  1228. {
  1229. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1230. new targetid;
  1231. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /respawn [PlayerID/PartOfName]");
  1232. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1233. else
  1234. {
  1235. new string[128];
  1236. new pName[24], pTame[24];
  1237. GetPlayerName(playerid,pName,24);
  1238. GetPlayerName(targetid,pTame,24);
  1239. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been respawned by Administrator %s.",pTame,pName);
  1240. SendClientMessageToAll(COLOR_RED, string);
  1241. SpawnPlayer(targetid);
  1242. }
  1243. return 1;
  1244. }
  1245.  
  1246. //-----[Gethere]-----
  1247. CMD:gethere(playerid, params[])
  1248. {
  1249. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1250. new targetid, string[128];
  1251. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /gethere [PlayerID/PartOfName]");
  1252. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1253. else
  1254. {
  1255. new pName[24];
  1256. GetPlayerName(playerid,pName,128);
  1257. format(string, sizeof(string), ""#COL_YELLOW"[ADMIN]"#COL_LRED" You have been teleported to Administrator %s.",pName);
  1258. SendClientMessage(targetid,COLOR_RED,string);
  1259. SetPlayerInterior(targetid,GetPlayerInterior(playerid));
  1260. new Float:TPX, Float:TPY, Float:TPZ;
  1261. GetPlayerPos(playerid, TPX, TPY, TPZ);
  1262. SetPlayerPos(targetid, TPX, TPY, TPZ+1);
  1263. }
  1264. return 1;
  1265. }
  1266. CMD:o(playerid, o[], help)
  1267. {
  1268. #pragma unused help
  1269. new name[ MAX_PLAYER_NAME ], string[ 128 ];
  1270. if(isnull(o)) return SendClientMessage(playerid,COLOR_SYNTAX -1,"[SYNTAX]: /ooc [text]");
  1271. if(ooc == false && !IsPlayerAdmin( playerid )) return SendClientMessage(playerid,COLOR_ERROR -1,"[ERROR]: OOC Chat is disabled");
  1272. GetPlayerName(playerid, name, sizeof( name ));
  1273. format(string, sizeof(string),"[OOC Chat] %s: %s", name, o);
  1274. SendClientMessageToAll(LIME -1,string);
  1275. return 1;
  1276. }
  1277. CMD:addveh(playerid, params[])
  1278. {
  1279. #pragma unused params
  1280. if(PlayerInfo[playerid][Adminlevel] < 5) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1281. if(IsPlayerInAnyVehicle(playerid)) {
  1282. new filestring[264],Float:X,Float:Y,Float:Z,Float:Rot;
  1283. GetPlayerPos(playerid,X,Y,Z);
  1284. GetVehicleZAngle(GetPlayerVehicleID(playerid), Rot);
  1285. new vid = GetVehicleModel(GetPlayerVehicleID(playerid));
  1286. new File:pos=fopen("vehicles.ini", io_append);
  1287. format(filestring, 256, "\n%d,%f,%f,%f,%f,-1,-1 ;", vid, X, Y, Z, Rot);
  1288. fwrite(pos, filestring);
  1289. fclose(pos);
  1290. SendClientMessage(playerid,GREEN,"[SUCCESS]: You have successfully added a vehicle!");
  1291. }
  1292. else {
  1293. SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not in a vehicle!.");
  1294. }
  1295. return 1;
  1296. }
  1297. CMD:veh(playerid, params[])
  1298. {
  1299. if(PlayerInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1300. {
  1301. new veh,color1,color2;
  1302. if (!sscanf(params, "iii", veh, color1,color2))
  1303. {
  1304. new Float:x, Float:y, Float:z;
  1305. GetPlayerPos(playerid, x,y,z);
  1306. AddStaticVehicle(veh, x,y,z,0,color1, color2);
  1307. }
  1308. else SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /veh [carid] [Color 1] [Color 2]");
  1309. }
  1310. return 1;
  1311. }
  1312. CMD:sendtols(playerid, params[])
  1313. {
  1314. new id, sendername[MAX_PLAYER_NAME], string[128];
  1315. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1316. else if(sscanf(params,"u", id)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /sendtols [PlayerID]");
  1317. else if(GetPlayerState(id) == 2)
  1318. {
  1319. new tmpcar = GetPlayerVehicleID(id);
  1320. SetVehiclePos(tmpcar,1529.6,-1691.2,13.3);
  1321. }
  1322. else
  1323. {
  1324. SetPlayerPos(id, 1529.6,-1691.2,13.3);
  1325. }
  1326. GetPlayerName(playerid, sendername, sizeof(sendername));
  1327. sendername[strfind(sendername,"_")] = ' ';
  1328. format(string, sizeof(string),"[INFO]: You have been teleported to Los Santos by Administrator %s !", sendername);
  1329. SendClientMessage(id, GREEN, string);
  1330. SetPlayerInterior(id,0);
  1331. SetPlayerVirtualWorld(id, 0);
  1332. return 1;
  1333. }
  1334. CMD:setskin(playerid, params[])
  1335. {
  1336. new
  1337. id, skin, name[ MAX_PLAYER_NAME ], name2[ MAX_PLAYER_NAME ], str[ 128 ];
  1338. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1339. if( sscanf ( params, "ui", id, skin ) ) return SendClientMessage( playerid, COLOR_SYNTAX -1,#[SYNTAX]: /setskin [PlayerName/ID] [SkinModel]);
  1340. if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid,COLOR_ERROR -1, #[ERROR]: Invalid player ID);
  1341. if(skin > 299 || skin < 1) return SendClientMessage(playerid, -1,#Wrong Skin ID! Available ID's: 1-299);
  1342. GetPlayerName( playerid, name, MAX_PLAYER_NAME ); GetPlayerName( id, name2, MAX_PLAYER_NAME );
  1343. format( str, sizeof ( str ),"[SUCCESS] You have set %s skin to model %d", name2, skin);
  1344. SendClientMessage( playerid, GREEN -1, str );
  1345. format( str, sizeof ( str ),"[SUCCESS] Your skin has been set to model %d by %s", skin, name);
  1346. SendClientMessage( id, GREEN -1, str );
  1347. SetPlayerSkin( id, skin );
  1348. return true;
  1349. }
  1350. CMD:me(playerid, params[])
  1351. {
  1352. new name[MAX_PLAYER_NAME], str[128];
  1353. GetPlayerName(playerid, name, sizeof(name));
  1354. if(isnull(params))
  1355. return SendClientMessage(playerid,COLOR_SYNTAX -1,"[SYNTAX]: /me [Action]");
  1356. format(str,sizeof(str),"*%s %s",name, params);
  1357. ProxDetector(30.0, playerid, str, COLOR_ME, COLOR_ME, COLOR_ME, COLOR_ME, COLOR_ME);
  1358. return 1;
  1359. }
  1360.  
  1361.  
  1362. CMD:env(playerid, params[])
  1363. {
  1364. new name[MAX_PLAYER_NAME], str[128];
  1365. GetPlayerName(playerid, name, sizeof(name));
  1366. if(isnull(params))
  1367. return SendClientMessage(playerid,COLOR_SYNTAX -1,"[SYNTAX]: /env [Environment]");
  1368. format(str,sizeof(str),"*%s ((%s))",params, name);
  1369. ProxDetector(30.0, playerid, str, COLOR_ME, COLOR_ME, COLOR_ME, COLOR_ME, COLOR_ME);
  1370. return 1;
  1371. }
  1372.  
  1373.  
  1374. CMD:b(playerid,params[])
  1375. {
  1376. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /b [local ooc chat]");
  1377. new sendername[MAX_PLAYER_NAME], string[128];
  1378. GetPlayerName(playerid,sendername,sizeof(sendername));
  1379. sendername[strfind(sendername,"_")] = ' ';
  1380. format(string, sizeof(string), "((%s: %s ))", sendername, params);
  1381. ProxDetector(30.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  1382. return 1;
  1383. }
  1384.  
  1385.  
  1386. CMD:s(playerid,params[])
  1387. {
  1388. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /s [shout]");
  1389. new sendername[MAX_PLAYER_NAME], string[128];
  1390. GetPlayerName(playerid, sendername, sizeof(sendername));
  1391. format(string, sizeof(string), "%s Shouts: %s!!", sendername, params);
  1392. ProxDetector(40.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
  1393. return 1;
  1394. }
  1395.  
  1396.  
  1397. CMD:low(playerid,params[])
  1398. {
  1399. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"/low [Quiet Talk]");
  1400. new sendername[MAX_PLAYER_NAME], string[128];
  1401. GetPlayerName(playerid,sendername,sizeof(sendername));
  1402. sendername[strfind(sendername,"_")] = ' ';
  1403. format(string,sizeof(string), "%s says quietly: %s", sendername, params);
  1404. ProxDetector(3.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  1405. return 1;
  1406. }
  1407. CMD:enableooc(playerid, o[], help)
  1408. {
  1409. #pragma unused help
  1410. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1411. ooc = true;
  1412. SendClientMessageToAll(GREEN-1,"[INFO]: OOC Chat has been enabled");
  1413. return 1;
  1414. }
  1415. CMD:disableooc(playerid, o[], help)
  1416. {
  1417. #pragma unused help
  1418. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1419. if(ooc == true)
  1420. {
  1421. ooc = false;
  1422. SendClientMessageToAll(GREEN-1,"[INFO]: OOC Chat has been disabled");
  1423. }
  1424. return 1;
  1425. }
  1426. CMD:vrespawn(playerid, params[])
  1427. {
  1428. #pragma unused params
  1429. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1430. new bool:VehicleUsed[MAX_VEHICLES] = false;
  1431. foreach(Character, i)//for(new i = 0; i < MAX_PLAYERS; i++)
  1432. {
  1433. if(IsPlayerInAnyVehicle(i)) VehicleUsed[GetPlayerVehicleID(i)] = true;
  1434. }
  1435. for(new i = 0; i < MAX_VEHICLES; i++)
  1436. {
  1437. if(VehicleUsed[i] == false) SetVehicleToRespawn(i);
  1438. }
  1439. return SendClientMessageToAll(GREEN,"[INFO]: All Unccupied Vehicles Have Been Respawned!");
  1440. }
  1441. COMMAND:cc( playerid, params[ ] )
  1442. {
  1443. #pragma unused params
  1444. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1445. for( new i = 0; i < 50; i++ ) SendClientMessageToAll(0x33FF33AA, " "); return 1;
  1446. }
  1447. CMD:sethp(playerid, params[])
  1448. {
  1449. new id, hp, sendername[MAX_PLAYER_NAME], string[128];
  1450. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1451. else if(sscanf(params,"ui", id, hp)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /sethp [PlayerID] [Amount]");
  1452. else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Invalid player ID");
  1453. else
  1454. {
  1455. SetPlayerHealth(id, hp);
  1456. GetPlayerName(playerid, sendername, sizeof(sendername));
  1457. sendername[strfind(sendername,"_")] = ' ';
  1458. format(string, sizeof(string),"[INFO]: Your health has been set to %i by Administrator %s", hp, sendername);
  1459. SendClientMessage(id, GREEN, string);
  1460. }
  1461. return 1;
  1462. }
  1463. CMD:givegun(playerid, params[])
  1464. {
  1465. new id, gun, ammo;
  1466. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1467. else if(sscanf(params,"uii", id, gun, ammo)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /givegun [PlayerID] [GunID] [Ammo]");
  1468. else if(gun > 47 || gun < 1) return SendClientMessage(playerid, COLOR_YELLOW,"[INFO]: GUN ID'S: 1-47");
  1469. else if(ammo > 999 || ammo < 1) return SendClientMessage(playerid, COLOR_YELLOW,"[INFO]: Ammo 1-999");
  1470. else
  1471. {
  1472. GivePlayerWeapon(id, gun, ammo);
  1473. }
  1474. return 1;
  1475. }
  1476. CMD:healall(playerid, params[])
  1477. {
  1478. new sendername[MAX_PLAYER_NAME], string[128];
  1479. GetPlayerName(playerid, sendername, sizeof(sendername));
  1480. sendername[strfind(sendername,"_")] = ' ';
  1481. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1482. else
  1483. {
  1484. format(string, sizeof(string), "[INFO]: Administrator %s has healed everyone", sendername);
  1485. SendClientMessageToAll(GREEN, string);
  1486. for(new i = 0; i < MAX_PLAYERS; i ++)
  1487. SetPlayerHealth(i,100);
  1488. }
  1489. return 1;
  1490. }
  1491. CMD:report(playerid,params[])
  1492. {
  1493. new id, reason[35], string[128], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
  1494. if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /report [PlayerID] [Reason]");
  1495. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Invalid player ID");
  1496. else
  1497. {
  1498. GetPlayerName(id, name,sizeof(name));
  1499. GetPlayerName(playerid, sendername, sizeof(sendername));
  1500. sendername[strfind(sendername,"_")] = ' ';
  1501. format(string, sizeof(string), "[ID:%d] %s has reported %s: %s.", playerid, sendername, name, reason);
  1502. ABroadCast(COLOR_YELLOW,string,1);
  1503. format(string, sizeof(string), "[INFO]: Use /markfalse [ID] or /acceptreport [ID]");
  1504. ABroadCast(COLOR_YELLOW,string,1);
  1505. format(string, sizeof(string), "[INFO]: Your report was just send to the online admins, please wait for a reply");
  1506. SendClientMessage(playerid,GREEN,string);
  1507. PlayerNeedsHelp[playerid] = 1;
  1508. return 1;
  1509. }
  1510. }
  1511. CMD:markfalse(playerid, params[])
  1512. {
  1513. new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  1514. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1515. if(sscanf(params,"u", id)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /markfalse [PlayerID]");
  1516. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Player not connected!");
  1517. else
  1518. {
  1519. if(PlayerNeedsHelp[id] == 1)
  1520. {
  1521. PlayerNeedsHelp[id] = 0;
  1522. GetPlayerName(playerid, sendername, sizeof(sendername));
  1523. GetPlayerName(id, name, sizeof(name));
  1524. format(string, sizeof(string), "[Admin Decision]: %s has just marked [ID:%d]%s false!.", sendername, id, name);
  1525. ABroadCast(COLOR_YELLOW, string, 1);
  1526. format(string, sizeof(string), "**[INFO]: [ID:%d] %s has denied your report due variety of reasons!.", playerid, sendername);
  1527. SendClientMessage(id, GREEN, string);
  1528. }
  1529. else return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: This player did not ask for help! [Wrong ID]");
  1530. }
  1531. return 1;
  1532. }
  1533. CMD:acceptreport(playerid, params[])
  1534. {
  1535. new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  1536. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1537. if(sscanf(params,"u", id)) return SendClientMessage(playerid, COLOR_SYNTAX," [SYNTAX]: /acceptreport [playerid]");
  1538. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Player not connected");
  1539. else
  1540. {
  1541. if(PlayerNeedsHelp[id] == 1)
  1542. {
  1543. PlayerNeedsHelp[id] = 0;
  1544. GetPlayerName(playerid, sendername, sizeof(sendername));
  1545. GetPlayerName(id, name, sizeof(name));
  1546. format(string, sizeof(string), "[Admin Decision]: %s has just accepted the report of [ID:%d]%s.", sendername, id, name);
  1547. ABroadCast(COLOR_YELLOW, string, 1);
  1548. format(string, sizeof(string), "**[INFO]: [ID:%d] %s has accepted your report and now ready to assist you! Please be patience.", playerid, sendername);
  1549. SendClientMessage(id, GREEN, string);
  1550. }
  1551. else return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: This player did not ask for help! [Wrong ID]");
  1552. }
  1553. return 1;
  1554. }
  1555. CMD:whisper(playerid, params[])
  1556. {
  1557. new id, text[35], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  1558. if(sscanf(params,"uz", id, text)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /(w)hisper [PlayerID] [Text]");
  1559. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Invalid player ID");
  1560. else
  1561. {
  1562. new Float:x, Float:y, Float:z;
  1563. GetPlayerPos(id,x,y,z);
  1564. if(PlayerToPoint(5, playerid, x,y,z))
  1565. {
  1566. GetPlayerName(playerid, sendername,sizeof(sendername));
  1567. GetPlayerName(id, name, sizeof(name));
  1568. if(id == playerid)
  1569. {
  1570. format(string,sizeof(string),"%s mutters something", sendername);
  1571. ProxDetector(5.0, playerid, string, COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME);
  1572. }
  1573. else
  1574. {
  1575. format(string,sizeof(string),"%s whispers something to %s", sendername, name);
  1576. ProxDetector(15.0, playerid, string, COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME);
  1577. }
  1578. format(string, sizeof(string), "%s whispers: %s", sendername, text);
  1579. SendClientMessage(id, COLOR_YELLOW3, string);
  1580. format(string, sizeof(string), "%s whispers: %s", sendername, text);
  1581. SendClientMessage(playerid, COLOR_YELLOW3, string);
  1582. }
  1583. else return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: That player is not near you!");
  1584. }
  1585. return 1;
  1586. }
  1587. CMD:w(playerid, params[])
  1588. {
  1589. return cmd_whisper(playerid, params);
  1590. }
  1591. CMD:helpme(playerid, params[])
  1592. {
  1593. new string[128], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], id;
  1594. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /helpme [Description]");
  1595. GetPlayerName(playerid,sendername,sizeof(sendername));
  1596. GetPlayerName(id,name,sizeof(name));
  1597. format(string,sizeof(string),"[INFO]: %s has requested for help: %s", sendername, params);
  1598. ABroadCast(ORANGE,string,1);
  1599. SendClientMessage(playerid, GREEN,"[INFO]: You have requested for help, please wait for a reply");
  1600. return 1;
  1601. }
  1602. CMD:pay(playerid, params[])
  1603. {
  1604. new id, money, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  1605. if(sscanf(params,"ui", id, money)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /pay [PlayerID] [Amount]");
  1606. if(money < 1 || money > 2000) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: You can't pay less than 1 Dollar!.");
  1607. if(!ProxDetectorS(5.0, playerid, id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: You are too far away from that player!");
  1608. else
  1609. {
  1610. GetPlayerName(id, name, sizeof(name));
  1611. GetPlayerName(playerid, sendername, sizeof(sendername));
  1612. new pmoney = GetPlayerMoney(playerid);
  1613. if (money > 0 && pmoney >= money)
  1614. {
  1615. GivePlayerMoney(playerid, (0 - money));
  1616. GivePlayerMoney(id, money);
  1617. format(string, sizeof(string), "[INFO]: You payed %s(ID: %d) $%d.", name,id, money);
  1618. SendClientMessage(playerid, GREEN, string);
  1619. format(string, sizeof(string), "[INFO]: You recieved $%d from %s(ID: %d).", money, sendername, playerid);
  1620. {
  1621. }
  1622. sendername[strfind(sendername,"_")] = ' ';
  1623. format(string, sizeof(string), "* %s takes out %d$ from his pocket and hands it to %s.", sendername , money ,name);
  1624. ProxDetector(30.0, playerid, string, COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME);
  1625. ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
  1626. }
  1627. }
  1628. return 1;
  1629. }
  1630. CMD:givemoney(playerid, params[])
  1631. {
  1632. new id, cash, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  1633. if(PlayerInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1634. if(sscanf(params,"ui", id, cash)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /givemoney [playerid/partofname] [ammount]");
  1635. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Invalid player ID");
  1636. else
  1637. {
  1638. GivePlayerMoney(id, cash);
  1639. GetPlayerName(playerid,sendername,sizeof(sendername));
  1640. GetPlayerName(id,name,sizeof(name));
  1641. format(string,sizeof(string),"[INFO]: %s has given %s money in amout of: $%d", sendername, name, cash);
  1642. ABroadCast(GREEN,string,1);
  1643. format(string,sizeof(string),"[INFO]: You have recieved %d money from Administrator in amount of: $%s", cash, sendername);
  1644. SendClientMessage(id, GREEN, string);
  1645. }
  1646. return 1;
  1647. }
  1648. //-----[Adminchat]-----
  1649. CMD:a(playerid, params[])
  1650. {
  1651. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1652. new pName[MAX_PLAYER_NAME], string[128];
  1653. GetPlayerName(playerid, pName, sizeof(pName));
  1654. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /a [Text]" );
  1655.  
  1656. format(string, sizeof(string), "[ Administrator %s: %s ]", pName, params);
  1657. SendMessageToAdmins(ORANGE,string);
  1658.  
  1659. return 1;
  1660. }
  1661. CMD:ad( playerid, params[]) //This ad will not add any name or contact number, so adverts wont be MG'ed if the advertiser does not want his name in.
  1662. {
  1663. if( !strlen ( params ) )
  1664. return SendClientMessage ( playerid, COLOR_SYNTAX, "[SYNTAX]: /ad [Advertisement]" );
  1665.  
  1666. if( strlen( params ) < 2 )
  1667. return SendClientMessage( playerid, COLOR_ERROR, "[ERROR]: Your advertisement is not long enough." );
  1668.  
  1669. new szAdMsg[255];
  1670. format( szAdMsg, 255, "Advertisement: %s", params );
  1671. SendClientMessageToAll( COLOR_GREEN, szAdMsg );
  1672. return 1;
  1673. }
  1674. //-----[Create LMS]-----
  1675. CMD:createlms(playerid, params[]) {
  1676. new
  1677. WeaponID,
  1678. RewardAmount,
  1679. string[128],
  1680. player_Name[MAX_PLAYER_NAME];
  1681.  
  1682. if(PlayerInfo[playerid][Adminlevel] < 5) {
  1683.  
  1684. if(sscanf(params, "ii", WeaponID, RewardAmount))
  1685. return SendClientMessage(playerid, -1, ""#COL_DGREY"[CMD] / "#COL_SGREY"[WeaponID] [Reward]");
  1686.  
  1687. GetPlayerPos(playerid, g_EventPosition[0], g_EventPosition[1], g_EventPosition[2]);
  1688. GetPlayerFacingAngle(playerid, g_EventPosition[3]);
  1689. GetPlayerRame(playerid, player_Name, sizeof(player_Name));
  1690.  
  1691. g_EventWeapon = WeaponID;
  1692. g_EventReward = RewardAmount;
  1693. format(string, sizeof(string), ""COL_BROWN"[EVENT]"#COL_EASY" Administrator %s has created an LMS event! "#COL_BROWN"/join "#COL_EASY"to join the event!", player_Name);
  1694. SendClientMessageToAll(-1, string);
  1695.  
  1696. SetTimerEx("UnfreezeLMS", 20000, false, "i", playerid);
  1697.  
  1698. g_EventOpen = 1;
  1699. g_EventPlayers = 0;
  1700.  
  1701. }
  1702. else return SendClientMessage(playerid, COLOR_RED, ".:: You are not authorized to use this command ::.");
  1703. return true;
  1704.  
  1705. }
  1706.  
  1707. //-----[Join LMS]-----
  1708. CMD:join(playerid, params[]) {
  1709. #pragma unused params
  1710. if(pInEvent[playerid] == 0) {
  1711. if(g_EventOpen == 1) {
  1712.  
  1713. SetPlayerPos(playerid, g_EventPosition[0], g_EventPosition[1], g_EventPosition[2]);
  1714. SetPlayerFacingAngle(playerid, g_EventPosition[3]);
  1715.  
  1716. ResetPlayerWeapons(playerid);
  1717. GivePlayerWeapon(playerid, g_EventWeapon, 100000);
  1718.  
  1719. GameTextForPlayer(playerid, "~g~Joined event~n~~w~Please wait..", 3000, 3);
  1720.  
  1721. TogglePlayerControllable(playerid, 0);
  1722.  
  1723. g_EventPlayers++;
  1724. pInEvent[playerid] = 1; //Now in the event!
  1725.  
  1726. }
  1727. else return SendClientMessage(playerid, COLOR_RED, ".:: No event is going on ::.");
  1728.  
  1729. }
  1730. else return SendClientMessage(playerid, COLOR_RED, ".:: You're already in the event ::.");
  1731.  
  1732. return true;
  1733.  
  1734. }
  1735.  
  1736. // .:-----------------------------------------------------------------------:.
  1737. // .:=======================================================================:.
  1738. // { This is the start of IRC commands. }
  1739. // { Date: 09/09/11 using IRC plugin }
  1740. // { Last Updated: 10/09/11 By: Kingunit }
  1741. //
  1742. // .:-----------------------------------------------------------------------:.
  1743. // .:=======================================================================:.
  1744.  
  1745. //-----[IRC Kick]-----
  1746. IRCCMD:kick(botid, channel[], user[], host[], params[])
  1747. {
  1748. if (IRC_IsOp(botid, channel, user))
  1749. {
  1750. new playerid, reason[64];
  1751. if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  1752. {
  1753. return 1;
  1754. }
  1755. if (IsPlayerConnected(playerid))
  1756. {
  1757. new msg[128], name[MAX_PLAYER_NAME];
  1758. GetPlayerName(playerid, name, sizeof(name));
  1759. format(msg, sizeof(msg), "02*** %s has been kicked by %s on IRC. (%s)", name, user, reason);
  1760. IRC_GroupSay(gGroupID, channel, msg);
  1761. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been kicked by IRC Admin %s: %s", name, user, reason);
  1762. SendClientMessageToAll(0x0000FFFF, msg);
  1763.  
  1764. Kick(playerid);
  1765. }
  1766. }
  1767. return 1;
  1768. }
  1769.  
  1770. //-----[IRC Ban]-----
  1771. IRCCMD:ban(botid, channel[], user[], host[], params[])
  1772. {
  1773. if (IRC_IsOp(botid, channel, user))
  1774. {
  1775. new playerid, reason[64];
  1776. if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  1777. {
  1778. return 1;
  1779. }
  1780. if (IsPlayerConnected(playerid))
  1781. {
  1782. new msg[128], name[MAX_PLAYER_NAME];
  1783. GetPlayerName(playerid, name, sizeof(name));
  1784. format(msg, sizeof(msg), "02*** %s has been banned by %s on IRC. (%s)", name, user, reason);
  1785. IRC_GroupSay(gGroupID, channel, msg);
  1786. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been banned by IRC Admin %s: %s", name, user, reason);
  1787. SendClientMessageToAll(0x0000FFFF, msg);
  1788.  
  1789. BanEx(playerid, reason);
  1790. }
  1791. }
  1792. return 1;
  1793. }
  1794.  
  1795. //-----[IRC RCON]-----
  1796. IRCCMD:rcon(botid, channel[], user[], host[], params[])
  1797. {
  1798. if (IRC_IsOp(botid, channel, user))
  1799. {
  1800. if (!isnull(params))
  1801. {
  1802. if (strcmp(params, "exit", true) != 0 && strfind(params, "loadfs irc", true) == -1)
  1803. {
  1804. new msg[128];
  1805. format(msg, sizeof(msg), "RCON command %s has been executed.", params);
  1806. IRC_GroupSay(gGroupID, channel, msg);
  1807.  
  1808. SendRconCommand(params);
  1809. }
  1810. }
  1811. }
  1812. return 1;
  1813. }
  1814.  
  1815. //-----[IRC Slap]-----
  1816. IRCCMD:slap(botid, channel[], user[], host[], params[])
  1817. {
  1818. if (IRC_IsHalfop(botid, channel, user))
  1819. {
  1820. new playerid;
  1821. if (IsPlayerConnected(playerid))
  1822. {
  1823. new Float:SLX, Float:SLY, Float:SLZ;
  1824. GetPlayerPos(playerid, SLX, SLY,SLZ);
  1825. SetPlayerPos(playerid, SLX, SLY, SLZ+5);
  1826.  
  1827. new msg[128], name[MAX_PLAYER_NAME];
  1828. GetPlayerName(playerid, name, sizeof(name));
  1829.  
  1830. format(msg, sizeof(msg), "02*** %s has been slapped by IRC Admin %s", name, user);
  1831. IRC_GroupSay(gGroupID, channel, msg);
  1832. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been slapped by IRC Admin %s", name, user);
  1833. SendClientMessageToAll(0x0000FFFF, msg);
  1834. }
  1835. }
  1836. return 1;
  1837. }
  1838.  
  1839. //-----[IRC Explode]-----
  1840. IRCCMD:explode(botid, channel[], user[], host[], params[])
  1841. {
  1842. if (IRC_IsHalfop(botid, channel, user))
  1843. {
  1844. new playerid;
  1845. if (IsPlayerConnected(playerid))
  1846. {
  1847. new Float:SLX, Float:SLY, Float:SLZ;
  1848. GetPlayerPos(playerid, SLX, SLY,SLZ);
  1849. CreateExplosion(SLX, SLY, SLZ, 11, 0.25);
  1850.  
  1851. new msg[128], name[MAX_PLAYER_NAME];
  1852. GetPlayerName(playerid, name, sizeof(name));
  1853.  
  1854. format(msg, sizeof(msg), "02*** %s has been exploded by IRC Admin %s", name, user);
  1855. IRC_GroupSay(gGroupID, channel, msg);
  1856. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been exploded by IRC Admin %s", name, user);
  1857. SendClientMessageToAll(0x0000FFFF, msg);
  1858. }
  1859. }
  1860. return 1;
  1861. }
  1862.  
  1863. //-----[IRC Armup]-----
  1864. IRCCMD:armup(botid, channel[], user[], host[], params[])
  1865. {
  1866. if (IRC_IsHalfop(botid, channel, user))
  1867. {
  1868. new playerid;
  1869. if (IsPlayerConnected(playerid))
  1870. {
  1871. new msg[128], name[MAX_PLAYER_NAME];
  1872. GetPlayerName(playerid, name, sizeof(name));
  1873.  
  1874. SetPlayerHealth(playerid, 100);
  1875. SetPlayerArmour(playerid, 100.0);
  1876. GivePlayerWeapon(playerid, 24, 500);
  1877. GivePlayerWeapon(playerid, 27, 500);
  1878. GivePlayerWeapon(playerid, 31, 500);
  1879. GivePlayerWeapon(playerid, 1, 1);
  1880.  
  1881. format(msg, sizeof(msg), "02*** %s has been armed by IRC Admin %s", name, user);
  1882. IRC_GroupSay(gGroupID, channel, msg);
  1883. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been armed by IRC Admin %s", name, user);
  1884. SendClientMessageToAll(0x0000FFFF, msg);
  1885. }
  1886. }
  1887. return 1;
  1888. }
  1889.  
  1890. //-----[IRC Respawn]-----
  1891. IRCCMD:respawn(botid, channel[], user[], host[], params[])
  1892. {
  1893. if (IRC_IsHalfop(botid, channel, user))
  1894. {
  1895. new playerid;
  1896. if (IsPlayerConnected(playerid))
  1897. {
  1898. new msg[128], name[MAX_PLAYER_NAME];
  1899. GetPlayerName(playerid, name, sizeof(name));
  1900.  
  1901. format(msg, sizeof(msg), "02*** %s has been respawned by IRC Admin %s", name, user);
  1902. IRC_GroupSay(gGroupID, channel, msg);
  1903. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been respawned by IRC Admin %s", name, user);
  1904. SendClientMessageToAll(0x0000FFFF, msg);
  1905.  
  1906. SpawnPlayer(playerid);
  1907. }
  1908. }
  1909. return 1;
  1910. }
  1911.  
  1912. //-----[IRC Freeze]-----
  1913. IRCCMD:freeze(botid, channel[], user[], host[], params[])
  1914. {
  1915. if (IRC_IsHalfop(botid, channel, user))
  1916. {
  1917. new playerid;
  1918. if (IsPlayerConnected(playerid))
  1919. {
  1920. new msg[128], name[MAX_PLAYER_NAME];
  1921. GetPlayerName(playerid, name, sizeof(name));
  1922.  
  1923. format(msg, sizeof(msg), "02*** %s has been frozen by IRC Admin %s", name, user);
  1924. IRC_GroupSay(gGroupID, channel, msg);
  1925. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been frozen by IRC Admin %s", name, user);
  1926. SendClientMessageToAll(0x0000FFFF, msg);
  1927.  
  1928. TogglePlayerControllable(playerid, 0);
  1929. }
  1930. }
  1931. return 1;
  1932. }
  1933.  
  1934. //-----[IRC Unfreeze]-----
  1935. IRCCMD:unfreeze(botid, channel[], user[], host[], params[])
  1936. {
  1937. if (IRC_IsHalfop(botid, channel, user))
  1938. {
  1939. new playerid;
  1940. if (IsPlayerConnected(playerid))
  1941. {
  1942. new msg[128], name[MAX_PLAYER_NAME];
  1943. GetPlayerName(playerid, name, sizeof(name));
  1944.  
  1945. format(msg, sizeof(msg), "02*** %s has been unfrozen by IRC Admin %s", name, user);
  1946. IRC_GroupSay(gGroupID, channel, msg);
  1947. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been unfrozen by IRC Admin %s", name, user);
  1948. SendClientMessageToAll(0x0000FFFF, msg);
  1949.  
  1950. TogglePlayerControllable(playerid, 1);
  1951. }
  1952. }
  1953. return 1;
  1954. }
  1955.  
  1956. //-----[IRC Freezeall]-----
  1957. IRCCMD:freezeall(botid, channel[], user[], host[], params[])
  1958. {
  1959. if (IRC_IsOp(botid, channel, user))
  1960. {
  1961. new playerid;
  1962. if (IsPlayerConnected(playerid))
  1963. {
  1964. new msg[128], name[MAX_PLAYER_NAME];
  1965. GetPlayerName(playerid, name, sizeof(name));
  1966.  
  1967. format(msg, sizeof(msg), "02*** All players are frozen by IRC Admin %s", user);
  1968. IRC_GroupSay(gGroupID, channel, msg);
  1969.  
  1970. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" All players are frozen by IRC Admin %s", user);
  1971. SendClientMessageToAll(0x0000FFFF, msg);
  1972.  
  1973. for(new i=0; i<MAX_PLAYERS; i++)
  1974. {
  1975. if(IsPlayerConnected(i))
  1976. {
  1977. TogglePlayerControllable(i,0);
  1978. }
  1979. }
  1980. }
  1981. }
  1982. return 1;
  1983. }
  1984. //----[PROX DETECTOR]-----
  1985. ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  1986. {
  1987. if(IsPlayerConnected(playerid))
  1988. {
  1989. new Float:posx, Float:posy, Float:posz;
  1990. new Float:oldposx, Float:oldposy, Float:oldposz;
  1991. new Float:tempposx, Float:tempposy, Float:tempposz;
  1992. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  1993. for(new i = 0; i < MAX_PLAYERS; i++)
  1994. {
  1995. if(IsPlayerConnected(i))
  1996. {
  1997. GetPlayerPos(i, posx, posy, posz);
  1998. tempposx = (oldposx -posx);
  1999. tempposy = (oldposy -posy);
  2000. tempposz = (oldposz -posz);
  2001. if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
  2002. {
  2003. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  2004. {
  2005. SendClientMessage(i, col1, string);
  2006. }
  2007. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  2008. {
  2009. SendClientMessage(i, col2, string);
  2010. }
  2011. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  2012. {
  2013. SendClientMessage(i, col3, string);
  2014. }
  2015. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  2016. {
  2017. SendClientMessage(i, col4, string);
  2018. }
  2019. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2020. {
  2021. SendClientMessage(i, col5, string);
  2022. }
  2023. }
  2024. }
  2025. }
  2026. }
  2027. return 1;
  2028. //======[STOCKS]======
  2029. }
  2030. stock strreplace(string[], find, replace)
  2031. {
  2032. for(new i=0; string[i]; i++)
  2033. {
  2034. if(string[i] == find)
  2035. {
  2036. string[i] = replace;
  2037. }
  2038. }
  2039. }
  2040. stock LoadStaticVehiclesFromFile(const filename[])
  2041. {
  2042. new File:file_ptr;
  2043. new line[256];
  2044. new var_from_line[64];
  2045. new vehicletype;
  2046. new Float:SpawnX;
  2047. new Float:SpawnY;
  2048. new Float:SpawnZ;
  2049. new Float:SpawnRot;
  2050. new Color1, Color2;
  2051. new index;
  2052. new vehicles_loaded;
  2053.  
  2054. file_ptr = fopen(filename,filemode:io_read);
  2055. if(!file_ptr) return 0;
  2056.  
  2057. vehicles_loaded = 0;
  2058.  
  2059. while(fread(file_ptr,line,256) > 0) {
  2060. index = 0;
  2061.  
  2062. // Read type
  2063. index = token_by_delim(line,var_from_line,',',index);
  2064. if(index == (-1)) continue;
  2065. vehicletype = strval(var_from_line);
  2066. if(vehicletype < 400 || vehicletype > 611) continue;
  2067.  
  2068. // Read X, Y, Z, Rotation
  2069. index = token_by_delim(line,var_from_line,',',index+1);
  2070. if(index == (-1)) continue;
  2071. SpawnX = floatstr(var_from_line);
  2072.  
  2073. index = token_by_delim(line,var_from_line,',',index+1);
  2074. if(index == (-1)) continue;
  2075. SpawnY = floatstr(var_from_line);
  2076.  
  2077. index = token_by_delim(line,var_from_line,',',index+1);
  2078. if(index == (-1)) continue;
  2079. SpawnZ = floatstr(var_from_line);
  2080.  
  2081. index = token_by_delim(line,var_from_line,',',index+1);
  2082. if(index == (-1)) continue;
  2083. SpawnRot = floatstr(var_from_line);
  2084.  
  2085. // Read Color1, Color2
  2086. index = token_by_delim(line,var_from_line,',',index+1);
  2087. if(index == (-1)) continue;
  2088. Color1 = strval(var_from_line);
  2089.  
  2090. index = token_by_delim(line,var_from_line,';',index+1);
  2091. Color2 = strval(var_from_line);
  2092.  
  2093. //printf("%d,%d,%f,%f,%f,%f,%d,%d",total_vehicles_from_files+vehicles_loaded+1,vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2);
  2094.  
  2095. // respawn 30 minutes
  2096. AddStaticVehicleEx(vehicletype,SpawnX,SpawnY,SpawnZ+1,SpawnRot,Color1,Color2,(30*60));
  2097. vehicles_loaded++;
  2098. }
  2099.  
  2100. fclose(file_ptr);
  2101. printf("Loaded %d vehicles from: %s",vehicles_loaded,filename);
  2102. return vehicles_loaded;
  2103. }
  2104.  
  2105.  
  2106. stock token_by_delim(const string[], return_str[], delim, start_index)
  2107. {
  2108. new x=0;
  2109. while(string[start_index] != EOS && string[start_index] != delim) {
  2110. return_str[x] = string[start_index];
  2111. x++;
  2112. start_index++;
  2113. }
  2114. return_str[x] = EOS;
  2115. if(string[start_index] == EOS) start_index = (-1);
  2116. return start_index;
  2117. }
  2118.  
  2119.  
  2120. stock IsRolePlayName(playerid, bool:alphaonly = true)
  2121. {
  2122. new trpn[MAX_PLAYER_NAME];
  2123. if(GetPlayerName(playerid,trpn,sizeof(trpn))) {
  2124. new strd = strfind(trpn, "_", false);
  2125.  
  2126. if(strfind(trpn,"_",false,strd+1) == -1) {
  2127. if(strd > 0) {
  2128. if(trpn[strd-1] && trpn[strd+1]) {
  2129. if(alphaonly) {
  2130. for(new a = 0, l = strlen(trpn); a < l; a++) {
  2131. switch(trpn[a]) {
  2132. case '0' .. '9': return 0;
  2133.  
  2134. case 'a' .. 'z': continue;
  2135. case 'A' .. 'Z': continue;
  2136. // easier than specifying every invalid char
  2137. case '_': continue;
  2138.  
  2139. default: return 0;
  2140. }
  2141. }
  2142. }
  2143. return 1;
  2144. }
  2145. }
  2146. }
  2147. }
  2148. return 0;
  2149. }
  2150. stock SendMessageToAdmins(color, string[])
  2151. {
  2152. for(new i = 0; i < MAX_PLAYERS; i++)
  2153. {
  2154. if(IsPlayerConnected(i) && PlayerInfo[i][Adminlevel] > 0) // Own var
  2155. {
  2156. SendClientMessage(i, color, string);
  2157. }
  2158. }
  2159. return 1;
  2160. }
  2161. public ABroadCast(color,const string[],level)
  2162. {
  2163. for(new i = 0; i < MAX_PLAYERS; i++)
  2164. {
  2165. if(IsPlayerConnected(i))
  2166. {
  2167. if (PlayerInfo[i][Adminlevel] >= level)
  2168. {
  2169. SendClientMessage(i, color, string);
  2170. }
  2171. }
  2172. }
  2173. return 1;
  2174. }
  2175. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  2176. {
  2177. if(IsPlayerConnected(playerid))
  2178. {
  2179. new Float:oldposx, Float:oldposy, Float:oldposz;
  2180. new Float:tempposx, Float:tempposy, Float:tempposz;
  2181. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2182. tempposx = (oldposx -x);
  2183. tempposy = (oldposy -y);
  2184. tempposz = (oldposz -z);
  2185. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  2186. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2187. {
  2188. return 1;
  2189. }
  2190. }
  2191. return 0;
  2192. }
  2193. public ProxDetectorS(Float:radi, playerid, targetid)
  2194. {
  2195. if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
  2196. {
  2197. new Float:posx, Float:posy, Float:posz;
  2198. new Float:oldposx, Float:oldposy, Float:oldposz;
  2199. new Float:tempposx, Float:tempposy, Float:tempposz;
  2200. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2201. //radi = 2.0; //Trigger Radius
  2202. GetPlayerPos(targetid, posx, posy, posz);
  2203. tempposx = (oldposx -posx);
  2204. tempposy = (oldposy -posy);
  2205. tempposz = (oldposz -posz);
  2206. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  2207. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2208. {
  2209. return 1;
  2210. }
  2211. }
  2212. return 0;
  2213. }
Advertisement
Add Comment
Please, Sign In to add comment