Advertisement
Joron

Untitled

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