Joron

Untitled

Mar 23rd, 2016
673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 56.63 KB | None | 0 0
  1. /*
  2. LOS SANTOS STREET WARS[UPDATE V1.2]
  3.  
  4. New:
  5. Added Rcon Login Protection *
  6. Added IP Notification for Admins *
  7. Added Girls Team *
  8. Added More Weapons On Spawn *
  9. Added TextDraws while requestingClass *
  10. Added New Animations *
  11. Added /Afk,/back *
  12. Added FPS Per Player And Admin View (Admin 1+ Can See Ip's)*
  13. Added New Clothes*
  14.  
  15. */
  16. //==============================================================================
  17. //INCLUDES
  18. #include <a_samp>
  19. #include <YSI\y_ini>
  20. #include <streamer>
  21. #include <sscanf2>
  22. #include <zcmd>
  23. #include <foreach>
  24.  
  25. //==============================================================================
  26.  
  27. //Teams
  28. #define TEAM_GROVE 1
  29. #define TEAM_BALLAS 2
  30. #define TEAM_VAGOS 3
  31. #define TEAM_AZTECAS 4
  32. #define TEAM_TRIADS 5
  33. #define TEAM_MAFIA 6
  34. #define TEAM_HOBO 7
  35. #define TEAM_GIRLS 8
  36. #define TEAM_GROVE_COLOR 0x33AA33AA//GREEN 1 change ltr :P
  37. #define TEAM_BALLAS_COLOR 0x800080FF//Purple 2
  38. #define TEAM_VAGOS_COLOR 0xFFFFFFAA//Yellow 3
  39. #define TEAM_TRIADS_COLOR 0xFF0000FF//RED 4
  40. #define TEAM_AZTECAS_COLOR 0x33CCFFAA//LightBlue 5
  41. #define TEAM_MAFIA_COLOR 0x000000AA//BLACK 6
  42. #define TEAM_HOBO_COLOR 0xAFAFAFAA//Grey 7
  43. #define TEAM_GIRLS_COLOR 0xFFC0CBAA//Light light pink
  44.  
  45. //==============================================================================
  46.  
  47. #define COLOR_GREEN 0x33AA33AA
  48. #define COLOR_RED 0xFF0000FF
  49. #define COLOR_BLUE 0x0000BBAA
  50. #define COLOR_ORANGE 0xFF9900AA
  51.  
  52.  
  53.  
  54. //==============================================================================
  55.  
  56. #define GREY 0xAFAFAFAA
  57. #define COLOR_WHITE 0xFFFFFFAA
  58. #define COLOR_GREEN 0x33AA33AA
  59.  
  60. #define COLOR_LIGHTBLUE 0x33CCFFAA
  61. #define COLOR_PURPLE 0x800080FF
  62. #define COLOR_YELLOW 0xFFFFFFAA
  63.  
  64.  
  65. //==============================================================================
  66. //DIALOGS
  67. #define DIALOG_REGISTER 1
  68. #define DIALOG_LOGIN 2
  69. #define DIALOG_CMDS 3
  70. #define DIALOG_ACMDS 4
  71.  
  72. //==============================================================================
  73.  
  74. #define PATH "/Users/%s.ini"
  75.  
  76. //==============================================================================
  77.  
  78. #define COL_WHITE "{FFFFFF}"
  79. #define COL_RED "{F81414}"
  80. #define COL_GREEN "{00FF22}"
  81. #define COL_LIGHTBLUE "{00CED1}"
  82.  
  83. #define COLOR_TIME 0xFFFFFFFF //Change the colour of the time textdraw here
  84. #define COLOR_DAY 0xFFFFFFFF //Change the colour of the day textdraw here
  85. #define COLOR_WHITE 0xFFFFFFAA
  86.  
  87. //==============================================================================
  88.  
  89. enum pInfo
  90. {
  91. pPass,
  92. pCash,
  93. pAdmin,
  94. pWarns,
  95. pKills,
  96. pBanned,
  97. pDeaths
  98. }
  99. new PlayerInfo[MAX_PLAYERS][pInfo];
  100.  
  101. forward LoadUser_data(playerid,name[],value[]);
  102. public LoadUser_data(playerid,name[],value[])
  103. {
  104. INI_Int("Password",PlayerInfo[playerid][pPass]);
  105. INI_Int("Cash",PlayerInfo[playerid][pCash]);
  106. INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  107. INI_Int("Kills",PlayerInfo[playerid][pKills]);
  108. INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  109. return 1;
  110. }
  111.  
  112. stock UserPath(playerid)
  113. {
  114. new string[128],playername[MAX_PLAYER_NAME];
  115. GetPlayerName(playerid,playername,sizeof(playername));
  116. format(string,sizeof(string),PATH,playername);
  117. return string;
  118. }
  119.  
  120. stock SendAdminMessage(color,const astring[])
  121. {
  122. foreach(Player, i)
  123. {
  124. if(GetPlayerState(i) != PLAYER_STATE_NONE)
  125. {
  126. if(IsPlayerAdmin(i))
  127. {
  128. SendClientMessage(i, color, astring);
  129. }
  130. else if(PlayerInfo[i][pAdmin] >= 1)
  131. {
  132. SendClientMessage(i, color, astring);
  133. }
  134. }
  135. }
  136. return 1;
  137. }
  138.  
  139.  
  140.  
  141. stock GetName(playerid)
  142. {
  143. new
  144. pName[MAX_PLAYER_NAME];
  145.  
  146. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  147. return pName;
  148. }
  149.  
  150.  
  151. /*Credits to Dracoblue*/
  152. stock udb_hash(buf[]) {
  153. new length=strlen(buf);
  154. new s1 = 1;
  155. new s2 = 0;
  156. new n;
  157. for (n=0; n<length; n++)
  158. {
  159. s1 = (s1 + buf[n]) % 65521;
  160. s2 = (s2 + s1) % 65521;
  161. }
  162. return (s2 << 16) + s1;
  163. }
  164.  
  165. main(){}
  166.  
  167. new Text:TopBox;
  168. new Text:BottomBox;
  169. new Text:lssw;
  170. new InDM[MAX_PLAYERS];
  171. new Dead[MAX_PLAYERS];
  172. new gTeam[MAX_PLAYERS];
  173. new IsOnduty[MAX_PLAYERS];
  174. new fstr[200];
  175. new IsMuted[MAX_PLAYERS];
  176. new
  177. pDrunkLevelLast[MAX_PLAYERS],
  178. PlayerText3D:playertextid,
  179. pFPS[MAX_PLAYERS]
  180. ;
  181.  
  182. forward FPSS(playerid);
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. //==============================================================================
  190.  
  191. public OnGameModeInit()
  192. {
  193.  
  194. SetGameModeText("GangWars v1.2");
  195. DisableInteriorEnterExits();
  196.  
  197. //GROVE
  198. AddPlayerClass(105,2497.5190,-1646.3367,13.5405,157.9393,0,0,0,0,0,0);
  199. AddPlayerClass(106,2497.5190,-1646.3367,13.5405,157.9393,0,0,0,0,0,0);
  200. AddPlayerClass(107,2497.5190,-1646.3367,13.5405,157.9393,0,0,0,0,0,0);
  201. AddPlayerClass(149,2497.5190,-1646.3367,13.5405,157.9393,0,0,0,0,0,0);
  202.  
  203. //BALLAS
  204. AddPlayerClass(102,2157.4441,-1612.4562,14.2938,202.2420,0,0,0,0,0,0);
  205. AddPlayerClass(103,2166.7832,-1613.4037,14.3594,163.3884,0,0,0,0,0,0);
  206. AddPlayerClass(104,2142.4939,-1641.6448,14.8686,308.1265,0,0,0,0,0,0);
  207.  
  208. //VAGOS
  209. AddPlayerClass(108,2256.0142,-1333.7314,23.9817,229.5982,0,0,0,0,0,0);
  210. AddPlayerClass(109,2263.1296,-1336.2548,23.9845,259.0517,0,0,0,0,0,0);
  211. AddPlayerClass(110,2264.0396,-1346.9767,23.9832,325.7923,0,0,0,0,0,0);
  212.  
  213. //AZTECAS
  214. AddPlayerClass(114,2685.0576,-1428.3448,30.5107,93.2903,0,0,0,0,0,0);
  215. AddPlayerClass(115,2667.0266,-1444.2384,30.5259,317.3023,0,0,0,0,0,0);
  216. AddPlayerClass(116,2670.7781,-1457.7408,30.5485,358.9526,0,0,0,0,0,0);
  217.  
  218. //TRIADS
  219. AddPlayerClass(117,2261.2849,-1904.8745,14.9375,10.2138,0,0,0,0,0,0);
  220. AddPlayerClass(118,2283.6514,-1902.6400,13.5670,359.8502,0,0,0,0,0,0);
  221. AddPlayerClass(120,2269.5051,-1882.6860,14.2344,162.1349,0,0,0,0,0,0);
  222.  
  223. //MAFIA
  224. AddPlayerClass(111,1936.9249,-1584.0172,13.5708,179.6112,0,0,0,0,0,0);
  225. AddPlayerClass(112,1949.8657,-1558.8053,13.6318,176.1411,0,0,0,0,0,0);
  226. AddPlayerClass(113,1936.9249,-1584.0172,13.5708,179.6112,0,0,0,0,0,0);
  227. AddPlayerClass(124,1936.9249,-1584.0172,13.5708,179.6112,0,0,0,0,0,0);
  228. AddPlayerClass(125,1949.8657,-1558.8053,13.6318,176.1411,0,0,0,0,0,0);
  229. AddPlayerClass(126,1961.5153,-1634.1903,15.9612,87.1536,0,0,0,0,0,0);
  230. AddPlayerClass(127,1961.5153,-1634.1903,15.9612,87.1536,0,0,0,0,0,0);
  231.  
  232. //Hobo
  233. AddPlayerClass(230,2304.4458,-1785.9780,13.5575,15.7005,0,0,0,0,0,0);
  234. AddPlayerClass(137,2292.6584,-1796.5696,13.5469,345.6202,0,0,0,0,0,0);
  235.  
  236. //Girls
  237. AddPlayerClass(11,1808.8853,-1901.6010,13.5769,359.3967,0,0,0,0,0,0);//Girls
  238. AddPlayerClass(56,1805.3092,-1935.5482,13.5469,12.5568,0,0,0,0,0,0);//Girls
  239. AddPlayerClass(141,1772.7604,-1926.3534,13.5522,277.3259,0,0,0,0,0,0);//Girls
  240. AddPlayerClass(192,1808.8853,-1901.6010,13.5769,359.3967,0,0,0,0,0,0);//Girls
  241.  
  242.  
  243.  
  244. //GROVE Cars
  245. AddStaticVehicleEx(567,2490.7607,-1683.4261,13.2885,275.3206,86,86,8000);//Low Rider
  246. AddStaticVehicleEx(541,2518.4236,-1663.8990,13.7979,95.7908,86,86,8000);//Bullet
  247. AddStaticVehicleEx(541,2518.8640,-1668.4261,14.0463,93.7776,86,86,8000);//Bullet
  248. AddStaticVehicleEx(504,2506.6702,-1651.1348,13.4935,139.6581,86,86,8000);//Bloodring
  249. AddStaticVehicleEx(495,2488.6318,-1653.7251,13.7581,85.0858,86,86,8000);//SandKing
  250. AddStaticVehicleEx(411,2511.6003,-1688.5813,13.2796,45.3268,86,86,8000); //Infernus
  251. AddStaticVehicleEx(463,2514.0093,-1680.2672,13.0241,46.1333,86,86,8000); //Nrg-500 current a freeway
  252.  
  253.  
  254. //BALLAS Cars
  255. AddStaticVehicleEx(522,2167.9104,-1654.8807,14.6948,320.7073,211,211,8000);//Nrg-500
  256. AddStaticVehicleEx(494,2177.3792,-1642.8383,14.8432,251.8386,211,211,8000);//HotRing Racer
  257. AddStaticVehicleEx(494,2180.1619,-1632.6628,14.8439,256.4447,211,211,8000);//HotRing Racer
  258. AddStaticVehicleEx(411,2150.6958,-1637.5159,13.4757,274.4271,211,211,8000);//Infernus
  259. AddStaticVehicleEx(451,2154.2903,-1624.8654,13.3870,250.3402,211,211,8000);//Turismo
  260.  
  261. //VAGOS Cars
  262. AddStaticVehicleEx(541,2275.5583,-1332.6943,23.5293,179.8865,6,6,8000);//Bullet
  263. AddStaticVehicleEx(451,2266.3171,-1332.6750,23.5226,179.8358,6,6,8000);//Turismo
  264. AddStaticVehicleEx(411,2266.3440,-1348.3184,23.5278,179.7608,6,6,8000);//Infernus
  265. AddStaticVehicleEx(411,2275.5525,-1348.3644,23.5415,179.8123,6,6,8000);//Infernus
  266. AddStaticVehicleEx(522,2261.6194,-1344.1903,23.5949,180.7501,6,6,8000);//Nrg-500
  267.  
  268. //AZTECAS Cars
  269. AddStaticVehicleEx(541,2673.2263,-1442.2036,30.0715,357.3026,135,135,8000);//Bullet
  270. AddStaticVehicleEx(411,2672.4028,-1458.9976,30.0891,356.8409,135,135,8000);//Infernus
  271. AddStaticVehicleEx(451,2682.4988,-1445.3346,30.0750,355.7568,135,135,8000);//Turismo
  272. AddStaticVehicleEx(429,2681.5261,-1458.8330,30.0878,356.1672,135,135,8000);//Banshee
  273.  
  274. //TRIADS Cars
  275. AddStaticVehicleEx(411,2273.0483,-1908.1461,13.2538,1.4100,3,3,8000);//Infernus
  276. AddStaticVehicleEx(451,2249.7756,-1908.6405,13.2534,359.0685,3,3,8000);//Turismo
  277. AddStaticVehicleEx(522,2255.9285,-1878.6984,13.8403,182.0271,3,3,8000);//Nrg-500
  278. AddStaticVehicleEx(522,2282.9189,-1877.9165,13.8419,179.1341,3,3,8000);//Nrg-500
  279. AddStaticVehicleEx(415,2265.0911,-1889.5537,13.1250,90.8826,3,3,8000);//Cheetah
  280. AddStaticVehicleEx(429,2259.4453,-1899.7599,13.1558,91.9257,3,3,8000);//Banshee
  281.  
  282. //MAFIA Cars
  283. AddStaticVehicleEx(451,2299.2148,-1747.0513,13.2531,271.0845,0,0,8000);//Turismo
  284. AddStaticVehicleEx(451,2299.0151,-1737.2966,13.2481,271.1233,0,0,8000);//Turismo
  285. AddStaticVehicleEx(411,2285.9077,-1754.2102,13.2536,271.4731,0,0,8000);//Infernus
  286. AddStaticVehicleEx(522,2277.7419,-1747.4136,13.2530,267.4197,0,0,8000);//Infernus
  287. AddStaticVehicleEx(504,2278.4419,-1737.4795,13.2531,270.3918,0,0,8000);//BloodRing
  288.  
  289. //Hobo Cars
  290. AddStaticVehicleEx(411,1932.3667,-1585.1436,13.2719,179.6139,252,252,8000);//Infernus
  291. AddStaticVehicleEx(411,1940.6488,-1585.1996,13.2795,179.6146,252,252,8000);//Infernus
  292. AddStaticVehicleEx(429,1936.3250,-1560.2512,13.3152,223.7088,252,252,8000);//Banshee
  293. AddStaticVehicleEx(541,1935.9469,-1625.7687,13.1686,180.2713,252,252,8000);//Bullet
  294. AddStaticVehicleEx(451,1946.2505,-1630.8336,13.1684,179.2144,252,252,8000);//Turismo
  295. AddStaticVehicleEx(522,1947.2510,-1576.2006,13.1902,134.4855,252,252,8000);//Nrg-500
  296. AddStaticVehicleEx(522,1970.9478,-1619.1942,15.5774,266.9412,252,252,8000);//Nrg-500
  297. //Girls Car
  298. AddStaticVehicle(411,1776.5524,-1932.8336,13.1281,0.1031,232,232); // starthere
  299. AddStaticVehicle(411,1780.2761,-1932.8925,13.1242,359.3441,232,232); // starthere
  300. AddStaticVehicle(411,1784.6216,-1932.9307,13.1259,359.9516,232,232); // starthere
  301. AddStaticVehicle(451,1779.2080,-1895.9689,13.1118,273.3054,232,232); // starthere
  302. AddStaticVehicle(451,1778.9584,-1891.5371,13.0970,273.4599,232,232); // starthere
  303. AddStaticVehicle(451,1778.7507,-1887.9524,13.1090,273.3065,232,232); // starthere
  304. AddStaticVehicle(522,1801.3827,-1917.1772,12.9641,359.8041,232,232); // starthere
  305. AddStaticVehicle(522,1803.6248,-1917.1849,12.9636,359.8041,232,232); // starthere
  306. AddStaticVehicle(522,1806.1047,-1917.1931,12.9751,359.8013,232,232); // starthere
  307. AddStaticVehicle(541,1807.8556,-1884.7046,13.1132,269.0692,232,232); // starthere
  308. AddStaticVehicle(541,1801.6066,-1884.6329,13.1148,268.4905,232,232); // starthere
  309. AddStaticVehicle(541,1794.6552,-1884.6785,13.1100,269.8454,232,232); // starthere
  310.  
  311. TopBox = TextDrawCreate(641.531494, 1.500000, "usebox");
  312. TextDrawLetterSize(TopBox, 0.000000, 12.840741);
  313. TextDrawTextSize(TopBox, -2.000000, 0.000000);
  314. TextDrawAlignment(TopBox, 1);
  315. TextDrawColor(TopBox, 0);
  316. TextDrawUseBox(TopBox, true);
  317. TextDrawBoxColor(TopBox, 102);
  318. TextDrawSetShadow(TopBox, 0);
  319. TextDrawSetOutline(TopBox, 0);
  320. TextDrawFont(TopBox, 0);
  321.  
  322. BottomBox = TextDrawCreate(2.000000, 448.916687, "usebox");
  323. TextDrawLetterSize(BottomBox, 0.000000, -10.622221);
  324. TextDrawTextSize(BottomBox, 637.531494, 0.000000);
  325. TextDrawAlignment(BottomBox, 1);
  326. TextDrawColor(BottomBox, 0);
  327. TextDrawUseBox(BottomBox, true);
  328. TextDrawBoxColor(BottomBox, 102);
  329. TextDrawSetShadow(BottomBox, 0);
  330. TextDrawSetOutline(BottomBox, 0);
  331. TextDrawFont(BottomBox, 0);
  332.  
  333. lssw = TextDrawCreate(172.884353, 92.749992, "Los Santos Street Wars");
  334. TextDrawLetterSize(lssw, 0.489824, 2.416668);
  335. TextDrawAlignment(lssw, 1);
  336. TextDrawColor(lssw, -1);
  337. TextDrawSetShadow(lssw, 0);
  338. TextDrawSetOutline(lssw, 1);
  339. TextDrawBackgroundColor(lssw, 51);
  340. TextDrawFont(lssw, 2);
  341. TextDrawSetProportional(lssw, 1);
  342. return 1;
  343. }
  344.  
  345. //==============================================================================
  346.  
  347. public OnGameModeExit()
  348. {
  349. return 1;
  350. }
  351.  
  352. //==============================================================================
  353.  
  354.  
  355. public OnPlayerRequestClass(playerid, classid)
  356. {
  357. //Textdraws Showing For Player.
  358. TextDrawShowForPlayer(playerid,TopBox);
  359. TextDrawShowForPlayer(playerid,BottomBox);
  360. TextDrawShowForPlayer(playerid,lssw);
  361.  
  362. SetPlayerTeamFromClass(playerid, classid);
  363. SetPlayerInterior(playerid, 6);
  364. SetPlayerPos(playerid, 345.5598,301.1534,999.9382);
  365. SetPlayerFacingAngle(playerid, 0.9177);
  366. SetPlayerCameraLookAt(playerid, 345.5598,301.1534,999.9382);
  367. SetPlayerCameraPos(playerid, 345.5598 + (5 * floatsin(-0.6528, degrees)), 301.1534 + (5 * floatcos(-0.6528, degrees)), 999.9382);
  368.  
  369. switch (classid)
  370. {
  371. case 0..3://GROVE
  372. {
  373. if(classid == 0 || classid == 1 || classid == 2 || classid == 3)
  374. {
  375. GameTextForPlayer(playerid,"~g~Grove Street",4000,4);
  376. }
  377. }
  378. case 4..6://BALLAS
  379. {
  380. if(classid == 4 || classid == 5 || classid == 6)
  381. {
  382. GameTextForPlayer(playerid,"~p~BALLAS",4000,4);
  383. }
  384. }
  385. case 7..9://Vagos
  386. {
  387. if(classid == 7 || classid == 8 || classid == 9)
  388. {
  389. GameTextForPlayer(playerid,"~y~Vagos",4000,4);
  390. }
  391. }
  392. case 10..12://AZTECAS
  393. {
  394. if(classid == 10 || classid == 11 || classid == 12)
  395. {
  396. GameTextForPlayer(playerid,"~b~AZTECAS",4000,4);
  397. }
  398. }
  399. case 13..15:
  400. {
  401. if(classid == 13 || classid == 14 || classid == 15)
  402. {
  403. GameTextForPlayer(playerid,"~r~TRIADS",4000,4);
  404. }
  405. }
  406. case 16..22:
  407. {
  408. if(classid == 16 || classid == 17 || classid == 18 || classid == 19 || classid == 20 || classid == 21 || classid == 22)
  409. {
  410. GameTextForPlayer(playerid,"~w~MAFIA",4000,4);
  411. }
  412. }
  413. case 23..24:
  414. {
  415. if(classid == 23 || classid == 24)
  416. {
  417. GameTextForPlayer(playerid,"~l~Hobo",4000,4);
  418. }
  419. }
  420. case 25..28://GIRLS
  421. {
  422. GameTextForPlayer(playerid,"~p~~h~Girls",4000,4);
  423. }
  424.  
  425. }
  426. ApplyAnimation(playerid, "CAMERA", "CAMSTND_CMON", 4.1, false, false, false, false, 0, false); // 2
  427. return 1;
  428. }
  429.  
  430. //==============================================================================
  431.  
  432. public OnPlayerConnect(playerid)
  433. {
  434. pDrunkLevelLast[playerid] = 0;
  435. pFPS[playerid] = 0;
  436.  
  437. if(fexist(UserPath(playerid)))
  438. {
  439. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  440. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
  441. }
  442. else
  443. {
  444. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FF3838}Account Registration","{a9c4e4}Welcome To Los Santos Street Wars\n{FFFFFF}Enter A Password Below To Register","Register","");
  445. }
  446. SendClientMessage(playerid, GREY, "Welcome To Los Santos Street Wars.");
  447. SendClientMessage(playerid, -1, "{FFFFFF}_____________________________________________________________________________________________________________");
  448. SendClientMessage(playerid, -1, "{FF0000}Warning: {a9c4e4}The Concept In This Server And GTA in general maybe considered Explicit Material.");
  449. SendClientMessage(playerid, -1, "{a9c4e4}Visit Our Website For More Information and Community forums.");
  450. SendClientMessage(playerid, -1, "{FFFFFF}_____________________________________________________________________________________________________________");
  451. InDM[playerid] = 0;
  452.  
  453. new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
  454. GetPlayerName(playerid, pname, sizeof(pname));
  455. format(string, sizeof(string), "%s(%d) has joined the Server.",pname,playerid);
  456. SendClientMessageToAll(0xAAAAAAAA, string);
  457.  
  458. new ip[50], stringg[150];
  459. GetPlayerIp(playerid, ip, sizeof(ip));
  460. format(stringg, sizeof(stringg),"{FF0000}IP Notification: {FFFFFF}[IP]: %s(%d) - %s", GetName(playerid), playerid, ip);
  461. SendAdminMessage(-1, stringg);
  462. return 1;
  463. }
  464.  
  465.  
  466.  
  467.  
  468. //==============================================================================
  469.  
  470. public OnPlayerDisconnect(playerid, reason)
  471. {
  472. pDrunkLevelLast[playerid] = 0;
  473. pFPS[playerid] = 0;
  474.  
  475. new INI:File = INI_Open(UserPath(playerid));
  476. INI_SetTag(File,"data");
  477. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  478. INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  479. INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  480. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  481. INI_Close(File);
  482.  
  483. new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
  484. GetPlayerName(playerid, pname, sizeof(pname));
  485. switch(reason)
  486. {
  487. case 0: format(string, sizeof(string), "%s(%d) has left the Server. (Timeout / Crash).", pname,playerid);
  488. case 1: format(string, sizeof(string), "%s(%d) has left the Server. (Leaving / Quit).", pname,playerid);
  489. case 2: format(string, sizeof(string), "%s(%d) has left the Server. (Kicked / Banned).", pname,playerid);
  490. }
  491. SendClientMessageToAll(0xAAAAAAAA, string);
  492. return 1;
  493. }
  494.  
  495.  
  496. //==============================================================================
  497.  
  498. public OnPlayerSpawn(playerid)
  499. {
  500. //Hiding The Textdraws when the player spawns
  501. TextDrawHideForPlayer(playerid,TopBox);
  502. TextDrawHideForPlayer(playerid,BottomBox);
  503. TextDrawHideForPlayer(playerid,lssw);
  504.  
  505. SetPlayerToTeamColor(playerid);
  506. SetPlayerInterior(playerid, 0);
  507. SetPlayerArmour(playerid,100);
  508. SetPlayerScore(playerid,5);
  509. GivePlayerMoney(playerid,25000);
  510. GivePlayerWeapon(playerid,24,104);
  511. GivePlayerWeapon(playerid,25,150);
  512. GivePlayerWeapon(playerid,31,250);
  513. if(Dead[playerid] == 1)
  514. {
  515. SetPlayerHealth(playerid, 100);
  516. SetPlayerArmour(playerid, 100);
  517. Dead[playerid] = 0;
  518. }
  519. return 1;
  520. }
  521.  
  522. //==============================================================================
  523. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
  524. {
  525. // antiteamkill
  526. new Float:Health;
  527. GetPlayerHealth(playerid, Health);
  528. if(gTeam[issuerid] == gTeam[playerid])
  529. {
  530. GetPlayerHealth(playerid, Health);
  531. SetPlayerHealth(playerid, Health+amount);
  532. }
  533. return 1;
  534. }
  535.  
  536. //==============================================================================
  537. public OnPlayerDeath(playerid, killerid, reason)
  538. {
  539. PlayerInfo[killerid][pKills]++;
  540. PlayerInfo[playerid][pDeaths]++;
  541. SendDeathMessage(killerid, playerid, reason);
  542. return 1;
  543. }
  544.  
  545. //==============================================================================
  546.  
  547. public OnVehicleSpawn(vehicleid)
  548. {
  549. return 1;
  550. }
  551.  
  552. //==============================================================================
  553.  
  554. public OnVehicleDeath(vehicleid, killerid)
  555. {
  556. return 1;
  557. }
  558.  
  559. //==============================================================================
  560.  
  561. public OnPlayerText(playerid, text[])
  562. {
  563. return 1;
  564. }
  565.  
  566. //==============================================================================
  567.  
  568. public OnPlayerCommandText(playerid, cmdtext[])
  569. {
  570. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  571. {
  572. // Do something here
  573. return 1;
  574. }
  575. return 0;
  576. }
  577.  
  578. //==============================================================================
  579.  
  580. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  581. {
  582. return 1;
  583. }
  584.  
  585. //==============================================================================
  586.  
  587. public OnPlayerExitVehicle(playerid, vehicleid)
  588. {
  589. return 1;
  590. }
  591.  
  592. //==============================================================================
  593.  
  594. public OnPlayerStateChange(playerid, newstate, oldstate)
  595. {
  596. return 1;
  597. }
  598.  
  599. //==============================================================================
  600.  
  601. public OnPlayerEnterCheckpoint(playerid)
  602. {
  603. return 1;
  604. }
  605.  
  606. //==============================================================================
  607.  
  608. public OnPlayerLeaveCheckpoint(playerid)
  609. {
  610. return 1;
  611. }
  612.  
  613. //==============================================================================
  614.  
  615. public OnPlayerEnterRaceCheckpoint(playerid)
  616. {
  617. return 1;
  618. }
  619.  
  620. //==============================================================================
  621.  
  622. public OnPlayerLeaveRaceCheckpoint(playerid)
  623. {
  624. return 1;
  625. }
  626.  
  627. //==============================================================================
  628.  
  629. public OnRconCommand(cmd[])
  630. {
  631. return 1;
  632. }
  633.  
  634. //==============================================================================
  635.  
  636. public OnPlayerRequestSpawn(playerid)
  637. {
  638. return 1;
  639. }
  640.  
  641. //==============================================================================
  642.  
  643. public OnObjectMoved(objectid)
  644. {
  645. return 1;
  646. }
  647.  
  648. //==============================================================================
  649.  
  650. public OnPlayerObjectMoved(playerid, objectid)
  651. {
  652. return 1;
  653. }
  654.  
  655. //==============================================================================
  656.  
  657. public OnPlayerPickUpPickup(playerid, pickupid)
  658. {
  659. return 1;
  660. }
  661.  
  662. //==============================================================================
  663.  
  664. public OnVehicleMod(playerid, vehicleid, componentid)
  665. {
  666. return 1;
  667. }
  668.  
  669. //==============================================================================
  670.  
  671. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  672. {
  673. return 1;
  674. }
  675.  
  676. //==============================================================================
  677.  
  678. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  679. {
  680. return 1;
  681. }
  682.  
  683. //==============================================================================
  684.  
  685. public OnPlayerSelectedMenuRow(playerid, row)
  686. {
  687. return 1;
  688. }
  689.  
  690. //==============================================================================
  691.  
  692. public OnPlayerExitedMenu(playerid)
  693. {
  694. return 1;
  695. }
  696.  
  697. //==============================================================================
  698.  
  699. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  700. {
  701. return 1;
  702. }
  703.  
  704. //==============================================================================
  705.  
  706. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  707. {
  708. return 1;
  709. }
  710.  
  711. //==============================================================================
  712.  
  713. public OnRconLoginAttempt(ip[], password[], success)
  714. {
  715. if(!success) //If the password was incorrect
  716. {
  717. new pip[16];
  718. for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
  719. {
  720. GetPlayerIp(i, pip, sizeof(pip));
  721. if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
  722. { new str[128], name[MAX_PLAYER_NAME];
  723. GetPlayerName(i, name, sizeof(name));
  724. format(str, sizeof(str), "{37DB45}%s Has Been Kicked From The Server (Rcon Login Attempt)", name);
  725. SendClientMessageToAll(COLOR_PURPLE,str);
  726. SendClientMessage(i, 0xFFFFFFFF, "{FF0000}You Have Been Kicked From The Server (Rcon Login Attempt)."); //Send a message
  727. Kick(i); //They are now Kicked.
  728. }
  729. }
  730. }
  731. return 1;
  732. }
  733. //==============================================================================
  734.  
  735. public OnPlayerUpdate(playerid)
  736. {
  737. new drunknew = GetPlayerDrunkLevel(playerid);
  738. if(drunknew < 100) return SetPlayerDrunkLevel(playerid, 2000);
  739. else
  740. {
  741. if (pDrunkLevelLast[playerid] != drunknew)
  742. {
  743. new wfps = pDrunkLevelLast[playerid] - drunknew;
  744. if ((wfps > 0) && (wfps < 200)) pFPS[playerid] = wfps;
  745. pDrunkLevelLast[playerid] = drunknew;
  746. }
  747. }
  748. SetTimerEx("FPS!", 101, 1, "i", playerid);
  749. return 1;
  750. }
  751.  
  752. public FPSS(playerid)
  753. {
  754. for(new i; i < sizeof(playertextid); i++) DeletePlayer3DTextLabel(playerid, playertextid);
  755. new
  756. Float:P[3],
  757. sStr[100],
  758. IP[15]
  759. ;
  760. if(PlayerInfo[playerid][pAdmin] < 1)
  761. {
  762. GetPlayerPos(playerid, P[0], P[1], P[2]);
  763. GetPlayerIp(playerid, IP, sizeof(IP));
  764. format(sStr, sizeof(sStr), "Ping: {9B30FF}%i\n{F09C00}IP: {9B30FF}%s\n{F09C00}FPS: {9B30FF}%i", GetPlayerPing(playerid), IP, pFPS[playerid]);
  765. playertextid = CreatePlayer3DTextLabel(playerid, sStr, 0xF09C00AA, P[0], P[1], P[2]+1.0, 10.0);
  766. UpdatePlayer3DTextLabelText(playerid, playertextid, 0xF09C00AA, sStr);
  767. }
  768. else
  769. {
  770. GetPlayerPos(playerid, P[0], P[1], P[2]);
  771. format(sStr, sizeof(sStr), "Ping: {9B30FF}%i\n{F09C00}FPS: {9B30FF}%i", GetPlayerPing(playerid), pFPS[playerid]);
  772. playertextid = CreatePlayer3DTextLabel(playerid, sStr, 0xF09C00AA, P[0], P[1], P[2]+1.0, 10.0);
  773. UpdatePlayer3DTextLabelText(playerid, playertextid, 0xF09C00AA, sStr);
  774. }
  775. return 1;
  776. }
  777.  
  778.  
  779. //==============================================================================
  780.  
  781. public OnPlayerStreamIn(playerid, forplayerid)
  782. {
  783. return 1;
  784. }
  785.  
  786. //==============================================================================
  787.  
  788. public OnPlayerStreamOut(playerid, forplayerid)
  789. {
  790. return 1;
  791. }
  792.  
  793. //==============================================================================
  794.  
  795. SetPlayerTeamFromClass(playerid, classid)
  796. {
  797. if(classid == 0 || classid == 1 || classid == 2 || classid == 3)
  798. {
  799. gTeam[playerid] = TEAM_GROVE;
  800. }
  801. else if(classid == 4 || classid == 5 || classid == 6)
  802. {
  803. gTeam[playerid] = TEAM_BALLAS;
  804. }
  805. else if(classid == 7 || classid == 8 || classid == 9)
  806. {
  807. gTeam[playerid] = TEAM_VAGOS;
  808. }
  809. else if(classid == 10 || classid == 11 || classid == 12)
  810. {
  811. gTeam[playerid] = TEAM_AZTECAS;
  812. }
  813. else if(classid == 13 || classid == 14 || classid == 15)
  814. {
  815. gTeam[playerid] = TEAM_TRIADS;
  816. }
  817. else if(classid == 16 || classid == 17 || classid == 18 || classid == 19 || classid == 20 || classid == 21)
  818. {
  819. gTeam[playerid] = TEAM_MAFIA;
  820. }
  821. else if(classid == 22 || classid == 23)
  822. {
  823. gTeam[playerid] = TEAM_HOBO;
  824. }
  825. else if(classid == 24 || classid == 25 || classid == 26 || classid == 27)
  826. {
  827. gTeam[playerid] = TEAM_GIRLS;
  828. }
  829. return 1;
  830. }
  831.  
  832. //==============================================================================
  833.  
  834. SetPlayerToTeamColor(playerid)
  835. {
  836. if (gTeam[playerid] == TEAM_GROVE)
  837. {
  838. SetPlayerColor(playerid, TEAM_GROVE_COLOR);
  839. }
  840. else if (gTeam[playerid] == TEAM_BALLAS)
  841. {
  842. SetPlayerColor(playerid, TEAM_BALLAS_COLOR);
  843. }
  844. else if (gTeam[playerid] == TEAM_VAGOS)
  845. {
  846. SetPlayerColor(playerid, TEAM_VAGOS_COLOR);
  847. }
  848. else if (gTeam[playerid] == TEAM_AZTECAS)
  849. {
  850. SetPlayerColor(playerid, TEAM_AZTECAS_COLOR);
  851. }
  852. else if (gTeam[playerid] == TEAM_TRIADS)
  853. {
  854. SetPlayerColor(playerid, TEAM_TRIADS_COLOR);
  855. }
  856. else if (gTeam[playerid] == TEAM_MAFIA)
  857. {
  858. SetPlayerColor(playerid, TEAM_MAFIA_COLOR);
  859. }
  860. else if (gTeam[playerid] == TEAM_HOBO)
  861. {
  862. SetPlayerColor(playerid, TEAM_HOBO_COLOR);
  863. }
  864. else if (gTeam[playerid] == TEAM_GIRLS)
  865. {
  866. SetPlayerColor(playerid, TEAM_GIRLS_COLOR);
  867. }
  868.  
  869.  
  870. }
  871.  
  872. //==============================================================================
  873.  
  874.  
  875. public OnVehicleStreamIn(vehicleid, forplayerid)
  876. {
  877. return 1;
  878. }
  879.  
  880. //==============================================================================
  881.  
  882. public OnVehicleStreamOut(vehicleid, forplayerid)
  883. {
  884. return 1;
  885. }
  886.  
  887. //==============================================================================
  888.  
  889. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  890. {
  891. if(dialogid == DIALOG_REGISTER)
  892. {
  893. if (!response) return Kick(playerid);
  894. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_LIGHTBLUE"Account Registration",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
  895. new INI:File = INI_Open(UserPath(playerid));
  896. INI_SetTag(File,"data");
  897. INI_WriteInt(File,"Password",udb_hash(inputtext));
  898. INI_WriteInt(File,"Cash",0);
  899. INI_WriteInt(File,"Admin",0);
  900. INI_WriteInt(File,"Kills",0);
  901. INI_WriteInt(File,"Deaths",0);
  902. INI_Close(File);
  903. }
  904. else if(dialogid == DIALOG_LOGIN)
  905. {
  906. if ( !response ) return Kick ( playerid );
  907. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  908. {
  909. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  910. GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  911. }
  912. }
  913. else if(dialogid == DIALOG_ACMDS)
  914. {
  915. switch(listitem)
  916. {
  917. case 0:
  918. {
  919. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
  920. ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "Admin Level 1", "/ban /kick /warn /duty /mute /unmute", "Close", "");
  921. }
  922. case 1:
  923. {
  924. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Only admin level 2+ can use this command.");
  925. ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "Admin Level 2", "/sethealth /setarmour /goto /get /ac /ip /fix", "Close", "");
  926. }
  927. case 2:
  928. {
  929. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Only admin level 3+ can use this command.");
  930. ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "Admin Level 3", "/givecash /jetpack /removejetpack /freeze /unfreeze ", "Close", "");
  931. }
  932. }
  933. }
  934. return 1;
  935. }
  936.  
  937. //==============================================================================
  938.  
  939. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  940. {
  941. return 1;
  942. }
  943.  
  944. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  945. {
  946. if(!success) SendClientMessage(playerid, -1, "{FFFFFF} I dont know that command type /cmds for a list of Commands.");
  947. return 1;
  948. }
  949. //==============================================================================
  950. //*******************************End Of Script**********************************
  951. //=====================================================Commands=================
  952.  
  953. //General Commands
  954. CMD:changeteam(playerid,params[]) //Cmd to change your team
  955. {
  956. SetPlayerHealth(playerid, 0.0);
  957. ForceClassSelection(playerid);
  958. return 1;
  959. }
  960.  
  961. CMD:kill(playerid) // CMD to commit a suicide
  962. {
  963. SetPlayerHealth(playerid, 0);
  964. return 1;
  965. }
  966.  
  967.  
  968.  
  969. CMD:pm(playerid, params[])
  970. {
  971. new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
  972. if(sscanf(params, "us", id, str2))
  973. {
  974. SendClientMessage(playerid, 0xFFFF00AA, "Usage: /pm <Name/Id> <message>");
  975. return 1;
  976. }
  977. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "[ERROR]: Player not connected");
  978. if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "[ERROR]: You cannot PM yourself!");
  979. {
  980. GetPlayerName(playerid, Name1, sizeof(Name1));
  981. GetPlayerName(id, Name2, sizeof(Name2));
  982. format(str, sizeof(str), "To %s(ID %d): %s", Name2, id, str2);
  983. SendClientMessage(playerid, 0xFFFF00AA, str);
  984. format(str, sizeof(str), "From %s(ID %d): %s", Name1, playerid, str2);
  985. SendClientMessage(id, 0xFFFF00AA, str);
  986. new astring[100];
  987. format(astring, sizeof(astring),"PM: %s(%d) to %s(%d): %s", GetName(playerid), playerid, GetName(id), id, str);
  988. SendAdminMessage(GREY, astring);
  989.  
  990. }
  991. return 1;
  992. }
  993.  
  994. CMD:arena(playerid, params[])
  995. {
  996. InDM[playerid] = 1;
  997. SetPlayerPos(playerid, -975.975708,1060.983032,1345.671875);
  998. SetPlayerInterior(playerid, 10);
  999. SetPlayerVirtualWorld(playerid, 0);
  1000. SetPlayerFacingAngle(playerid, 89.1282);
  1001. SetCameraBehindPlayer(playerid);
  1002. SetPlayerArmour(playerid,100);
  1003. SetPlayerHealth(playerid,100);
  1004. SetPlayerTeam(playerid, playerid);
  1005. SendClientMessage(playerid, -1, "{FFFFFF}[Arena]:{a9c4e4}You Have Join The Arena Type /qarena To Exit.");
  1006. return 1;
  1007. }
  1008.  
  1009.  
  1010. CMD:qarena(playerid, params[])
  1011. {
  1012. if(InDM[playerid] == 0)
  1013. {
  1014. SendClientMessage(playerid, -1, "[Arena]:{a9c4e4}You are not at the DM arena!");
  1015. return 1;
  1016. }
  1017. else if(InDM[playerid] == 1)
  1018. {
  1019. InDM[playerid] = 0;
  1020. SetPlayerVirtualWorld(playerid, 0);
  1021. SetPlayerHealth(playerid, 0.00);
  1022. SetPlayerInterior(playerid, 0);
  1023. SendClientMessage(playerid, -1, "[Arena]:{a9c4e4}You have left the DM arena!");
  1024. return 1;
  1025. }
  1026. return 1;
  1027. }
  1028.  
  1029. CMD:cmds(playerid, params[])
  1030. {
  1031. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "{a9c4e4}General Commands", "{FFFFFF}/changeteam /kill /pm /arena /qarena /afk /back ", "Close", "");
  1032. return 1;
  1033. }
  1034.  
  1035.  
  1036.  
  1037. //=============================================================================
  1038. //===================================ADMIN COMMANDS============================
  1039. //Rcon login commands
  1040. CMD:setlevel(playerid, params[])
  1041. {
  1042. new level, id;
  1043. if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /setlevel [name/id] [level]");
  1044. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
  1045. if(IsPlayerAdmin(playerid))
  1046. {
  1047. PlayerInfo[id][pAdmin] = level;
  1048. PlayerPlaySound(id,1085,0.0,0.0,0.0);
  1049. format(fstr, sizeof(fstr), "You have set %s(%d) admin level to %d.", GetName(id), id, level);
  1050. SendClientMessage(playerid, COLOR_YELLOW, fstr);
  1051. format(fstr, sizeof(fstr), "Admin %s(%d) has set your admin level to %d.", GetName(playerid), playerid, level);
  1052. SendClientMessage(id, COLOR_LIGHTBLUE, fstr);
  1053. }
  1054. else if(PlayerInfo[playerid][pAdmin] == 4)
  1055. {
  1056. PlayerInfo[id][pAdmin] = level;
  1057. PlayerPlaySound(id,1085,0.0,0.0,0.0);
  1058. format(fstr, sizeof(fstr), "You have set %s(%d) admin level to %d.", GetName(id), id, level);
  1059. SendClientMessage(playerid, COLOR_YELLOW, fstr);
  1060. format(fstr, sizeof(fstr), "Admin %s(%d) has set your admin level to %d.", GetName(playerid), playerid, level);
  1061. SendClientMessage(id, COLOR_LIGHTBLUE, fstr);
  1062. }
  1063. else
  1064. {
  1065. SendClientMessage(playerid, COLOR_RED, "Only Rcon Login Admins can use this command.");
  1066. }
  1067. return true;
  1068. }
  1069.  
  1070. //Admin Level 1 Commands
  1071. //==============================================================================
  1072.  
  1073. CMD:acmds(playerid, params[])
  1074. {
  1075. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
  1076. ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_LIST, "{FFFFFF}Admin Commands", "{FFFFFF}Admin Level 1\n{a9c4e4}Admin Level 2\n{FF0000}Admin Level 3", "Ok", "Cancel");
  1077. return 1;
  1078. }
  1079.  
  1080. CMD:ban(playerid, params[]) // CMD for banning someone
  1081. {
  1082. new pid;
  1083. new str[128];
  1084. new reason;
  1085. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
  1086. if(sscanf(params,"us", pid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [Player ID] [Reason]");
  1087.  
  1088.  
  1089. {
  1090. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
  1091. if(PlayerInfo[playerid][pAdmin]<=PlayerInfo[pid][pAdmin]) return SendClientMessage(playerid, COLOR_RED, "That admin has an higher admin rank, therefor you can't ban him!");
  1092. if(playerid==pid) return SendClientMessage(playerid, COLOR_RED, "You can't ban yourself!");
  1093. format(str, sizeof(str), "You have banned %s. Reason: %s", GetName(pid), reason);
  1094. SendClientMessage(playerid, COLOR_PURPLE, str);
  1095. format(str, sizeof(str), "ADMCMD: %s have been banned from Lssw. Reason:(%s)", GetName(pid), GetName(playerid), reason );
  1096. SendClientMessageToAll(COLOR_RED, str);
  1097. PlayerInfo[pid][pBanned] = 1;
  1098. Kick(pid);
  1099. new astring[64];
  1100. format(astring, sizeof(astring),"%s [%d] typed: /ban %s", GetName(playerid), playerid);
  1101. SendAdminMessage(GREY, astring);
  1102. }
  1103. return 1;
  1104. }
  1105.  
  1106.  
  1107. CMD:kick(playerid, params[]) // CMD for unbanning someone
  1108. {
  1109. new pid;
  1110. new str[128];
  1111. new reason;
  1112. if(sscanf(params,"us", pid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [Player ID] [Reason]");
  1113. if (PlayerInfo[playerid][pAdmin]>=1)
  1114. {
  1115. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
  1116. if(PlayerInfo[playerid][pAdmin]<=PlayerInfo[pid][pAdmin]) return SendClientMessage(playerid, COLOR_RED, "PlayerID is higher admin rank, can't kick him!");
  1117. format(str, sizeof(str), "You have kicked %s. Reason: %s", GetName(pid), reason);
  1118. SendClientMessage(playerid, COLOR_RED, str);
  1119. format(str, sizeof(str), "%s have been kicked by %s. Reason: %s", GetName(pid), GetName(playerid), reason);
  1120. SendClientMessage(playerid, COLOR_BLUE, str);
  1121. Kick(playerid);
  1122. }
  1123. return 1;
  1124. }
  1125.  
  1126. CMD:warn(playerid, params[]) // CMD for warning someone
  1127. {
  1128. new pid;
  1129. new str[128];
  1130. new reason;
  1131. if(sscanf(params, "us", pid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /warn [Player ID] [Reason]");
  1132. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
  1133. if(PlayerInfo[playerid][pAdmin]>=1)
  1134. {
  1135. if(PlayerInfo[pid][pAdmin]>=PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_WHITE, "You can't warn this player: he's higher admin rank!");
  1136. if(PlayerInfo[pid][pWarns]>=3)
  1137. {
  1138. PlayerInfo[pid][pWarns]++;
  1139. PlayerInfo[pid][pBanned]++;
  1140. format(str, sizeof(str), "ADMCMD: %s has been warned by an %s. Reason: %s", GetName(pid), GetName(playerid), reason);
  1141. SendClientMessageToAll(COLOR_PURPLE, str);
  1142. format(str, sizeof(str), "AUTO-BAN: %s has been automatically banned. Reason: Too much warnings.", GetName(pid));
  1143. SendClientMessageToAll(COLOR_PURPLE, str);
  1144. Kick(pid);
  1145. }
  1146. else
  1147. {
  1148. PlayerInfo[pid][pWarns]++;
  1149. format(str, sizeof(str), "ADMCMD: %s has been warned by an %s. Reason: %s", GetName(pid), GetName(playerid), reason);
  1150. SendClientMessageToAll(COLOR_PURPLE, str);
  1151. }
  1152. }
  1153. return 1;
  1154. }
  1155.  
  1156. CMD:duty(playerid, params[])
  1157. {
  1158. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
  1159. if(PlayerInfo[playerid][pAdmin] >= 1 && IsOnduty{playerid} == 0)
  1160. {
  1161. IsOnduty{playerid} = 1;
  1162. SetPlayerHealth(playerid,9999999.0);
  1163. SetPlayerArmour(playerid,9999999.0);
  1164. GivePlayerWeapon(playerid,38,999999);
  1165. }
  1166. else if( IsOnduty{playerid} == 1)
  1167. {
  1168. IsOnduty{playerid} = 0;
  1169. ResetPlayerWeapons(playerid);
  1170. SetPlayerHealth(playerid, 100.0);
  1171. SetPlayerArmour(playerid, 100.0);
  1172. }
  1173. return 1;
  1174.  
  1175. }
  1176.  
  1177. CMD:mute(playerid, params[])
  1178. {
  1179. new muteid, reason[24];
  1180. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
  1181. if(sscanf(params, "us[24]", muteid, reason)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /mute [name/id] [reason]");
  1182. if(strlen(reason) < 1 || strlen(reason) > 24) return SendClientMessage(playerid, COLOR_RED, "Your reason can only contain 1-24 characters.");
  1183. if(muteid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
  1184. if(muteid == playerid) return SendClientMessage(playerid, COLOR_RED, "You cant mute yourself.");
  1185. if(PlayerInfo[muteid][pAdmin] >= 1) return SendClientMessage(playerid, COLOR_RED, "You cant mute admins.");
  1186. {
  1187. IsMuted{muteid} = 1;
  1188. GameTextForPlayer(muteid,"~r~Muted", 3000, 5);
  1189. format(fstr, sizeof(fstr), "Admin %s [%d] has muted you - Reason: %s", GetName(playerid), playerid, reason);
  1190. SendClientMessage(muteid, COLOR_RED, fstr);
  1191. format(fstr, sizeof(fstr), "You have muted %s [%d] - Reason: %s", GetName(muteid), muteid, reason);
  1192. SendClientMessage(playerid, COLOR_YELLOW, fstr);
  1193. new astring[100];
  1194. format(astring, sizeof(astring), "Admin %s [%d] has muted %s [%d] - Reason: %s", GetName(playerid), playerid, GetName(muteid), muteid, reason);
  1195. SendAdminMessage(GREY, astring);
  1196. }
  1197. return 1;
  1198. }
  1199.  
  1200. CMD:unmute(playerid, params[])
  1201. {
  1202. new muteid;
  1203. if(sscanf(params, "u", muteid)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /unmute [name/id]");
  1204. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
  1205. if(muteid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
  1206. {
  1207. IsMuted{muteid} = 0;
  1208. GameTextForPlayer(muteid,"~g~Unmuted", 3000, 5);
  1209. format(fstr, sizeof(fstr), "Admin %s [%d] has unmuted you.", GetName(playerid), playerid);
  1210. SendClientMessage(muteid, COLOR_LIGHTBLUE, fstr);
  1211. format(fstr, sizeof(fstr), "You have unmuted %s [%d]", GetName(muteid), muteid);
  1212. SendClientMessage(playerid, COLOR_YELLOW, fstr);
  1213. new astring[100];
  1214. format(astring, sizeof(astring), "Admin %s [%d] has unmuted %s [%d]", GetName(playerid), playerid, GetName(muteid), muteid);
  1215. SendAdminMessage(GREY, astring);
  1216. }
  1217. return true;
  1218. }
  1219.  
  1220.  
  1221.  
  1222. //Admin Level 2 commands
  1223. //====================================================
  1224. CMD:sethealth(playerid, params[]) // CMD for setting someone his health
  1225. {
  1226. new amount;
  1227. new pid;
  1228. new str[128];
  1229. if(sscanf(params, "ui", pid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethealth [Player ID] [Amount]");
  1230. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
  1231. if (PlayerInfo[playerid][pAdmin]>=2)
  1232. {
  1233. SetPlayerHealth(pid, amount);
  1234. format(str, sizeof(str), "Your health has been set to %i by an Admin!", amount);
  1235. SendClientMessage(pid, COLOR_RED, str);
  1236. format(str, sizeof(str), "You just set %s's health to %i.", GetName(pid), amount);
  1237. SendClientMessage(playerid, COLOR_RED, str);
  1238. }
  1239. else SendClientMessage(playerid, COLOR_RED, "SERVER: You must be an Admin Level 2+ to use this command!");
  1240. return 1;
  1241. }
  1242.  
  1243.  
  1244. CMD:setarmour(playerid, params[]) // CMD for setting someone his armour
  1245. {
  1246. new amount;
  1247. new pid;
  1248. new str[128];
  1249. if(sscanf(params, "ui", pid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setarmour [Player ID] [Amount]");
  1250. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
  1251. if (PlayerInfo[playerid][pAdmin]>=2)
  1252. {
  1253. SetPlayerArmour(pid, amount);
  1254. format(str, sizeof(str), "An Admin has set your armour to %i!", amount);
  1255. SendClientMessage(pid, COLOR_YELLOW, str);
  1256. format(str, sizeof(str), "You just set %s's armour to %i.", GetName(pid), amount);
  1257. SendClientMessage(playerid, COLOR_RED, str);
  1258. }
  1259. else SendClientMessage(playerid, COLOR_RED, "SERVER: You must be an Admin Level 2+ to use this command!");
  1260. return 1;
  1261. }
  1262.  
  1263. CMD:goto(playerid, params[]) // CMD to go to someone
  1264. {
  1265. new pid;
  1266. if(IsPlayerConnected(pid))
  1267. {
  1268. if(PlayerInfo[playerid][pAdmin]>=2)
  1269. {
  1270. if(!sscanf(params, "ui", pid))
  1271. {
  1272. new string[64];
  1273. new Float:x, Float:y, Float:z; GetPlayerPos(pid,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(pid));
  1274. format(string, sizeof(string), "You teleported yourself to %s .", GetName(pid));
  1275. SendClientMessage(playerid, COLOR_RED, string);
  1276. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(pid));
  1277. SetPlayerPos(playerid,x+2,y,z);
  1278. return 1;
  1279. }
  1280. else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /goto [PlayerID/PartOfName]");
  1281. }
  1282. else return SendClientMessage(playerid, COLOR_RED, "You must be an admin to use this command!");
  1283. }
  1284. else return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
  1285. }
  1286.  
  1287. CMD:get(playerid, params[]) // CMD to get someone to you
  1288. {
  1289. new pid;
  1290. if(IsPlayerConnected(pid))
  1291. {
  1292. if(PlayerInfo[playerid][pAdmin]>=2)
  1293. {
  1294. if(!sscanf(params, "ui", pid))
  1295. {
  1296. new string[64];
  1297. new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerInterior(pid,GetPlayerInterior(playerid));
  1298. format(string, sizeof(string), "You teleported %s to you.", GetName(pid));
  1299. SendClientMessage(playerid, COLOR_YELLOW, string);
  1300. SetPlayerVirtualWorld(pid,GetPlayerVirtualWorld(playerid));
  1301. SetPlayerPos(pid,x+2,y,z);
  1302. return 1;
  1303. }
  1304. else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /get [Name/PlayerID]");
  1305. }
  1306. else return SendClientMessage(playerid, COLOR_RED, "You must be an admin to use this command!");
  1307. }
  1308. else return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
  1309. }
  1310.  
  1311. CMD:ac(playerid, params[])
  1312. {
  1313. new msg[30];
  1314. if(sscanf(params, "s[30]", msg)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /a [msg]]");
  1315. if(strlen(msg) < 1 || strlen(msg) > 30) return SendClientMessage(playerid, COLOR_RED, "Your message can only contain 1-30 characters.");
  1316. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
  1317. {
  1318. format(fstr, sizeof(fstr), "~w~%s", msg);
  1319. GameTextForAll(fstr, 5000, 5);
  1320. new astring[64];
  1321. format(astring, sizeof(astring),"%s [%d] typed: /ann", GetName(playerid), playerid);
  1322. SendAdminMessage(GREY, astring);
  1323. }
  1324. return 1;
  1325. }
  1326.  
  1327. CMD:ip(playerid, params[])
  1328. {
  1329. new targetid, ip[50];
  1330. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Only admin level 2+ can use this command.");
  1331. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /ip [name/id]");
  1332. if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
  1333. {
  1334. GetPlayerIp(targetid, (ip),sizeof(ip));
  1335. format(fstr, sizeof(fstr), "[IP]: %s [%d] - %s", GetName(targetid), targetid, ip);
  1336. SendClientMessage(playerid, GREY, fstr);
  1337. }
  1338. return 1;
  1339. }
  1340.  
  1341. CMD:fix(playerid, params[])
  1342. {
  1343. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Only admin level 2+ can use this command.");
  1344. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED, "You need to be in a vehicle to use this command.");
  1345. {
  1346. RepairVehicle(GetPlayerVehicleID(playerid));
  1347. GameTextForPlayer(playerid,"~w~Vehicle ~g~Repaired", 5000, 5);
  1348. }
  1349. new astring[100];
  1350. format(astring, sizeof(astring), "%s [%d] typed: /afix", GetName(playerid), playerid);
  1351. SendAdminMessage(GREY, astring);
  1352. return 1;
  1353. }
  1354.  
  1355. //Admin Level 3 Commands
  1356. //==============================================================================
  1357. CMD:givecash(playerid, params[]) // CMD to give somebody some cash
  1358. {
  1359. new amount;
  1360. new pid;
  1361. new str[128];
  1362. if(sscanf(params, "ui", pid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givecash [Player ID] [Amount]");
  1363. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
  1364. if (PlayerInfo[playerid][pAdmin]>=3)
  1365. {
  1366. GivePlayerMoney(pid, amount);
  1367. format(str, sizeof(str), "You have been granted $%i by an Admin!", amount);
  1368. SendClientMessage(pid, COLOR_YELLOW, str);
  1369. format(str, sizeof(str), "You just gave $%i to %s.", amount, GetName(pid));
  1370. SendClientMessage(playerid, COLOR_GREEN, str);
  1371. }
  1372. else SendClientMessage(playerid, COLOR_RED, "SERVER: You must be Admin level 3+ To use this Command");
  1373. return 1;
  1374. }
  1375.  
  1376. CMD:jetpack(playerid, params[])
  1377. {
  1378. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Only admin level 3+ can use this command.");
  1379. {
  1380. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  1381. SendClientMessage(playerid, COLOR_LIGHTBLUE, "IMPORTANT: Use /removejetpack when your done, DONT LET A PLAYER ACCESS THIS JETPACK!");
  1382. format(fstr, sizeof(fstr), "Admin %s [%d] has spawned a jetpack.", GetName(playerid), playerid);
  1383. SendAdminMessage(GREY, fstr);
  1384. }
  1385. return true;
  1386. }
  1387.  
  1388. CMD:removejetpack(playerid, params[])
  1389. {
  1390. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Only admin level 3+ can use this command.");
  1391. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
  1392. {
  1393. new Float:x, Float:y, Float:z, Float:ang;
  1394. GetPlayerPos(playerid, x, y, z);
  1395. GetPlayerFacingAngle(playerid, ang);
  1396. new VehicleID = CreateVehicle(522, x, y, z, ang, -1, -1, -1);
  1397. PutPlayerInVehicle(playerid, VehicleID, 0);
  1398. SetVehicleVirtualWorld(VehicleID, GetPlayerVirtualWorld(playerid));
  1399. LinkVehicleToInterior(VehicleID, GetPlayerInterior(playerid));
  1400. ChangeVehicleColor(VehicleID,0,3);
  1401. DestroyVehicle(GetPlayerVehicleID(playerid));
  1402. }
  1403. else
  1404. {
  1405. SendClientMessage(playerid, COLOR_LIGHTBLUE, "You do not have a jetpack.");
  1406. }
  1407. return 1;
  1408. }
  1409.  
  1410. CMD:freeze(playerid, params[])
  1411. {
  1412. new target, reason[24];
  1413. if(sscanf(params, "us[24]", target, reason)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /freeze [name/id]");
  1414. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Only admin level 3+ can use this command.");
  1415. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
  1416. if(PlayerInfo[target][pAdmin] >= 3) return SendClientMessage(playerid, COLOR_RED, "You cant freeze admins higher rank than you.");
  1417. {
  1418. TogglePlayerControllable(target,false);
  1419. GameTextForPlayer(target,"~r~Frozen", 3000, 5);
  1420. format(fstr, sizeof(fstr), "Admin %s [%d] has frozen you", GetName(playerid), playerid);
  1421. SendClientMessage(target, COLOR_RED, fstr);
  1422. format(fstr, sizeof(fstr), "You have frozen %s [%d]", GetName(target), target);
  1423. SendClientMessage(playerid, COLOR_YELLOW, fstr);
  1424. new astring[24];
  1425. format(astring, sizeof(astring), "Admin %s [%d] has frozen %s [%d]", GetName(playerid), playerid, GetName(target), target);
  1426. SendAdminMessage(GREY, astring);
  1427. }
  1428. return 1;
  1429. }
  1430.  
  1431. CMD:unfreeze(playerid, params[])
  1432. {
  1433. new target;
  1434. if(sscanf(params, "u", target)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /unfreeze [name/id]");
  1435. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 3+ can use this command.");
  1436. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
  1437. {
  1438. TogglePlayerControllable(target,true);
  1439. GameTextForPlayer(target,"~g~Unfrozen", 3000, 5);
  1440. format(fstr, sizeof(fstr), "Admin %s [%d] has unfrozen you.", GetName(playerid), playerid);
  1441. SendClientMessage(target, COLOR_LIGHTBLUE, fstr);
  1442. format(fstr, sizeof(fstr), "You have unfrozen %s [%d]", GetName(target), target);
  1443. SendClientMessage(playerid, COLOR_YELLOW, fstr);
  1444. new astring[100];
  1445. format(astring, sizeof(astring), "Admin %s [%d] has unfrozen %s [%d]", GetName(playerid), playerid, GetName(target), target);
  1446. SendAdminMessage(GREY, astring);
  1447. }
  1448. return true;
  1449. }
  1450.  
  1451. //==============================================================================
  1452.  
  1453. CMD:objects(playerid,parmas[])
  1454. {
  1455. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "{a9c4e4}Object Commands", "{FFFFFF}/penis /fire /clucker /cowboy /gas /weed", "Close", ""); return 1;
  1456. }
  1457.  
  1458. CMD:penis(playerid,params[])
  1459. {
  1460. SetPlayerAttachedObject(playerid, 0, 19086, 6, 0.000000, 0.000000, 0.000000, 0.000000, -101.899971, 0.000000);
  1461. return 1;
  1462. }
  1463.  
  1464. CMD:clucker(playerid,params[])
  1465. {
  1466. SetPlayerAttachedObject(playerid, 1, 19137, 2, 0.093000, 0.000000, 0.000000);
  1467. return 1;
  1468. }
  1469.  
  1470. CMD:fire(playerid,params[])
  1471. {
  1472. SetPlayerAttachedObject(playerid, 3, 18688, 2, -0.134000, -0.157999, -1.584001, 0.000000, -7.199995, 0.000000);
  1473. return 1;
  1474. }
  1475.  
  1476. CMD:cowboy(playerid,params[])
  1477. {
  1478. SetPlayerAttachedObject(playerid, 4, 19095, 2, 0.205000, 0.000000, 0.000000);
  1479. return 1;
  1480. }
  1481.  
  1482. CMD:gas(playerid,params[])
  1483. {
  1484. SetPlayerAttachedObject(playerid, 5, 19320, 2, 0.193000, -0.065999, 0.004999, 0.700002, 84.000015, -3.199998);
  1485. return 1;
  1486. }
  1487.  
  1488. CMD:weed(playerid,params[])
  1489. {
  1490. SetPlayerAttachedObject(playerid, 6, 3044, 2, 0.067999, 0.028000, 0.033999, 0.000000, -5.400000, 176.300109);
  1491. return 1;
  1492. }
  1493.  
  1494.  
  1495. CMD:afk(playerid,params[])
  1496. {
  1497. SetPlayerVirtualWorld(playerid,1);
  1498. TogglePlayerControllable(playerid,false);
  1499. GameTextForPlayer(playerid,"~y~AFK",7000,5);
  1500. format(fstr, sizeof(fstr), "[AFK]:%s(%d) Is Currently Away From Keyboard.", GetName(playerid), playerid);
  1501. SendClientMessageToAll(0x33CCFFAA,fstr);
  1502. SendClientMessage(playerid,COLOR_GREEN,"You're Currently Away From Keyboard type /back to return to the game.");
  1503. return 1;
  1504. }
  1505.  
  1506. CMD:back(playerid,params[])
  1507. {
  1508. SetPlayerVirtualWorld(playerid,0);
  1509. TogglePlayerControllable(playerid,true);
  1510. format(fstr, sizeof(fstr), "[Back]:%s(%d) Is Now Back.", GetName(playerid), playerid);
  1511. SendClientMessageToAll(0x33CCFFAA,fstr);
  1512. SendClientMessage(playerid,COLOR_GREEN,"You're Now Back In The Game.");
  1513. return 1;
  1514. }
  1515.  
  1516.  
  1517. /*
  1518. //==============================================================================
  1519. ********************************************************************************
  1520. =============================== END OF GAMEMODE ================================
  1521. ********************************************************************************
  1522. //==============================================================================
  1523. */
Advertisement
Add Comment
Please, Sign In to add comment