Guest User

Untitled

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