Guest User

Untitled

a guest
Sep 20th, 2011
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 62.21 KB | None | 0 0
  1. /*
  2. .:==============================================================:.
  3. Central Gaming TDM.
  4. Created by Yamoo.
  5.  
  6. # If you are reading this, before Yamoo personally has writing
  7. you are probably leaking the script from somewhere and therefore
  8. can say you'll be reported if found out.
  9.  
  10. # This gamemode has been created for the use of Central Gaming.
  11.  
  12. # Credits to Kingunit for creating the y_ini blank gamemode,
  13. also thanks to Kush for the YSI Server Includes; other credits
  14. go to the creators of each and every individual who made the
  15. .inc files.
  16.  
  17. # Needs done.
  18.  
  19. ; Camera view for Ballas, LSPD and VIP.
  20. ; Cars need changed - just replace the car ids.
  21. ; Mapping put into place.
  22. ; /spec.
  23. .:--------------------------------------------------------------:. */
  24.  
  25. #include <a_samp>
  26. #include <YSI\y_ini>
  27. #include <zcmd>
  28. #include <sscanf2>
  29. #include <irc>
  30. #include <foreach>
  31.  
  32. //-----[IRC Settings]-----
  33. #define IRC_SERVER "irc.crystalirc.net"
  34. #define IRC_PORT (6667)
  35. #define IRC_CHANNEL "#Warehouse"
  36.  
  37. #define BOT_1_NICKNAME "SA-MP Bot[1]"
  38. #define BOT_1_REALNAME "SA-MP Bot[1]"
  39. #define BOT_1_USERNAME "SA-MP Bot[1]"
  40.  
  41. #define MAX_BOTS (1)
  42.  
  43. new gBotID[MAX_BOTS], gGroupID;
  44. new Text:Classtext;
  45. new Menu:shop;
  46. new Menu:bombshop;
  47.  
  48. //-----[INI includes]-----
  49. #define DIALOG_REGISTER 1
  50. #define DIALOG_LOGIN 2
  51. #define PATH "/Users/%s.ini"
  52.  
  53. //-----[Color defines]-----
  54. #define COLOR_WHITE 0xFFFFFFFF
  55. #define COLOR_GREEN 0x33AA33AA
  56. #define COLOR_RED 0xA10000AA
  57. #define COLOR_YELLOW 0xFFFF00AA
  58. #define COLOR_GREY 0xAFAFAFAA
  59. #define LIME 0x88AA62FF
  60. #define WHITE 0xFFFFFFAA
  61. #define RULE 0xFBDF89AA
  62. #define ORANGE 0xDB881AAA
  63. #define GOLD 0xB8860BAA
  64.  
  65. #define GREY 0xAFAFAFAA
  66. #define GREEN 0x9FFF00FF
  67. #define RED 0xA10000AA
  68. #define YELLOW 0xFFFF00AA
  69. #define WHITE 0xFFFFFFAA
  70. #define BLUE 0x0000BBAA
  71.  
  72. //-----[0.3c Color defines]-----
  73. #define COL_EASY "{FFF1AF}"
  74. #define COL_DGREEN "{0E8C00}"
  75. #define COL_LOGIN "{98E090}"
  76. #define COL_WHITE "{FFFFFF}"
  77. #define COL_BLACK "{0E0101}"
  78. #define COL_GREY "{C3C3C3}"
  79. #define COL_GREEN "{6EF83C}"
  80. #define COL_RED "{F81414}"
  81. #define COL_YELLOW "{F3FF02}"
  82. #define COL_ORANGE "{F9B857}"
  83. #define COL_LIME "{B7FF00}"
  84. #define COL_CYAN "{00FFEE}"
  85. #define COL_LBLUE "{298ACF}"
  86. #define COL_BLUE "{0049FF}"
  87. #define COL_MAGENTA "{F300FF}"
  88. #define COL_VIOLET "{B700FF}"
  89. #define COL_PINK "{FF00EA}"
  90. #define COL_MARONE "{A90202}"
  91. #define COL_CMD "{B8FF02}"
  92. #define COL_PARAM "{3FCD02}"
  93. #define COL_SERVER "{AFE7FF}"
  94. #define COL_VALUE "{A3E4FF}"
  95. #define COL_RULE "{F9E8B7}"
  96. #define COL_RULE2 "{FBDF89}"
  97. #define COL_RWHITE "{FFFFFF}"
  98. #define COL_LGREEN "{9FE4AA}"
  99. #define COL_LRED "{DA7272}"
  100. #define COL_LRED2 "{C77D87}"
  101. #define COL_DYELLOW "{FAFA52}"
  102. #define COL_BROWN "{8C703F}"
  103. #define COL_SBLACK "{474747}"
  104. #define COL_SGREY "{ADADAD}"
  105. #define COL_DGREY "{616161}"
  106. #define COL_SBLUE "{3660D1}"
  107. #undef MAX_PLAYERS
  108. #define MAX_PLAYERS 32
  109.  
  110. /* Team defines */
  111. #define TEAM_GROVE 1
  112. #define TEAM_BALLA 2
  113. #define TEAM_LSPD 3
  114. #define TEAM_TRIAD 4
  115. #define TEAM_SURENOS 5
  116. #define TEAM_VIP 6
  117. #define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green
  118. #define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple
  119. #define TEAM_LSPD_COLOR 0x0000BBAA // Blue
  120. #define TEAM_TRIAD_COLOR 0xA10000AA // Red
  121. #define TEAM_SURENOS_COLOR 0x0099FF // Light blue
  122. #define TEAM_VIP_COLOR 0xB8860BAA // Gold
  123. new gTeam[MAX_PLAYERS];
  124.  
  125. new Text3D:Admin[ MAX_PLAYERS ], AdminDuty[ MAX_PLAYERS ],
  126. checkinv = 0;
  127.  
  128. forward ABroadCast(color,const string[],level);
  129.  
  130. new
  131. Float:g_EventPosition[4],
  132. g_EventWeapon = -1,
  133. g_EventReward = 0,
  134. g_EventPlayers = 0,
  135. pInEvent[MAX_PLAYERS] = 0,
  136. g_EventOpen = 0;
  137. //-----[Enum Playerinfo]-----
  138. enum pInfo
  139. {
  140. Password,
  141. Cash,
  142. Kills,
  143. Deaths,
  144. Adminlevel,
  145. VIP
  146. }
  147. new PlayerInfo[MAX_PLAYERS][pInfo];
  148.  
  149. main() { }
  150.  
  151. SetPlayerTeamFromClass(playerid, classid)
  152. {
  153. if (classid == 0)
  154. {
  155. gTeam[playerid] = TEAM_GROVE;
  156. }
  157. else
  158. {
  159. gTeam[playerid] = TEAM_BALLA;
  160. gTeam[playerid] = TEAM_LSPD;
  161. gTeam[playerid] = TEAM_TRIAD;
  162. gTeam[playerid] = TEAM_SURENOS;
  163. gTeam[playerid] = TEAM_VIP;
  164. }
  165. }
  166.  
  167. SetPlayerToTeamColor(playerid)
  168. {
  169. if (gTeam[playerid] == TEAM_GROVE)
  170. {
  171. SetPlayerColor(playerid, TEAM_GROVE_COLOR);
  172. }
  173. else if (gTeam[playerid] == TEAM_BALLA)
  174. {
  175. SetPlayerColor(playerid, TEAM_BALLA_COLOR);
  176. }
  177. else if (gTeam[playerid] == TEAM_LSPD_COLOR)
  178. {
  179. SetPlayerColor(playerid, TEAM_LSPD_COLOR);
  180. }
  181. else if (gTeam[playerid] == TEAM_TRIAD_COLOR)
  182. {
  183. SetPlayerColor(playerid, TEAM_TRIAD_COLOR);
  184. }
  185. else if (gTeam[playerid] == TEAM_SURENOS_COLOR)
  186. {
  187. SetPlayerColor(playerid, TEAM_SURENOS_COLOR);
  188. }
  189. else if (gTeam[playerid] == TEAM_VIP_COLOR)
  190. {
  191. SetPlayerColor(playerid, TEAM_VIP_COLOR);
  192. }
  193. }
  194.  
  195. public ABroadCast(color,const string[],level)
  196. {
  197. for(new i = 0; i < MAX_PLAYERS; i++)
  198. {
  199. if(IsPlayerConnected(i))
  200. {
  201. if (PlayerInfo[i][Adminlevel] >= level)
  202. {
  203. SendClientMessage(i, color, string);
  204. printf("%s", string);
  205. }
  206. }
  207. }
  208. return 1;
  209. }
  210.  
  211. public OnGameModeInit()
  212. {
  213. shop = CreateMenu("Shop Menu", 1, 50.0, 180.0, 200.0, 200.0);
  214.  
  215. AddMenuItem(shop, 0, "AK47 $1000");
  216. AddMenuItem(shop, 0, "M4 $1500");
  217. AddMenuItem(shop, 0, "Tec-9 $1500");
  218. AddMenuItem(shop, 0, "SMG $500");
  219. AddMenuItem(shop, 0, "Shotgun $500");
  220. AddMenuItem(shop, 0, "Deagle $300");
  221. AddMenuItem(shop, 0, "Armour $1500");
  222.  
  223. bombshop = CreateMenu("Bomb Shop Menu", 1, 50.0, 180.0, 200.0, 200.0);
  224.  
  225. AddMenuItem(bombshop, 0, "RPG $2000");
  226. AddMenuItem(bombshop, 0, "Gernades $900");
  227. AddMenuItem(bombshop, 0, "Tear Gas $300");
  228. AddMenuItem(bombshop, 0, "C4 $900");
  229. AddMenuItem(bombshop, 0, "Molotovs $900");
  230. AddMenuItem(bombshop, 0, "Flamethrower $1500");
  231.  
  232.  
  233.  
  234. gBotID[0] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_1_NICKNAME, BOT_1_REALNAME, BOT_1_USERNAME);
  235. IRC_SetIntData(gBotID[0], E_IRC_CONNECT_DELAY, 20);
  236. gGroupID = IRC_CreateGroup();
  237.  
  238. SetGameModeText("CG:TDM V0.52a");
  239. DisableInteriorEnterExits();
  240.  
  241. // Vehicle spawns.
  242. AddStaticVehicle(587,2487.4587,-1682.7505,13.0600,88.9653,86,86); // Grove 1
  243. AddStaticVehicle(587,2504.9736,-1679.4690,13.1859,317.1174,86,86); // Grove 2
  244. AddStaticVehicle(587,2498.5916,-1651.9669,13.2231,174.3243,86,86); // Grove 3
  245. AddStaticVehicle(587,2484.4790,-1654.2858,13.1209,91.0507,86,86); // Grove 4
  246. AddStaticVehicle(587,2187.8391,-1660.4637,14.6782,348.5267,5,5); // Balla 1
  247. AddStaticVehicle(587,2183.9255,-1681.5304,13.7016,348.5760,5,5); // Balla 2
  248. AddStaticVehicle(587,2196.8567,-1664.1522,14.5951,350.1524,5,5); // Balla 3
  249. AddStaticVehicle(587,2192.5518,-1682.3214,13.7180,347.1376,5,5); // Balla 4
  250. AddStaticVehicle(598,1535.9929,-1673.9319,13.1290,359.3989,0,1); // LSPD 1
  251. AddStaticVehicle(598,1534.3129,-1685.7982,13.1985,177.9582,0,1); // LSPD 2
  252. AddStaticVehicle(598,1524.4269,-1682.9047,13.2074,359.6769,0,1); // LSPD 3
  253. AddStaticVehicle(598,1524.8428,-1663.3488,13.2059,0.8781,0,1); // LSPD 4
  254. AddStaticVehicle(497,1565.8287,-1647.9678,28.5791,89.5353,0,0); // LSPD Heli spawn.
  255. AddStaticVehicle(427,1513.7935,-1661.5538,13.6786,266.3866,0,6); // LSPD Enforcer 1
  256. AddStaticVehicle(427,1514.2697,-1656.1556,13.6712,267.1016,0,6); // LSPD Enforcer 2
  257. AddStaticVehicle(401,1206.1577,-1730.0765,13.3062,179.7398,3,0); // Triad 1
  258. AddStaticVehicle(401,1200.3794,-1729.5776,13.3065,180.9349,3,0); // Triad 2
  259. AddStaticVehicle(401,1192.9402,-1743.7073,13.2958,89.1745,3,0); // Triad 3
  260. AddStaticVehicle(401,1192.6244,-1750.2810,13.3100,89.9612,3,0); // Triad 4
  261. AddStaticVehicle(411,1785.4857,-2117.4868,13.1924,270.3767,64,1); // Sur 1
  262. AddStaticVehicle(411,1793.4227,-2126.0552,13.2740,359.9570,64,1); // Sur 2
  263. AddStaticVehicle(411,1793.6064,-2107.8752,13.1890,268.7945,64,1); // Sur 3
  264. AddStaticVehicle(411,1817.2701,-2104.5771,13.1908,335.3533,64,1); // Sur 4
  265. AddStaticVehicle(522,1140.9578,-2004.5723,68.5618,273.3880,3,8); // // VIP 1
  266. AddStaticVehicle(522,1141.1970,-2068.0688,68.5465,262.2642,3,8); // // VIP 2
  267. AddStaticVehicle(411,1247.4617,-2009.5303,59.5283,266.2096,123,1); // // VIP 3
  268. AddStaticVehicle(411,1245.7002,-2038.8945,59.5622,271.3038,123,1); // // VIP 4
  269. AddStaticVehicle(411,1276.5537,-2028.3231,58.7090,88.3041,123,1); // // VIP 5
  270. AddStaticVehicle(411,1277.0875,-2043.1765,58.7599,271.1546,123,1); // // VIP 6
  271. AddStaticVehicle(411,1265.5612,-2010.4873,58.9884,178.8389,123,1); // // VIP 7
  272. AddStaticVehicle(411,1245.5374,-2057.9949,59.5526,266.3947,123,1); // // VIP 8
  273. AddStaticVehicle(411,1245.6647,-2052.2964,59.5647,269.1614,123,1); // // VIP 9
  274. AddStaticVehicle(425,1117.7528,-2021.2284,74.9871,0.3720,43,0); // VIP Hunter Heli.
  275.  
  276.  
  277. // Grove Street
  278. AddPlayerClass(105, 2495.495605, -1689.601684, 14.533213, 0.131221, 24, 500, 4, 1, 0, 0); // skin 1
  279. AddPlayerClass(107, 2495.495605, -1689.601684, 14.533213, 0.131221, 24, 500, 4, 1, 0, 0); // skin 2
  280. AddPlayerClass(106, 2495.495605, -1689.601684, 14.533213, 0.131221, 24, 500, 4, 1, 0, 0); // skin 3
  281. // Ballas
  282. AddPlayerClass(103, 2165.319335, -1672.072509, 16.271999, 270.059112, 24, 500, 4, 1, 0, 0); // skin 1
  283. AddPlayerClass(102, 2165.319335, -1672.072509, 16.271999, 270.059112, 24, 500, 4, 1, 0, 0); // skin 2
  284. AddPlayerClass(104, 2165.319335, -1672.072509, 16.271999, 270.059112, 24, 500, 4, 1, 0, 0); // skin 3
  285. // LSPD.
  286. AddPlayerClass(280, 1553.188842, -1675.218139, 16.195312, 92.107582, 24, 500, 4, 1, 46, 1); // skin 1
  287. AddPlayerClass(285, 1553.188842, -1675.218139, 16.195312, 92.107582, 24, 500, 4, 1, 46, 1); // skin 2
  288. AddPlayerClass(284, 1553.188842, -1675.218139, 16.195312, 92.107582, 24, 500, 4, 1, 46, 1); // skin 3
  289. //Triad
  290. AddPlayerClass(117, 1212.407104, -1748.701782, 13.594337, 52.313873, 24, 500, 4, 1, 0, 0); // skin 1
  291. AddPlayerClass(118, 1212.407104, -1748.701782, 13.594337, 52.313873, 24, 500, 4, 1, 0, 0); // skin 2
  292. AddPlayerClass(120, 1212.407104, -1748.701782, 13.594337, 52.313873, 24, 500, 4, 1, 0, 0); //skin 3
  293. // Surenos
  294. AddPlayerClass(114, 1803.943359, -2124.409423, 13.942373, 3.601522, 24, 500, 4, 1, 0, 0); // skin 1
  295. AddPlayerClass(115, 1803.943359, -2124.409423, 13.942373, 3.601522, 24, 500, 4, 1, 0, 0); // skin 2
  296. AddPlayerClass(116, 1803.943359, -2124.409423, 13.942373, 3.601522, 24, 500, 4, 1, 0, 0); // skin 3
  297. // VIP.
  298. AddPlayerClass(217, 1123.5151, -2037.0284, 69.8869, 263.9446, 24, 500, 4, 1, 24, 1000); // skin 1
  299. AddPlayerClass(37, 1123.5151, -2037.0284, 69.8869, 263.9446, 24, 500, 4, 1, 24, 1000); // skin 2
  300. AddPlayerClass(99, 1123.5151, -2037.0284, 69.8869, 263.9446, 24, 500, 4, 1, 24, 1000); // skin 3
  301. return 1;
  302. }
  303.  
  304. public OnGameModeExit()
  305. {
  306. IRC_Quit(gBotID[0], "SA-MP bot exiting");
  307. IRC_DestroyGroup(gGroupID);
  308. return 1;
  309. }
  310.  
  311. public OnPlayerRequestClass(playerid, classid)
  312. {
  313. SetPlayerPos(playerid,2201.6306,1217.2319,10.8128);
  314. SetPlayerFacingAngle(playerid,178.6062);
  315. SetPlayerCameraPos(playerid,2202.2537,1210.6444,10.8128);
  316. SetPlayerCameraLookAt(playerid,2201.6306,1217.2319,10.8128);
  317. SetPlayerTeamFromClass(playerid, classid);
  318.  
  319. switch(classid)
  320. {
  321. case 0 .. 2:
  322. {
  323. TextDrawDestroy(Classtext);
  324. Classtext = TextDrawCreate(170.0, 350.0, "Grove Street.");
  325. TextDrawLetterSize(Classtext, 1.5, 2.5);
  326. TextDrawFont(Classtext, 0);
  327. TextDrawColor(Classtext, TEAM_GROVE_COLOR);
  328. TextDrawShowForPlayer(playerid,Classtext);
  329. SetPlayerPos(playerid,2481.010253, -1654.001953, 13.317111);
  330. SetPlayerFacingAngle(playerid,176.249954);
  331. SetPlayerCameraPos(playerid,2482.577880, -1661.032836, 14.404399);
  332. SetPlayerCameraLookAt(playerid,2201.6306,1217.2319,10.8128);
  333. SetPlayerTeam(playerid, TEAM_GROVE);
  334. gTeam[playerid] = TEAM_GROVE;
  335. SetPlayerColor(playerid, TEAM_GROVE_COLOR);
  336. }
  337. case 3 .. 5:
  338. {
  339. TextDrawDestroy(Classtext);
  340. Classtext = TextDrawCreate(170.0, 350.0, "Ballas");
  341. TextDrawLetterSize(Classtext, 1.5, 2.5);
  342. TextDrawFont(Classtext, 0);
  343. TextDrawColor(Classtext, TEAM_BALLA_COLOR);
  344. TextDrawShowForPlayer(playerid,Classtext);
  345. SetPlayerPos(playerid,2167.300292,-1672.419311,15.080292);
  346. SetPlayerFacingAngle(playerid,176.249954);
  347. SetPlayerCameraPos(playerid,2165.319335, -1672.072509, 16.271999);
  348. SetPlayerTeam(playerid, TEAM_BALLA);
  349. gTeam[playerid] = TEAM_BALLA;
  350. SetPlayerColor(playerid, TEAM_BALLA_COLOR);
  351. }
  352. case 6 .. 8:
  353. {
  354. TextDrawDestroy(Classtext);
  355. Classtext = TextDrawCreate(170.0, 350.0, "LSPD");
  356. TextDrawLetterSize(Classtext, 1.5, 2.5);
  357. TextDrawFont(Classtext, 0);
  358. TextDrawColor(Classtext, TEAM_LSPD_COLOR);
  359. TextDrawShowForPlayer(playerid,Classtext);
  360. SetPlayerPos(playerid,2495.495605,-1689.601684,14.533213);
  361. SetPlayerFacingAngle(playerid,176.249954);
  362. SetPlayerCameraPos(playerid,1555.510620, -1675.810668, 17.036300);
  363. SetPlayerTeam(playerid, TEAM_LSPD);
  364. gTeam[playerid] = TEAM_LSPD;
  365. SetPlayerColor(playerid, TEAM_LSPD_COLOR);
  366. }
  367. case 9 .. 11:
  368. {
  369. TextDrawDestroy(Classtext);
  370. Classtext = TextDrawCreate(170.0, 350.0, "Japanese Triad");
  371. TextDrawLetterSize(Classtext, 1.5, 2.5);
  372. TextDrawFont(Classtext, 0);
  373. TextDrawColor(Classtext, TEAM_TRIAD_COLOR);
  374. TextDrawShowForPlayer(playerid,Classtext);
  375. SetPlayerPos(playerid,1212.407104,-1748.701782,13.594337);
  376. SetPlayerFacingAngle(playerid,176.249954);
  377. SetPlayerCameraPos(playerid,1211.534667, -1750.346191, 14.528200);
  378. SetPlayerTeam(playerid, TEAM_TRIAD);
  379. gTeam[playerid] = TEAM_TRIAD;
  380. SetPlayerColor(playerid, TEAM_TRIAD_COLOR);
  381. }
  382. case 12 .. 14:
  383. {
  384. TextDrawDestroy(Classtext);
  385. Classtext = TextDrawCreate(170.0, 350.0, "Southside Surenos");
  386. TextDrawLetterSize(Classtext, 1.5, 2.5);
  387. TextDrawFont(Classtext, 0);
  388. TextDrawColor(Classtext, TEAM_SURENOS_COLOR);
  389. TextDrawShowForPlayer(playerid,Classtext);
  390. SetPlayerPos(playerid,1803.943359,-2124.409423,13.942373);
  391. SetPlayerFacingAngle(playerid,176.249954);
  392. SetPlayerCameraPos(playerid,1804.112792,-2125.102539,14.747099);
  393. SetPlayerTeam(playerid, TEAM_SURENOS);
  394. gTeam[playerid] = TEAM_SURENOS;
  395. SetPlayerColor(playerid, TEAM_SURENOS_COLOR);
  396. }
  397. case 15 .. 17:
  398. {
  399. TextDrawDestroy(Classtext);
  400. Classtext = TextDrawCreate(170.0, 350.0, "V.I.P");
  401. TextDrawLetterSize(Classtext, 1.5, 2.5);
  402. TextDrawFont(Classtext, 0);
  403. TextDrawColor(Classtext, TEAM_VIP_COLOR);
  404. TextDrawShowForPlayer(playerid,Classtext);
  405. if(PlayerInfo[playerid][VIP] < 1)
  406. {
  407. ForceClassSelection(playerid);
  408. SetPlayerHealth(playerid, 0.0);
  409. SendClientMessage(playerid, RED, "Your do not have the VIP status to select this class!"); }
  410. SetPlayerPos(playerid,1123.5151,-2037.0284,69.8869);
  411. SetPlayerFacingAngle(playerid,176.249954);
  412. SetPlayerCameraPos(playerid,2165.319335, -1672.072509, 16.271999);
  413. SetPlayerTeam(playerid, TEAM_VIP);
  414. gTeam[playerid] = TEAM_VIP;
  415. SetPlayerColor(playerid, TEAM_VIP_COLOR);
  416. }
  417. }
  418. return 1;
  419. }
  420.  
  421. public OnPlayerConnect(playerid)
  422. {
  423.  
  424. new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
  425. GetPlayerName(playerid, pname, sizeof(pname));
  426. format(string, sizeof(string), "[JOINED] %s has joined the server", pname);
  427. SendClientMessageToAll(COLOR_GREY, string);
  428.  
  429. for(new chat = 0; chat <= 100; chat++)
  430. {
  431. SendClientMessage(playerid,COLOR_WHITE," ");
  432. }
  433.  
  434. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"==========================================================================================================");
  435. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN" Central Gaming TDM.");
  436. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN" ");
  437. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"» Welcome to Central Gaming TDM.");
  438. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"» Please visit our forums at www.centralgaming.elementfx.com");
  439. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"» Next update; 30th November 2011");
  440. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"» If you'll like to donate to earn yourself extra items then visit our fourm.");
  441. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"» We'll also be releasing other servers based on the vote of the ");
  442. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN" .. community later on in time.");
  443. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"==========================================================================================================");
  444.  
  445. if(fexist(UserPath(playerid)))
  446. {
  447. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  448. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Login", "\t\t"#COL_EASY"Central Gaming "#COL_DGREEN"TDM "#COL_EASY"(V1.02a)\n\n"#COL_WHITE"Welcome back, \nPlease enter your password below to start the game!", "Login", "Exit");
  449. }
  450. else
  451. {
  452. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Register" , "\t\t"#COL_EASY"Central Gaming "#COL_DGREEN"TDM "#COL_EASY"(V1.02a)\n\n"#COL_WHITE"You are not registered, \nPlease enter a password below to register your account!", "Register", "Exit");
  453. }
  454.  
  455. new joinMsg[128], name[MAX_PLAYER_NAME];
  456. GetPlayerName(playerid, name, sizeof(name));
  457. format(joinMsg, sizeof(joinMsg), "02[%d] 03*** %s has joined the server!", playerid, name);
  458. IRC_GroupSay(gGroupID, IRC_CHANNEL, joinMsg);
  459. return 1;
  460. }
  461.  
  462. public OnPlayerDisconnect(playerid, reason)
  463. {
  464.  
  465. new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
  466. GetPlayerName(playerid, pname, sizeof(pname));
  467. switch(reason)
  468. {
  469. case 0: format(string, sizeof(string), "[LEFT] %s has left the server. (Timeout)", pname);
  470. case 1: format(string, sizeof(string), "[LEFT] %s has left the server. (Leaving)", pname);
  471. case 2: format(string, sizeof(string), "[LEFT] %s has left the server. (Kicked/Banned)", pname);
  472. }
  473. SendClientMessageToAll(COLOR_GREY, string);
  474.  
  475. new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
  476. switch(reason)
  477. {
  478. case 0: reasonMsg = "Timeout";
  479. case 1: reasonMsg = "Leaving";
  480. case 2: reasonMsg = "Kicked";
  481. }
  482. GetPlayerName(playerid, name, sizeof(name));
  483. format(leaveMsg, sizeof(leaveMsg), "02[%d] 03*** %s has left the server! (%s)", playerid, name, reasonMsg);
  484. IRC_GroupSay(gGroupID, IRC_CHANNEL, leaveMsg);
  485.  
  486. new INI:File = INI_Open(UserPath(playerid));
  487. INI_SetTag(File,"data");
  488. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  489. INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
  490. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
  491. INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
  492. INI_WriteInt(File,"VIP",PlayerInfo[playerid][VIP]);
  493. INI_Close(File);
  494. return 1;
  495. }
  496.  
  497. public OnPlayerSpawn(playerid)
  498. {
  499. SendClientMessage(playerid, GREY, "You have chosen your class!");
  500. SendClientMessage(playerid, GREY, "VIP status is available through donations!");
  501. SendClientMessage(playerid, GREY, "Have fun and stay clean ;)!");
  502.  
  503. SetPlayerToTeamColor(playerid);
  504. return 1;
  505. }
  506.  
  507. public OnPlayerDeath(playerid, killerid, reason)
  508. {
  509. GivePlayerMoney(killerid,450);
  510. GivePlayerMoney(playerid,-150);
  511. new msg[128], killerName[MAX_PLAYER_NAME], reasonMsg[32], playerName[MAX_PLAYER_NAME];
  512. GetPlayerName(killerid, killerName, sizeof(killerName));
  513. GetPlayerName(playerid, playerName, sizeof(playerName));
  514. if (killerid != INVALID_PLAYER_ID)
  515. {
  516. switch (reason)
  517. {
  518. case 0: reasonMsg = "Unarmed";
  519. case 1: reasonMsg = "Brass Knuckles";
  520. case 2: reasonMsg = "Golf Club";
  521. case 3: reasonMsg = "Night Stick";
  522. case 4: reasonMsg = "Knife";
  523. case 5: reasonMsg = "Baseball Bat";
  524. case 6: reasonMsg = "Shovel";
  525. case 7: reasonMsg = "Pool Cue";
  526. case 8: reasonMsg = "Katana";
  527. case 9: reasonMsg = "Chainsaw";
  528. case 10: reasonMsg = "Dildo";
  529. case 11: reasonMsg = "Dildo";
  530. case 12: reasonMsg = "Vibrator";
  531. case 13: reasonMsg = "Vibrator";
  532. case 14: reasonMsg = "Flowers";
  533. case 15: reasonMsg = "Cane";
  534. case 22: reasonMsg = "Pistol";
  535. case 23: reasonMsg = "Silenced Pistol";
  536. case 24: reasonMsg = "Desert Eagle";
  537. case 25: reasonMsg = "Shotgun";
  538. case 26: reasonMsg = "Sawn-off Shotgun";
  539. case 27: reasonMsg = "Combat Shotgun";
  540. case 28: reasonMsg = "MAC-10";
  541. case 29: reasonMsg = "MP5";
  542. case 30: reasonMsg = "AK-47";
  543. case 31: reasonMsg = "M4";
  544. case 32: reasonMsg = "TEC-9";
  545. case 33: reasonMsg = "Country Rifle";
  546. case 34: reasonMsg = "Sniper Rifle";
  547. case 37: reasonMsg = "Fire";
  548. case 38: reasonMsg = "Minigun";
  549. case 41: reasonMsg = "Spray Can";
  550. case 42: reasonMsg = "Fire Extinguisher";
  551. case 51: reasonMsg = "Explosion";
  552. default: reasonMsg = "Unknown";
  553. }
  554. format(msg, sizeof(msg), "04*** %s killed %s. (%s)", killerName, playerName, reasonMsg);
  555. }
  556. else
  557. {
  558. switch (reason)
  559. {
  560. case 53: format(msg, sizeof(msg), "04*** %s died! (Drowned)", playerName);
  561. case 54: format(msg, sizeof(msg), "04*** %s died! (Collision)", playerName);
  562. default: format(msg, sizeof(msg), "04*** %s died!", playerName);
  563. }
  564. }
  565. IRC_GroupSay(gGroupID, IRC_CHANNEL, msg);
  566.  
  567. PlayerInfo[killerid][Kills]++;
  568. PlayerInfo[playerid][Deaths]++;
  569.  
  570. if(pInEvent[playerid] == 1) {
  571. g_EventPlayers--;
  572. pInEvent[playerid] = 0;
  573. if(g_EventPlayers == 1) {
  574. foreach(Player, i) {
  575. if(pInEvent[i] == 1) {
  576. new string[128], player_Name[MAX_PLAYER_NAME];
  577. format(string, sizeof(string), ""#COL_BROWN"[EVENT]"#COL_EASY" %s has won the LMS event and has collected $%d!", player_Name, g_EventReward);
  578. SendClientMessageToAll(-1, string);
  579. GivePlayerMoney(i, g_EventReward);
  580. pInEvent[i] = 0;
  581. g_EventOpen = 0, g_EventPlayers = 0, g_EventReward = 0, g_EventWeapon = 0;
  582. SpawnPlayer(i);
  583. }
  584. }
  585. }
  586. }
  587. return 1;
  588. }
  589.  
  590. public OnVehicleSpawn(vehicleid)
  591. {
  592. return 1;
  593. }
  594.  
  595. public OnVehicleDeath(vehicleid, killerid)
  596. {
  597. return 1;
  598. }
  599.  
  600. public OnPlayerText(playerid, text[])
  601. {
  602. return 0;
  603. }
  604.  
  605. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  606. {
  607. return 1;
  608. }
  609.  
  610. public OnPlayerExitVehicle(playerid, vehicleid)
  611. {
  612. return 1;
  613. }
  614.  
  615. public OnPlayerEnterCheckpoint(playerid)
  616. {
  617. return 1;
  618. }
  619.  
  620. public OnPlayerLeaveCheckpoint(playerid)
  621. {
  622. return 1;
  623. }
  624.  
  625. public OnPlayerEnterRaceCheckpoint(playerid)
  626. {
  627. return 1;
  628. }
  629.  
  630. public OnPlayerLeaveRaceCheckpoint(playerid)
  631. {
  632. return 1;
  633. }
  634.  
  635. public OnRconCommand(cmd[])
  636. {
  637. return 1;
  638. }
  639.  
  640. public OnPlayerRequestSpawn(playerid)
  641. {
  642. return 1;
  643. }
  644.  
  645. public OnObjectMoved(objectid)
  646. {
  647. return 1;
  648. }
  649.  
  650. public OnPlayerObjectMoved(playerid, objectid)
  651. {
  652. return 1;
  653. }
  654.  
  655. public OnPlayerPickUpPickup(playerid, pickupid)
  656. {
  657. return 1;
  658. }
  659.  
  660. public OnVehicleMod(playerid, vehicleid, componentid)
  661. {
  662. return 1;
  663. }
  664.  
  665. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  666. {
  667. return 1;
  668. }
  669.  
  670. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  671. {
  672. return 1;
  673. }
  674.  
  675. public OnPlayerSelectedMenuRow(playerid, row)
  676. {
  677. new Menu:current;
  678. current = GetPlayerMenu(playerid);
  679. if(current == shop)
  680. {
  681. switch(row)
  682. {
  683. case 0:{
  684. if(PlayerInfo[playerid][Cash] <= 999)
  685. {
  686. SendClientMessage(playerid, GREY, "Shop: You need $1000!");
  687. return 1;
  688. }
  689. else if(PlayerInfo[playerid][Cash] >= 1000)
  690. GivePlayerWeapon(playerid, 30, 600);
  691. GivePlayerMoney(playerid, -1000);
  692.  
  693. }
  694. case 1:{
  695. if(PlayerInfo[playerid][Cash] <= 1499)
  696. {
  697. SendClientMessage(playerid, GREY, "Shop: You need $1500!");
  698. return 1;
  699. }
  700. else if(PlayerInfo[playerid][Cash] >= 1500)
  701. GivePlayerWeapon(playerid, 31, 600);
  702. GivePlayerMoney(playerid, -1500);
  703.  
  704.  
  705. }
  706. case 2:{
  707. if(PlayerInfo[playerid][Cash] <= 1499)
  708. {
  709. SendClientMessage(playerid, GREY, "Shop: You need $1500!");
  710. return 1;
  711. }
  712. else if(PlayerInfo[playerid][Cash] >= 1500)
  713. GivePlayerWeapon(playerid, 32, 50);
  714. GivePlayerMoney(playerid, -1500);
  715.  
  716.  
  717. }
  718. case 3:{
  719. if(PlayerInfo[playerid][Cash] <= 499)
  720. {
  721. SendClientMessage(playerid, GREY, "Shop: You need $500!");
  722. return 1;
  723. }
  724. else if(PlayerInfo[playerid][Cash] >=500)
  725. GivePlayerWeapon(playerid, 29, 300);
  726. GivePlayerMoney(playerid, -500);
  727.  
  728.  
  729. }
  730. case 4:{
  731. if(PlayerInfo[playerid][Cash] <= 499)
  732. {
  733. SendClientMessage(playerid, GREY, "Shop: You need $500!");
  734. return 1;
  735. }
  736. else if(PlayerInfo[playerid][Cash] >=500)
  737. GivePlayerWeapon(playerid, 25, 50);
  738. GivePlayerMoney(playerid, -500);
  739.  
  740.  
  741. }
  742. case 5:{
  743. if(PlayerInfo[playerid][Cash] <= 299)
  744. {
  745. SendClientMessage(playerid, GREY, "Shop: You need $300!");
  746. return 1;
  747. }
  748. else if(PlayerInfo[playerid][Cash] >=300)
  749. GivePlayerWeapon(playerid, 24, 200);
  750. GivePlayerMoney(playerid, -300);
  751.  
  752.  
  753. }
  754. case 6:{
  755. if(PlayerInfo[playerid][Cash] <= 1499)
  756. {
  757. SendClientMessage(playerid, GREY, "Shop: You need $1,500!");
  758. return 1;
  759. }
  760. else if(PlayerInfo[playerid][Cash] >= 1500)
  761. SetPlayerArmour(playerid, 100);
  762. GivePlayerMoney(playerid, -1500);
  763. return 1;
  764. }
  765. }
  766. }
  767. if(current == bombshop)
  768. {
  769. switch(row)
  770. {
  771. case 0:{
  772. if(PlayerInfo[playerid][Cash] <= 1999)
  773. {
  774. SendClientMessage(playerid, GREY, "Shop: You need $2000");
  775. return 1;
  776. }
  777. else if(PlayerInfo[playerid][Cash] >= 2000)
  778. GivePlayerWeapon(playerid, 35, 5);
  779. GivePlayerMoney(playerid, -2000);
  780. }
  781.  
  782.  
  783. case 1:{
  784. if(PlayerInfo[playerid][Cash] <= 899)
  785. {
  786. SendClientMessage(playerid, GREY, "Shop: You need $900");
  787. return 1;
  788. }
  789. else if(PlayerInfo[playerid][Cash] >= 900)
  790. GivePlayerWeapon(playerid, 16, 3);
  791. GivePlayerMoney(playerid, -900);
  792. }
  793.  
  794.  
  795. case 2:{
  796. if(PlayerInfo[playerid][Cash] <= 299)
  797. {
  798. SendClientMessage(playerid, GREY, "Shop: You need $300");
  799. return 1;
  800. }
  801. else if(PlayerInfo[playerid][Cash] >= 300)
  802. GivePlayerWeapon(playerid, 17, 3);
  803. GivePlayerMoney(playerid, -300);
  804. }
  805.  
  806.  
  807. case 3:{
  808. if(PlayerInfo[playerid][Cash] <= 899)
  809. {
  810. SendClientMessage(playerid, GREY, "Shop: You need $900");
  811. return 1;
  812. }
  813. else if(PlayerInfo[playerid][Cash] >= 900)
  814. GivePlayerWeapon(playerid, 39, 5);
  815. GivePlayerWeapon(playerid, 40, 5);
  816. GivePlayerMoney(playerid, -900);
  817. }
  818.  
  819.  
  820. case 4:{
  821. if(PlayerInfo[playerid][Cash] <= 899)
  822. {
  823. SendClientMessage(playerid, GREY, "Shop: You need $900");
  824. return 1;
  825. }
  826. else if(PlayerInfo[playerid][Cash] >= 900)
  827. GivePlayerWeapon(playerid, 18, 5);
  828. GivePlayerMoney(playerid, -900);
  829. }
  830.  
  831.  
  832. case 5:{
  833. if(PlayerInfo[playerid][Cash] <= 1499)
  834. {
  835. SendClientMessage(playerid, GREY, "Shop: You need $1500");
  836. return 1;
  837. }
  838. else if(PlayerInfo[playerid][Cash] >= 1500)
  839. GivePlayerWeapon(playerid, 37, 500);
  840. GivePlayerMoney(playerid, -1500);
  841. }
  842. }
  843. }
  844. return 1;
  845. }
  846.  
  847.  
  848. public OnPlayerExitedMenu(playerid)
  849. {
  850. return 1;
  851. }
  852.  
  853. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  854. {
  855. return 1;
  856. }
  857.  
  858. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  859. {
  860. return 1;
  861. }
  862.  
  863. public OnPlayerStateChange(playerid, newstate, oldstate)
  864. {
  865. return 1;
  866. }
  867.  
  868. public OnRconLoginAttempt(ip[], password[], success)
  869. {
  870. return 1;
  871. }
  872.  
  873. public OnPlayerUpdate(playerid)
  874. {
  875. return 1;
  876. }
  877.  
  878. public OnPlayerStreamIn(playerid, forplayerid)
  879. {
  880. return 1;
  881. }
  882.  
  883. public OnPlayerStreamOut(playerid, forplayerid)
  884. {
  885. return 1;
  886. }
  887.  
  888. public OnVehicleStreamIn(vehicleid, forplayerid)
  889. {
  890. return 1;
  891. }
  892.  
  893. public OnVehicleStreamOut(vehicleid, forplayerid)
  894. {
  895. return 1;
  896. }
  897.  
  898. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  899. {
  900. switch( dialogid )
  901. {
  902. case DIALOG_REGISTER:
  903. {
  904. if (!response) return Kick(playerid);
  905. if(response)
  906. {
  907. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""#COL_ORANGE":: "#COL_WHITE"Register" , "\t\t"#COL_EASY"Central Gaming "#COL_DGREEN"TDM "#COL_EASY"(V1.02a)\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");
  908. new INI:File = INI_Open(UserPath(playerid));
  909. INI_SetTag(File,"data");
  910. INI_WriteInt(File,"Password",udb_hash(inputtext));
  911. INI_WriteInt(File,"Cash",0);
  912. INI_WriteInt(File,"Kills",0);
  913. INI_WriteInt(File,"Deaths",0);
  914. INI_WriteInt(File,"Adminlevel",0);
  915. INI_WriteInt(File,"VIP",0);
  916. INI_Close(File);
  917. }
  918. }
  919.  
  920. case DIALOG_LOGIN:
  921. {
  922. if ( !response ) return Kick ( playerid );
  923. if( response )
  924. {
  925. if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
  926. {
  927. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  928. GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
  929. }
  930. else
  931. {
  932. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Login", "\t\t"#COL_EASY"Central Gaming "#COL_DGREEN"TDM "#COL_EASY"(V1.02a)\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");
  933. }
  934. return 1;
  935. }
  936. }
  937. }
  938. return 1;
  939. }
  940.  
  941. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  942. {
  943. return 1;
  944. }
  945.  
  946. //-----[LoadUser Data]-----
  947. forward LoadUser_data(playerid,name[],value[]);
  948. public LoadUser_data(playerid,name[],value[])
  949. {
  950. INI_Int("Password",PlayerInfo[playerid][Password]);
  951. INI_Int("Cash",PlayerInfo[playerid][Cash]);
  952. INI_Int("Kills",PlayerInfo[playerid][Kills]);
  953. INI_Int("Deaths",PlayerInfo[playerid][Deaths]);
  954. INI_Int("Adminlevel",PlayerInfo[playerid][Adminlevel]);
  955. INI_Int("VIP",PlayerInfo[playerid][VIP]);
  956. return 1;
  957. }
  958.  
  959. //-----[Userpatch]-----
  960. stock UserPath(playerid)
  961. {
  962. new string[128],playername[MAX_PLAYER_NAME];
  963. GetPlayerName(playerid,playername,sizeof(playername));
  964. format(string,sizeof(string),PATH,playername);
  965. return string;
  966. }
  967.  
  968. //-----[Hash function. Thanxx to Dracoblue]-----
  969. stock udb_hash(buf[]) {
  970. new length=strlen(buf);
  971. new s1 = 1;
  972. new s2 = 0;
  973. new n;
  974. for (n=0; n<length; n++)
  975. {
  976. s1 = (s1 + buf[n]) % 65521;
  977. s2 = (s2 + s1) % 65521;
  978. }
  979. return (s2 << 16) + s1;
  980. }
  981.  
  982. //-----[INV Explosion]-----
  983. forward Explosion(targetid, adminid);
  984. public Explosion(targetid, adminid) {
  985. if(checkinv == 1)
  986. {
  987. new Float:health;
  988. GetPlayerHealth(targetid,health);
  989. if(health == 100)
  990. {
  991. SendClientMessage(targetid,COLOR_RED,"Invulnerability check result : [POSITIVE]");
  992. checkinv = 0;
  993. }
  994. else if(health != 100)
  995. {
  996. SendClientMessage(targetid,COLOR_YELLOW,"Invulnerability check result : [NEGATIVE]");
  997. checkinv = 0;
  998. }
  999. }
  1000. return 1;
  1001. }
  1002.  
  1003. //-----[Callbacks]-----
  1004. public IRC_OnConnect(botid, ip[], port)
  1005. {
  1006. printf("*** IRC_OnConnect: Bot ID %d connected to %s:%d", botid, ip, port);
  1007. IRC_JoinChannel(botid, IRC_CHANNEL);
  1008. IRC_AddToGroup(gGroupID, botid);
  1009. return 1;
  1010. }
  1011.  
  1012. public IRC_OnDisconnect(botid, ip[], port, reason[])
  1013. {
  1014. printf("*** IRC_OnDisconnect: Bot ID %d disconnected from %s:%d (%s)", botid, ip, port, reason);
  1015. IRC_RemoveFromGroup(gGroupID, botid);
  1016. return 1;
  1017. }
  1018.  
  1019. public IRC_OnConnectAttempt(botid, ip[], port)
  1020. {
  1021. printf("*** IRC_OnConnectAttempt: Bot ID %d attempting to connect to %s:%d...", botid, ip, port);
  1022. return 1;
  1023. }
  1024.  
  1025. public IRC_OnConnectAttemptFail(botid, ip[], port, reason[])
  1026. {
  1027. printf("*** IRC_OnConnectAttemptFail: Bot ID %d failed to connect to %s:%d (%s)", botid, ip, port, reason);
  1028. return 1;
  1029. }
  1030.  
  1031. public IRC_OnReceiveRaw(botid, message[])
  1032. {
  1033. new File:file;
  1034. if (!fexist("irc_log.txt"))
  1035. {
  1036. file = fopen("irc_log.txt", io_write);
  1037. }
  1038. else
  1039. {
  1040. file = fopen("irc_log.txt", io_append);
  1041. }
  1042. if (file)
  1043. {
  1044. fwrite(file, message);
  1045. fwrite(file, "\r\n");
  1046. fclose(file);
  1047. }
  1048. return 1;
  1049. }
  1050.  
  1051. //-----[Unfreeze LMS]-----
  1052. //-----[Unfreezeplayer]-----
  1053. forward UnfreezeLMS(playerid);
  1054. public UnfreezeLMS(playerid)
  1055. {
  1056. foreach(Player, i)
  1057. {
  1058. if(pInEvent[i] == 1)
  1059. {
  1060. if(g_EventOpen == 1)
  1061. {
  1062. TogglePlayerControllable(i, 1);
  1063. GameTextForPlayer(i, "~r~Be the Last Man Standing!", 2000, 3);
  1064. }
  1065. }
  1066. }
  1067. return 1;
  1068. }
  1069.  
  1070.  
  1071. // .:-----------------------------------------------------------------------:.
  1072. // .:=======================================================================:.
  1073. // { This is the start of ZCMD commands. }
  1074. // { Date: 24/08/11 using ZCMD and SSCANF }
  1075. // { Last Updated: 25/08/11 By: Kingunit }
  1076. //
  1077. // .:-----------------------------------------------------------------------:.
  1078. // .:=======================================================================:.
  1079.  
  1080. //-----[Commands]-----
  1081. CMD:hack(playerid, params[])
  1082. {
  1083. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1084. if(checkinv == 1)
  1085. {
  1086. new Float:health;
  1087. new targetid = GetPlayerHealth(targetid, health);
  1088. if(health == 100)
  1089. {
  1090. SendClientMessage(playerid,COLOR_RED,"Hack result = Positive; This player is hacking.");
  1091. checkinv = 1;
  1092. }
  1093. else if(health != 100)
  1094. {
  1095. SendClientMessage(playerid,COLOR_YELLOW,"Hack result = Negative; This player is not hacking.");
  1096. checkinv = 0;
  1097. }
  1098. }
  1099. return 1;
  1100. }
  1101.  
  1102. CMD:savepos(playerid, params[])
  1103. {
  1104. new Float:X, Float:Z, Float:Y, Float:A;
  1105. GetPlayerPos(playerid, X, Y, Z);
  1106. GetPlayerFacingAngle(playerid, A);
  1107. new File:pos=fopen("OnFootPos.txt", io_append);
  1108. new string[128];
  1109. format(string, sizeof(string), "(%f, %f, %f, %f);\r\n", X, Y, Z, A);
  1110. SendClientMessage(playerid,COLOR_GREY,"OnFootPosition saved to OnFootPos.txt !");
  1111. fwrite(pos, string);
  1112. fclose(pos);
  1113. return 1;
  1114. }
  1115.  
  1116. CMD:savecampos(playerid, params[])
  1117. {
  1118. new Float:X, Float:Z, Float:Y;
  1119. GetPlayerCameraPos(playerid, X, Y, Z);
  1120. new File:pos=fopen("CameraPos.txt", io_append);
  1121. new string[128];
  1122. format(string, sizeof(string), "(%f, %f, %f);\r\n", X, Y, Z);
  1123. SendClientMessage(playerid,COLOR_GREY,"CameraPos saved to CameraPos.txt !");
  1124. fwrite(pos, string);
  1125. fclose(pos);
  1126. return 1;
  1127. }
  1128.  
  1129. CMD:commands(playerid, params[])
  1130. {
  1131. SendClientMessage(playerid,COLOR_WHITE, ".:: Commands ::.");
  1132. SendClientMessage(playerid,COLOR_WHITE, "/pm - /rules - /kill");
  1133. return 1;
  1134. }
  1135.  
  1136. //-----[Rules]-----
  1137. CMD:rules(playerid, params[])
  1138. {
  1139. SendClientMessage(playerid,COLOR_WHITE, ".:: Server Rules::.");
  1140. SendClientMessage(playerid,COLOR_WHITE, "Do not use hack programs.");
  1141. SendClientMessage(playerid,COLOR_WHITE, "Do not ask for a Administrator rank.");
  1142. SendClientMessage(playerid,COLOR_WHITE, "Do not drive by whilst driving.");
  1143. return 1;
  1144. }
  1145.  
  1146. //-----[Kill]-----
  1147. CMD:kill(playerid, params[])
  1148. {
  1149. SetPlayerHealth(playerid, 0.0);
  1150. SendClientMessage(playerid, COLOR_RED, ""#COL_LGREEN"[INFO]"#COL_SBLUE" You committed a suicide!");
  1151. return 1;
  1152. }
  1153.  
  1154. //-----[PM]-----
  1155. COMMAND:pm(playerid, params[])
  1156. {
  1157. new str[128],id,pname[MAX_PLAYER_NAME], Message[128];
  1158. if(sscanf(params, "us[128]", id, Message))SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName] [Message]");
  1159. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1160. else
  1161. {
  1162. GetPlayerName(id, str, 24);
  1163. format(str, sizeof(str), "PM To %s(%d): %s", str, id, Message);
  1164. GetPlayerName(id, str, 24);
  1165. format(str, sizeof(str), "PM To %s(%d): %s", str, id, Message);
  1166. SendClientMessage(playerid, COLOR_RED, str);
  1167. GetPlayerName(playerid, pname, sizeof(pname));
  1168. format(str, sizeof(str), "PM From %s(%d): %s", pname, playerid, Message);
  1169. SendClientMessage(id, COLOR_RED, str);
  1170. }
  1171. return 1;
  1172. }
  1173.  
  1174. //-----[Adminhelp]-----
  1175. CMD:ah(playerid, params[])
  1176. {
  1177. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1178. SendClientMessage(playerid,COLOR_WHITE, ""#COL_DGREEN"===============[ "#COL_WHITE"Administrator Commands"#COL_DGREEN" ]===============");
  1179. SendClientMessage(playerid,COLOR_WHITE, ""#COL_ORANGE"> "#COL_DGREEN"General note:"#COL_WHITE" This are the Administrator commands.");
  1180. SendClientMessage(playerid,COLOR_WHITE, ""#COL_ORANGE"> "#COL_DGREEN"Administrator (1):"#COL_WHITE" /kick - /ban - /slap - /explode - /apm - /inv - /gmx - /freeze - /freezeall");
  1181. SendClientMessage(playerid,COLOR_WHITE, ""#COL_ORANGE"> "#COL_DGREEN"Administrator (1):"#COL_WHITE" /adminduty - /jetpack - /goto - /gethere - /respawn");
  1182. return 1;
  1183. }
  1184.  
  1185. //-----[AdminChat]----
  1186. CMD:ac(playerid, params[])
  1187. {
  1188. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED," You are not authorized to use this command!");
  1189. if(!isnull(params))
  1190. {
  1191. new string[128],id;
  1192. GetPlayerName(id, string, 24);
  1193. format(string, sizeof(string), "Administrator %s(%d): %s", string, id, params);
  1194. ABroadCast(COLOR_YELLOW, string, 1);
  1195. }
  1196. return 1;
  1197. }
  1198.  
  1199. CMD:report(playerid, params[])
  1200. {
  1201. new targetid;
  1202. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "/report <playerid> <reason>");
  1203. if(!isnull(params))
  1204. {
  1205. new string[128];
  1206. new pName[24];
  1207. new pTame[24];
  1208. GetPlayerName(playerid, pName, 24);
  1209. GetPlayerName(targetid, pTame, 24);
  1210. format(string, sizeof(string), "%s has reported %s for %s", pName,pTame,params);
  1211. ABroadCast(COLOR_YELLOW, string, 1);
  1212. }
  1213. return 1;
  1214. }
  1215.  
  1216. CMD:t(playerid, params[])
  1217. {
  1218. foreach(Player, i)
  1219. {
  1220. if(gTeam[i] == gTeam[playerid])
  1221. {
  1222. new string[128], pName[24];
  1223. GetPlayerName(playerid,pName,24);
  1224. format(string,sizeof(string),"TEAM CHAT: %s says: %s",pName,params);
  1225. SendClientMessage(i, YELLOW, string);
  1226. }
  1227. }
  1228. return 1;
  1229. }
  1230.  
  1231. CMD:slap(playerid, params[])
  1232. {
  1233. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1234. new targetid;
  1235. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName]");
  1236. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1237. else
  1238. {
  1239. new Float:SLX, Float:SLY, Float:SLZ;
  1240. GetPlayerPos(targetid, SLX, SLY, SLZ);
  1241. SetPlayerPos(targetid, SLX, SLY, SLZ+5);
  1242. PlayerPlaySound(targetid, 1130, SLX, SLY, SLZ+5);
  1243. new string[128];
  1244. new pName[24];
  1245. new pTame[24];
  1246. GetPlayerName(playerid,pName,24);
  1247. GetPlayerName(targetid,pTame,24);
  1248. format(string,sizeof string,""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been slapped by Administrator %s.",pTame,pName);
  1249. SendClientMessageToAll(COLOR_RED, string);
  1250. }
  1251. return 1;
  1252. }
  1253.  
  1254. //-----[Adminhelp]-----
  1255. CMD:kick(playerid, params[])
  1256. {
  1257. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1258. new targetid, reason[64], string[128];
  1259. if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName] [Reason]");
  1260. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1261. {
  1262. new pTargetName[24], pName[24];
  1263. GetPlayerName(playerid,pName,24);
  1264. GetPlayerName(targetid,pTargetName,24);
  1265. format(string, sizeof(string), ""#COL_ORANGE"[SERVER]"#COL_LRED" Admin %s has kicked %s: %s", pName, pTargetName, reason);
  1266. SendClientMessageToAll(COLOR_RED,string);
  1267. Kick(targetid);
  1268. }
  1269. return 1;
  1270. }
  1271.  
  1272. //-----[Server GMX]-----
  1273. CMD:gmx(playerid, params[])
  1274. {
  1275. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1276. {
  1277. new string[256];
  1278. new pName[24];
  1279. GetPlayerName(playerid,pName,24);
  1280. format(string,sizeof string,""#COL_ORANGE"[SERVER]"#COL_LRED" Administrator %s has created a server restart.",pName);
  1281.  
  1282. new INI:File = INI_Open(UserPath(playerid));
  1283. INI_SetTag(File,"data");
  1284. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  1285. INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
  1286. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
  1287. INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
  1288. INI_Close(File);
  1289.  
  1290. SendClientMessageToAll(COLOR_RED, string);
  1291. GameTextForAll("Server Restarting",3000,0);
  1292. SetTimer("Gmx",3000,false);
  1293. SendRconCommand("gmx");
  1294. }
  1295. return 1;
  1296. }
  1297.  
  1298. //-----[Ban]-----
  1299. CMD:ban(playerid, params[])
  1300. {
  1301. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1302. new targetid, reason[64], string[128];
  1303. if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName] [Reason]");
  1304. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1305. {
  1306. new pTargetName[24], pName[24];
  1307. GetPlayerName(playerid,pName,24);
  1308. GetPlayerName(targetid,pTargetName,24);
  1309. format(string, sizeof(string), ""#COL_ORANGE"[SERVER]"#COL_LRED" Admin %s has IP banned %s: %s", pName, pTargetName, reason);
  1310. SendClientMessageToAll(COLOR_RED,string);
  1311. Ban(targetid);
  1312. }
  1313. return 1;
  1314. }
  1315. //-----[Shop]-----
  1316. CMD:shop(playerid, params[])
  1317. {
  1318. ShowMenuForPlayer(shop, playerid);
  1319. return 1;
  1320. }
  1321.  
  1322. CMD:bombshop(playerid, params[])
  1323. {
  1324. if(PlayerInfo[playerid][VIP] < 1) return SendClientMessage(playerid, COLOR_RED, "You need to be a VIP member to use this command!");
  1325. {
  1326. ShowMenuForPlayer(bombshop, playerid);
  1327. return 1;
  1328. }
  1329. }
  1330. //----[Explode]-----
  1331. CMD:explode(playerid, params[])
  1332. {
  1333. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1334. new targetid;
  1335. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName]");
  1336. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1337. else
  1338. {
  1339. new Float:SLX, Float:SLY, Float:SLZ;
  1340. GetPlayerPos(targetid, SLX, SLY,SLZ);
  1341. CreateExplosion(SLX, SLY, SLZ, 11, 0.25);
  1342. new string[128];
  1343. new pName[24], pTame[24];
  1344. GetPlayerName(playerid,pName,24);
  1345. GetPlayerName(targetid,pTame,24);
  1346. GivePlayerMoney(playerid, 150);
  1347. format(string,sizeof string,""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been exploded by an Administrator and you will be refunded.",pTame);
  1348. SendClientMessageToAll(COLOR_RED, string);
  1349. }
  1350. return 1;
  1351. }
  1352.  
  1353. //-----[Admin PM]-----
  1354. COMMAND:apm(playerid, params[])
  1355. {
  1356. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1357. new str[128],id,pname[MAX_PLAYER_NAME], Message[128];
  1358. if(sscanf(params, "us[128]", id, Message))SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName] [Message]");
  1359. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1360. else
  1361. {
  1362. GetPlayerName(id, str, 24);
  1363. format(str, sizeof(str), "[ADMIN] %s(%d): %s", str, id, Message);
  1364. GetPlayerName(id, str, 24);
  1365. format(str, sizeof(str), "[ADMIN] %s(%d): %s", str, id, Message);
  1366. SendClientMessage(playerid, COLOR_YELLOW, str);
  1367. GetPlayerName(playerid, pname, sizeof(pname));
  1368. format(str, sizeof(str), "[ADMIN] %s(%d): %s", pname, playerid, Message);
  1369. SendClientMessage(id, COLOR_YELLOW, str);
  1370. }
  1371. return 1;
  1372. }
  1373.  
  1374. //-----[Make admin]-----
  1375. COMMAND:makeadmin(playerid, params[])
  1376. {
  1377. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1378. new id, lvl;
  1379. if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName] [Level]");
  1380. else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
  1381. else if(lvl > 1) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ADMIN]"#COL_LRED" Administrator level cannot be higher then 1!");
  1382. else
  1383. {
  1384. PlayerInfo[id][Adminlevel] = lvl;
  1385. }
  1386. return 1;
  1387. }
  1388.  
  1389. //-----[Freeze]-----
  1390. CMD:freeze(playerid, params[])
  1391. {
  1392. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1393. new targetid, string[128];
  1394. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName]");
  1395. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1396. new pTargetName[24], pName[24];
  1397. GetPlayerName(playerid,pName,24);
  1398. GetPlayerName(targetid,pTargetName,24);
  1399. format(string, sizeof(string), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been frozen by Administrator %s.",pTargetName, pName);
  1400. SendClientMessageToAll(COLOR_RED,string);
  1401. TogglePlayerControllable(targetid, 0);
  1402. return 1;
  1403. }
  1404.  
  1405. //-----[Unfreeze]-----
  1406. CMD:unfreeze(playerid, params[])
  1407. {
  1408. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1409. new targetid, string[128];
  1410. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName]");
  1411. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1412. new pTargetName[24], pName[24];
  1413. GetPlayerName(playerid,pName,24);
  1414. GetPlayerName(targetid,pTargetName,24);
  1415. format(string, sizeof(string), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been unfrozen by Administrator %s.",pTargetName, pName);
  1416. SendClientMessageToAll(COLOR_RED,string);
  1417. TogglePlayerControllable(targetid, 1);
  1418. return 1;
  1419. }
  1420. //-----[Adminduty]-----
  1421. CMD:adminduty(playerid, params[])
  1422. {
  1423. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1424. if( AdminDuty[ playerid ] == 0 )
  1425. {
  1426. AdminDuty[ playerid ] = 1;
  1427. Admin[ playerid ] = Create3DTextLabel("ADMIN DUTY",0x5CD6CAFF,30.0,40.0,50.0,10.0,0);
  1428. Attach3DTextLabelToPlayer( Admin[ playerid ], playerid, 0.0, 0.0, 0.3);
  1429. SetPlayerHealth(playerid, 100000);
  1430. SetPlayerArmour(playerid, 100000);
  1431. new string[128];
  1432. new pName[24], pTame[24];
  1433. GetPlayerName(playerid,pName,24);
  1434. format(string,sizeof string,""#COL_LRED" Administrator %s is on Admin Duty.",pName,pTame);
  1435. ABroadCast(COLOR_WHITE, string, 1);
  1436. }
  1437. else
  1438. {
  1439. AdminDuty[ playerid ] = 0;
  1440. Delete3DTextLabel( Admin[ playerid ] );
  1441. SetPlayerHealth(playerid, 100);
  1442. SetPlayerArmour(playerid, 0);
  1443. new string[128];
  1444. new pName[24], pTame[24];
  1445. GetPlayerName(playerid,pName,24);
  1446. format(string,sizeof string,""#COL_LRED" Administrator %s is off Admin Duty.",pName,pTame);
  1447. ABroadCast(COLOR_WHITE, string, 1);
  1448. }
  1449. return 1;
  1450. }
  1451.  
  1452. //-----[Freeze All]-----
  1453. CMD:freezeall(playerid, params[])
  1454. {
  1455. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1456. new string[128];
  1457. new pName[24], pTame[24];
  1458. GetPlayerName(playerid,pName,24);
  1459. format(string,sizeof string,""#COL_ORANGE"[SERVER]"#COL_LRED" Administrator %s has frozen everyone.",pName,pTame);
  1460. SendClientMessageToAll(COLOR_RED, string);
  1461. for(new i=0; i<MAX_PLAYERS; i++)
  1462. {
  1463. if(IsPlayerConnected(i))
  1464. {
  1465. TogglePlayerControllable(i,0);
  1466. }
  1467. }
  1468. return 1;
  1469. }
  1470.  
  1471. //-----[Unfreeze All]-----
  1472. CMD:unfreezeall(playerid, params[])
  1473. {
  1474. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1475. new string[128];
  1476. new pName[24], pTame[24];
  1477. GetPlayerName(playerid,pName,24);
  1478. format(string,sizeof string,""#COL_ORANGE"[SERVER]"#COL_LRED" Administrator %s has unfrozen everyone.",pName,pTame);
  1479. SendClientMessageToAll(COLOR_RED, string);
  1480. for(new i=0; i<MAX_PLAYERS; i++)
  1481. {
  1482. if(IsPlayerConnected(i))
  1483. {
  1484. TogglePlayerControllable(i,1);
  1485. }
  1486. }
  1487. return 1;
  1488. }
  1489. //-----[Goto]-----
  1490. CMD:goto(playerid, params[])
  1491. {
  1492. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1493. new targetid, string[128];
  1494. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName]");
  1495. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1496. else
  1497. {
  1498. new pName[24];
  1499. GetPlayerName(targetid,pName,128);
  1500. format(string, sizeof(string), ""#COL_ORANGE"[ADMIN]"#COL_LRED" You succesfully teleported to [%d] %s.",targetid, pName);
  1501. SendClientMessage(playerid,COLOR_RED,string);
  1502. SetPlayerInterior(playerid,GetPlayerInterior(targetid));
  1503. new Float:TPX, Float:TPY, Float:TPZ;
  1504. GetPlayerPos(targetid, TPX, TPY, TPZ);
  1505. SetPlayerPos(playerid, TPX, TPY, TPZ+1);
  1506. }
  1507. return 1;
  1508. }
  1509.  
  1510. //-----[Respawn]-----
  1511. CMD:respawn(playerid, params[])
  1512. {
  1513. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1514. new targetid;
  1515. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName]");
  1516. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1517. else
  1518. {
  1519. new string[128];
  1520. new pName[24], pTame[24];
  1521. GetPlayerName(playerid,pName,24);
  1522. GetPlayerName(targetid,pTame,24);
  1523. format(string,sizeof string,""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been respawned by Administrator %s.",pTame,pName);
  1524. SendClientMessageToAll(COLOR_RED, string);
  1525. SpawnPlayer(targetid);
  1526. }
  1527. return 1;
  1528. }
  1529.  
  1530. //-----[Gethere]-----
  1531. CMD:gethere(playerid, params[])
  1532. {
  1533. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1534. new targetid, string[128];
  1535. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName]");
  1536. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
  1537. else
  1538. {
  1539. new pName[24];
  1540. GetPlayerName(playerid,pName,128);
  1541. format(string, sizeof(string), ""#COL_ORANGE"[ADMIN]"#COL_LRED" You have been teleported to Administrator %s.",pName);
  1542. SendClientMessage(targetid,COLOR_RED,string);
  1543. SetPlayerInterior(targetid,GetPlayerInterior(playerid));
  1544. new Float:TPX, Float:TPY, Float:TPZ;
  1545. GetPlayerPos(playerid, TPX, TPY, TPZ);
  1546. SetPlayerPos(targetid, TPX, TPY, TPZ+1);
  1547. }
  1548. return 1;
  1549. }
  1550.  
  1551. CMD:jetpack(playerid, params[])
  1552. {
  1553. if(IsPlayerConnected(playerid))
  1554. {
  1555. if(PlayerInfo[playerid][Adminlevel] < 1)
  1556. {
  1557. SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1558. return 1;
  1559. }
  1560. if(!IsPlayerInAnyVehicle(playerid))
  1561. {
  1562. SetPlayerSpecialAction(playerid, 2);
  1563. SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ADMIN]"#COL_LRED" Jetpack spawned. Dont forget to remove it with /removejet.");
  1564. }
  1565. }
  1566. return 1;
  1567. }
  1568. //-----[Remove Jetpack]-----
  1569. CMD:removejet(playerid, params[])
  1570. {
  1571. if(IsPlayerConnected(playerid))
  1572. {
  1573. if(PlayerInfo[playerid][Adminlevel] < 1)
  1574. {
  1575. SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
  1576. return 1;
  1577. }
  1578. if(!IsPlayerInAnyVehicle(playerid))
  1579. {
  1580. SetPlayerSpecialAction(playerid, 0);
  1581. SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ADMIN]"#COL_LRED" Your jetpack has been removed.");
  1582. }
  1583. }
  1584. return 1;
  1585. }
  1586. //-----[Create LMS]-----
  1587. CMD:createlms(playerid, params[]) {
  1588. new
  1589. WeaponID,
  1590. RewardAmount,
  1591. string[128],
  1592. player_Name[MAX_PLAYER_NAME];
  1593.  
  1594. if(PlayerInfo[playerid][Adminlevel] > 2) {
  1595.  
  1596. if(sscanf(params, "ii", WeaponID, RewardAmount))
  1597. return SendClientMessage(playerid, -1, ""#COL_DGREY"[CMD] / "#COL_SGREY"[WeaponID] [Reward]");
  1598.  
  1599. GetPlayerPos(playerid, g_EventPosition[0], g_EventPosition[1], g_EventPosition[2]);
  1600. GetPlayerFacingAngle(playerid, g_EventPosition[3]);
  1601.  
  1602. g_EventWeapon = WeaponID;
  1603. g_EventReward = RewardAmount;
  1604. 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);
  1605. SendClientMessageToAll(-1, string);
  1606.  
  1607. SetTimerEx("UnfreezeLMS", 20000, false, "i", playerid);
  1608.  
  1609. g_EventOpen = 1;
  1610. g_EventPlayers = 0;
  1611.  
  1612. }
  1613. else return SendClientMessage(playerid, COLOR_RED, ".:: You are not authorized to use this command ::.");
  1614. return true;
  1615.  
  1616. }
  1617.  
  1618. //-----[Join LMS]-----
  1619. CMD:join(playerid, params[]) {
  1620. #pragma unused params
  1621. if(pInEvent[playerid] == 0) {
  1622. if(g_EventOpen == 1) {
  1623.  
  1624. SetPlayerPos(playerid, g_EventPosition[0], g_EventPosition[1], g_EventPosition[2]);
  1625. SetPlayerFacingAngle(playerid, g_EventPosition[3]);
  1626.  
  1627. ResetPlayerWeapons(playerid);
  1628. GivePlayerWeapon(playerid, g_EventWeapon, 100000);
  1629.  
  1630. GameTextForPlayer(playerid, "~g~Joined event~n~~w~Please wait..", 3000, 3);
  1631.  
  1632. TogglePlayerControllable(playerid, 0);
  1633.  
  1634. g_EventPlayers++;
  1635. pInEvent[playerid] = 1; //Now in the event!
  1636.  
  1637. }
  1638. else return SendClientMessage(playerid, COLOR_RED, ".:: No event is going on ::.");
  1639.  
  1640. }
  1641. else return SendClientMessage(playerid, COLOR_RED, ".:: You're already in the event ::.");
  1642.  
  1643. return true;
  1644.  
  1645. }
  1646.  
  1647. // .:-----------------------------------------------------------------------:.
  1648. // .:=======================================================================:.
  1649. // { This is the start of IRC commands. }
  1650. // { Date: 09/09/11 using IRC plugin }
  1651. // { Last Updated: 10/09/11 By: Kingunit }
  1652. //
  1653. // .:-----------------------------------------------------------------------:.
  1654. // .:=======================================================================:.
  1655.  
  1656. //-----[IRC Kick]-----
  1657. IRCCMD:kick(botid, channel[], user[], host[], params[])
  1658. {
  1659. if (IRC_IsOp(botid, channel, user))
  1660. {
  1661. new playerid, reason[64];
  1662. if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  1663. {
  1664. return 1;
  1665. }
  1666. if (IsPlayerConnected(playerid))
  1667. {
  1668. new msg[128], name[MAX_PLAYER_NAME];
  1669. GetPlayerName(playerid, name, sizeof(name));
  1670. format(msg, sizeof(msg), "02*** %s has been kicked by %s on IRC. (%s)", name, user, reason);
  1671. IRC_GroupSay(gGroupID, channel, msg);
  1672. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been kicked by IRC Admin %s: %s", name, user, reason);
  1673. SendClientMessageToAll(0x0000FFFF, msg);
  1674.  
  1675. Kick(playerid);
  1676. }
  1677. }
  1678. return 1;
  1679. }
  1680.  
  1681. //-----[IRC Ban]-----
  1682. IRCCMD:ban(botid, channel[], user[], host[], params[])
  1683. {
  1684. if (IRC_IsOp(botid, channel, user))
  1685. {
  1686. new playerid, reason[64];
  1687. if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  1688. {
  1689. return 1;
  1690. }
  1691. if (IsPlayerConnected(playerid))
  1692. {
  1693. new msg[128], name[MAX_PLAYER_NAME];
  1694. GetPlayerName(playerid, name, sizeof(name));
  1695. format(msg, sizeof(msg), "02*** %s has been banned by %s on IRC. (%s)", name, user, reason);
  1696. IRC_GroupSay(gGroupID, channel, msg);
  1697. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been banned by IRC Admin %s: %s", name, user, reason);
  1698. SendClientMessageToAll(0x0000FFFF, msg);
  1699.  
  1700. BanEx(playerid, reason);
  1701. }
  1702. }
  1703. return 1;
  1704. }
  1705.  
  1706. //-----[IRC RCON]-----
  1707. IRCCMD:rcon(botid, channel[], user[], host[], params[])
  1708. {
  1709. if (IRC_IsOp(botid, channel, user))
  1710. {
  1711. if (!isnull(params))
  1712. {
  1713. if (strcmp(params, "exit", true) != 0 && strfind(params, "loadfs irc", true) == -1)
  1714. {
  1715. new msg[128];
  1716. format(msg, sizeof(msg), "RCON command %s has been executed.", params);
  1717. IRC_GroupSay(gGroupID, channel, msg);
  1718.  
  1719. SendRconCommand(params);
  1720. }
  1721. }
  1722. }
  1723. return 1;
  1724. }
  1725.  
  1726. //-----[IRC Slap]-----
  1727. IRCCMD:slap(botid, channel[], user[], host[], params[])
  1728. {
  1729. if (IRC_IsHalfop(botid, channel, user))
  1730. {
  1731. new playerid;
  1732. if (IsPlayerConnected(playerid))
  1733. {
  1734. new Float:SLX, Float:SLY, Float:SLZ;
  1735. GetPlayerPos(playerid, SLX, SLY,SLZ);
  1736. SetPlayerPos(playerid, SLX, SLY, SLZ+5);
  1737.  
  1738. new msg[128], name[MAX_PLAYER_NAME];
  1739. GetPlayerName(playerid, name, sizeof(name));
  1740.  
  1741. format(msg, sizeof(msg), "02*** %s has been slapped by IRC Admin %s", name, user);
  1742. IRC_GroupSay(gGroupID, channel, msg);
  1743. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been slapped by IRC Admin %s", name, user);
  1744. SendClientMessageToAll(0x0000FFFF, msg);
  1745. }
  1746. }
  1747. return 1;
  1748. }
  1749.  
  1750. //-----[IRC Explode]-----
  1751. IRCCMD:explode(botid, channel[], user[], host[], params[])
  1752. {
  1753. if (IRC_IsHalfop(botid, channel, user))
  1754. {
  1755. new playerid;
  1756. if (IsPlayerConnected(playerid))
  1757. {
  1758. new Float:SLX, Float:SLY, Float:SLZ;
  1759. GetPlayerPos(playerid, SLX, SLY,SLZ);
  1760. CreateExplosion(SLX, SLY, SLZ, 11, 0.25);
  1761.  
  1762. new msg[128], name[MAX_PLAYER_NAME];
  1763. GetPlayerName(playerid, name, sizeof(name));
  1764.  
  1765. format(msg, sizeof(msg), "02*** %s has been exploded by IRC Admin %s", name, user);
  1766. IRC_GroupSay(gGroupID, channel, msg);
  1767. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been exploded by IRC Admin %s", name, user);
  1768. SendClientMessageToAll(0x0000FFFF, msg);
  1769. }
  1770. }
  1771. return 1;
  1772. }
  1773.  
  1774. //-----[IRC Armup]-----
  1775. IRCCMD:armup(botid, channel[], user[], host[], params[])
  1776. {
  1777. if (IRC_IsHalfop(botid, channel, user))
  1778. {
  1779. new playerid;
  1780. if (IsPlayerConnected(playerid))
  1781. {
  1782. new msg[128], name[MAX_PLAYER_NAME];
  1783. GetPlayerName(playerid, name, sizeof(name));
  1784.  
  1785. SetPlayerHealth(playerid, 100);
  1786. SetPlayerArmour(playerid, 100.0);
  1787. GivePlayerWeapon(playerid, 24, 500);
  1788. GivePlayerWeapon(playerid, 27, 500);
  1789. GivePlayerWeapon(playerid, 31, 500);
  1790. GivePlayerWeapon(playerid, 1, 1);
  1791.  
  1792. format(msg, sizeof(msg), "02*** %s has been armed by IRC Admin %s", name, user);
  1793. IRC_GroupSay(gGroupID, channel, msg);
  1794. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been armed by IRC Admin %s", name, user);
  1795. SendClientMessageToAll(0x0000FFFF, msg);
  1796. }
  1797. }
  1798. return 1;
  1799. }
  1800.  
  1801. //-----[IRC Respawn]-----
  1802. IRCCMD:respawn(botid, channel[], user[], host[], params[])
  1803. {
  1804. if (IRC_IsHalfop(botid, channel, user))
  1805. {
  1806. new playerid;
  1807. if (IsPlayerConnected(playerid))
  1808. {
  1809. new msg[128], name[MAX_PLAYER_NAME];
  1810. GetPlayerName(playerid, name, sizeof(name));
  1811.  
  1812. format(msg, sizeof(msg), "02*** %s has been respawned by IRC Admin %s", name, user);
  1813. IRC_GroupSay(gGroupID, channel, msg);
  1814. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been respawned by IRC Admin %s", name, user);
  1815. SendClientMessageToAll(0x0000FFFF, msg);
  1816.  
  1817. SpawnPlayer(playerid);
  1818. }
  1819. }
  1820. return 1;
  1821. }
  1822.  
  1823. //-----[IRC Freeze]-----
  1824. IRCCMD:freeze(botid, channel[], user[], host[], params[])
  1825. {
  1826. if (IRC_IsHalfop(botid, channel, user))
  1827. {
  1828. new playerid;
  1829. if (IsPlayerConnected(playerid))
  1830. {
  1831. new msg[128], name[MAX_PLAYER_NAME];
  1832. GetPlayerName(playerid, name, sizeof(name));
  1833.  
  1834. format(msg, sizeof(msg), "02*** %s has been frozen by IRC Admin %s", name, user);
  1835. IRC_GroupSay(gGroupID, channel, msg);
  1836. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been frozen by IRC Admin %s", name, user);
  1837. SendClientMessageToAll(0x0000FFFF, msg);
  1838.  
  1839. TogglePlayerControllable(playerid, 0);
  1840. }
  1841. }
  1842. return 1;
  1843. }
  1844.  
  1845. //-----[IRC Unfreeze]-----
  1846. IRCCMD:unfreeze(botid, channel[], user[], host[], params[])
  1847. {
  1848. if (IRC_IsHalfop(botid, channel, user))
  1849. {
  1850. new playerid;
  1851. if (IsPlayerConnected(playerid))
  1852. {
  1853. new msg[128], name[MAX_PLAYER_NAME];
  1854. GetPlayerName(playerid, name, sizeof(name));
  1855.  
  1856. format(msg, sizeof(msg), "02*** %s has been unfrozen by IRC Admin %s", name, user);
  1857. IRC_GroupSay(gGroupID, channel, msg);
  1858. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been unfrozen by IRC Admin %s", name, user);
  1859. SendClientMessageToAll(0x0000FFFF, msg);
  1860.  
  1861. TogglePlayerControllable(playerid, 1);
  1862. }
  1863. }
  1864. return 1;
  1865. }
  1866.  
  1867. //-----[IRC Freezeall]-----
  1868. IRCCMD:freezeall(botid, channel[], user[], host[], params[])
  1869. {
  1870. if (IRC_IsOp(botid, channel, user))
  1871. {
  1872. new playerid;
  1873. if (IsPlayerConnected(playerid))
  1874. {
  1875. new msg[128], name[MAX_PLAYER_NAME];
  1876. GetPlayerName(playerid, name, sizeof(name));
  1877.  
  1878. format(msg, sizeof(msg), "02*** All players are frozen by IRC Admin %s", user);
  1879. IRC_GroupSay(gGroupID, channel, msg);
  1880.  
  1881. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" All players are frozen by IRC Admin %s", user);
  1882. SendClientMessageToAll(0x0000FFFF, msg);
  1883.  
  1884. for(new i=0; i<MAX_PLAYERS; i++)
  1885. {
  1886. if(IsPlayerConnected(i))
  1887. {
  1888. TogglePlayerControllable(i,0);
  1889. }
  1890. }
  1891. }
  1892. }
  1893. return 1;
  1894. }
Advertisement
Add Comment
Please, Sign In to add comment