Advertisement
Guest User

test

a guest
Mar 26th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 53.17 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #undef MAX_PLAYERS
  4. #define MAX_PLAYERS (200)
  5.  
  6. #pragma tabsize (4)
  7. #pragma dynamic (10000)
  8.  
  9. #include <fixes>
  10. #include <izcmd>
  11. #include <sscanf2>
  12. #include <dialogs>
  13. #include <streamer>
  14. #include <attachments>
  15.  
  16. #define COLOR_DODGER_BLUE (0x1E90FFFF)
  17. #define COLOR_FIREBRICK (0xB22222FF)
  18. #define COLOR_STEEL_BLUE (0x4682B4FF)
  19. #define COLOR_RED (0xFF0000FF)
  20. #define COLOR_GREY (0x808080FF)
  21. #define COLOR_GREEN (0x00CC00FF)
  22. #define COLOR_LIME (0xCCFF99FF)
  23. #define COLOR_BLACK (0x000000FF)
  24. #define COLOR_WHITE (0xFFFFFFFF)
  25. #define COLOR_ORANGE (0xFF9933FF)
  26. #define COLOR_YELLOW (0xFFFF66FF)
  27. #define COLOR_BLUE (0x0099CCFF)
  28. #define COLOR_PURPLE (0x6600FFFF)
  29. #define COLOR_BROWN (0x663300FF)
  30. #define COLOR_PINK (0xCC99FFFF)
  31. #define COLOR_HOT_PINK (0xFF99FFFF)
  32. #define COLOR_THISTLE (0xD8BFD8FF)
  33. #define COLOR_KHAKI (0x999966FF)
  34. #define COLOR_ORANGE_RED (0xFF4500FF)
  35.  
  36. #define SAMP_BLUE "{A9C4E4}"
  37. #define WHITE "{FFFFFF}"
  38. #define MARONE "{800000}"
  39. #define RED "{FF0000}"
  40. #define HOT_PINK "{FF99FF}"
  41. #define LIME "{CCFF99}"
  42. #define TOMATO "{FF6347}"
  43. #define PINK "{CC99FF}"
  44. #define BLACK "{000000}"
  45. #define ORANGE "{FF9933}"
  46. #define YELLOW "{FFFF66}"
  47. #define GREEN "{00CC00}"
  48. #define VIOLET "{EE82EE}"
  49. #define BROWN "{663300}"
  50. #define CORAL "{993333}"
  51.  
  52. #if !defined FLOAT_INFINITY
  53. #define FLOAT_INFINITY (Float:0x7F800000)
  54. #endif
  55.  
  56. #define DIALOG_ID_COMMON (0)
  57. #define DIALOG_ID_SHOP (1)
  58. #define DIALOG_ID_CONFIRM (2)
  59.  
  60. main() {
  61. SetGameModeText("LSGW v1.0 - TDM/DM");
  62. }
  63.  
  64. enum e_TEAM {
  65. teamId,
  66. teamName[45],
  67. teamSkin,
  68. teamColor,
  69. teamWeapon1[2],
  70. teamWeapon2[2],
  71. teamWeapon3[2],
  72. teamWeaponThrown[2],
  73. teamWeaponMelle
  74. };
  75.  
  76. enum e_SERVER {
  77. serverPlayers
  78. };
  79.  
  80. enum e_PLAYER {
  81. playerClass,
  82. PlayerText: playerClassTxt[2],
  83. PlayerText: playerSpawnTxt,
  84. playerSpawnTxtTimer,
  85. playerSpawnProtectTimer,
  86. Text3D: playerSpawnProtectLabel,
  87. PlayerText: playerOffradarTxt,
  88. playerOffradarTimer,
  89. playerLastOffradar,
  90. playerLastRefill,
  91. playerWeaponSelc,
  92. playerLastAmmoBoost,
  93. bool: playerHelmet,
  94. bool: playerMask
  95. };
  96.  
  97. new const g_Team[][e_TEAM] = {
  98. {0, "Groves", 105, 0x00FF00AA, {30, 300}, {25, 100}, {24, 100}, {17, 3}, 1},
  99. {0, "Groves", 106, 0x00FF00AA, {34, 300}, {25, 100}, {24, 100}, {17, 3}, 1},
  100. {0, "Groves", 107, 0x00FF00AA, {29, 300}, {27, 100}, {24, 100}, {17, 3}, 1},
  101.  
  102. {1, "Ballas", 102, 0x800080AA, {30, 300}, {25, 100}, {22, 100}, {16, 3}, 2},
  103. {1, "Ballas", 103, 0x800080AA, {34, 300}, {25, 100}, {22, 100}, {16, 3}, 2},
  104. {1, "Ballas", 104, 0x800080AA, {29, 300}, {26, 100}, {22, 100}, {16, 3}, 2},
  105.  
  106. {2, "Cops", 283, 0x0080FFAA, {31, 300}, {25, 100}, {24, 100}, {17, 3}, 3},
  107. {2, "Cops", 285, 0x0080FFAA, {34, 300}, {25, 100}, {24, 100}, {17, 3}, 3},
  108. {2, "Cops", 286, 0x0080FFAA, {29, 300}, {27, 100}, {24, 100}, {17, 3}, 3},
  109.  
  110. {3, "Vagos", 108, 0xFFFF00AA, {29, 300}, {27, 100}, {23, 100}, {18, 3}, 4},
  111. {3, "Vagos", 109, 0xFFFF00AA, {34, 300}, {27, 100}, {23, 100}, {18, 3}, 4},
  112. {3, "Vagos", 110, 0xFFFF00AA, {30, 300}, {26, 100}, {23, 100}, {18, 3}, 4},
  113.  
  114. {4, "Aztecas", 114, 0x00FFFFAA, {30, 300}, {26, 100}, {22, 100}, {16, 3}, 5},
  115. {4, "Aztecas", 115, 0x00FFFFAA, {34, 300}, {26, 100}, {22, 100}, {16, 3}, 5},
  116. {4, "Aztecas", 116, 0x00FFFFAA, {29, 300}, {27, 100}, {22, 100}, {16, 3}, 5},
  117.  
  118. {5, "Bikers", 247, 0xFF4B00AA, {30, 300}, {25, 100}, {24, 100}, {17, 3}, 6},
  119. {5, "Bikers", 248, 0xFF4B00AA, {34, 300}, {25, 100}, {24, 100}, {17, 3}, 6},
  120. {5, "Bikers", 249, 0xFF4B00AA, {33, 300}, {27, 100}, {24, 100}, {17, 5}, 6},
  121.  
  122. {6, "Barbers", 156, 0xA52A2AAA, {32, 300}, {25, 100}, {23, 100}, {16, 3}, 8},
  123. {6, "Barbers", 176, 0xA52A2AAA, {34, 300}, {25, 100}, {23, 100}, {16, 3}, 8},
  124. {6, "Barbers", 177, 0xA52A2AAA, {31, 300}, {27, 100}, {23, 100}, {16, 3}, 8}
  125. };
  126.  
  127. new const Float:g_SpawnGroves[][4] = {
  128. {2487.5906, -1647.0276, 14.0703, 178.2233},
  129. {2495.2595, -1688.7878, 14.0247, 0.9613},
  130. {2524.2061, -1677.3821, 19.9302, 90.2623}
  131. };
  132.  
  133. new const Float:g_SpawnBallas[][4] = {
  134. {1939.1927, -1115.8624, 27.3786, 179.3580},
  135. {1925.6742, -1115.6378, 27.0883, 176.7902},
  136. {1889.9614, -1114.2015, 26.2758, 179.2984}
  137. };
  138.  
  139. new const Float:g_SpawnCops[][4] = {
  140. {1579.7522, -1635.7533, 13.5603, 87.5415},
  141. {1543.9868, -1631.9741, 13.3828, 90.7054},
  142. {1543.9868, -1631.9741, 13.3828, 90.7054}
  143. };
  144.  
  145. new const Float:g_SpawnVagos[][4] = {
  146. {2436.6279, -1303.5195, 24.6401, 271.6647},
  147. {2462.8672, -1323.4487, 27.3906, 84.9144}
  148. };
  149.  
  150. new const Float:g_SpawnAztecas[][4] = {
  151. {1782.1407, -2124.7839, 13.7495, 0.6275},
  152. {1781.4502, -2103.3040, 13.5469, 177.3490},
  153. {1762.4257, -2103.8257, 13.5469, 179.8791}
  154. };
  155.  
  156. new const Float:g_SpawnBikers[][4] = {
  157. {489.6188, -1796.1342, 6.0625, 0.0445},
  158. {520.1090, -1779.3583, 5.7522, 94.9854},
  159. {477.2205, -1764.4628, 5.5330, 178.0196}
  160. };
  161.  
  162. new const Float:g_SpawnBarbers[][4] = {
  163. {1480.9514, -1414.0276, 11.8828, 89.9471},
  164. {1473.1471, -1334.2107, 11.8828, 178.2417},
  165. {1564.7397, -1423.0775, 11.8828, 88.7463}
  166. };
  167.  
  168. new
  169. g_Server[e_SERVER],
  170. g_Player[MAX_PLAYERS][e_PLAYER]
  171. ;
  172.  
  173. public OnGameModeInit() {
  174. for (new i, j = sizeof(g_Team); i < j; i++) {
  175. AddPlayerClass(g_Team[i][teamSkin], -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
  176. }
  177.  
  178. return 1;
  179. }
  180.  
  181. public OnGameModeExit() {
  182.  
  183. return 1;
  184. }
  185.  
  186. public OnPlayerConnect(playerid) {
  187. g_Server[serverPlayers]++;
  188.  
  189. new
  190. szBuffer[156]
  191. ;
  192. format(szBuffer, sizeof(szBuffer), "Thanks for joining, now its %i players!", g_Server[serverPlayers]);
  193. SendClientMessage(playerid, COLOR_YELLOW, szBuffer);
  194. SendClientMessage(playerid, COLOR_PINK, "If you are new here, do read /help, /rules.");
  195. //SendClientMessage(playerid, COLOR_PINK, "Now you can pick dead player's weapons by pressing key \"N\" near one.");
  196.  
  197. g_Player[playerid][playerClassTxt][0] = CreatePlayerTextDraw(playerid,130.000000, 230.000000, "GROVE");
  198. PlayerTextDrawBackgroundColor(playerid,g_Player[playerid][playerClassTxt][0], 255);
  199. PlayerTextDrawFont(playerid,g_Player[playerid][playerClassTxt][0], 1);
  200. PlayerTextDrawLetterSize(playerid,g_Player[playerid][playerClassTxt][0], 0.400000, 2.000000);
  201. PlayerTextDrawColor(playerid,g_Player[playerid][playerClassTxt][0], 16711935);
  202. PlayerTextDrawSetOutline(playerid,g_Player[playerid][playerClassTxt][0], 1);
  203. PlayerTextDrawSetProportional(playerid,g_Player[playerid][playerClassTxt][0], 1);
  204. PlayerTextDrawSetSelectable(playerid,g_Player[playerid][playerClassTxt][0], 0);
  205.  
  206. g_Player[playerid][playerClassTxt][1] = CreatePlayerTextDraw(playerid,130.000000, 247.000000, "Players: ~r~17 ~w~~h~out of ~r~122~n~~w~~h~You will be spawning with ~r~Ak-47, Combat shotgun, Desert eagle, Tear gas");
  207. PlayerTextDrawBackgroundColor(playerid,g_Player[playerid][playerClassTxt][1], 255);
  208. PlayerTextDrawFont(playerid,g_Player[playerid][playerClassTxt][1], 1);
  209. PlayerTextDrawLetterSize(playerid,g_Player[playerid][playerClassTxt][1], 0.160000, 0.799999);
  210. PlayerTextDrawColor(playerid,g_Player[playerid][playerClassTxt][1], -1);
  211. PlayerTextDrawSetOutline(playerid,g_Player[playerid][playerClassTxt][1], 1);
  212. PlayerTextDrawSetProportional(playerid,g_Player[playerid][playerClassTxt][1], 1);
  213. PlayerTextDrawSetSelectable(playerid,g_Player[playerid][playerClassTxt][1], 0);
  214.  
  215. g_Player[playerid][playerSpawnTxt] = CreatePlayerTextDraw(playerid,10.000000, 160.000000, "Team ~b~~h~~h~Grove~n~~n~Weapons recieved!~n~Ak-47, Shotgun, Desert Eagle, Grenade, Brass knuckle~n~~n~You have spawn protection");
  216. PlayerTextDrawBackgroundColor(playerid,g_Player[playerid][playerSpawnTxt], 255);
  217. PlayerTextDrawFont(playerid,g_Player[playerid][playerSpawnTxt], 1);
  218. PlayerTextDrawLetterSize(playerid,g_Player[playerid][playerSpawnTxt], 0.180000, 1.000000);
  219. PlayerTextDrawColor(playerid,g_Player[playerid][playerSpawnTxt], -1);
  220. PlayerTextDrawSetOutline(playerid,g_Player[playerid][playerSpawnTxt], 1);
  221. PlayerTextDrawSetProportional(playerid,g_Player[playerid][playerSpawnTxt], 1);
  222. PlayerTextDrawUseBox(playerid,g_Player[playerid][playerSpawnTxt], 1);
  223. PlayerTextDrawBoxColor(playerid,g_Player[playerid][playerSpawnTxt], 200);
  224. PlayerTextDrawTextSize(playerid,g_Player[playerid][playerSpawnTxt], 140.000000, 0.000000);
  225. PlayerTextDrawSetSelectable(playerid,g_Player[playerid][playerSpawnTxt], 0);
  226.  
  227. g_Player[playerid][playerOffradarTxt] = CreatePlayerTextDraw(playerid,10.000000, 238.000000, "You are now off the radar, that means not visible on game map/radar~n~~n~/Offradar: ~r~~h~~h~50..");
  228. PlayerTextDrawBackgroundColor(playerid,g_Player[playerid][playerOffradarTxt], 255);
  229. PlayerTextDrawFont(playerid,g_Player[playerid][playerOffradarTxt], 1);
  230. PlayerTextDrawLetterSize(playerid,g_Player[playerid][playerOffradarTxt], 0.180000, 1.000000);
  231. PlayerTextDrawColor(playerid,g_Player[playerid][playerOffradarTxt], -1);
  232. PlayerTextDrawSetOutline(playerid,g_Player[playerid][playerOffradarTxt], 1);
  233. PlayerTextDrawSetProportional(playerid,g_Player[playerid][playerOffradarTxt], 1);
  234. PlayerTextDrawUseBox(playerid,g_Player[playerid][playerOffradarTxt], 1);
  235. PlayerTextDrawBoxColor(playerid,g_Player[playerid][playerOffradarTxt], 336860360);
  236. PlayerTextDrawTextSize(playerid,g_Player[playerid][playerOffradarTxt], 140.000000, 0.000000);
  237. PlayerTextDrawSetSelectable(playerid,g_Player[playerid][playerOffradarTxt], 0);
  238.  
  239. g_Player[playerid][playerSpawnProtectTimer] = -1;
  240. g_Player[playerid][playerOffradarTimer] = -1;
  241.  
  242. return 1;
  243. }
  244.  
  245. public OnPlayerDisconnect(playerid, reason) {
  246. g_Server[serverPlayers]--;
  247.  
  248. return 1;
  249. }
  250.  
  251. public OnPlayerRequestClass(playerid, classid) {
  252. PlayerTextDrawColor(playerid, g_Player[playerid][playerClassTxt][0], g_Team[classid][teamColor]);
  253. PlayerTextDrawSetString(playerid, g_Player[playerid][playerClassTxt][0], g_Team[classid][teamName]);
  254. PlayerTextDrawShow(playerid, g_Player[playerid][playerClassTxt][0]);
  255.  
  256. new
  257. iTeamPlayer,
  258. szBuffer[450],
  259. szWeaponName[35]
  260. ;
  261. for (new i, j = GetPlayerPoolSize(); i <= j; i++) {
  262. if (GetPlayerTeam(i) == g_Team[classid][teamId]) {
  263. iTeamPlayer++;
  264. }
  265. }
  266. format(szBuffer, sizeof(szBuffer), "Players: ~r~%i ~w~~h~out of ~r~%i~n~", iTeamPlayer, g_Server[serverPlayers]);
  267. strcat(szBuffer, "~w~~h~You will be spawning with ~r~");
  268. GetWeaponName(g_Team[classid][teamWeapon1][0], szWeaponName, sizeof(szWeaponName));
  269. strcat(szBuffer, szWeaponName);
  270. strcat(szBuffer, ", ");
  271. GetWeaponName(g_Team[classid][teamWeapon2][0], szWeaponName, sizeof(szWeaponName));
  272. strcat(szBuffer, szWeaponName);
  273. strcat(szBuffer, ", ");
  274. GetWeaponName(g_Team[classid][teamWeapon3][0], szWeaponName, sizeof(szWeaponName));
  275. strcat(szBuffer, szWeaponName);
  276. strcat(szBuffer, ", ");
  277. GetWeaponName(g_Team[classid][teamWeaponThrown][0], szWeaponName, sizeof(szWeaponName));
  278. strcat(szBuffer, szWeaponName);
  279. strcat(szBuffer, ", ");
  280. GetWeaponName(g_Team[classid][teamWeaponMelle], szWeaponName, sizeof(szWeaponName));
  281. strcat(szBuffer, szWeaponName);
  282. PlayerTextDrawSetString(playerid, g_Player[playerid][playerClassTxt][1], szBuffer);
  283. PlayerTextDrawShow(playerid, g_Player[playerid][playerClassTxt][1]);
  284.  
  285. if (g_Player[playerid][playerSpawnProtectTimer] != -1) {
  286. KillTimer(g_Player[playerid][playerSpawnProtectTimer]);
  287. }
  288. if (IsValidDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel])) {
  289. DestroyDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel]);
  290. }
  291.  
  292. if (g_Player[playerid][playerSpawnTxtTimer] != -1) {
  293. KillTimer(g_Player[playerid][playerSpawnTxtTimer]);
  294. }
  295. OnSpawnTextdrawHide(playerid);
  296.  
  297. if (g_Player[playerid][playerOffradarTimer] != -1) {
  298. KillTimer(g_Player[playerid][playerOffradarTimer]);
  299. }
  300. g_Player[playerid][playerOffradarTimer] = -1;
  301. g_Player[playerid][playerLastOffradar] = 0;
  302. PlayerTextDrawHide(playerid, g_Player[playerid][playerOffradarTxt]);
  303.  
  304. switch (g_Team[classid][teamId]) {
  305. case 0: {
  306. SetPlayerInterior(playerid, 0);
  307. SetPlayerCameraPos(playerid, 2524.1550, -1671.1104, 19.9203);
  308. SetPlayerCameraLookAt(playerid, 2520.1550, -1671.1104, 19.4203);
  309. SetPlayerPos(playerid, 2520.1550, -1671.1104, 19.4203);
  310. SetPlayerFacingAngle(playerid, 270.0000);
  311. }
  312. case 1: {
  313. SetPlayerInterior(playerid, 0);
  314. SetPlayerCameraPos(playerid, 1948.655639, -1114.651733, 31.215576);
  315. SetPlayerCameraLookAt(playerid, 1944.464599, -1117.156250, 30.137393);
  316. SetPlayerPos(playerid,1945.0365,-1116.4506,30.7578);
  317. SetPlayerFacingAngle(playerid,295.8885);
  318. }
  319. case 2: {
  320. SetPlayerInterior(playerid, 0);
  321. SetPlayerCameraPos(playerid, 1512.555541, -1638.949829, 19.780670);
  322. SetPlayerCameraLookAt(playerid, 1515.505371, -1642.952270, 19.252750);
  323. SetPlayerPos(playerid,1514.8364,-1642.3707,19.2422);
  324. SetPlayerFacingAngle(playerid,31.5911);
  325. }
  326. case 3: {
  327. SetPlayerInterior(playerid, 0);
  328. SetPlayerCameraPos(playerid, 2631.425781, -1068.947387, 77.147903);
  329. SetPlayerCameraLookAt(playerid, 2626.514404, -1068.871337, 76.214347);
  330. SetPlayerPos(playerid,2626.9626,-1068.8726,75.9696);
  331. SetPlayerFacingAngle(playerid,269.8981);
  332. }
  333. case 4: {
  334. SetPlayerInterior(playerid, 0);
  335. SetPlayerCameraPos(playerid, 1785.895385, -2094.484130, 18.303087);
  336. SetPlayerCameraLookAt(playerid, 1787.589721, -2099.043457, 17.144950);
  337. SetPlayerPos(playerid,1787.6921,-2099.0662,17.4470);
  338. SetPlayerFacingAngle(playerid,31.6718);
  339. }
  340. case 5: {
  341. SetPlayerInterior(playerid, 0);
  342. SetPlayerCameraPos(playerid, 1124.762329, -1191.299682, 33.810428);
  343. SetPlayerCameraLookAt(playerid, 1122.427734, -1195.331298, 31.995071);
  344. SetPlayerPos(playerid,1122.2896,-1195.3792,32.0313);
  345. SetPlayerFacingAngle(playerid,326.1501);
  346. }
  347. case 6: {
  348. SetPlayerInterior(playerid, 0);
  349. SetPlayerCameraPos(playerid, 869.850463, -973.024658, 41.405673);
  350. SetPlayerCameraLookAt(playerid, 873.374816, -969.478149, 41.434577);
  351. SetPlayerPos(playerid,873.1442,-969.5593,41.0649);
  352. SetPlayerFacingAngle(playerid,141.9807);
  353. }
  354. default: {
  355. SetPlayerInterior(playerid, 0);
  356. SetPlayerCameraPos(playerid, 2466.381591, -1644.103027, 18.203895);
  357. SetPlayerCameraLookAt(playerid, 2470.127685, -1647.413452, 18.117961);
  358. SetPlayerPos(playerid,2469.7090,-1646.9497,18.2023);
  359. SetPlayerFacingAngle(playerid,53.1127);
  360. }
  361. }
  362.  
  363. g_Player[playerid][playerClass] = classid;
  364.  
  365. return 1;
  366. }
  367.  
  368. public OnPlayerRequestSpawn(playerid) {
  369. SendClientMessage(playerid, COLOR_KHAKI, "* You can change your team using /ct or /st or Press F4 key.");
  370. return 1;
  371. }
  372.  
  373. public OnPlayerSpawn(playerid) {
  374. PlayerTextDrawHide(playerid, g_Player[playerid][playerClassTxt][0]);
  375. PlayerTextDrawHide(playerid, g_Player[playerid][playerClassTxt][1]);
  376.  
  377. RemovePlayerAttachedObject(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 1);
  378. g_Player[playerid][playerHelmet] = false;
  379. RemovePlayerAttachedObject(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 2);
  380. g_Player[playerid][playerMask] = false;
  381.  
  382. new
  383. iRandom
  384. ;
  385. switch (g_Team[g_Player[playerid][playerClass]][teamId]) {
  386. case 0: {
  387. iRandom = random(sizeof(g_SpawnGroves));
  388. SetPlayerPos(playerid, g_SpawnGroves[iRandom][0], g_SpawnGroves[iRandom][1], g_SpawnGroves[iRandom][2]);
  389. SetPlayerFacingAngle(playerid, g_SpawnGroves[iRandom][3]);
  390. }
  391. case 1: {
  392. iRandom = random(sizeof(g_SpawnBallas));
  393. SetPlayerPos(playerid, g_SpawnBallas[iRandom][0], g_SpawnBallas[iRandom][1], g_SpawnBallas[iRandom][2]);
  394. SetPlayerFacingAngle(playerid, g_SpawnBallas[iRandom][3]);
  395. }
  396. case 2: {
  397. iRandom = random(sizeof(g_SpawnCops));
  398. SetPlayerPos(playerid, g_SpawnCops[iRandom][0], g_SpawnCops[iRandom][1], g_SpawnCops[iRandom][2]);
  399. SetPlayerFacingAngle(playerid, g_SpawnCops[iRandom][3]);
  400. }
  401. case 3: {
  402. iRandom = random(sizeof(g_SpawnVagos));
  403. SetPlayerPos(playerid, g_SpawnVagos[iRandom][0], g_SpawnVagos[iRandom][1], g_SpawnVagos[iRandom][2]);
  404. SetPlayerFacingAngle(playerid, g_SpawnVagos[iRandom][3]);
  405. }
  406. case 4: {
  407. iRandom = random(sizeof(g_SpawnAztecas));
  408. SetPlayerPos(playerid, g_SpawnAztecas[iRandom][0], g_SpawnAztecas[iRandom][1], g_SpawnAztecas[iRandom][2]);
  409. SetPlayerFacingAngle(playerid, g_SpawnAztecas[iRandom][3]);
  410. }
  411. case 5: {
  412. iRandom = random(sizeof(g_SpawnBikers));
  413. SetPlayerPos(playerid, g_SpawnBikers[iRandom][0], g_SpawnBikers[iRandom][1], g_SpawnBikers[iRandom][2]);
  414. SetPlayerFacingAngle(playerid, g_SpawnBikers[iRandom][3]);
  415. }
  416. case 6: {
  417. iRandom = random(sizeof(g_SpawnBarbers));
  418. SetPlayerPos(playerid, g_SpawnBarbers[iRandom][0], g_SpawnBarbers[iRandom][1], g_SpawnBarbers[iRandom][2]);
  419. SetPlayerFacingAngle(playerid, g_SpawnBarbers[iRandom][3]);
  420. }
  421. }
  422.  
  423. SetPlayerTeam(playerid, g_Team[g_Player[playerid][playerClass]][teamId]);
  424. SetPlayerSkin(playerid, g_Team[g_Player[playerid][playerClass]][teamSkin]);
  425. SetPlayerColor(playerid, g_Team[g_Player[playerid][playerClass]][teamColor]);
  426. ResetPlayerWeapons(playerid);
  427. GivePlayerWeapon(playerid, g_Team[g_Player[playerid][playerClass]][teamWeapon1][0], g_Team[g_Player[playerid][playerClass]][teamWeapon1][1]);
  428. GivePlayerWeapon(playerid, g_Team[g_Player[playerid][playerClass]][teamWeapon2][0], g_Team[g_Player[playerid][playerClass]][teamWeapon2][1]);
  429. GivePlayerWeapon(playerid, g_Team[g_Player[playerid][playerClass]][teamWeapon3][0], g_Team[g_Player[playerid][playerClass]][teamWeapon3][1]);
  430. GivePlayerWeapon(playerid, g_Team[g_Player[playerid][playerClass]][teamWeaponThrown][0], g_Team[g_Player[playerid][playerClass]][teamWeaponThrown][1]);
  431. GivePlayerWeapon(playerid, g_Team[g_Player[playerid][playerClass]][teamWeaponMelle], 1);
  432.  
  433. for (new i; i < MAX_PLAYERS; i++) {
  434. SetPlayerMarkerForPlayer(i, playerid, (g_Team[g_Player[playerid][playerClass]][teamColor] | 0xFFFFFFFF));
  435. }
  436.  
  437. SetPlayerInterior(playerid, 0);
  438. SetPlayerVirtualWorld(playerid, 0);
  439. SetPlayerHealth(playerid, FLOAT_INFINITY);
  440.  
  441. new
  442. szBuffer[450],
  443. szWeaponName[35]
  444. ;
  445. strcat(szBuffer, "Team ~b~~h~~h~");
  446. strcat(szBuffer, g_Team[g_Player[playerid][playerClass]][teamName]);
  447. strcat(szBuffer, "~n~~n~Weapons recieved!~n~");
  448. GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon1][0], szWeaponName, sizeof(szWeaponName));
  449. strcat(szBuffer, szWeaponName);
  450. strcat(szBuffer, ", ");
  451. GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon2][0], szWeaponName, sizeof(szWeaponName));
  452. strcat(szBuffer, szWeaponName);
  453. strcat(szBuffer, ", ");
  454. GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon3][0], szWeaponName, sizeof(szWeaponName));
  455. strcat(szBuffer, szWeaponName);
  456. strcat(szBuffer, ", ");
  457. GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeaponThrown][0], szWeaponName, sizeof(szWeaponName));
  458. strcat(szBuffer, szWeaponName);
  459. strcat(szBuffer, ", ");
  460. GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeaponMelle], szWeaponName, sizeof(szWeaponName));
  461. strcat(szBuffer, szWeaponName);
  462. strcat(szBuffer, "~n~~n~You have spawn protection [5 secs]");
  463. PlayerTextDrawSetString(playerid, g_Player[playerid][playerSpawnTxt], szBuffer);
  464. PlayerTextDrawShow(playerid, g_Player[playerid][playerSpawnTxt]);
  465.  
  466. if (g_Player[playerid][playerSpawnProtectTimer] != -1) {
  467. KillTimer(g_Player[playerid][playerSpawnProtectTimer]);
  468. }
  469. if (IsValidDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel])) {
  470. DestroyDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel]);
  471. }
  472. g_Player[playerid][playerSpawnProtectLabel] = CreateDynamic3DTextLabel("Spawn Protection", COLOR_RED, 0.0, 0.0, 0.7, 20.0, playerid, _, 1);
  473. g_Player[playerid][playerSpawnProtectTimer] = SetTimerEx("OnSpawnProtectionOver", 5000, false, "iff", playerid, 100.0, 10.0);
  474.  
  475. if (g_Player[playerid][playerSpawnTxtTimer] != -1) {
  476. KillTimer(g_Player[playerid][playerSpawnTxtTimer]);
  477. }
  478. g_Player[playerid][playerSpawnTxtTimer] = SetTimerEx("OnSpawnTextdrawHide", 15000, false, "i", playerid);
  479.  
  480. if (g_Player[playerid][playerOffradarTimer] != -1) {
  481. KillTimer(g_Player[playerid][playerOffradarTimer]);
  482. }
  483. g_Player[playerid][playerOffradarTimer] = -1;
  484. g_Player[playerid][playerLastOffradar] = 0;
  485. PlayerTextDrawHide(playerid, g_Player[playerid][playerOffradarTxt]);
  486.  
  487. g_Player[playerid][playerLastRefill] = 0;
  488. g_Player[playerid][playerLastAmmoBoost] = 0;
  489.  
  490. SendClientMessage(playerid, COLOR_YELLOW, "* If you want to go off the radar, use the command /offradar.");
  491. SendClientMessage(playerid, COLOR_YELLOW, "* Use /hp in case you are injured, /ar for an additional armour and /shop for other instant stuff.");
  492.  
  493. return 1;
  494. }
  495.  
  496. forward OnSpawnProtectionOver(playerid, Float:h, Float:a);
  497. public OnSpawnProtectionOver(playerid, Float:h, Float:a) {
  498. SetPlayerHealth(playerid, h);
  499. SetPlayerArmour(playerid, a);
  500.  
  501. g_Player[playerid][playerSpawnProtectTimer] = -1;
  502.  
  503. if (IsValidDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel])) {
  504. DestroyDynamic3DTextLabel(g_Player[playerid][playerSpawnProtectLabel]);
  505. }
  506.  
  507. new
  508. szBuffer[450],
  509. szWeaponName[35]
  510. ;
  511. strcat(szBuffer, "Team ~b~~h~~h~");
  512. strcat(szBuffer, g_Team[g_Player[playerid][playerClass]][teamName]);
  513. strcat(szBuffer, "~n~~n~Weapons recieved!~n~");
  514. GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon1][0], szWeaponName, sizeof(szWeaponName));
  515. strcat(szBuffer, szWeaponName);
  516. strcat(szBuffer, ", ");
  517. GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon2][0], szWeaponName, sizeof(szWeaponName));
  518. strcat(szBuffer, szWeaponName);
  519. strcat(szBuffer, ", ");
  520. GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeapon3][0], szWeaponName, sizeof(szWeaponName));
  521. strcat(szBuffer, szWeaponName);
  522. strcat(szBuffer, ", ");
  523. GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeaponThrown][0], szWeaponName, sizeof(szWeaponName));
  524. strcat(szBuffer, szWeaponName);
  525. strcat(szBuffer, ", ");
  526. GetWeaponName(g_Team[g_Player[playerid][playerClass]][teamWeaponMelle], szWeaponName, sizeof(szWeaponName));
  527. strcat(szBuffer, szWeaponName);
  528. strcat(szBuffer, "~n~~n~~r~~h~~h~Spawn protection over!");
  529. PlayerTextDrawSetString(playerid, g_Player[playerid][playerSpawnTxt], szBuffer);
  530. PlayerTextDrawShow(playerid, g_Player[playerid][playerSpawnTxt]);
  531. }
  532.  
  533. forward OnSpawnTextdrawHide(playerid);
  534. public OnSpawnTextdrawHide(playerid) {
  535. PlayerTextDrawHide(playerid, g_Player[playerid][playerSpawnTxt]);
  536.  
  537. g_Player[playerid][playerSpawnTxtTimer] = -1;
  538. }
  539.  
  540. public OnPlayerDeath(playerid, killerid, reason) {
  541. SendClientMessage(killerid, COLOR_ORANGE, "Good job gangsta! You smoked the nigga! [+$2500 +1 Score]");
  542. GivePlayerMoney(killerid, 2500);
  543. SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
  544.  
  545. GivePlayerMoney(playerid, -1000);
  546.  
  547. return 1;
  548. }
  549.  
  550. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart) {
  551. if (GetPlayerTeam(playerid) != NO_TEAM && GetPlayerTeam(playerid) == GetPlayerTeam(damagedid)) {
  552. GameTextForPlayer(playerid, "~r~Don't attack your teammates", 3000, 3);
  553. return 0;
  554. }
  555.  
  556. return 1;
  557. }
  558.  
  559. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) {
  560. if ((GetPlayerTeam(playerid) == NO_TEAM && GetPlayerTeam(issuerid) == NO_TEAM) || GetPlayerTeam(issuerid) != GetPlayerTeam(playerid)) {
  561. if (bodypart == 9 && ! g_Player[playerid][playerHelmet]) {
  562. SetPlayerHealth(playerid, 0.0);
  563.  
  564. SendClientMessage(issuerid, COLOR_ORANGE, "Good job gangsta! You made a perfect headshot over that nigga! [+$3000 +1 Score]");
  565. GivePlayerMoney(issuerid, 3000);
  566. SetPlayerScore(issuerid, GetPlayerScore(issuerid) + 1);
  567.  
  568. return 0;
  569. }
  570. }
  571. return 1;
  572. }
  573.  
  574. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) {
  575. if (hittype == BULLET_HIT_TYPE_VEHICLE) {
  576. new
  577. target = INVALID_PLAYER_ID
  578. ;
  579. for (new i; i < MAX_PLAYERS; i++) {
  580. if (i != playerid && IsPlayerConnected(i) && GetPlayerVehicleID(i) == hitid && GetPlayerVehicleSeat(i) == 0) {
  581. target = i;
  582. break;
  583. }
  584. }
  585. if (target != INVALID_PLAYER_ID && GetPlayerTeam(playerid) != NO_TEAM && GetPlayerTeam(playerid) == GetPlayerTeam(target)) {
  586. GameTextForPlayer(playerid, "~r~Don't attack a team vehicle", 3000, 3);
  587. return 0;
  588. }
  589. }
  590.  
  591. return 1;
  592. }
  593.  
  594. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
  595. if (! ispassenger) {
  596. new
  597. target = INVALID_PLAYER_ID
  598. ;
  599. for (new i; i < MAX_PLAYERS; i++) {
  600. if (i != playerid && IsPlayerConnected(i) && GetPlayerVehicleID(i) == vehicleid && GetPlayerVehicleSeat(i) == 0) {
  601. target = i;
  602. break;
  603. }
  604. }
  605. if (target != INVALID_PLAYER_ID && GetPlayerTeam(playerid) != NO_TEAM && GetPlayerTeam(playerid) == GetPlayerTeam(target)) {
  606. ClearAnimations(playerid);
  607.  
  608. new
  609. Float:x,
  610. Float:y,
  611. Float:z
  612. ;
  613. GetPlayerPos(playerid, x, y, z);
  614. SetPlayerPos(playerid, x, y, z);
  615.  
  616. GameTextForPlayer(playerid, "~r~Don't jack your team vehicle", 3000, 3);
  617. return 0;
  618. }
  619. }
  620.  
  621. return 1;
  622. }
  623.  
  624. public OnPlayerUpdate(playerid) {
  625. if (GetPlayerWeapon(playerid) == 4) {
  626. if (GetPlayerAnimationIndex(playerid) != 0) {
  627. new
  628. animation[2][35]
  629. ;
  630. GetAnimationName(GetPlayerAnimationIndex(playerid), animation[0], 35, animation[1], 35);
  631.  
  632. if (!strcmp(animation[0], "KNIFE", true) && !strcmp(animation[1], "KILL_Knife_Player", true)) {
  633. new
  634. target = GetPlayerTargetPlayer(playerid)
  635. ;
  636.  
  637. if (IsPlayerConnected(target)) {
  638. new
  639. Float:x,
  640. Float:y,
  641. Float:z
  642. ;
  643. GetPlayerPos(target, x, y, z);
  644.  
  645. if (IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z)) {
  646. if (GetPlayerTeam(playerid) == GetPlayerTeam(target)) {
  647. ClearAnimations(playerid);
  648.  
  649. GetPlayerPos(playerid, x, y, z);
  650. SetPlayerPos(playerid, x, y, z);
  651.  
  652. GameTextForPlayer(playerid, "~r~Don't knife your Teammates", 5000, 3);
  653. GameTextForPlayer(playerid, "~r~You got team knifed!~n~~r~Type /sync to synchronize", 5000, 3);
  654.  
  655. return 0;
  656. }
  657. }
  658. }
  659. }
  660. }
  661. }
  662.  
  663. return 1;
  664. }
  665.  
  666. bool:IsPlayerInInvalidState(playerid) {
  667. new
  668. Float:fHealth
  669. ;
  670. GetPlayerHealth(playerid, fHealth);
  671. if (fHealth <= 0.0) {
  672. return true;
  673. }
  674. else if (GetPlayerState(playerid) == PLAYER_STATE_WASTED) {
  675. return true;
  676. }
  677. else if (GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) {
  678. return true;
  679. }
  680. else {
  681. return false;
  682. }
  683. }
  684.  
  685. CMD:hp(playerid) {
  686. if (IsPlayerInInvalidState(playerid)) {
  687. return 1;
  688. }
  689.  
  690. if (GetPlayerMoney(playerid) < 5000) {
  691. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5000 for health refill.");
  692. }
  693.  
  694. if (gettime() - g_Player[playerid][playerLastRefill] <= 5 * 60) {
  695. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You must wait for atleast 5 minutes before using this command again.");
  696. }
  697.  
  698. SetPlayerHealth(playerid, 100.0);
  699. GivePlayerMoney(playerid, -5000);
  700. SendClientMessage(playerid, COLOR_ORANGE_RED, "HEALTH: You have refilled your player's health [-$5000].");
  701. GameTextForPlayer(playerid, "~g~+100 Health", 3000, 3);
  702.  
  703. g_Player[playerid][playerLastRefill] = gettime();
  704.  
  705. return 1;
  706. }
  707.  
  708. CMD:health(playerid) {
  709. return cmd_hp(playerid);
  710. }
  711.  
  712. CMD:heal(playerid) {
  713. return cmd_hp(playerid);
  714. }
  715.  
  716. CMD:ar(playerid) {
  717. if (IsPlayerInInvalidState(playerid)) {
  718. return 1;
  719. }
  720.  
  721. if (GetPlayerMoney(playerid) < 5000) {
  722. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5000 for armour refill.");
  723. }
  724.  
  725. if (gettime() - g_Player[playerid][playerLastRefill] <= 5 * 60) {
  726. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You must wait for atleast 5 minutes before using this command again.");
  727. }
  728.  
  729. SetPlayerArmour(playerid, 100.0);
  730. GivePlayerMoney(playerid, -5000);
  731. SendClientMessage(playerid, COLOR_ORANGE_RED, "ARMOUR: You have refilled your player's armour [-$5000].");
  732. GameTextForPlayer(playerid, "~g~+100 Armour", 3000, 3);
  733.  
  734. g_Player[playerid][playerLastRefill] = gettime();
  735.  
  736. return 1;
  737. }
  738.  
  739. CMD:armour(playerid) {
  740. return cmd_ar(playerid);
  741. }
  742.  
  743. CMD:shop(playerid, params[]) {
  744. if (IsPlayerInInvalidState(playerid)) {
  745. return 1;
  746. }
  747.  
  748. if (IsPlayerInAnyVehicle(playerid)) {
  749. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You must be on foot to use this command.");
  750. }
  751.  
  752. if (! sscanf(params, "i", g_Player[playerid][playerWeaponSelc]) && 0 <= g_Player[playerid][playerWeaponSelc] <= 20) {
  753. switch (g_Player[playerid][playerWeaponSelc]) {
  754. case 0: {
  755. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Knife "SAMP_BLUE"for "WHITE"-$1000 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
  756. }
  757. case 1: {
  758. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Chainsaw "SAMP_BLUE"for "WHITE"-$2500 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
  759. }
  760. case 2: {
  761. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Grenade "SAMP_BLUE"for "WHITE"-$2500 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
  762. }
  763. case 3: {
  764. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Moltove Cocktail "SAMP_BLUE"for "WHITE"-$2000 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
  765. }
  766. case 4: {
  767. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Silenced 9mm "SAMP_BLUE"for "WHITE"-$3000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
  768. }
  769. case 5: {
  770. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Desert Eagle "SAMP_BLUE"for "WHITE"-$4500 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
  771. }
  772. case 6: {
  773. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Sawnoff Shotgun "SAMP_BLUE"for "WHITE"-$6500 "SAMP_BLUE"[50 ammo] ?", "Yes", "No");
  774. }
  775. case 7: {
  776. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Combat Shotgun "SAMP_BLUE"for "WHITE"-$6000 "SAMP_BLUE"[50 ammo] ?", "Yes", "No");
  777. }
  778. case 8: {
  779. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"UZI "SAMP_BLUE"for "WHITE"-$4500 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
  780. }
  781. case 9: {
  782. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"MP5 "SAMP_BLUE"for "WHITE"-$4000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
  783. }
  784. case 10: {
  785. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Tec-9 "SAMP_BLUE"for "WHITE"-$4500 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
  786. }
  787. case 11: {
  788. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Sniper Rifle "SAMP_BLUE"for "WHITE"-$7000 "SAMP_BLUE"[50 ammo] ?", "Yes", "No");
  789. }
  790. case 12: {
  791. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Ak-47 "SAMP_BLUE"for "WHITE"-$5000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
  792. }
  793. case 13: {
  794. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"M4 "SAMP_BLUE"for "WHITE"-$5500 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
  795. }
  796. case 14: {
  797. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"RPG. "SAMP_BLUE"for "WHITE"-$3500 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
  798. }
  799. case 15: {
  800. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"HS. Rocket "SAMP_BLUE"for "WHITE"-$4000 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
  801. }
  802. case 16: {
  803. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Flamethrower "SAMP_BLUE"for "WHITE"-$5000 "SAMP_BLUE"[200 ammo] ?", "Yes", "No");
  804. }
  805. case 17: {
  806. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "RED"MINIGUN "SAMP_BLUE"for "WHITE"-$15000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
  807. }
  808. case 18: {
  809. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Satchel Charge "SAMP_BLUE"for "WHITE"-$2000 "SAMP_BLUE"[1 ammo] ?", "Yes", "No");
  810. }
  811. case 19: {
  812. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Spray Can "SAMP_BLUE"for "WHITE"-$1000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
  813. }
  814. case 20: {
  815. ShowPlayerDialog(playerid, DIALOG_ID_CONFIRM, DIALOG_STYLE_MSGBOX, "Shop confirmation:", "Are you sure you want to buy a "WHITE"Fire Extinguisher "SAMP_BLUE"for "WHITE"-$1000 "SAMP_BLUE"[100 ammo] ?", "Yes", "No");
  816. }
  817. }
  818.  
  819. SendClientMessage(playerid, COLOR_KHAKI, "TIP: You can also see the full weapons list by just typing /shop.");
  820.  
  821. return 1;
  822. }
  823.  
  824. new
  825. szInfo[2024]
  826. ;
  827. strcat(szInfo, "335\n0. Knife~n~1 Ammo~n~-$1000\n");
  828. strcat(szInfo, "341\n1. Chainsaw~n~1 Ammo~n~-$2500\n");
  829. strcat(szInfo, "342\n2. Grenade~n~1 Ammo~n~-$2000\n");
  830. strcat(szInfo, "343\n3. Moltove~n~1 Ammo~n~-$2000\n");
  831. strcat(szInfo, "347\n4. Silenced 9mm~n~100 Ammo~n~-$3000\n");
  832. strcat(szInfo, "348\n5. Desert Eagle~n~50 Ammo~n~-$4500\n");
  833. strcat(szInfo, "350\n6. Sawnoff Shotgun~n~50 Ammo~n~-$6500\n");
  834. strcat(szInfo, "351\n7. Combat Shotgun~n~50 Ammo~n~-$6000\n");
  835. strcat(szInfo, "352\n8. UZI~n~100 Ammo~n~-$4500\n");
  836. strcat(szInfo, "353\n9. MP5~n~100 Ammo~n~-$4000\n");
  837. strcat(szInfo, "372\n10. Tec-9~n~100 Ammo~n~-$4500\n");
  838. strcat(szInfo, "358\n11. Sniper Rifle~n~50 Ammo~n~-$7000\n");
  839. strcat(szInfo, "355\n12. Ak-47~n~100 Ammo~n~-$5000\n");
  840. strcat(szInfo, "356\n13. M4~n~100 Ammo~n~-$5500\n");
  841. strcat(szInfo, "359\n14. RPG.~n~1 Ammo~n~-$3500\n");
  842. strcat(szInfo, "360\n15. HS. Rocket~n~1 Ammo~n~-$4000\n");
  843. strcat(szInfo, "361\n16. Flamethrower~n~200 Ammo~n~-$5000\n");
  844. strcat(szInfo, "362\n17. MINIGUN~n~~w~~h~100 Ammo~n~-$15000\n");
  845. strcat(szInfo, "363\n18. Satchel Charge~n~1 Ammo~n~-$2000\n");
  846. strcat(szInfo, "365\n19. Spray Can~n~100 Ammo~n~-$1000\n");
  847. strcat(szInfo, "366\n20. Fire Extinguisher~n~100 Ammo~n~-$1000");
  848. ShowPlayerDialog(playerid, DIALOG_ID_SHOP, DIALOG_STYLE_PREVMODEL, "Game shop", szInfo, "Buy", "Close");
  849.  
  850. SendClientMessage(playerid, COLOR_KHAKI, "TIP: You also instanly buy weapons by specifing the listitem in front of /shop [eg. /shop 0 - for knife].");
  851.  
  852. return 1;
  853. }
  854.  
  855. CMD:helmet(playerid) {
  856. if (IsPlayerInInvalidState(playerid)) {
  857. return 1;
  858. }
  859.  
  860. if (g_Player[playerid][playerHelmet]) {
  861. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You already have a helmet, over your head!");
  862. }
  863.  
  864. if (GetPlayerMoney(playerid) < 8000) {
  865. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $8000 for helmet.");
  866. }
  867.  
  868. GivePlayerMoney(playerid, -8000);
  869. g_Player[playerid][playerHelmet] = true;
  870. SetPlayerAttachedObject(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 1, 18638, 2, 0.128000, 0.049999, 0.006000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  871.  
  872. SendClientMessage(playerid, COLOR_LIME, "HELMET: You won't instantly die from headshots, now onwards. [-$8000]");
  873.  
  874. return 1;
  875. }
  876.  
  877. CMD:mask(playerid) {
  878. if (IsPlayerInInvalidState(playerid)) {
  879. return 1;
  880. }
  881.  
  882. if (g_Player[playerid][playerMask]) {
  883. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You already have a mask, sticked on your face!");
  884. }
  885.  
  886. if (GetPlayerMoney(playerid) < 5000) {
  887. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5000 for mask.");
  888. }
  889.  
  890. GivePlayerMoney(playerid, -5000);
  891. g_Player[playerid][playerMask] = true;
  892. SetPlayerAttachedObject(playerid, MAX_PLAYER_ATTACHED_OBJECTS - 2, 19472, 2, -0.022000, 0.137000, 0.018999, 3.899994, 85.999961, 92.999984, 0.923999, 1.141000, 1.026999);
  893.  
  894. SendClientMessage(playerid, COLOR_LIME, "HELMET: You won't get effected or feel cough from teargas, now onwards. [-$5000]");
  895.  
  896. return 1;
  897. }
  898.  
  899. CMD:ep(playerid) {
  900. if (IsPlayerInInvalidState(playerid)) {
  901. return 1;
  902. }
  903.  
  904. GivePlayerWeapon(playerid, 46, 1);
  905. GameTextForPlayer(playerid, "~g~Parachute", 3000, 3);
  906.  
  907. return 1;
  908. }
  909.  
  910. CMD:para(playerid) {
  911. return cmd_ep(playerid);
  912. }
  913.  
  914. CMD:parachute(playerid) {
  915. return cmd_ep(playerid);
  916. }
  917.  
  918. CMD:offradar(playerid) {
  919. if (IsPlayerInInvalidState(playerid)) {
  920. return 1;
  921. }
  922.  
  923. if (g_Player[playerid][playerOffradarTimer] != -1) {
  924. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You are already off the radar.");
  925. }
  926.  
  927. if (GetPlayerMoney(playerid) < 7000) {
  928. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $7000 for going off radar.");
  929. }
  930.  
  931. if (gettime() - g_Player[playerid][playerLastOffradar] <= 3 * 60) {
  932. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You must wait for atleast 3 minutes before using this command again.");
  933. }
  934.  
  935. for (new i; i < MAX_PLAYERS; i++) {
  936. SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));
  937. }
  938. GivePlayerMoney(playerid, -7000);
  939. PlayerTextDrawShow(playerid, g_Player[playerid][playerOffradarTxt]);
  940.  
  941. SendClientMessage(playerid, COLOR_ORANGE_RED, "OFF-RADAR: You are now invisible on map for 2 minutes [-$7000].");
  942. GameTextForPlayer(playerid, "~b~Off Radar", 3000, 3);
  943.  
  944. g_Player[playerid][playerLastOffradar] = 2 * 60;
  945. g_Player[playerid][playerOffradarTimer] = SetTimerEx("OnPlayerOffRadarTimeExpire", 1000, true, "i", playerid);
  946.  
  947. return 1;
  948. }
  949.  
  950. CMD:offradars(playerid) {
  951. new
  952. szBuffer[MAX_PLAYER_NAME],
  953. szInfo[MAX_PLAYER_NAME * MAX_PLAYERS]
  954. ;
  955. for (new i, j = GetPlayerPoolSize(); i <= j; i++) {
  956. if (IsPlayerConnected(i) && g_Player[i][playerOffradarTimer] != -1) {
  957. format(szInfo, sizeof(szInfo), "%i. ", i);
  958. GetPlayerName(i, szBuffer, MAX_PLAYER_NAME);
  959. strcat(szInfo, szBuffer);
  960. strcat(szInfo, " ");
  961. format(szBuffer, sizeof(szBuffer), "[For %i secs.]", g_Player[playerid][playerLastOffradar]);
  962. strcat(szInfo, szBuffer);
  963. strcat(szInfo, "\n");
  964. }
  965. }
  966.  
  967. if (! szInfo[0]) {
  968. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: No players /offradar currently.");
  969. }
  970. else {
  971. ShowPlayerDialog(playerid, DIALOG_ID_COMMON, DIALOG_STYLE_LIST, "Player currently /offradar:", szBuffer, "Close", "");
  972. }
  973.  
  974. return 1;
  975. }
  976.  
  977. CMD:kill(playerid) {
  978. SetPlayerHealth(playerid, 0.0);
  979.  
  980. return 1;
  981. }
  982.  
  983. CMD:die(playerid) {
  984. return cmd_kill(playerid);
  985. }
  986.  
  987. CMD:ammo(playerid) {
  988. if (IsPlayerInInvalidState(playerid)) {
  989. return 1;
  990. }
  991.  
  992. if (GetPlayerMoney(playerid) < 4500) {
  993. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4500 for ammo boost (all weapons).");
  994. }
  995.  
  996. if (gettime() - g_Player[playerid][playerLastAmmoBoost] <= 2 * 60) {
  997. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You must wait for atleast 2 minutes before using this command again.");
  998. }
  999.  
  1000. new
  1001. iWeapon[2]
  1002. ;
  1003. for (new i; i < 13; i++) {
  1004. GetPlayerWeaponData(playerid, i, iWeapon[0], iWeapon[1]);
  1005. GivePlayerWeapon(playerid, iWeapon[0], -iWeapon[1]);
  1006. switch (iWeapon[0]) {
  1007. case 0..15: {
  1008. iWeapon[1] += 1;
  1009. }
  1010. case 16..18: {
  1011. iWeapon[1] += 1;
  1012. }
  1013. case 22..31: {
  1014. iWeapon[1] += 50;
  1015. }
  1016. case 33..34: {
  1017. iWeapon[1] += 10;
  1018. }
  1019. case 35..36: {
  1020. iWeapon[1] += 1;
  1021. }
  1022. case 37: {
  1023. iWeapon[1] += 50;
  1024. }
  1025. default: {
  1026. iWeapon[1] += 1;
  1027. }
  1028. }
  1029. GivePlayerWeapon(playerid, iWeapon[0], iWeapon[1]);
  1030. }
  1031. GivePlayerMoney(playerid, -4500);
  1032. SendClientMessage(playerid, COLOR_ORANGE_RED, "AMMO: You have boosted all of your weapons' ammo [-$4500].");
  1033. GameTextForPlayer(playerid, "~g~+Ammo boost", 3000, 3);
  1034.  
  1035. g_Player[playerid][playerLastAmmoBoost] = gettime();
  1036.  
  1037. return 1;
  1038. }
  1039.  
  1040. CMD:boost(playerid) {
  1041. return cmd_ammo(playerid);
  1042. }
  1043.  
  1044. bool:IsPlayerNearAnyEnemy(playerid) {
  1045. new
  1046. Float:x,
  1047. Float:y,
  1048. Float:z
  1049. ;
  1050. GetPlayerPos(playerid, x, y, z);
  1051.  
  1052. for (new i, j = GetPlayerPoolSize(); i <= j; i++) {
  1053. if (IsPlayerConnected(i) && GetPlayerTeam(i) != GetPlayerTeam(playerid) && IsPlayerInRangeOfPoint(i, 50.0, x, y, z)) {
  1054. return true;
  1055. }
  1056. }
  1057.  
  1058. return false;
  1059. }
  1060.  
  1061. CMD:changeteam(playerid) {
  1062. if (IsPlayerInInvalidState(playerid)) {
  1063. return 1;
  1064. }
  1065.  
  1066. if (IsPlayerNearAnyEnemy(playerid)) {
  1067. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You cannot use this command near enemies (50 units range).");
  1068. }
  1069.  
  1070. ForceClassSelection(playerid);
  1071. SpawnPlayer(playerid);
  1072.  
  1073. return 1;
  1074. }
  1075.  
  1076. CMD:ct(playerid) {
  1077. return cmd_changeteam(playerid);
  1078. }
  1079.  
  1080. CMD:st(playerid) {
  1081. return cmd_changeteam(playerid);
  1082. }
  1083.  
  1084. CMD:help(playerid) {
  1085. new
  1086. szBuffer[1024]
  1087. ;
  1088. strcat(szBuffer, ""WHITE"/hp "SAMP_BLUE"- Buy health for your player\n\n");
  1089. strcat(szBuffer, ""WHITE"/ar "SAMP_BLUE"- Buy armour for your player\n\n");
  1090. strcat(szBuffer, ""WHITE"/shop "SAMP_BLUE"- Open weapons shop\n\n");
  1091. strcat(szBuffer, ""WHITE"/helmet "SAMP_BLUE"- Buy anti headshot helmet\n\n");
  1092. strcat(szBuffer, ""WHITE"/mask "SAMP_BLUE"- Buy anti tear gas mask\n\n");
  1093. strcat(szBuffer, ""WHITE"/ep "SAMP_BLUE"- Spawn a parachute\n\n");
  1094. strcat(szBuffer, ""WHITE"/offradar "SAMP_BLUE"- Go invisible on the map\n\n");
  1095. strcat(szBuffer, ""WHITE"/offradars "SAMP_BLUE"- See off radar players\n\n");
  1096. strcat(szBuffer, ""WHITE"/kill "SAMP_BLUE"- Sucide\n\n");
  1097. strcat(szBuffer, ""WHITE"/ammo "SAMP_BLUE"- Refill/Boost ammo for all your weapons\n\n");
  1098. strcat(szBuffer, ""WHITE"/ct "SAMP_BLUE"- Change team without dying\n\n");
  1099. strcat(szBuffer, ""WHITE"/acmds "SAMP_BLUE"- Admin system commands\n\n");
  1100.  
  1101. ShowPlayerDialog(playerid, DIALOG_ID_COMMON, DIALOG_STYLE_MSGBOX, "Server help", szBuffer, "Close", "");
  1102.  
  1103. return 1;
  1104. }
  1105.  
  1106. forward OnPlayerOffRadarTimeExpire(playerid);
  1107. public OnPlayerOffRadarTimeExpire(playerid) {
  1108. if (g_Player[playerid][playerLastOffradar] == 0) {
  1109. for (new i; i < MAX_PLAYERS; i++) {
  1110. SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) | 0xFFFFFFFF));
  1111. }
  1112. SendClientMessage(playerid, COLOR_ORANGE_RED, "ON-RADAR: You are now On the radar.");
  1113. GameTextForPlayer(playerid, "~b~On Radar", 3000, 3);
  1114.  
  1115. KillTimer(g_Player[playerid][playerOffradarTimer]);
  1116. g_Player[playerid][playerOffradarTimer] = -1;
  1117. g_Player[playerid][playerLastOffradar] = gettime();
  1118.  
  1119. PlayerTextDrawHide(playerid, g_Player[playerid][playerOffradarTxt]);
  1120. }
  1121. else {
  1122. g_Player[playerid][playerLastOffradar]--;
  1123.  
  1124. new
  1125. szBuffer[150]
  1126. ;
  1127. format(szBuffer, sizeof(szBuffer), "You are now off the radar, that means not visible on game map/radar~n~~n~/Offradar: ~r~~h~~h~%i..", g_Player[playerid][playerLastOffradar]);
  1128. PlayerTextDrawSetString(playerid, g_Player[playerid][playerOffradarTxt], szBuffer);
  1129. }
  1130. }
  1131.  
  1132. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  1133. switch (dialogid) {
  1134. case DIALOG_ID_SHOP, DIALOG_ID_CONFIRM: {
  1135. if (response) {
  1136. if (dialogid == DIALOG_ID_CONFIRM) {
  1137. listitem = g_Player[playerid][playerWeaponSelc];
  1138. }
  1139.  
  1140. switch (listitem) {
  1141. case 0: {
  1142. if (GetPlayerMoney(playerid) < 1000) {
  1143. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $1000 to buy Knife.");
  1144. }
  1145.  
  1146. GivePlayerWeapon(playerid, 4, 1);
  1147. GivePlayerMoney(playerid, -1000);
  1148.  
  1149. GameTextForPlayer(playerid, "~g~Knife~n~~g~-$1000", 3000, 3);
  1150. }
  1151. case 1: {
  1152. if (GetPlayerMoney(playerid) < 1000) {
  1153. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $1000 to buy Chainsaw.");
  1154. }
  1155.  
  1156. GivePlayerWeapon(playerid, 9, 1);
  1157. GivePlayerMoney(playerid, -1000);
  1158.  
  1159. GameTextForPlayer(playerid, "~g~Chainsaw~n~~g~-$1000", 3000, 3);
  1160. }
  1161. case 2: {
  1162. if (GetPlayerMoney(playerid) < 2500) {
  1163. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $2500 to buy Grenade.");
  1164. }
  1165.  
  1166. GivePlayerWeapon(playerid, 16, 1);
  1167. GivePlayerMoney(playerid, -2500);
  1168.  
  1169. GameTextForPlayer(playerid, "~g~Grenade~n~~g~-$2500", 3000, 3);
  1170. }
  1171. case 3: {
  1172. if (GetPlayerMoney(playerid) < 2000) {
  1173. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $2000 to buy Moltove Cocktail.");
  1174. }
  1175.  
  1176. GivePlayerWeapon(playerid, 18, 1);
  1177. GivePlayerMoney(playerid, -2000);
  1178.  
  1179. GameTextForPlayer(playerid, "~g~Grenade~n~~g~-$2500", 3000, 3);
  1180. }
  1181. case 4: {
  1182. if (GetPlayerMoney(playerid) < 3000) {
  1183. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $3000 to buy Silenced 9mm.");
  1184. }
  1185.  
  1186. GivePlayerWeapon(playerid, 23, 100);
  1187. GivePlayerMoney(playerid, -3000);
  1188.  
  1189. GameTextForPlayer(playerid, "~g~Silenced 9mm~n~~g~-$3000", 3000, 3);
  1190. }
  1191. case 5: {
  1192. if (GetPlayerMoney(playerid) < 4500) {
  1193. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4500 to buy Desert Eagle.");
  1194. }
  1195.  
  1196. GivePlayerWeapon(playerid, 24, 100);
  1197. GivePlayerMoney(playerid, -4500);
  1198.  
  1199. GameTextForPlayer(playerid, "~g~Desert Eagle~n~~g~-$4500", 3000, 3);
  1200. }
  1201. case 6: {
  1202. if (GetPlayerMoney(playerid) < 6500) {
  1203. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $6500 to buy Sawnoff Shotgun.");
  1204. }
  1205.  
  1206. GivePlayerWeapon(playerid, 26, 50);
  1207. GivePlayerMoney(playerid, -6500);
  1208.  
  1209. GameTextForPlayer(playerid, "~g~Sawnoff Shotgun~n~~g~-$6500", 3000, 3);
  1210. }
  1211. case 7: {
  1212. if (GetPlayerMoney(playerid) < 6000) {
  1213. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $6000 to buy Combat Shotgun.");
  1214. }
  1215.  
  1216. GivePlayerWeapon(playerid, 27, 50);
  1217. GivePlayerMoney(playerid, -6000);
  1218.  
  1219. GameTextForPlayer(playerid, "~g~Combat Shotgun~n~~g~-$6000", 3000, 3);
  1220. }
  1221. case 8: {
  1222. if (GetPlayerMoney(playerid) < 4500) {
  1223. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4500 to buy UZI.");
  1224. }
  1225.  
  1226. GivePlayerWeapon(playerid, 28, 100);
  1227. GivePlayerMoney(playerid, -4500);
  1228.  
  1229. GameTextForPlayer(playerid, "~g~UZI~n~~g~-$4500", 3000, 3);
  1230. }
  1231. case 9: {
  1232. if (GetPlayerMoney(playerid) < 4000) {
  1233. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4000 to buy MP5.");
  1234. }
  1235.  
  1236. GivePlayerWeapon(playerid, 29, 100);
  1237. GivePlayerMoney(playerid, -4000);
  1238.  
  1239. GameTextForPlayer(playerid, "~g~MP5~n~~g~-$4000", 3000, 3);
  1240. }
  1241. case 10: {
  1242. if (GetPlayerMoney(playerid) < 4500) {
  1243. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4500 to buy Tec-9.");
  1244. }
  1245.  
  1246. GivePlayerWeapon(playerid, 32, 100);
  1247. GivePlayerMoney(playerid, -4500);
  1248.  
  1249. GameTextForPlayer(playerid, "~g~Tec-9~n~~g~-$4500", 3000, 3);
  1250. }
  1251. case 11: {
  1252. if (GetPlayerMoney(playerid) < 7000) {
  1253. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $7000 to buy Sniper Rifle.");
  1254. }
  1255.  
  1256. GivePlayerWeapon(playerid, 34, 50);
  1257. GivePlayerMoney(playerid, -7000);
  1258.  
  1259. GameTextForPlayer(playerid, "~g~Sniper Rifle~n~~g~-$7000", 3000, 3);
  1260. }
  1261. case 12: {
  1262. if (GetPlayerMoney(playerid) < 5000) {
  1263. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5000 to buy Ak-47.");
  1264. }
  1265.  
  1266. GivePlayerWeapon(playerid, 30, 100);
  1267. GivePlayerMoney(playerid, -5000);
  1268.  
  1269. GameTextForPlayer(playerid, "~g~Ak-47~n~~g~-$5000", 3000, 3);
  1270. }
  1271. case 13: {
  1272. if (GetPlayerMoney(playerid) < 5500) {
  1273. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5500 to buy M4.");
  1274. }
  1275.  
  1276. GivePlayerWeapon(playerid, 31, 100);
  1277. GivePlayerMoney(playerid, -5500);
  1278.  
  1279. GameTextForPlayer(playerid, "~g~M4~n~~g~-$5500", 3000, 3);
  1280. }
  1281. case 14: {
  1282. if (GetPlayerMoney(playerid) < 3500) {
  1283. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $3500 to buy RPG..");
  1284. }
  1285.  
  1286. GivePlayerWeapon(playerid, 35, 1);
  1287. GivePlayerMoney(playerid, -3500);
  1288.  
  1289. GameTextForPlayer(playerid, "~g~RPG.~n~~g~-$3500", 3000, 3);
  1290. }
  1291. case 15: {
  1292. if (GetPlayerMoney(playerid) < 4000) {
  1293. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $4000 to buy HS. Rocket.");
  1294. }
  1295.  
  1296. GivePlayerWeapon(playerid, 36, 1);
  1297. GivePlayerMoney(playerid, -4000);
  1298.  
  1299. GameTextForPlayer(playerid, "~g~HS. Rocket~n~~g~-$4000", 3000, 3);
  1300. }
  1301. case 16: {
  1302. if (GetPlayerMoney(playerid) < 5000) {
  1303. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $5000 to buy Flamethrower.");
  1304. }
  1305.  
  1306. GivePlayerWeapon(playerid, 37, 200);
  1307. GivePlayerMoney(playerid, -5000);
  1308.  
  1309. GameTextForPlayer(playerid, "~g~Flamethrower~n~~g~-$5000", 3000, 3);
  1310. }
  1311. case 17: {
  1312. if (GetPlayerMoney(playerid) < 15000) {
  1313. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $15000 to buy MINIGUN.");
  1314. }
  1315.  
  1316. GivePlayerWeapon(playerid, 38, 100);
  1317. GivePlayerMoney(playerid, -15000);
  1318.  
  1319. GameTextForPlayer(playerid, "~g~MINIGUN~n~~g~-$15000", 3000, 3);
  1320. }
  1321. case 18: {
  1322. if (GetPlayerMoney(playerid) < 2000) {
  1323. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $2000 to buy Satchel Charge.");
  1324. }
  1325.  
  1326. GivePlayerWeapon(playerid, 39, 1);
  1327. GivePlayerMoney(playerid, -2000);
  1328.  
  1329. GameTextForPlayer(playerid, "~g~Satchel Charge~n~~g~-$2000", 3000, 3);
  1330. }
  1331. case 19: {
  1332. if (GetPlayerMoney(playerid) < 1000) {
  1333. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $1000 to buy Spray Can.");
  1334. }
  1335.  
  1336. GivePlayerWeapon(playerid, 41, 100);
  1337. GivePlayerMoney(playerid, -1000);
  1338.  
  1339. GameTextForPlayer(playerid, "~g~Spray Can~n~~g~-$1000", 3000, 3);
  1340. }
  1341. case 20: {
  1342. if (GetPlayerMoney(playerid) < 1000) {
  1343. return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You need atleast $1000 to buy Fire Extinguisher.");
  1344. }
  1345.  
  1346. GivePlayerWeapon(playerid, 42, 100);
  1347. GivePlayerMoney(playerid, -1000);
  1348.  
  1349. GameTextForPlayer(playerid, "~g~Fire Extinguisher~n~~g~-$1000", 3000, 3);
  1350. }
  1351. }
  1352. }
  1353. }
  1354. }
  1355.  
  1356. return 1;
  1357. }
  1358.  
  1359. public OnPlayerText(playerid, text[]) {
  1360. new
  1361. szName[MAX_PLAYER_NAME],
  1362. szBuffer[156]
  1363. ;
  1364. GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
  1365. format(szBuffer, sizeof(szBuffer), "%i> %s: "SAMP_BLUE"%s", playerid, szName, text);
  1366. SendClientMessageToAll(GetPlayerColor(playerid), szBuffer);
  1367.  
  1368. return 0;
  1369. }
  1370.  
  1371. public OnVehicleDeath(vehicleid, killerid) {
  1372. if (killerid != INVALID_PLAYER_ID) {
  1373. for (new i, j = GetPlayerPoolSize(); i <= j; i++) {
  1374. if (i != killerid, IsPlayerConnected(i) && GetPlayerVehicleID(i) == vehicleid) {
  1375. return OnPlayerDeath(i, killerid, GetPlayerWeapon(killerid));
  1376. }
  1377. }
  1378. }
  1379.  
  1380. return 1;
  1381. }
  1382.  
  1383. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
  1384. if (newkeys & KEY_FIRE) {
  1385. if(GetPlayerWeapon(playerid) == 17) {
  1386. new
  1387. Float:x,
  1388. Float:y,
  1389. Float:z
  1390. ;
  1391. GetPlayerPos(playerid, x, y, z);
  1392.  
  1393. for (new i, j = GetPlayerPoolSize(); i < j; i++) {
  1394. if (IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 7.0, x, y, z) && i != playerid && GetPlayerState(i) == PLAYER_STATE_ONFOOT && ((GetPlayerTeam(playerid) == NO_TEAM && GetPlayerTeam(i) == NO_TEAM) || GetPlayerTeam(i) != GetPlayerTeam(playerid)) && ! g_Player[i][playerMask]) {
  1395. ApplyAnimation(i, "ped", "gas_cwr", 1.0, 0, 0, 0, 0, 0);
  1396. }
  1397. }
  1398. }
  1399. }
  1400.  
  1401. return 1;
  1402. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement