Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 114.58 KB | None | 0 0
  1. /*==================================================================================
  2. === LS Turf Wars 2 Ultimate v2 ===
  3. === By Popo ===
  4. === ===
  5. === Inspired by and bason on LS Turf Wars by [W]Hustler ===
  6. === ===
  7. === Credits: [W]Hustler, Simon, Mike, Jax, Sintax, -Seif-, Lethal, [NB]90NINE ===
  8. === HAMM3R and LeD. ===
  9. ==================================================================================*/
  10.  
  11. #include <a_samp>
  12. #include <core>
  13. #include <float>
  14.  
  15. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  16.  
  17. #define SLOTS 100 // how many slots the server got.
  18. #define ATTACK_TIME 180000 // Three minutes (60000 = 1 minute)
  19. #define STANDINTURF_TIME 20000 // Twenty secs (Always some extra secs are added because of the CheckPlayers timer)
  20. #define ATTACK_KILLS 5 // Kills to start a turfwar
  21. #define MEMBERS_NEEDED 10 // Members in turf to start turfwar
  22. #define TEAMSCORE 500 // Teamscore to take over all the opponends turf.
  23. #define DROP_WEAPONS 1
  24. #define DROP_LENGTH 10000 // 10 Seconds
  25. #define MAX_TEAMS 11
  26. #define MAX_TURFS 60
  27.  
  28. //================================== COLORS ====================================
  29. #define COLOR_GREY 0xAFAFAFAA
  30. #define COLOR_WHITE 0xFFFFFFAA
  31. #define COLOR_YELLOW 0xFFFF00AA
  32. #define COLOR_GREEN 0x00B000FF
  33. #define COLOR_ORANGE 0xFF9900AA
  34. #define COLOR_RED 0xFF4646FF
  35. #define COLOR_WHITE 0xFFFFFFAA
  36. #define COLOR_ME 0x62F821FF
  37. #define COLOR_INACTIVE 0xC8BEBEFF
  38. #define COLOR_FLASH 0xFF000080
  39. #define COLOR_FLASH2 0xFFFFFF80
  40. #define COLOR_ACHAT 0x8080FFFF
  41. #define COLOR_TPM 0x53A6A6FF
  42.  
  43. //Team Colors
  44. #define AZTECAS_COLOR 0x18D6E480
  45. #define VAGOS_COLOR 0xF5BE1880
  46. #define BALLAS_COLOR 0x9245AB80
  47. #define GROVE_COLOR 0x007D0080
  48. #define DEALERS_COLOR 0x5E2F2F80
  49. #define COPS_COLOR 0x0080FF80
  50. #define BIKERS_COLOR 0xAAAA0080
  51. #define RAPPERS_COLOR 0x91000080
  52. #define GUARDS_COLOR 0x41414180
  53. #define HOODLUMS_COLOR 0xFFAD5B80
  54. #define WORKERS_COLOR 0x1D584A80
  55.  
  56. //==============================================================================
  57. static gTeam[ SLOTS ];
  58. new bounty[ SLOTS ];
  59. new playerCheckpoint[ SLOTS ];
  60. new ShowPM[ SLOTS ];
  61. new Spawned[ SLOTS ];
  62. new Float:X250[ SLOTS ], Float:Y250[ SLOTS ], Float:Z250[ SLOTS ];
  63. new PlayerOnDuty[ SLOTS ];
  64. new lTMoney[ SLOTS ];
  65. new lSMoney[ SLOTS ];
  66. new TimerStarted[ MAX_TURFS ];
  67. new TheKiller[ SLOTS ];
  68. new gDropPickup[101] = -1;
  69. new savePos;
  70. new worldTime;
  71. new Menu:TKMenu;
  72.  
  73. new gDenyWeaponDrop[] = {1,8,11,12,13,17,19,20,35,36,37,38,39,40,41,43,44,45};
  74. #pragma unused gDenyWeaponDrop
  75.  
  76. //==================================== TEAM STUFF ==============================
  77. enum
  78. {
  79. TEAM_AZTECAS,
  80. TEAM_VAGOS,
  81. TEAM_BALLAS,
  82. TEAM_GROVE,
  83. TEAM_DEALERS,
  84. TEAM_COPS,
  85. TEAM_BIKERS,
  86. TEAM_RAPPERS,
  87. TEAM_GUARDS,
  88. TEAM_HOODLUMS,
  89. TEAM_WORKERS
  90. };
  91.  
  92. enum teaminfo
  93. {
  94. TeamName[ 32 ],
  95. TeamColor,
  96. TurfWarsWon,
  97. TurfWarsLost,
  98. RivalsKilled,
  99. HomiesDied,
  100. TeamScore
  101. }
  102.  
  103. new TeamInfo[ MAX_TEAMS ][ teaminfo ]= {
  104. { "Aztecas", AZTECAS_COLOR, 0, 0, 0, 0, 0},
  105. { "Vagos", VAGOS_COLOR, 0, 0, 0, 0, 0},
  106. { "Ballas", BALLAS_COLOR, 0, 0, 0, 0, 0},
  107. { "O.G.F.", GROVE_COLOR, 0, 0, 0, 0, 0},
  108. { "Dealers", DEALERS_COLOR, 0, 0, 0, 0, 0},
  109. { "Cops", COPS_COLOR, 0, 0, 0, 0, 0},
  110. { "Bikers", BIKERS_COLOR, 0, 0, 0, 0, 0},
  111. { "Rappers", RAPPERS_COLOR, 0, 0, 0, 0, 0},
  112. { "Guards", GUARDS_COLOR, 0, 0, 0, 0, 0},
  113. { "Hoodlums", HOODLUMS_COLOR, 0, 0, 0, 0, 0},
  114. { "Workers", WORKERS_COLOR, 0, 0, 0, 0, 0}
  115. };
  116.  
  117. //=================================== TURF STUFF ===============================
  118. enum tinfo
  119. {
  120. turfID,
  121. turfName[ 40 ],
  122. Float:zMinX,
  123. Float:zMinY,
  124. Float:zMaxX,
  125. Float:zMaxY,
  126. TurfColor,
  127. TurfOwner,
  128. TurfAttacker,
  129. TurfKills,
  130. TurfAttackKills,
  131. TurfWarStarted,
  132. MIT // Members In Turf
  133. }
  134.  
  135. new turfs[ MAX_TURFS ][ tinfo ] = {
  136. { 0, "Ganton", 2222.50, -1852.80, 2632.80, -1722.30, GROVE_COLOR, TEAM_GROVE, -1, 0, 0, 0, 0},
  137. { 1, "Ganton", 2222.50, -1722.30, 2632.80, -1628.50, GROVE_COLOR, TEAM_GROVE, -1, 0, 0, 0, 0},
  138. { 2, "Idlewood", 1812.60, -1852.80, 1971.60, -1742.30, COPS_COLOR, TEAM_COPS, -1, 0, 0, 0, 0},
  139. { 3, "Idlewood", 1951.60, -1742.30, 2124.60, -1602.30, COPS_COLOR, TEAM_COPS, -1, 0, 0, 0, 0},
  140. { 4, "Idlewood", 1812.60, -1602.30, 2124.60, -1449.60, COPS_COLOR, TEAM_COPS, -1, 0, 0, 0, 0},
  141. { 5, "Idlewood", 2124.60, -1742.30, 2222.50, -1494.00, GROVE_COLOR, TEAM_GROVE, -1, 0, 0, 0, 0},
  142. { 6, "Idlewood", 1971.60, -1852.80, 2222.50, -1742.30, GROVE_COLOR, TEAM_GROVE, -1, 0, 0, 0, 0},
  143. { 7, "Idlewood", 1812.60, -1742.30, 1951.60, -1602.30, COPS_COLOR, TEAM_COPS, -1, 0, 0, 0, 0},
  144. { 8, "Willow Field", 1970.60, -2179.20, 2089.00, -1852.80, AZTECAS_COLOR, TEAM_AZTECAS, -1, 0, 0, 0, 0},
  145. { 9, "Willow Field", 2089.00, -1989.90, 2324.00, -1852.80, AZTECAS_COLOR, TEAM_AZTECAS, -1, 0, 0, 0, 0},
  146. { 10, "Willow Field", 2089.00, -2235.80, 2201.80, -1989.90, AZTECAS_COLOR, TEAM_AZTECAS, -1, 0, 0, 0, 0},
  147. { 11, "Willow Field", 2324.00, -2059.20, 2541.70, -1852.80, GROVE_COLOR, TEAM_GROVE, -1, 0, 0, 0, 0},
  148. { 12, "Jefferson", 2056.80, -1372.00, 2281.40, -1210.70, BALLAS_COLOR, TEAM_BALLAS, -1, 0, 0, 0, 0},
  149. { 13, "Jefferson", 2056.80, -1210.70, 2185.30, -1126.30, BALLAS_COLOR, TEAM_BALLAS, -1, 0, 0, 0, 0},
  150. { 14, "Jefferson", 2056.80, -1449.60, 2266.20, -1372.00, BALLAS_COLOR, TEAM_BALLAS, -1, 0, 0, 0, 0},
  151. { 15, "East Los Santos", 2421.00, -1628.50, 2632.80, -1454.30, GROVE_COLOR, TEAM_GROVE, -1, 0, 0, 0, 0},
  152. { 16, "East Los Santos", 2222.50, -1628.50, 2421.00, -1494.00, GROVE_COLOR, TEAM_GROVE, -1, 0, 0, 0, 0},
  153. { 17, "East Los Santos", 2266.20, -1494.00, 2381.60, -1372.00, BALLAS_COLOR, TEAM_BALLAS, -1, 0, 0, 0, 0},
  154. { 18, "East Los Santos", 2281.60, -1372.00, 2381.60, -1135.00, BALLAS_COLOR, TEAM_BALLAS, -1, 0, 0, 0, 0},
  155. { 19, "East Los Santos", 2381.60, -1454.30, 2462.10, -1135.00, BALLAS_COLOR, TEAM_BALLAS, -1, 0, 0, 0, 0},
  156. { 20, "East Los Santos", 2462.10, -1454.30, 2581.70, -1135.00, BALLAS_COLOR, TEAM_BALLAS, -1, 0, 0, 0, 0},
  157. { 21, "East Beach", 2632.80, -1852.80, 2959.30, -1668.10, DEALERS_COLOR, TEAM_DEALERS, -1, 0, 0, 0, 0},
  158. { 22, "East Beach", 2632.80, -1668.10, 2747.70, -1393.40, DEALERS_COLOR, TEAM_DEALERS, -1, 0, 0, 0, 0},
  159. { 23, "East Beach", 2747.70, -1668.10, 2959.30, -1498.60, DEALERS_COLOR, TEAM_DEALERS, -1, 0, 0, 0, 0},
  160. { 24, "East Beach", 2747.70, -1498.60, 2959.30, -1120.00, VAGOS_COLOR, TEAM_VAGOS, -1, 0, 0, 0, 0},
  161. { 25, "Playa Del Seville", 2703.50, -2126.90, 2959.30, -1852.80, DEALERS_COLOR, TEAM_DEALERS, -1, 0, 0, 0, 0},
  162. { 26, "El Corona", 1812.60, -2179.20, 1970.60, -1852.80, AZTECAS_COLOR, TEAM_AZTECAS, -1, 0, 0, 0, 0},
  163. { 27, "El Corona", 1692.60, -2179.20, 1812.60, -1842.20, AZTECAS_COLOR, TEAM_AZTECAS, -1, 0, 0, 0, 0},
  164. { 28, "Glen Park", 1812.60, -1350.70, 2056.80, -1100.80, BALLAS_COLOR, TEAM_BALLAS, -1, 0, 0, 0, 0},
  165. { 29, "Los Flores", 2581.70, -1393.40, 2747.70, -1135.00, VAGOS_COLOR, TEAM_VAGOS, -1, 0, 0, 0, 0},
  166. { 30, "Las Colinas", 1994.30, -1100.80, 2056.80, -920.80, VAGOS_COLOR, TEAM_VAGOS, -1, 0, 0, 0, 0},
  167. { 31, "Las Colinas", 2056.80, -1126.30, 2126.80, -920.80, VAGOS_COLOR, TEAM_VAGOS, -1, 0, 0, 0, 0},
  168. { 32, "Las Colinas", 2185.30, -1154.50, 2281.40, -934.40, VAGOS_COLOR, TEAM_VAGOS, -1, 0, 0, 0, 0},
  169. { 33, "Las Colinas", 2126.80, -1126.30, 2185.30, -934.40, VAGOS_COLOR, TEAM_VAGOS, -1, 0, 0, 0, 0},
  170. { 34, "Las Colinas", 2632.70, -1135.00, 2747.70, -945.00, VAGOS_COLOR, TEAM_VAGOS, -1, 0, 0, 0, 0},
  171. { 35, "Las Colinas", 2281.40, -1135.00, 2632.70, -945.00, VAGOS_COLOR, TEAM_VAGOS, -1, 0, 0, 0, 0},
  172. { 36, "Verona Beach", 930.20, -2006.70, 1073.20, -1804.20, BIKERS_COLOR, TEAM_BIKERS, -1, 0, 0, 0, 0},
  173. { 37, "Verona Beach", 851.40, -1804.20, 1046.10, -1577.50, BIKERS_COLOR, TEAM_BIKERS, -1, 0, 0, 0, 0},
  174. { 38, "Verona Beach", 1161.50, -1722.20, 1323.90, -1577.50, BIKERS_COLOR, TEAM_BIKERS, -1, 0, 0, 0, 0},
  175. { 39, "Verona Beach", 1046.10, -1722.20, 1161.50, -1577.50, BIKERS_COLOR, TEAM_BIKERS, -1, 0, 0, 0, 0},
  176. { 40, "Mulholland", 1169.10, -910.10, 1318.10, -768.00, RAPPERS_COLOR, TEAM_RAPPERS, -1, 0, 0, 0, 0},
  177. { 41, "Mulholland", 1318.10, -910.10, 1357.00, -768.00, RAPPERS_COLOR, TEAM_RAPPERS, -1, 0, 0, 0, 0},
  178. { 42, "Mulholland", 1357.00, -926.90, 1463.90, -768.00, RAPPERS_COLOR, TEAM_RAPPERS, -1, 0, 0, 0, 0},
  179. { 43, "Mulholland", 1185.58, -767.09, 1462.02, -641.76, RAPPERS_COLOR, TEAM_RAPPERS, -1, 0, 0, 0, 0},
  180. { 44, "Pershing Square", 1327.8929,-1729.3352,1821.7725,-1573.5878, COPS_COLOR, TEAM_COPS, -1, 0, 0, 0, 0},
  181. { 45, "LS International", 1249.60, -2394.30, 1852.00, -2179.20, GUARDS_COLOR, TEAM_GUARDS, -1, 0, 0, 0, 0},
  182. { 46, "LS International", 1852.00, -2394.30, 2089.00, -2179.20, GUARDS_COLOR, TEAM_GUARDS, -1, 0, 0, 0, 0},
  183. { 47, "LS International", 1382.70, -2730.80, 2201.80, -2394.30, GUARDS_COLOR, TEAM_GUARDS, -1, 0, 0, 0, 0},
  184. { 48, "Ocean Docks", 2373.70, -2697.00, 2809.20, -2330.40, HOODLUMS_COLOR, TEAM_HOODLUMS, -1, 0, 0, 0, 0},
  185. { 49, "Ocean Docks", 2201.80, -2418.30, 2324.00, -2095.00, HOODLUMS_COLOR, TEAM_HOODLUMS, -1, 0, 0, 0, 0},
  186. { 50, "Ocean Docks", 2324.00, -2302.30, 2703.50, -2145.10, HOODLUMS_COLOR, TEAM_HOODLUMS, -1, 0, 0, 0, 0},
  187. { 51, "Ocean Docks", 2089.00, -2394.30, 2201.80, -2235.80, HOODLUMS_COLOR, TEAM_HOODLUMS, -1, 0, 0, 0, 0},
  188. { 52, "Ocean Docks", 2201.80, -2730.80, 2324.00, -2418.30, HOODLUMS_COLOR, TEAM_HOODLUMS, -1, 0, 0, 0, 0},
  189. { 53, "Ocean Docks", 2703.50, -2302.30, 2959.30, -2126.90, DEALERS_COLOR, TEAM_DEALERS, -1, 0, 0, 0, 0},
  190. { 54, "Ocean Docks", 2324.00, -2145.10, 2703.50, -2059.20, HOODLUMS_COLOR, TEAM_HOODLUMS, -1, 0, 0, 0, 0},
  191. { 55, "Market", 787.40, -1416.20, 1072.60, -1310.20, WORKERS_COLOR, TEAM_WORKERS, -1, 0, 0, 0, 0},
  192. { 56, "Market", 952.60, -1310.20, 1072.60, -1130.80, WORKERS_COLOR, TEAM_WORKERS, -1, 0, 0, 0, 0},
  193. { 57, "Market", 1072.60, -1416.20, 1370.80, -1130.80, WORKERS_COLOR, TEAM_WORKERS, -1, 0, 0, 0, 0},
  194. { 58, "Market", 926.90, -1577.50, 1370.80, -1416.20, BIKERS_COLOR, TEAM_BIKERS, -1, 0, 0, 0, 0},
  195. { 59, "Downtown LS", 1370.80, -1384.90, 1463.90, -1170.80, WORKERS_COLOR, TEAM_WORKERS, -1, 0, 0, 0, 0}
  196. };
  197.  
  198. new TurfInfo[ MAX_TURFS ][ MAX_TEAMS ][ tinfo ];
  199.  
  200. //============================= AMMUNATION STUFF ===============================
  201. #define CP_AMMU 0
  202. #define CP_AMMU_2 1
  203.  
  204. #define MAX_POINTS 2
  205.  
  206. new Float:checkCoords[ MAX_POINTS ][ 4 ] = {
  207. { 284.2472, -41.8122, 300.0394, -31.2338 }, //AMMUNATION
  208. { 284.0852, -112.7093, 298.1693, -102.9225 } //AMMUNATION_2
  209. };
  210.  
  211. new Float:checkpoints[ MAX_POINTS ][ 4 ] = {
  212. { 289.9959, -40.4220, 1001.5156, 40.0},
  213. { 296.3686, -105.0054, 1001.5156, 40.0}
  214. };
  215.  
  216. new checkpointType[ MAX_POINTS ] = {
  217. CP_AMMU,
  218. CP_AMMU_2
  219. };
  220.  
  221. #define MAX_WEAPONS 14
  222. new weaponNames[ MAX_WEAPONS ][ 32 ] = {
  223. "Pistol",
  224. "Silenced Pistol",
  225. "Desert Eagle",
  226. "Shotgun",
  227. "Combat Shotgun",
  228. "Micro Uzi",
  229. "Tec9",
  230. "MP5",
  231. "AK47",
  232. "M4",
  233. "Sniper Rifle",
  234. "Grenade",
  235. "Molotov",
  236. "Chainsaw"
  237. };
  238. new weaponIDs[ MAX_WEAPONS ] = {
  239. 22, //Pistol
  240. 23, //Silenced Pistol
  241. 24, //Desert Eagle
  242. 25, //Shotgun
  243. 27, //Combat shotgun
  244. 28, //Micro Uzi
  245. 32, //Tec9
  246. 29, //MP5
  247. 30, //AK47
  248. 31, //M4
  249. 34, //Sniper Rifle
  250. 16, //Grenade
  251. 18, //Molotov
  252. 9 //Chainsaw
  253. };
  254. new weaponCost[ MAX_WEAPONS ] = {
  255. 5000,
  256. 6000,
  257. 10000,
  258. 10000,
  259. 25000,
  260. 17500,
  261. 15000,
  262. 12500,
  263. 25000,
  264. 27500,
  265. 22500,
  266. 20000,
  267. 20000,
  268. 7500
  269. };
  270. new weaponAmmo[ MAX_WEAPONS ] = {
  271. 100,
  272. 50,
  273. 50,
  274. 30,
  275. 30,
  276. 100,
  277. 100,
  278. 100,
  279. 100,
  280. 100,
  281. 15,
  282. 5,
  283. 5,
  284. 1
  285. };
  286. new playerWeapons[ SLOTS ][ MAX_WEAPONS ];
  287.  
  288. //=========================== SPAWNPOINTS ======================================
  289. new Float:gAztecasSP[ 5 ][ 4 ] = {
  290. {1782.4652, -2125.8149, 14.0679, 2.1458},
  291. {1802.0015, -2099.5906, 14.0210, 178.8617},
  292. {1733.7253, -2098.3542, 14.0366, 179.5071},
  293. {1674.3099, -2122.3008, 14.1460, 309.0879},
  294. {1734.5999, -2129.7507, 14.0210, 359.1053}
  295. };
  296.  
  297. new Float:gVagosSP[ 5 ][ 4 ] = {
  298. {2626.2966, -1112.7968, 67.8459, 268.0490},
  299. {2628.5859, -1068.0347, 69.6129, 270.7647},
  300. {2576.2104, -1070.5781, 69.8322, 90.3136},
  301. {2526.9141, -1061.0150, 69.5673, 276.0494},
  302. {2579.2810, -1033.8696, 69.5804, 182.8840}
  303. };
  304.  
  305. new Float:gBallasSP[ 5 ][ 4 ] = {
  306. {1999.8577, -1114.6553, 27.1250, 182.0473},
  307. {2022.9449, -1120.9398, 26.4210, 176.7813},
  308. {2045.8439, -1115.7263, 26.3617, 273.3338},
  309. {2093.7844, -1123.7844, 27.6899, 85.9610},
  310. {2094.6392, -1145.1943, 26.5929, 90.0567}
  311. };
  312.  
  313. new Float:gGroveSP[ 5 ][ 4 ] = {
  314. {2486.3970, -1645.1057, 14.0772, 179.9111},
  315. {2522.4792, -1678.8976, 15.4970, 84.5245},
  316. {2459.4883, -1690.7766, 13.5447, 4.4374},
  317. {2512.8555, -1650.1726, 14.3557, 144.0457},
  318. {2452.1179, -1642.6036, 13.7357, 185.5197}
  319. };
  320.  
  321. new Float:gDealersSP[ 5 ][ 4 ] = {
  322. {2751.8059, -1962.7186, 13.5469, 275.6328},
  323. {2786.4072, -1926.2677, 13.5469, 93.7698},
  324. {2801.9312, -1962.5712, 13.5469, 265.4980},
  325. {2736.3562, -1926.6581, 13.5469, 88.0278},
  326. {2782.5354, -2020.5160, 13.5620, 18.5249}
  327. };
  328.  
  329. new Float:gCopsSP[ 5 ][ 4 ] = {
  330. {1580.5128, -1634.4861, 13.5617, 130.4118},
  331. {1568.6759, -1690.4570, 5.8906, 176.6791},
  332. {1525.1227, -1678.2502, 5.8906, 273.1760},
  333. {1549.9097, -1639.7108, 6.2188, 140.2159},
  334. {1552.8384, -1675.1357, 16.1953, 89.8920}
  335. };
  336.  
  337. new Float:gBikersSP[ 5 ][ 4 ] = {
  338. {865.1617, -1634.7625, 14.9297, 176.2746},
  339. {851.1503, -1688.4281, 14.9478, 270.6273},
  340. {892.3436, -1638.1572, 14.9494, 179.3978},
  341. {936.1555, -1612.9193, 14.9414, 182.2190},
  342. {986.8895, -1624.1165, 14.9297, 85.0584}
  343. };
  344.  
  345. new Float:gRappersSP[ 5 ][ 4 ] = {
  346. {1299.7562, -799.9611, 84.1406, 194.2108},
  347. {1242.5406, -801.9774, 84.1406, 184.6465},
  348. {1257.8717, -785.9609, 92.0302, 94.8174},
  349. {1294.2952, -768.8214, 95.9635, 138.9095},
  350. {1300.6792, -788.9683, 88.3125, 137.6236}
  351. };
  352.  
  353. new Float:gGuardsSP[ 5 ][ 4 ] = {
  354. {2057.1948, -2369.3684, 16.1250, 233.0575},
  355. {2059.3333, -2378.7324, 16.1250, 271.5332},
  356. {2085.9832, -2368.4207, 15.7088, 95.6059},
  357. {2078.2334, -2375.8376, 13.5469, 151.6155},
  358. {2056.1616, -2382.3760, 13.5469, 214.3861}
  359. };
  360.  
  361. new Float:gHoodlumsSP[ 5 ][ 4 ] = {
  362. {2730.7947, -2477.1145, 17.5937, 357.1576},
  363. {2730.7314, -2425.7117, 17.5937, 180.2173},
  364. {2721.3579, -2380.8623, 17.3403, 181.0635},
  365. {2719.7244, -2516.8755, 17.3672, 359.3862},
  366. {2731.4517, -2488.0862, 13.6530, 187.1712}
  367. };
  368.  
  369. new Float:gWorkersSP[ 5 ][ 4 ] = {
  370. {1227.4185, -1243.5392, 19.6232, 222.0879},
  371. {1247.9486, -1230.1859, 13.6797, 311.5554},
  372. {1281.2274, -1232.5288, 13.9053, 142.7271},
  373. {1284.2473, -1253.5109, 13.5469, 327.8930},
  374. {1227.2406, -1269.6855, 13.5765, 317.0280}
  375. };
  376.  
  377. //==============================================================================
  378. forward TimeUpdate( );
  379. forward MoneyTimer( );
  380. forward GameModeExitFunc( );
  381. forward getCheckpointType( playerID );
  382. forward isPlayerInArea( playerID, Float:data[ 4 ] );
  383. forward IsPlayerInTurf( playerid, Float:min_x, Float:min_y, Float:max_x, Float:max_y );
  384. forward checkpointUpdate( );
  385. forward SavedUpdate( );
  386. forward TeamFix( );
  387. forward CheckPlayers( );
  388. forward StartWar( turf, attacker );
  389. forward EndWar( turf, attacker, defender );
  390. forward PickupDestroy( pickupid );
  391. forward TimeTextForPlayer( playerid, Text:text, time );
  392. forward DestroyTextTimer( Text:text );
  393. forward GameModeInitExitFunc( );
  394. forward OnPlayerTeamPrivmsg( playerid, msg[] );
  395. forward SendAdminMessage( color, string[] );
  396.  
  397. //==============================================================================
  398. #define MAX_SAVE 64
  399. new savedInfo[ MAX_SAVE ][ 3 ];
  400. new savedNames[ MAX_SAVE ][ MAX_PLAYER_NAME ];
  401. new savedWeapons[ MAX_SAVE ][ MAX_WEAPONS ];
  402.  
  403. //==============================================================================
  404. main()
  405. {
  406. print("\n\n-----------------------------------------\n");
  407. print("------ LSTW2 Ultimate v2 ------\n");
  408. print("------ By Popo ------\n");
  409. print("-----------------------------------------\n\n");
  410. worldTime = 12;
  411. }
  412. //==============================================================================
  413.  
  414. public TimeUpdate( ) {
  415. worldTime++;
  416. worldTime%=24;
  417. SetWorldTime( worldTime );
  418. }
  419. //==============================================================================
  420.  
  421. public OnGameModeInit( )
  422. {
  423. SetGameModeText( "LSTW2 Ultimate v2" );
  424. SetTeamCount( 11 );
  425. ShowPlayerMarkers( 1 );
  426. ShowNameTags( 1 );
  427. EnableZoneNames( 1 );
  428. EnableTirePopping( 1 );
  429. UsePlayerPedAnims( );
  430. AllowAdminTeleport( 1 );
  431. // SetDisabledWeapons( 8,10,11,12,13,14,17,19,20,21,35,36,37,38,39,40,41,42,43,44,45 );
  432.  
  433. // PlayerClasses
  434. // Aztecas //
  435. AddPlayerClass(292, 1673.6190, -2122.3142, 14.1460, 296.6250, 24,100, 27,100, 16,5);//D.Eagle
  436. AddPlayerClass(115, 1673.6190, -2122.3142, 14.1460, 296.6250, 24,100, 27,100, 16,5);//C.shotgun
  437. AddPlayerClass(116, 1673.6190, -2122.3142, 14.1460, 296.6250, 24,100, 27,100, 16,5);//Grenades
  438. AddPlayerClass( 41, 1673.6190, -2122.3142, 14.1460, 296.6250, 24,100, 27,100, 16,5);
  439. // Vagos //
  440. AddPlayerClass(108, 2626.4180, -1098.8073, 69.3514, 280.0232, 24,100, 27,100, 16,5);
  441. AddPlayerClass(109, 2626.4180, -1098.8073, 69.3514, 280.0232, 24,100, 27,100, 16,5);
  442. AddPlayerClass(110, 2626.4180, -1098.8073, 69.3514, 280.0232, 24,100, 27,100, 16,5);
  443. AddPlayerClass(215, 2626.4180, -1098.8073, 69.3514, 280.0232, 24,100, 27,100, 16,5);
  444. // Ballas //
  445. AddPlayerClass(102, 2277.6997, -1134.3367, 1050.8984, 264.2271, 24,100, 27,100, 18,5);//D.Eagle
  446. AddPlayerClass(103, 2277.6997, -1134.3367, 1050.8984, 264.2271, 24,100, 27,100, 18,5);//C.Shotgun
  447. AddPlayerClass(104, 2277.6997, -1134.3367, 1050.8984, 264.2271, 24,100, 27,100, 18,5);//Molotovs
  448. AddPlayerClass( 13, 2277.6997, -1134.3367, 1050.8984, 264.2271, 24,100, 27,100, 18,5);
  449. // Grove //
  450. AddPlayerClass(269, 2525.9170, -1674.7805, 1015.4986, 270.4626, 24,100, 27,100, 18,5);
  451. AddPlayerClass(270, 2525.9170, -1674.7805, 1015.4986, 270.4626, 24,100, 27,100, 18,5);
  452. AddPlayerClass(271, 2525.9170, -1674.7805, 1015.4986, 270.4626, 24,100, 27,100, 18,5);
  453. AddPlayerClass(195, 2525.9170, -1674.7805, 1015.4986, 270.4626, 24,100, 27,100, 18,5);
  454. // Dealers //
  455. AddPlayerClass( 28, 2744.3135, -1960.9834, 21.7099, 262.9126, 24,100, 27,100, 16,5);
  456. AddPlayerClass( 29, 2744.3135, -1960.9834, 21.7099, 262.9126, 24,100, 27,100, 16,5);
  457. AddPlayerClass( 30, 2744.3135, -1960.9834, 21.7099, 262.9126, 24,100, 27,100, 16,5);
  458. AddPlayerClass( 12, 2744.3135, -1960.9834, 21.7099, 262.9126, 24,100, 27,100, 16,5);
  459. // Cops //
  460. AddPlayerClass(265, 218.3181, 69.2598, 1005.0391, 272.1958, 24,100, 27,100, 16,5);
  461. AddPlayerClass(266, 218.3181, 69.2598, 1005.0391, 272.1958, 24,100, 27,100, 16,5);
  462. AddPlayerClass(267, 218.3181, 69.2598, 1005.0391, 272.1958, 24,100, 27,100, 16,5);
  463. AddPlayerClass(246, 218.3181, 69.2598, 1005.0391, 272.1958, 24,100, 27,100, 16,5);
  464. // Bikers //
  465. AddPlayerClass(100, 865.1848, -1634.4077, 14.9297, 176.2746, 24,100, 27,100, 18,5);
  466. AddPlayerClass(247, 865.1848, -1634.4077, 14.9297, 176.2746, 24,100, 27,100, 18,5);
  467. AddPlayerClass(248, 865.1848, -1634.4077, 14.9297, 176.2746, 24,100, 27,100, 18,5);
  468. AddPlayerClass(201, 865.1848, -1634.4077, 14.9297, 176.2746, 24,100, 27,100, 18,5);
  469. // Rappers //
  470. AddPlayerClass(293, 1252.9651, -795.6196, 1084.2344, 313.6620, 24,100, 27,100, 18,5);
  471. AddPlayerClass(297, 1252.9651, -795.6196, 1084.2344, 313.6620, 24,100, 27,100, 18,5);
  472. AddPlayerClass( 19, 1252.9651, -795.6196, 1084.2344, 313.6620, 24,100, 27,100, 18,5);
  473. AddPlayerClass(233, 1252.9651, -795.6196, 1084.2344, 313.6620, 24,100, 27,100, 18,5);
  474. // Guards //
  475. AddPlayerClass(163, 1197.1981, -1180.4625, 31.8125, 264.0207, 24,100, 27,100, 16,5);
  476. AddPlayerClass(164, 1197.1981, -1180.4625, 31.8125, 264.0207, 24,100, 27,100, 16,5);
  477. AddPlayerClass( 71, 1197.1981, -1180.4625, 31.8125, 264.0207, 24,100, 27,100, 16,5);
  478. AddPlayerClass(141, 1197.1981, -1180.4625, 31.8125, 264.0207, 24,100, 27,100, 16,5);
  479. // Hoodlums //
  480. AddPlayerClass(183, 2746.2112, -2454.1011, 16.6562, 271.6301, 24,100, 27,100, 16,5);
  481. AddPlayerClass( 21, 2746.2112, -2454.1011, 16.6562, 271.6301, 24,100, 27,100, 16,5);
  482. AddPlayerClass( 22, 2746.2112, -2454.1011, 16.6562, 271.6301, 24,100, 27,100, 16,5);
  483. AddPlayerClass(190, 2746.2112, -2454.1011, 16.6562, 271.6301, 24,100, 27,100, 16,5);
  484. // Workers //
  485. AddPlayerClass( 27, 1227.4185, -1243.5392, 19.6232, 222.0879, 24,100, 27,100, 18,5);
  486. AddPlayerClass(153, 1227.4185, -1243.5392, 19.6232, 222.0879, 24,100, 27,100, 18,5);
  487. AddPlayerClass( 16, 1227.4185, -1243.5392, 19.6232, 222.0879, 24,100, 27,100, 18,5);
  488. AddPlayerClass(192, 1227.4185, -1243.5392, 19.6232, 222.0879, 24,100, 27,100, 18,5);
  489.  
  490. //---------------------------- Team Vehicles -----------------------------------
  491. // Heli's Respawn after 30 secs
  492. AddStaticVehicleEx(487, 1802.5719, -2147.0588, 17.7954, 87.9824, 97, 1, 30); // az
  493. AddStaticVehicleEx(487, 1715.4847, -2144.8665, 17.4541, 271.2545, 97, 1, 30);
  494. AddStaticVehicleEx(487, 2529.1804, -1678.0981, 20.1069, 90.5616, 86, 1, 30); // gr
  495. AddStaticVehicleEx(487, 2376.1848, -1642.3527, 13.6877, 179.3587, 86, 1, 30);
  496. AddStaticVehicleEx(487, 1291.0372, -782.1488, 96.6349, 181.5480, 30, 1, 30); // ra
  497. AddStaticVehicleEx(487, 1291.2373, -795.5877, 96.6350, 358.7492, 30, 1, 30);
  498. AddStaticVehicleEx(487, 2042.5867, -2415.4641, 13.7237, 88.0966, 25, 1, 30); // gu
  499. AddStaticVehicleEx(487, 2082.5244, -2292.3137, 18.8407, 181.5882, 25, 1, 30);
  500. AddStaticVehicleEx(487, 883.4486, -1707.7190, 13.0928, 179.8443, 65, 1, 30); // bi
  501. AddStaticVehicleEx(487, 883.0782, -1735.2272, 13.0994, 0.6590, 65, 1, 30);
  502. AddStaticVehicleEx(497, 1565.4097, -1612.9707, 13.5594, 179.9088, 0, 1, 30); // co
  503. AddStaticVehicleEx(497, 1553.0725, -1612.7714, 13.5617, 180.4659, 0, 1, 30);
  504. AddStaticVehicleEx(487, 2040.1948, -1113.9559, 30.0394, 269.5649, 54, 1, 30); // ba
  505. AddStaticVehicleEx(487, 2098.3293, -1186.9663, 30.7324, 90.5505, 54, 1, 30);
  506. AddStaticVehicleEx(487, 2579.1829, -1030.6965, 73.3895, 268.4893, 6, 1, 30); // va
  507. AddStaticVehicleEx(487, 2596.3777, -1117.7544, 66.8571, 345.4225, 6, 1, 30);
  508. AddStaticVehicleEx(487, 2774.7979, -2540.2712, 19.0990, 359.3782, 102, 1, 30); // ho
  509. AddStaticVehicleEx(487, 2767.4480, -2372.3940, 19.0984, 89.4405, 102, 1, 30);
  510. AddStaticVehicleEx(487, 2744.1221, -1961.5730, 21.7922, 359.9515, 113, 1, 30); // de
  511. AddStaticVehicleEx(487, 2794.3784, -1925.2078, 21.7925, 179.7559, 113, 1, 30);
  512. AddStaticVehicleEx(487, 1257.0879, -1237.7987, 18.2206, 179.1622, 51, 1, 30); // wo
  513. AddStaticVehicleEx(487, 1255.4160, -1184.6429, 23.7554, 179.5271, 51, 1, 30);
  514.  
  515. // Cars Respawn after 30 secs
  516. // Aztecas //
  517. AddStaticVehicleEx(466, 1705.0120, -2128.7627, 13.2887, 359.7284, 97, 96, 30); // glendale
  518. AddStaticVehicleEx(474, 1667.9630, -2111.1350, 13.3098, 269.6416, 97, 96, 30); // hermes
  519. AddStaticVehicleEx(575, 1724.8003, -2097.8608, 13.1508, 179.8669, 97, 96, 30); // broadway
  520. AddStaticVehicleEx(466, 1773.0240, -2097.1389, 13.2892, 180.2724, 97, 96, 30); // glendale
  521. AddStaticVehicleEx(474, 1744.9988, -2127.5525, 13.3096, 359.7272, 97, 96, 30); // hermes
  522. AddStaticVehicleEx(567, 1793.4592, -2129.3376, 13.4168, 359.8183, 3, 3, 30); // savanna
  523. AddStaticVehicleEx(471, 1772.1758, -2125.4370, 13.0279, 359.0490, 96, 97, 30); // quad
  524. // Grove //
  525. AddStaticVehicleEx(492, 2508.3440, -1666.1531, 13.1820, 11.7864, 100, 96, 30); // greenwood
  526. AddStaticVehicleEx(600, 2473.1553, -1691.6614, 13.2278, 359.3989, 113, 96, 30); // picador
  527. AddStaticVehicleEx(567, 2443.2261, -1643.5012, 13.3333, 178.8905, 86, 96, 30); // savanna
  528. AddStaticVehicleEx(412, 2486.0669, -1654.5834, 13.2305, 89.3584, 86, 96, 30); // voodoo
  529. AddStaticVehicleEx(471, 2507.9875, -1650.4827, 13.2595, 136.9348, 96, 86, 30); // quad
  530. AddStaticVehicleEx(412, 2479.0452, -1748.4788, 13.3856, 359.3116, 86, 96, 30); // voodoo
  531. // Rappers //
  532. AddStaticVehicleEx(579, 1254.8761, -804.2604, 84.0739, 179.7531, 30, 96, 30); // huntley
  533. AddStaticVehicleEx(580, 1258.6738, -814.9005, 83.9366, 90.1519, 30, 96, 30); // stafford
  534. AddStaticVehicleEx(521, 1305.8616, -796.8700, 83.7083, 193.9615, 30, 96, 30); // fcr900
  535. AddStaticVehicleEx(533, 1248.9216, -803.8434, 83.8497, 179.9391, 30, 96, 30); // feltzer
  536. AddStaticVehicleEx(471, 1302.3571, -812.6957, 83.6223, 359.2730, 96, 30, 30); // quad
  537. // Guards //
  538. AddStaticVehicleEx(507, 2058.8191, -2325.0425, 13.3715, 269.9650, 25, 96, 30); // elegant
  539. AddStaticVehicleEx(426, 2087.5754, -2392.3960, 13.2899, 90.3086, 25, 96, 30); // premier
  540. AddStaticVehicleEx(426, 2086.3909, -2316.6287, 13.2902, 90.7526, 25, 96, 30); // premier
  541. AddStaticVehicleEx(507, 2058.7661, -2385.1228, 13.3706, 270.5188, 25, 96, 30); // elegant
  542. AddStaticVehicleEx(471, 2092.9546, -2358.0488, 13.0282, 89.3856, 96, 25, 30); // qaud
  543. // Bikers //
  544. AddStaticVehicleEx(463, 892.5114, -1670.0753, 13.0932, 359.0870, 65, 96, 30); // freeway
  545. AddStaticVehicleEx(463, 874.5585, -1657.5487, 13.0870, 180.3009, 65, 96, 30); // freeway
  546. AddStaticVehicleEx(463, 883.1781, -1645.7882, 13.0868, 270.2893, 65, 96, 30); // freeway
  547. AddStaticVehicleEx(471, 883.5585, -1669.6713, 13.0297, 358.2961, 96, 65, 30); // quad
  548. AddStaticVehicleEx(483, 892.6470, -1678.4722, 13.5393, 179.7223, 65, 96, 30); // camper
  549. AddStaticVehicleEx(483, 856.1459, -1649.7294, 13.5450, 269.4443, 65, 96, 30); // camper
  550. // Cops //
  551. AddStaticVehicleEx(596, 1536.1616, -1678.4150, 13.1024, 0.7176, 0, 1, 30); //lspd
  552. AddStaticVehicleEx(596, 1536.0039, -1667.0995, 13.1044, 179.5686, 0, 1, 30); // lspd
  553. AddStaticVehicleEx(523, 1602.3197, -1704.0796, 5.4609, 90.3475, 0, 0, 30); // hpv1000
  554. AddStaticVehicleEx(523, 1545.8175, -1668.0481, 5.4610, 89.3934, 0, 0, 30); // hpv1000
  555. AddStaticVehicleEx(596, 1570.4269, -1710.7415, 5.6099, 359.4638, 0, 1, 30); // lspd
  556. AddStaticVehicleEx(596, 1545.3386, -1680.2294, 5.6108, 90.8227, 0, 1, 30); // lspd
  557. // Ballas //
  558. AddStaticVehicleEx(566, 2050.7302, -1112.2198, 25.2511, 179.3903, 54, 96, 30); // tahoma
  559. AddStaticVehicleEx(517, 2092.5071, -1141.2423, 25.4409, 90.3768, 54, 96, 30); // majestic
  560. AddStaticVehicleEx(517, 1997.4957, -1119.4990, 26.6240, 238.9880, 54, 96, 30); // majestic
  561. AddStaticVehicleEx(566, 2014.4319, -1101.7258, 24.6692, 73.8224, 54, 96, 30); // tahoma
  562. AddStaticVehicleEx(471, 2090.8159, -1171.1304, 25.0758, 88.2568, 96, 54, 30); // quad
  563. // Vagos //
  564. AddStaticVehicleEx(467, 2570.5310, -1032.9722, 69.3204, 177.8111, 6, 1, 30); // oceanic
  565. AddStaticVehicleEx(474, 2604.4324, -1069.1321, 69.3482, 6.8428, 6, 1, 30); // hermes
  566. AddStaticVehicleEx(467, 2596.6460, -1077.2358, 69.3248, 180.5385, 6, 1, 30); // oceanic
  567. AddStaticVehicleEx(576, 2530.5186, -1065.2362, 69.1801, 0.7576, 6, 1, 30); // tornado
  568. AddStaticVehicleEx(471, 2629.8889, -1094.3588, 69.0961, 215.4930, 1, 6, 30); // quad
  569. AddStaticVehicleEx(576, 2535.4871, -1030.2832, 69.1921, 178.4364, 6, 1, 30); // tornado
  570. // Hoodlums //
  571. AddStaticVehicleEx(536, 2785.0857, -2455.9561, 13.3718, 89.3076, 102, 102, 30); // blade
  572. AddStaticVehicleEx(567, 2736.7261, -2465.7773, 13.5147, 270.4129, 102, 102, 30); // savanna
  573. AddStaticVehicleEx(534, 2766.2952, -2386.4956, 13.3560, 178.4640, 102, 96, 30); // remington
  574. AddStaticVehicleEx(492, 2736.1907, -2422.0134, 13.4108, 358.4986, 102, 96, 30); // greenwood
  575. AddStaticVehicleEx(535, 2784.8284, -2494.3149, 13.4165, 89.4226, 102, 96, 30); // slamvan
  576. AddStaticVehicleEx(471, 2785.2021, -2417.9648, 13.1141, 89.5588, 96, 102, 30); // quad
  577. // Dealers //
  578. AddStaticVehicleEx(567, 2684.5813, -1990.4877, 13.4226, 180.7511, 113, 113, 30); // savanna
  579. AddStaticVehicleEx(566, 2787.6191, -1992.1963, 13.1642, 90.1024, 113, 96, 30); // tahoma
  580. AddStaticVehicleEx(517, 2774.2568, -1930.2064, 13.2658, 359.4717, 113, 96, 30); // majestic
  581. AddStaticVehicleEx(535, 2764.6045, -1958.2736, 13.1780, 180.1994, 113, 96, 30); // slamvan
  582. AddStaticVehicleEx(471, 2735.1990, -1936.2517, 13.0279, 89.0335, 96, 113, 30); // quad
  583. AddStaticVehicleEx(536, 2772.9712, -1875.9406, 9.5048, 359.7028, 113, 113, 30); // blade
  584. // Workers //
  585. AddStaticVehicleEx(552, 1292.8713, -1251.0560, 13.2479, 0.1342, 51, 51, 30); // utility
  586. AddStaticVehicleEx(489, 1276.5681, -1213.2157, 13.8232, 269.7596, 51, 123, 30); // rancher
  587. AddStaticVehicleEx(486, 1277.5309, -1253.9189, 14.3162, 136.6396, 1, 1, 30); // dozer
  588. AddStaticVehicleEx(406, 1242.2900, -1266.4226, 14.9331, 270.7672, 1, 1, 30); // dumper
  589. AddStaticVehicleEx(524, 1266.7992, -1227.1768, 14.6131, 269.4213, 51, 51, 30); // cement
  590. AddStaticVehicleEx(560, 1290.8965, -1213.1510, 13.3845, 180.1363, 51, 51, 30); // sultan
  591.  
  592. //--------------------------------- Random Vehicles ----------------------------
  593. // Respawn after 50 secs except airplanes those are 30 secs
  594. AddStaticVehicleEx(515,2001.9824,-1940.0975,14.3743,270.7258,-1,-1,50); // roadtrain_5
  595. AddStaticVehicleEx(515,2206.9868,-2522.4387,14.5869,269.8065,-1,-1,50);
  596. AddStaticVehicleEx(515,2099.6655,-2077.5313,14.5885,180.8334,-1,-1,50);
  597. AddStaticVehicleEx(515,2432.8206,-2109.6555,14.5652,359.6463,-1,-1,50);
  598. AddStaticVehicleEx(515,2500.6555,-2209.1882,14.5620,178.6679,-1,-1,50);
  599. AddStaticVehicleEx(450,2061.0474,-1939.7745,13.2006,90.2122,-1,-1,50); // trailer_5
  600. AddStaticVehicleEx(435,2027.0923,-1939.9590,13.2064,269.6728,-1,-1,50);
  601. AddStaticVehicleEx(591,2458.3452,-2078.2278,13.2523,180.9549,-1,-1,50);
  602. AddStaticVehicleEx(450,2282.8433,-2351.3801,13.2523,224.2315,-1,-1,50);
  603. AddStaticVehicleEx(435,2208.4968,-2597.3840,13.2506,270.0967,-1,-1,50);
  604. AddStaticVehicleEx(446,2503.8308,-2268.1306,-0.6851,271.0656,-1,-1,50); // squalo_4
  605. AddStaticVehicleEx(446,2443.0024,-2715.0647,-0.2478,270.5447,-1,-1,50);
  606. AddStaticVehicleEx(446,2355.9438,-2521.3450,-0.7666,178.3984,-1,-1,50);
  607. AddStaticVehicleEx(446,2932.6929,-2057.4172,-0.7016,269.0194,-1,-1,50);
  608. AddStaticVehicleEx(592,1488.6454,-2593.2637,14.7407,270.0806,1,1,30); // andromada_2
  609. AddStaticVehicleEx(592,1488.3427,-2493.9607,14.7487,269.9044,1,1,30);
  610. AddStaticVehicleEx(519,1823.1643,-2630.5415,14.4654,359.6695,1,1,30); // shamal_2
  611. AddStaticVehicleEx(519,1889.6864,-2629.3171,14.4656,359.4183,1,1,30);
  612. AddStaticVehicleEx(513,1856.8051,-2411.1489,14.1093,197.3260,-1,-1,30); // stuntplane_2
  613. AddStaticVehicleEx(513,1814.5001,-2437.5330,14.0975,239.6807,-1,-1,30);
  614. AddStaticVehicleEx(553,2050.2764,-2637.4497,14.8787,61.8532,-1,-1,30); // nevada_2
  615. AddStaticVehicleEx(553,1941.2543,-2451.5334,14.8658,128.1360,-1,-1,30);
  616. AddStaticVehicleEx(476,2124.6965,-2458.1074,14.2599,120.1050,-1,-1,30); // rustler_3
  617. AddStaticVehicleEx(476,1984.8978,-2638.3120,14.2599,65.0431,-1,-1,30);
  618. AddStaticVehicleEx(476,1923.2277,-2241.2700,14.2527,180.2805,-1,-1,30);
  619. AddStaticVehicleEx(466,2052.0728,-1694.7084,13.2964,270.0654,16,16,50); // glendale_2
  620. AddStaticVehicleEx(567,2452.3054,-1102.5942,43.0857,357.9726,-1,-1,50);
  621. AddStaticVehicleEx(542,2327.4827,-1677.3326,14.1673,269.8396,-1,-1,50); // clover_5
  622. AddStaticVehicleEx(542,2495.2571,-1995.9064,13.2625,179.2733,-1,-1,50);
  623. AddStaticVehicleEx(542,2411.0503,-1390.7070,24.0663,359.3449,-1,-1,50);
  624. AddStaticVehicleEx(542,2161.7957,-1172.8940,23.5625,90.2493,-1,-1,50);
  625. AddStaticVehicleEx(542,1947.4548,-2120.5735,13.2899,269.9948,-1,-1,50);
  626. AddStaticVehicleEx(535,1844.4076,-1871.1821,13.1508,359.8899,-1,-1,50); // slamvan_3
  627. AddStaticVehicleEx(535,2192.6365,-1465.4865,25.3018,270.1690,-1,-1,50);
  628. AddStaticVehicleEx(535,2853.0518,-1330.1758,10.8295,279.3965,-1,-1,50);
  629. AddStaticVehicleEx(536,2399.3892,-1134.3718,29.8696,181.0839,-1,-1,50); // blade_3
  630. AddStaticVehicleEx(536,2373.8125,-1927.3652,13.1202,359.1471,-1,-1,50);
  631. AddStaticVehicleEx(536,2025.6007,-1648.8838,13.2912,90.3605,-1,-1,50);
  632. AddStaticVehicleEx(534,1921.1251,-1788.4198,13.1127,268.3328,-1,-1,50); // remington_3
  633. AddStaticVehicleEx(534,2822.3770,-1553.1898,10.6504,89.9093,-1,-1,50);
  634. AddStaticVehicleEx(534,2426.5911,-1243.1105,23.8694,359.6307,-1,-1,50);
  635. AddStaticVehicleEx(576,2817.3174,-1183.5714,24.8551,270.9797,-1,-1,50); // tornado_3
  636. AddStaticVehicleEx(576,2271.0046,-1032.8309,51.4856,136.4009,-1,-1,50);
  637. AddStaticVehicleEx(576,2475.3682,-1526.3867,23.6049,359.2925,-1,-1,50);
  638. AddStaticVehicleEx(566,2196.5745,-1283.0890,24.1231,179.5897,-1,-1,50); // tahoma_3
  639. AddStaticVehicleEx(566,2052.5330,-1904.4730,13.3282,179.1011,-1,-1,50);
  640. AddStaticVehicleEx(566,2390.1199,-1718.7175,13.3790,179.2825,-1,-1,50);
  641. AddStaticVehicleEx(567,2229.7876,-1363.0439,23.8577,90.2294,-1,-1,50); // savanna_4
  642. AddStaticVehicleEx(567,2805.7119,-1428.5934,16.1224,178.4703,-1,-1,50);
  643. AddStaticVehicleEx(567,2350.7051,-2000.0120,13.2338,359.9185,-1,-1,50);
  644. AddStaticVehicleEx(567,2454.1021,-1014.1890,59.6425,176.1889,-1,-1,50);
  645. AddStaticVehicleEx(589,2489.2539,-1953.6476,13.0816,1.0010,-1,-1,50); // club_4
  646. AddStaticVehicleEx(589,2694.3064,-1119.9226,69.2362,180.5238,-1,-1,50);
  647. AddStaticVehicleEx(589,2164.1445,-1793.6271,13.0189,180.5116,-1,-1,50);
  648. AddStaticVehicleEx(589,2256.8760,-1939.6943,13.2044,89.4820,-1,-1,50);
  649. AddStaticVehicleEx(492,1964.9985,-1719.2476,15.7505,359.4735,-1,-1,50); // greenwood_4
  650. AddStaticVehicleEx(492,1999.4695,-1275.2704,23.6021,180.5423,-1,-1,50);
  651. AddStaticVehicleEx(492,1879.1167,-2020.9791,13.1724,180.6543,-1,-1,50);
  652. AddStaticVehicleEx(492,2613.1377,-2380.0427,13.4068,179.5431,-1,-1,50);
  653. AddStaticVehicleEx(509,1947.1716,-1991.0991,13.0587,271.1580,-1,-1,50); // bike_6
  654. AddStaticVehicleEx(509,2130.0039,-1595.3577,13.8617,161.5534,-1,-1,50);
  655. AddStaticVehicleEx(509,2542.6423,-1354.5869,30.1054,178.9754,-1,-1,50);
  656. AddStaticVehicleEx(509,2508.5757,-1773.3990,13.0594,266.9215,-1,-1,50);
  657. AddStaticVehicleEx(509,2804.7268,-1252.8588,46.4658,142.1307,-1,-1,50);
  658. AddStaticVehicleEx(509,2023.4795,-962.4792,39.2699,21.0140,-1,-1,50);
  659. AddStaticVehicleEx(416,2037.2390,-1423.4762,17.1416,180.3667,1,3,50); // ambulance_2
  660. AddStaticVehicleEx(416,1179.3715,-1338.9187,13.9725,271.0954,1,3,50);
  661. AddStaticVehicleEx(560,1130.0643,-1689.4120,13.3153,180.3318,-1,-1,50); // sultan_3
  662. AddStaticVehicleEx(560,1040.7117,-1056.4841,31.4088,1.2718,-1,-1,50);
  663. AddStaticVehicleEx(560,1657.6219,-1089.1050,23.6119,270.4426,-1,-1,50);
  664. AddStaticVehicleEx(560,1012.6143,-1461.4174,13.2568,0.3901,-1,-1,50);
  665. AddStaticVehicleEx(579,981.2479,-1306.9004,13.3182,269.4426,-1,-1,50); // huntley_2
  666. AddStaticVehicleEx(579,1098.7172,-1763.8140,13.2781,89.8239,-1,-1,50);
  667. AddStaticVehicleEx(521,782.0196,-1612.4509,12.9532,270.1972,-1,-1,50); // fcr900_3
  668. AddStaticVehicleEx(521,1183.8922,-1263.9352,14.7461,181.1518,-1,-1,50);
  669. AddStaticVehicleEx(521,1279.5542,-1667.3218,13.1171,179.6212,-1,-1,50);
  670. AddStaticVehicleEx(521,1712.7981,-1005.5743,23.4843,171.1206,-1,-1,50);
  671. AddStaticVehicleEx(451,1464.1157,-903.3469,54.5425,0.0953,-1,-1,50); // turismo_1
  672. AddStaticVehicleEx(411,1517.6372,-694.6029,94.4771,89.4996,-1,-1,50); // infernus_2
  673. AddStaticVehicleEx(411,1193.0533,-1020.2946,32.2740,186.7821,-1,-1,50);
  674. AddStaticVehicleEx(541,1100.1062,-820.5209,86.5702,115.0450,-1,-1,50); // bullet_2
  675. AddStaticVehicleEx(541,1640.6359,-1281.9531,14.4353,256.6248,-1,-1,50);
  676. AddStaticVehicleEx(477,1231.4021,-1020.1202,32.3558,187.0757,-1,-1,50); // zr350_3
  677. AddStaticVehicleEx(477,826.6736,-1545.4895,13.3071,270.2256,-1,-1,50);
  678. AddStaticVehicleEx(477,1503.8798,-1321.1948,13.9002,0.7865,-1,-1,50);
  679. AddStaticVehicleEx(426,1108.3026,-1024.7616,31.6530,181.6333,-1,-1,50); // premier_1
  680. AddStaticVehicleEx(507,1001.4642,-1105.2848,23.6533,91.1393,-1,-1,50); // elegant_1
  681. AddStaticVehicleEx(402,1658.9725,-1695.1852,20.2898,180.1059,-1,-1,50); // buffalo_3
  682. AddStaticVehicleEx(402,2010.6484,-2203.4685,13.3786,0.4120,-1,-1,50);
  683. AddStaticVehicleEx(402,2102.4797,-1273.2668,25.3218,179.2833,-1,-1,50);
  684. AddStaticVehicleEx(437,1749.3578,-1858.4083,13.5473,270.0417,-1,-1,50); // coach_2
  685. AddStaticVehicleEx(437,2676.8569,-1673.6639,9.5299,179.6113,-1,-1,50);
  686. AddStaticVehicleEx(561,1401.4670,-2347.9583,13.3526,359.3793,-1,-1,50); // stratum_2
  687. AddStaticVehicleEx(561,957.8749,-1449.3049,13.3096,271.0958,-1,-1,50);
  688. AddStaticVehicleEx(558,1401.4198,-2225.3242,13.1763,179.6696,-1,-1,50); // uranus_1
  689. AddStaticVehicleEx(420,1691.5933,-2250.2534,13.1612,90.2945,6,1,50); // taxi_2
  690. AddStaticVehicleEx(420,1674.1932,-2322.7227,13.1630,269.8391,6,1,50);
  691. AddStaticVehicleEx(500,977.2274,-1847.8711,12.4171,88.1356,-1,-1,50); // mesa_2
  692. AddStaticVehicleEx(500,741.0170,-1866.4719,4.8683,240.8761,-1,-1,50);
  693. AddStaticVehicleEx(596,1015.7095,-1354.9799,13.0935,90.0699,0,1,50); // lspd_1
  694. AddStaticVehicleEx(444,1245.8824,-2022.2595,60.2011,269.7729,-1,-1,50); // monster_2
  695. AddStaticVehicleEx(444,1273.3865,-2010.0261,59.4094,180.2513,-1,-1,50);
  696. AddStaticVehicleEx(448,2116.2781,-1822.6934,13.1571,270.2033,3,6,50); // pizzaboy_2
  697. AddStaticVehicleEx(448,2124.0410,-1795.8849,13.1502,0.1300,3,6,50);
  698. AddStaticVehicleEx(518,2116.8557,-1783.0336,13.0587,359.6252,-1,-1,50); // buccaneer_3
  699. AddStaticVehicleEx(518,2706.6162,-1843.0298,9.1662,158.7779,-1,-1,50);
  700. AddStaticVehicleEx(518,2398.7065,-1545.8726,23.6661,270.0880,-1,-1,50);
  701. AddStaticVehicleEx(400,1358.4578,-1752.2974,13.4604,90.1414,-1,-1,50); // landstalker_2
  702. AddStaticVehicleEx(400,1468.4294,-1232.5582,13.7444,89.0040,-1,-1,50);
  703. AddStaticVehicleEx(581,2236.3997,-1637.8600,15.1748,159.7275,-1,-1,50); // bf400_4
  704. AddStaticVehicleEx(581,2633.3040,-1221.5355,49.6119,358.8300,-1,-1,50);
  705. AddStaticVehicleEx(581,2177.1533,-993.3595,62.5770,167.8490,-1,-1,50);
  706. AddStaticVehicleEx(581,2098.6597,-1359.5281,23.5625,270.9590,-1,-1,50);
  707. AddStaticVehicleEx(581,1214.8021,-1470.3621,13.1436,90.1879,-1,-1,50);
  708. AddStaticVehicleEx(481,1946.7832,-1364.9180,18.0948,124.3683,-1,-1,50); // bmx_3
  709. AddStaticVehicleEx(481,1883.9183,-1369.9069,13.0857,138.9769,-1,-1,50);
  710. AddStaticVehicleEx(481,1915.8243,-1437.6688,13.0706,230.1378,-1,-1,50);
  711. AddStaticVehicleEx(475,1696.4769,-1508.5443,13.1852,359.2828,-1,-1,50); // sabre_3
  712. AddStaticVehicleEx(475,1627.3304,-1038.1265,23.7035,359.3652,-1,-1,50);
  713. AddStaticVehicleEx(475,1910.5804,-1115.8199,25.4690,179.9177,-1,-1,50);
  714. AddStaticVehicleEx(588,1775.8020,-1896.7933,13.2893,180.6083,1,1,50); // hotdog_1
  715. AddStaticVehicleEx(423,2861.8750,-1951.5374,10.9619,0.4270,-1,-1,50); // mrwhoopee_1
  716. AddStaticVehicleEx(455,2174.1794,-2266.8301,13.8141,225.1139,-1,-1,50); // flatbed_3
  717. AddStaticVehicleEx(455,2506.7410,-2627.9053,14.0830,89.6795,-1,-1,50);
  718. AddStaticVehicleEx(455,2515.9543,-2355.0374,14.0669,226.4995,-1,-1,50);
  719. AddStaticVehicleEx(483,1279.7465,-1815.5831,13.3775,90.2054,-1,-1,50); // camper_3
  720. AddStaticVehicleEx(483,1951.4786,-1563.3632,13.6084,134.7018,-1,-1,50);
  721. AddStaticVehicleEx(483,2534.2007,-1474.1321,23.9917,269.1452,-1,-1,50);
  722. AddStaticVehicleEx(522,1425.6019,-1313.0128,13.1256,359.1056,-1,-1,50); // nrg500_3
  723. AddStaticVehicleEx(522,2819.5659,-1454.4861,39.6325,89.2029,-1,-1,50);
  724. AddStaticVehicleEx(522,1560.6329,-2321.9302,13.1249,268.9026,-1,-1,50);
  725.  
  726. //
  727. for (new t=0; t<MAX_TURFS; t++) {
  728. GangZoneCreate( turfs[ t ][zMinX], turfs[ t ][zMinY], turfs[ t ][zMaxX], turfs[ t ][zMaxY] );
  729. for (new teams=0; teams<MAX_TEAMS; teams++) TurfInfo[ t ][ teams ][ MIT ]=0;
  730. }
  731. //
  732. for(new x=0; x<=100; x++) gDropPickup[x] = -1;
  733.  
  734. TKMenu = CreateMenu( "TeamKill", 1, 30.0, 170.0, 100.0, 150.0 );
  735. AddMenuItem( TKMenu, 0, "Let him go" );
  736. AddMenuItem( TKMenu, 0, "Jail" );
  737. AddMenuItem( TKMenu, 0, "Death Penalty" );
  738. AddMenuItem( TKMenu, 0, "$5000 fine" );
  739. AddMenuItem( TKMenu, 0, "Drop from sky" );
  740. AddMenuItem( TKMenu, 0, "Blow up" );
  741. AddMenuItem( TKMenu, 0, "Take 70% health" );
  742.  
  743. SetTimer( "MoneyTimer", 1000, 1 );
  744. SetTimer( "checkpointUpdate", 1100, 1 );
  745. SetTimer( "CheckPlayers", 10000, 1 );
  746. SetTimer( "TimeUpdate", 60009, 1 );
  747. SetTimer( "SavedUpdate", 60017, 1 );
  748.  
  749. return 1;
  750. }
  751. //==============================================================================
  752.  
  753. public getCheckpointType( playerID ) {
  754. return checkpointType[ playerCheckpoint[playerID] ];
  755. }
  756. //==============================================================================
  757.  
  758. public isPlayerInArea(playerID, Float:data[4])
  759. {
  760. new Float:X, Float:Y, Float:Z;
  761.  
  762. GetPlayerPos(playerID, X, Y, Z);
  763. if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3]) {
  764. return 1;
  765. }
  766. return 0;
  767. }
  768. //==============================================================================
  769.  
  770. public IsPlayerInTurf(playerid,Float:min_x,Float:min_y,Float:max_x,Float:max_y)
  771. {
  772. new Float:X,Float:Y,Float:Z;
  773. GetPlayerPos(playerid, X, Y, Z);
  774. if((X <= max_x && X >= min_x) && (Y <= max_y && Y >= min_y)) return 1;
  775. return 0;
  776. }
  777. //==============================================================================
  778.  
  779. public checkpointUpdate( )
  780. {
  781. for(new i=0; i<SLOTS; i++)
  782. {
  783. if(IsPlayerConnected(i)) {
  784. for(new j=0; j < MAX_POINTS; j++) {
  785. if(isPlayerInArea(i, checkCoords[j])) {
  786. if(playerCheckpoint[i]!=j) {
  787. DisablePlayerCheckpoint(i);
  788. SetPlayerCheckpoint(i, checkpoints[j][0],checkpoints[j][1],checkpoints[j][2],checkpoints[j][3]);
  789. playerCheckpoint[i] = j;
  790. }
  791. } else {
  792. if(playerCheckpoint[i]==j) {
  793. DisablePlayerCheckpoint(i);
  794. playerCheckpoint[i] = 999;
  795. }
  796. }
  797. }
  798. }
  799. }
  800. }
  801. //==============================================================================
  802.  
  803. public SavedUpdate( )
  804. {
  805. for(new i = 0; i < MAX_SAVE; i++) {
  806. if(savedInfo[i][2] < 5) {
  807. if(savedInfo[i][2]==3) {
  808. savedInfo[i][0]=savedInfo[i][1]=0;
  809. savedNames[i][0]=0;
  810. }
  811. savedInfo[i][2]++;
  812. }
  813. }
  814. }
  815. //==============================================================================
  816.  
  817. public MoneyTimer( )
  818. {
  819. for ( new playerid = 0, mp = GetMaxPlayers( ); playerid < mp; playerid++ )
  820. {
  821. if ( !IsPlayerConnected( playerid ) )
  822. continue;
  823.  
  824. new
  825. pMoney = GetPlayerMoney( playerid );
  826.  
  827. if ( !lSMoney[ playerid ] && pMoney > ( lTMoney[ playerid ] + 1499 ) )
  828. {
  829. GetPlayerPos( playerid, X250[ playerid ], Y250[ playerid ], Z250[ playerid ] );
  830. if (X250[playerid] >= 1924.0562 && X250[playerid] <= 2019.0679 &&
  831. Y250[playerid] >= 967.1267 && Y250[playerid] <= 1029.9370 )
  832. {
  833. new tString[ 128 ];
  834. GetPlayerName( playerid, tString, MAX_PLAYER_NAME );
  835.  
  836. format(
  837. tString, 128,
  838. "* %s's (%d) cash just increased by $%d (from $%d to $%d | Location: 4Dragons)",
  839. tString, playerid, pMoney - lTMoney[ playerid ],
  840. lTMoney[ playerid ],pMoney
  841. );
  842. SendAdminMessage( COLOR_ORANGE, tString );
  843. }
  844. else if (X250[playerid] >= 2147.1572 && X250[playerid] <= 2259.6709 &&
  845. Y250[playerid] >= 1573.1588 && Y250[playerid] <= 1714.0790 )
  846. {
  847. new tString[ 128 ];
  848. GetPlayerName( playerid, tString, MAX_PLAYER_NAME );
  849.  
  850. format(
  851. tString, 128,
  852. "* %s's (%d) cash just increased by $%d (from $%d to $%d | Location: Caligulas)",
  853. tString, playerid, pMoney - lTMoney[ playerid ],
  854. lTMoney[ playerid ],pMoney
  855. );
  856. SendAdminMessage( COLOR_ORANGE, tString );
  857. }
  858. else {
  859. new tString[ 128 ];
  860. GetPlayerName( playerid, tString, MAX_PLAYER_NAME );
  861.  
  862. format(
  863. tString, 128,
  864. "* %s's (%d) cash just increased by $%d (from $%d to $%d | Location: Unknown)",
  865. tString, playerid, pMoney - lTMoney[ playerid ],
  866. lTMoney[ playerid ],pMoney
  867. );
  868. SendAdminMessage( COLOR_ORANGE, tString );
  869. }
  870. }
  871.  
  872. // Set the last script money to the current
  873. // real money (to stop the increase showing many times).
  874.  
  875. lTMoney[ playerid ] = pMoney;
  876. lSMoney[ playerid ] = 0;
  877. }
  878. }
  879. //==============================================================================
  880.  
  881. public OnPlayerConnect( playerid )
  882. {
  883. new playrname[ MAX_PLAYER_NAME ], string[ 256 ];
  884.  
  885. SetPlayerColor( playerid, COLOR_INACTIVE );
  886. GameTextForPlayer( playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~w~LSTW2 Ultimate v2", 5000, 3 );
  887. SendClientMessage( playerid, COLOR_RED, "Welcome, type /help for more info." );
  888.  
  889. GetPlayerName(playerid, playrname, sizeof(playrname));
  890. format(string, 256, "*** %s(ID: %d) has joined the server.", playrname, playerid);
  891. SendClientMessageToAll( COLOR_INACTIVE, string );
  892.  
  893. // SendDeathMessage( INVALID_PLAYER_ID, playerid, 200 ); // Connect message in kill chart
  894.  
  895. playerCheckpoint[ playerid ] =999;
  896. AllowPlayerTeleport( playerid, 0 );
  897. SetPlayerWantedLevel( playerid, 0 );
  898. Spawned [ playerid ] =0;
  899. ShowPM[ playerid ] =0;
  900. PlayerOnDuty[ playerid ]=0;
  901. lTMoney[ playerid ] = 0;
  902. lSMoney[ playerid ] = 0;
  903.  
  904.  
  905. GetPlayerName(playerid, playrname, sizeof(playrname));
  906. for(new i = 0; i < MAX_SAVE; i++) {
  907.  
  908. if(isStringSame(savedNames[i], playrname, MAX_PLAYER_NAME)) {
  909. bounty[playerid] = savedInfo[i][0];
  910.  
  911. savedInfo[i][0]=savedInfo[i][1]=0;
  912. savedNames[i][0]=0;
  913.  
  914. for(new j = 0; j < MAX_WEAPONS; j++) {
  915. playerWeapons[playerid][j]=savedWeapons[i][j];
  916. savedWeapons[i][j]=0;
  917. }
  918. }
  919. }
  920.  
  921. for (new i = 0; i < MAX_TURFS; i++) GangZoneShowForPlayer(playerid, turfs[ i ][turfID], turfs[ i ][TurfColor]);
  922.  
  923. return 1;
  924. }
  925. //==============================================================================
  926.  
  927. public OnPlayerDisconnect( playerid, reason )
  928. {
  929. new playername[ MAX_PLAYER_NAME ];
  930.  
  931. GetPlayerName(playerid, playername, sizeof(playername));
  932. SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
  933.  
  934. //Save temp info for timeouts/crashes
  935. GetPlayerName(playerid, playername, sizeof(playername));
  936. format(savedNames[savePos], MAX_PLAYER_NAME, "%s",playername);
  937.  
  938. savedInfo[savePos][0] = bounty[playerid];
  939. savedInfo[savePos][1] = 0;
  940.  
  941.  
  942. for(new i = 0; i < MAX_WEAPONS; i++)
  943. savedWeapons[savePos][i]=playerWeapons[playerid][i];
  944. //
  945. savePos++;
  946. if(savePos >= MAX_SAVE)
  947. savePos = 0;
  948. bounty[playerid] = 0;
  949.  
  950. for(new i = 0; i < MAX_WEAPONS;i++) {
  951. playerWeapons[playerid][i]=0;
  952. }
  953.  
  954. SetPlayerColor( playerid, COLOR_INACTIVE );
  955. }
  956. //==============================================================================
  957.  
  958. public OnPlayerRequestClass( playerid, classid )
  959. {
  960. SetPlayerClass( playerid, classid );
  961. SetPlayerColor( playerid, COLOR_INACTIVE );
  962. PlayerPlaySound( playerid, 1068, 0.0, 0.0, 0.0 );
  963.  
  964. switch(classid)
  965. {
  966. case 0..3:
  967. {
  968. SetPlayerPos(playerid,1810.5295,-2103.0408,13.5469);
  969. SetPlayerCameraPos(playerid,1814.3398,-2100.5222,13.5469);
  970. SetPlayerCameraLookAt(playerid,1810.5295,-2103.0408,13.5469);
  971. SetPlayerFacingAngle(playerid,300.0);
  972. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Aztecas", 3000, 3);
  973. ApplyAnimation(playerid,"RIOT", "RIOT_ANGRY",4.0,1,1,1,1,1);
  974. }
  975. case 4..7:
  976. {
  977. SetPlayerPos(playerid,2654.5081,-1063.5448,69.5937);
  978. SetPlayerCameraPos(playerid,2658.3940,-1060.7126,69.5209);
  979. SetPlayerCameraLookAt(playerid,2654.5081,-1063.5448,69.5937);
  980. SetPlayerFacingAngle(playerid,300.0);
  981. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Vagos", 3000, 3);
  982. ApplyAnimation(playerid,"RIOT", "RIOT_CHANT",4.0,1,1,1,1,1);
  983. }
  984. case 8..11:
  985. {
  986. SetPlayerPos(playerid,1979.8929,-1143.1704,25.9858);
  987. SetPlayerCameraPos(playerid,1975.8948,-1145.9689,25.9895);
  988. SetPlayerCameraLookAt(playerid,1979.8929,-1143.1704,25.9858);
  989. SetPlayerFacingAngle(playerid,120.0);
  990. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Ballas", 3000, 3);
  991. ApplyAnimation(playerid,"GHANDS", "gsign2LH",4.0,1,1,1,1,1);
  992. }
  993. case 12..15:
  994. {
  995. SetPlayerPos(playerid,2498.2249,-1644.6326,18.8751);
  996. SetPlayerCameraPos(playerid,2498.2676,-1640.1935,18.6116);
  997. SetPlayerCameraLookAt(playerid,2498.2249,-1644.6326,18.8751);
  998. SetPlayerFacingAngle(playerid,0.0);
  999. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Orange Grove Families", 3000, 3);
  1000. ApplyAnimation(playerid,"LOWRIDER", "RAP_B_Loop",4.0,1,1,1,1,1);
  1001. }
  1002. case 16..19:
  1003. {
  1004. SetPlayerPos(playerid,2785.7817,-1956.1940,20.4537);
  1005. SetPlayerCameraPos(playerid,2791.5693,-1956.3384,21.3124);
  1006. SetPlayerCameraLookAt(playerid,2785.7817,-1956.1940,20.4537);
  1007. SetPlayerFacingAngle(playerid,270.0);
  1008. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Dealers", 3000, 3);
  1009. ApplyAnimation(playerid,"DEALER", "DEALER_IDLE",4.0,1,1,1,1,1);
  1010. }
  1011. case 20..23:
  1012. {
  1013. SetPlayerPos(playerid,1524.5602,-1581.9534,23.5469);
  1014. SetPlayerCameraPos(playerid,1524.6063,-1577.8397,23.5469);
  1015. SetPlayerCameraLookAt(playerid,1524.5602,-1581.9534,23.5469);
  1016. SetPlayerFacingAngle(playerid,0.0);
  1017. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Cops", 3000, 3);
  1018. ApplyAnimation(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1);
  1019. }
  1020. case 24..27:
  1021. {
  1022. SetPlayerPos(playerid,953.6748,-1696.7352,20.3672);
  1023. SetPlayerCameraPos(playerid,958.7288,-1701.0875,20.9513);
  1024. SetPlayerCameraLookAt(playerid,953.6748,-1696.7352,20.3672);
  1025. SetPlayerFacingAngle(playerid,225.0);
  1026. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Bikers", 3000, 3);
  1027. ApplyAnimation(playerid,"GANGS", "Invite_Yes",4.0,1,1,1,1,1);
  1028. }
  1029. case 28..31:
  1030. {
  1031. SetPlayerPos(playerid,1288.2465,-800.1273,96.4609);
  1032. SetPlayerCameraPos(playerid,1285.2930,-795.5814,96.4609);
  1033. SetPlayerCameraLookAt(playerid,1288.2465,-800.1273,96.4609);
  1034. SetPlayerFacingAngle(playerid,20.0);
  1035. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Rappers", 3000, 3);
  1036. ApplyAnimation(playerid,"LOWRIDER", "RAP_A_Loop",4.0,1,1,1,1,1);
  1037. }
  1038. case 32..35:
  1039. {
  1040. SetPlayerPos(playerid,2080.7639,-2377.9961,18.4061);
  1041. SetPlayerCameraPos(playerid,2082.9263,-2373.7207,18.4061);
  1042. SetPlayerCameraLookAt(playerid,2080.7639,-2377.9961,18.4061);
  1043. SetPlayerFacingAngle(playerid,325.0);
  1044. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Guards", 3000, 3);
  1045. ApplyAnimation(playerid,"COP_AMBIENT", "Coplook_think",4.0,1,1,1,1,1);
  1046. }
  1047. case 36..39:
  1048. {
  1049. SetPlayerPos(playerid,2752.8835,-2513.6389,25.7914);
  1050. SetPlayerCameraPos(playerid,2753.1050,-2519.0244,26.6926);
  1051. SetPlayerCameraLookAt(playerid,2752.8835,-2513.6389,25.7914);
  1052. SetPlayerFacingAngle(playerid,180.0);
  1053. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Hoodlums", 3000, 3);
  1054. ApplyAnimation(playerid,"GYMNASIUM", "GYMshadowbox",4.0,1,1,1,1,1);
  1055. }
  1056. case 40..43:
  1057. {
  1058. SetPlayerPos(playerid,1262.5465,-1260.1057,13.2015);
  1059. SetPlayerCameraPos(playerid,1265.7855,-1262.5286,13.2771);
  1060. SetPlayerCameraLookAt(playerid,1262.5465,-1260.1057,13.2015);
  1061. SetPlayerFacingAngle( playerid,230.0 );
  1062. GameTextForPlayer( playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Workers", 3000, 3 );
  1063. ApplyAnimation( playerid, "STRIP", "PUN_HOLLER", 4.0, 1, 1, 1, 1, 1 );
  1064. }
  1065. }
  1066. return 1;
  1067. }
  1068. //==============================================================================
  1069.  
  1070. SetPlayerClass(playerid, classid)
  1071. {
  1072. switch(classid)
  1073. {
  1074. case 0..3: gTeam[playerid] = TEAM_AZTECAS;
  1075. case 4..7: gTeam[playerid] = TEAM_VAGOS;
  1076. case 8..11: gTeam[playerid] = TEAM_BALLAS;
  1077. case 12..15: gTeam[playerid] = TEAM_GROVE;
  1078. case 16..19: gTeam[playerid] = TEAM_DEALERS;
  1079. case 20..23: gTeam[playerid] = TEAM_COPS;
  1080. case 24..27: gTeam[playerid] = TEAM_BIKERS;
  1081. case 28..31: gTeam[playerid] = TEAM_RAPPERS;
  1082. case 32..35: gTeam[playerid] = TEAM_GUARDS;
  1083. case 36..39: gTeam[playerid] = TEAM_HOODLUMS;
  1084. case 40..43: gTeam[playerid] = TEAM_WORKERS;
  1085. }
  1086. }
  1087. //==============================================================================
  1088.  
  1089. public OnPlayerSpawn(playerid)
  1090. {
  1091. new rand = random( 5 );
  1092. SetPlayerInterior( playerid, 0 );
  1093. SetPlayerToTeamColor( playerid );
  1094. SetPlayerHealth( playerid, 100 );
  1095. Spawned[ playerid ] =1;
  1096. FlashZoneForPlayer( playerid );
  1097. PlayerPlaySound( playerid, 1069, 0.0, 0.0, 0.0) ;
  1098. SetCameraBehindPlayer( playerid );
  1099.  
  1100. switch(gTeam[playerid])
  1101. {
  1102. case TEAM_AZTECAS: {
  1103. SetPlayerPos(playerid,gAztecasSP[rand][0],gAztecasSP[rand][1],gAztecasSP[rand][2]);
  1104. SetPlayerFacingAngle(playerid,gAztecasSP[rand][3]);
  1105. }
  1106. case TEAM_VAGOS: {
  1107. SetPlayerPos(playerid,gVagosSP[rand][0],gVagosSP[rand][1],gVagosSP[rand][2]);
  1108. SetPlayerFacingAngle(playerid,gVagosSP[rand][3]);
  1109. }
  1110. case TEAM_BALLAS: {
  1111. SetPlayerPos(playerid,gBallasSP[rand][0],gBallasSP[rand][1],gBallasSP[rand][2]);
  1112. SetPlayerFacingAngle(playerid,gBallasSP[rand][3]);
  1113. }
  1114. case TEAM_GROVE: {
  1115. SetPlayerPos(playerid,gGroveSP[rand][0],gGroveSP[rand][1],gGroveSP[rand][2]);
  1116. SetPlayerFacingAngle(playerid,gGroveSP[rand][3]);
  1117. }
  1118. case TEAM_DEALERS: {
  1119. SetPlayerPos(playerid,gDealersSP[rand][0],gDealersSP[rand][1],gDealersSP[rand][2]);
  1120. SetPlayerFacingAngle(playerid,gDealersSP[rand][3]);
  1121. }
  1122. case TEAM_COPS: {
  1123. SetPlayerPos(playerid,gCopsSP[rand][0],gCopsSP[rand][1],gCopsSP[rand][2]);
  1124. SetPlayerFacingAngle(playerid,gCopsSP[rand][3]);
  1125. }
  1126. case TEAM_BIKERS: {
  1127. SetPlayerPos(playerid,gBikersSP[rand][0],gBikersSP[rand][1],gBikersSP[rand][2]);
  1128. SetPlayerFacingAngle(playerid,gBikersSP[rand][3]);
  1129. }
  1130. case TEAM_RAPPERS: {
  1131. SetPlayerPos(playerid,gRappersSP[rand][0],gRappersSP[rand][1],gRappersSP[rand][2]);
  1132. SetPlayerFacingAngle(playerid,gRappersSP[rand][3]);
  1133. }
  1134. case TEAM_GUARDS: {
  1135. SetPlayerPos(playerid,gGuardsSP[rand][0],gGuardsSP[rand][1],gGuardsSP[rand][2]);
  1136. SetPlayerFacingAngle(playerid,gGuardsSP[rand][3]);
  1137. }
  1138. case TEAM_HOODLUMS: {
  1139. SetPlayerPos(playerid,gHoodlumsSP[rand][0],gHoodlumsSP[rand][1],gHoodlumsSP[rand][2]);
  1140. SetPlayerFacingAngle(playerid,gHoodlumsSP[rand][3]);
  1141. }
  1142. case TEAM_WORKERS: {
  1143. SetPlayerPos(playerid,gWorkersSP[rand][0],gWorkersSP[rand][1],gWorkersSP[rand][2]);
  1144. SetPlayerFacingAngle(playerid,gWorkersSP[rand][3]);
  1145. }
  1146. }
  1147.  
  1148. for (new i = 0; i < MAX_WEAPONS; i++) {
  1149. if (playerWeapons[playerid][ i ] > 0) {
  1150. GivePlayerWeapon(playerid, weaponIDs[ i ], weaponAmmo[ i ]*playerWeapons[playerid][ i ]);
  1151. }
  1152. }
  1153.  
  1154. if (PlayerOnDuty[playerid] == 1) SetPlayerColor(playerid, COLOR_WHITE);
  1155.  
  1156. return 1;
  1157. }
  1158. //==============================================================================
  1159.  
  1160. SetPlayerToTeamColor(playerid)
  1161. {
  1162. switch(gTeam[playerid])
  1163. {
  1164. case TEAM_AZTECAS: SetPlayerColor( playerid, AZTECAS_COLOR);
  1165. case TEAM_VAGOS: SetPlayerColor( playerid, VAGOS_COLOR);
  1166. case TEAM_BALLAS: SetPlayerColor( playerid, BALLAS_COLOR);
  1167. case TEAM_GROVE: SetPlayerColor( playerid, GROVE_COLOR);
  1168. case TEAM_DEALERS: SetPlayerColor( playerid, DEALERS_COLOR);
  1169. case TEAM_COPS: SetPlayerColor( playerid, COPS_COLOR);
  1170. case TEAM_BIKERS: SetPlayerColor( playerid, BIKERS_COLOR);
  1171. case TEAM_RAPPERS: SetPlayerColor( playerid, RAPPERS_COLOR);
  1172. case TEAM_GUARDS: SetPlayerColor( playerid, GUARDS_COLOR);
  1173. case TEAM_HOODLUMS: SetPlayerColor( playerid, HOODLUMS_COLOR);
  1174. case TEAM_WORKERS: SetPlayerColor( playerid, WORKERS_COLOR);
  1175. }
  1176. }
  1177. //==============================================================================
  1178.  
  1179. FlashZoneForPlayer( playerid )
  1180. {
  1181. for (new i = 0; i < MAX_TURFS; i++)
  1182. {
  1183. if (turfs[ i ][ TurfWarStarted ] == 1)
  1184. {
  1185. if (gTeam[playerid] == turfs[ i ][ TurfAttacker ]) GangZoneFlashForPlayer( playerid, i, COLOR_FLASH );
  1186. else if (gTeam[playerid] == turfs[ i ][ TurfOwner ]) GangZoneFlashForPlayer( playerid, i, COLOR_FLASH );
  1187. else GangZoneFlashForPlayer( playerid, i, COLOR_FLASH2 );
  1188. }
  1189. }
  1190. }
  1191. //==============================================================================
  1192.  
  1193. public OnPlayerDeath( playerid, killerid, reason )
  1194. {
  1195. new killedplayer[ MAX_PLAYER_NAME ];
  1196. new Float:x, Float:y, Float:z;
  1197. new string[ 256 ];
  1198.  
  1199. Spawned[ playerid ] =0;
  1200. SetPlayerArmour( playerid, 0 );
  1201.  
  1202. if (killerid == INVALID_PLAYER_ID)
  1203. {
  1204. SendDeathMessage( INVALID_PLAYER_ID, playerid, reason );
  1205. SetPlayerWantedLevel( playerid, 0 );
  1206. TeamInfo[ gTeam[playerid] ][ HomiesDied ]++;
  1207. TeamInfo[ gTeam[playerid] ][ TeamScore ]--;
  1208. }
  1209. else
  1210. {
  1211. SendDeathMessage( killerid, playerid, reason );
  1212.  
  1213. #if DROP_WEAPONS
  1214. if (!GetPlayerInterior(playerid) && !IsPlayerInAnyVehicle(playerid)) DropPlayerWeapons(playerid);
  1215. #endif
  1216.  
  1217. if (gTeam[ killerid ] != gTeam[ playerid ]) // Valid kill
  1218. {
  1219. SetPlayerScore( killerid, GetPlayerScore( killerid ) +1 );
  1220. GivePlayerMoney( killerid, 500 );
  1221. SetPlayerWantedLevel( killerid, GetPlayerWantedLevel( killerid )+1 );
  1222. TeamInfo[ gTeam[killerid] ][ RivalsKilled ]++;
  1223. TeamInfo[ gTeam[playerid] ][ HomiesDied ]++;
  1224. TeamInfo[ gTeam[killerid] ][ TeamScore ]++;
  1225. TeamInfo[ gTeam[playerid] ][ TeamScore ]--;
  1226. //----------------------------- player was killed in a turf? -------------------
  1227. GetPlayerPos(playerid, x, y, z);
  1228. GetPlayerPos(killerid, x, y, z);
  1229. for (new i = 0; i < MAX_TURFS; i++)
  1230. {
  1231. if (IsPlayerInTurf(playerid, turfs[i][zMinX], turfs[i][zMinY], turfs[i][zMaxX], turfs[i][zMaxY]) &&
  1232. IsPlayerInTurf(killerid, turfs[i][zMinX], turfs[i][zMinY], turfs[i][zMaxX], turfs[i][zMaxY]) )
  1233. {
  1234. if (turfs[ i ][ TurfWarStarted ] != 1 && !IsPlayerInAnyVehicle(killerid))
  1235. {
  1236. TurfInfo[ i ][ gTeam[killerid] ][ TurfKills ]++;
  1237. if (TurfInfo[ i ][ gTeam[killerid] ][ TurfKills ] == ATTACK_KILLS)
  1238. {
  1239. if (turfs[ i ][ TurfOwner ] == gTeam[killerid]) {
  1240. for (new a=0; a<MAX_TEAMS; a++) { TurfInfo[ i ][ a ][ TurfKills ] =0; }
  1241. return 1;
  1242. }
  1243.  
  1244. turfs[ i ][ TurfAttacker ] = gTeam[killerid];
  1245. for (new b=0; b<SLOTS; b++)
  1246. {
  1247. if (gTeam[ b ] == turfs[ i ][ TurfAttacker ]) {
  1248. new msg1[ 256 ];
  1249. format(msg1,sizeof(msg1), "~w~We have provoked a turfwar ~w~in ~y~%s ~w~against the ~r~%s",
  1250. turfs[ i ][ turfName ], TeamInfo[ turfs[ i ][ TurfOwner ] ][ TeamName ]);
  1251. new Text:txt1 = TextDrawCreate( 200.0, 385.0, msg1 );
  1252. TextDrawFont( txt1, 0 );
  1253. TextDrawSetShadow( txt1, 0 );
  1254. TextDrawSetOutline( txt1, 1 );
  1255. TextDrawColor( txt1, 0xDFDFDFFF );
  1256. TimeTextForPlayer( b, txt1, 6000 );
  1257. GangZoneFlashForPlayer( b, turfs[ i ][turfID], COLOR_FLASH );
  1258. }
  1259. else if (gTeam[b] == turfs[ i ][ TurfOwner ]) {
  1260. new msg2[ 256 ];
  1261. format(msg2,sizeof(msg2), "~r~The ~y~%s ~r~have attacked our turf in ~y~%s!",
  1262. TeamInfo[ turfs[ i ][ TurfAttacker ] ][ TeamName ], turfs[ i ][ turfName ]);
  1263. new Text:txt2 = TextDrawCreate( 200.0, 370.0, msg2 );
  1264. TextDrawFont( txt2, 0 );
  1265. TextDrawSetShadow( txt2, 0 );
  1266. TextDrawSetOutline( txt2, 1 );
  1267. TextDrawColor( txt2, COLOR_RED );
  1268. TimeTextForPlayer( b, txt2, 6000 );
  1269. GangZoneFlashForPlayer( b, turfs[ i ][turfID], COLOR_FLASH );
  1270. }
  1271. else { GangZoneFlashForPlayer( b, turfs[ i ][turfID], COLOR_FLASH2 ); }
  1272. }
  1273. SetTimerEx("EndWar", ATTACK_TIME, false ,"iii", i, turfs[ i ][ TurfAttacker ], turfs[ i ][ TurfOwner ] );
  1274. turfs[ i ][ TurfWarStarted ] =1;
  1275. for(new c=0; c<MAX_TEAMS; c++) { TurfInfo[ i ][ c ][ TurfKills ] =0; TurfInfo[ i ][ c ][ TurfAttackKills ] =0; }
  1276. return 1;
  1277. }
  1278. }
  1279. else if (turfs[ i ][ TurfWarStarted ] == 1 && !IsPlayerInAnyVehicle(killerid) &&
  1280. (turfs[ i ][ TurfAttacker ] == gTeam[killerid]) || turfs[ i ][ TurfOwner ] == gTeam[killerid])
  1281. {
  1282. TurfInfo[ i ][ gTeam[killerid] ][ TurfAttackKills ]++;
  1283. return 1;
  1284. }
  1285. }
  1286. }
  1287. //------------------------ Was there a bounty on players head -------------------
  1288. if (bounty[ playerid ] > 0) {
  1289. GetPlayerName( playerid, killedplayer, sizeof( killedplayer ) );
  1290. format(string, sizeof(string), "* Bounty reward: %d for killing %s.", bounty[playerid], killedplayer);
  1291. SendClientMessage( killerid, COLOR_YELLOW, string );
  1292.  
  1293. GivePlayerMoney( killerid, bounty[ playerid ] );
  1294. bounty[ playerid ] = 0;
  1295. }
  1296. //------------------------ Did player had a wanted level -----------------------
  1297. if (GetPlayerWantedLevel( playerid ) > 0) {
  1298. switch( GetPlayerWantedLevel( playerid ) ) {
  1299. case 1: {
  1300. SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $1000 + 1 point." );
  1301. GivePlayerMoney( killerid, 1000 );
  1302. SetPlayerScore( killerid, GetPlayerScore( killerid ) +1 );
  1303. SetPlayerWantedLevel( playerid, 0 );
  1304. }
  1305. case 2: {
  1306. SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $2000 + 2 points." );
  1307. GivePlayerMoney( killerid, 2000);
  1308. SetPlayerScore( killerid, GetPlayerScore( killerid ) +2 );
  1309. SetPlayerWantedLevel( playerid, 0 );
  1310. }
  1311. case 3: {
  1312. SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $3000 + 3 points." );
  1313. GivePlayerMoney( killerid, 3000 );
  1314. SetPlayerScore( killerid, GetPlayerScore( killerid ) +3 );
  1315. SetPlayerWantedLevel( playerid, 0 );
  1316. }
  1317. case 4: {
  1318. SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $4000 + 4 points." );
  1319. GivePlayerMoney( killerid, 4000 );
  1320. SetPlayerScore( killerid, GetPlayerScore( killerid ) +4 );
  1321. SetPlayerWantedLevel( playerid, 0 );
  1322. }
  1323. case 5: {
  1324. SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $5000 + 5 points." );
  1325. GivePlayerMoney( killerid, 5000 );
  1326. SetPlayerScore( killerid, GetPlayerScore( killerid ) +5 );
  1327. SetPlayerWantedLevel( playerid, 0 );
  1328. }
  1329. case 6..200: {
  1330. SendClientMessage( killerid, COLOR_YELLOW, "* Bonus for killing a player with a wanted level: $6000 + 6 points." );
  1331. GivePlayerMoney( killerid, 6000 );
  1332. SetPlayerScore( killerid, GetPlayerScore( killerid ) +6 );
  1333. SetPlayerWantedLevel( playerid, 0 );
  1334. }
  1335. }
  1336. }
  1337. //------------------------------------------------------------------------------
  1338. }
  1339. else //Team Killer!
  1340. {
  1341. ShowMenuForPlayer(TKMenu, playerid);
  1342. new warning[ 256 ];
  1343. format( warning, sizeof( warning ), "* No teamkilling! Be prepared for the worst." );
  1344. SendClientMessage( killerid, COLOR_RED, warning );
  1345. if (IsPlayerConnected(killerid)) return TheKiller[ playerid ] = killerid;
  1346. }
  1347. }
  1348.  
  1349. return 1;
  1350. }
  1351. //==============================================================================
  1352.  
  1353. public CheckPlayers( )
  1354. {
  1355. new Float:x, Float:y, Float:z;
  1356. for (new i = 0; i < MAX_TURFS; i++)
  1357. {
  1358. for (new c = 0; c < MAX_TEAMS; c++) TurfInfo[ i ][ c ][ MIT ]=0;
  1359.  
  1360. for (new b=0; b<SLOTS; b++) {
  1361. if (Spawned[b] == 1 && !GetPlayerInterior(b))
  1362. {
  1363. GetPlayerPos(b, x, y, z);
  1364. if (IsPlayerInTurf(b, turfs[i][zMinX], turfs[i][zMinY], turfs[i][zMaxX], turfs[i][zMaxY]))
  1365. {
  1366. if (turfs[ i ][ TurfWarStarted ] != 1 && gTeam[b] != turfs[i][TurfOwner])
  1367. {
  1368. TurfInfo[ i ][ gTeam[b] ][ MIT ]++;
  1369. if (TurfInfo[ i ][ gTeam[b] ][ MIT ] >= MEMBERS_NEEDED)
  1370. {
  1371. if (TimerStarted[i] != 1) {
  1372. TimerStarted[i] = 1;
  1373. SetTimerEx("StartWar", STANDINTURF_TIME, 0, "ii", i, gTeam[b]);
  1374. }
  1375. }
  1376. }
  1377. }
  1378. }
  1379. }
  1380. }
  1381. }
  1382. //==============================================================================
  1383.  
  1384. public StartWar( turf, attacker )
  1385. {
  1386. new Float:x, Float:y, Float:z;
  1387.  
  1388. TimerStarted[turf] = 0;
  1389. for (new c=0; c<MAX_TEAMS; c++) {
  1390. TurfInfo[ turf ][ c ][ TurfKills ] =0;
  1391. TurfInfo[ turf ][ c ][ TurfAttackKills ] =0;
  1392. TurfInfo[ turf ][ c ][ MIT ]=0;
  1393. }
  1394.  
  1395. for (new id=0; id<SLOTS; id++)
  1396. {
  1397. if (Spawned[id] == 1 && !GetPlayerInterior(id))
  1398. {
  1399. GetPlayerPos(id, x, y, z);
  1400. if (IsPlayerInTurf(id, turfs[turf][zMinX], turfs[turf][zMinY], turfs[turf][zMaxX], turfs[turf][zMaxY]))
  1401. {
  1402. if (turfs[ turf ][ TurfWarStarted ] != 1)
  1403. {
  1404. if (gTeam[id] == attacker)
  1405. {
  1406. TurfInfo[ turf ][ attacker ][ MIT ]++;
  1407. if (TurfInfo[ turf ][ attacker ][ MIT ] >= MEMBERS_NEEDED)
  1408. {
  1409. turfs[ turf ][ TurfAttacker ] = attacker;
  1410. for (new t=0; t<SLOTS; t++)
  1411. {
  1412. if (gTeam[ t ] == turfs[ turf ][ TurfAttacker ]) {
  1413. new msg1[ 256 ];
  1414. format(msg1,sizeof(msg1), "~w~We have provoked a turfwar ~w~in ~y~%s ~w~against the ~r~%s",
  1415. turfs[ turf ][ turfName ], TeamInfo[ turfs[ turf ][ TurfOwner ] ][ TeamName ]);
  1416. new Text:txt1 = TextDrawCreate( 200.0, 385.0, msg1 );
  1417. TextDrawFont( txt1, 0 );
  1418. TextDrawSetShadow( txt1, 0 );
  1419. TextDrawSetOutline( txt1, 1 );
  1420. TextDrawColor( txt1, 0xDFDFDFFF );
  1421. TimeTextForPlayer( t, txt1, 6000 );
  1422. GangZoneFlashForPlayer( t, turfs[ turf ][turfID], COLOR_FLASH );
  1423. }
  1424. else if (gTeam[t] == turfs[ turf ][ TurfOwner ]) {
  1425. new msg2[ 256 ];
  1426. format(msg2,sizeof(msg2), "~r~The ~y~%s ~r~have attacked our turf in ~y~%s!",
  1427. TeamInfo[ turfs[ turf ][ TurfAttacker ] ][ TeamName ], turfs[ turf ][ turfName ]);
  1428. new Text:txt2 = TextDrawCreate( 200.0, 370.0, msg2 );
  1429. TextDrawFont( txt2, 0 );
  1430. TextDrawSetShadow( txt2, 0 );
  1431. TextDrawSetOutline( txt2, 1 );
  1432. TextDrawColor( txt2, COLOR_RED );
  1433. TimeTextForPlayer( t, txt2, 6000 );
  1434. GangZoneFlashForPlayer( t, turfs[ turf ][turfID], COLOR_FLASH );
  1435. }
  1436. else GangZoneFlashForPlayer( t, turfs[ turf ][turfID], COLOR_FLASH2 );
  1437. }
  1438. turfs[ turf ][ TurfWarStarted ] =1;
  1439. SetTimerEx("EndWar", ATTACK_TIME, false ,"iii", turf, turfs[ turf ][ TurfAttacker ], turfs[ turf ][ TurfOwner ] );
  1440. }
  1441. }
  1442. }
  1443. }
  1444. }
  1445. }
  1446. }
  1447. //==============================================================================
  1448.  
  1449. public EndWar( turf, attacker, defender )
  1450. {
  1451. new string[ 256 ];
  1452. new Float:x, Float:y, Float:z;
  1453. if (turfs[ turf ][ TurfWarStarted ] == 1)
  1454. {
  1455. GangZoneStopFlashForAll( turf );
  1456. turfs[ turf ][ TurfWarStarted ] =0;
  1457.  
  1458. // when attackers have more kills
  1459. if (TurfInfo[ turf ][ attacker ][ TurfAttackKills ] > TurfInfo[ turf ][ defender ][ TurfAttackKills ])
  1460. {
  1461. for (new a=0; a<SLOTS; a++)
  1462. {
  1463. if (gTeam[ a ] == defender) // send the message to losers
  1464. {
  1465. new msg1[ 256 ];
  1466. format(msg1,sizeof(msg1), "~r~The ~y~%s ~r~have taken over our turf in ~y~%s!",
  1467. TeamInfo[ attacker ][ TeamName ], turfs[ turf ][ turfName ]);
  1468. new Text:txt1 = TextDrawCreate(200.0, 400.0, msg1);
  1469. TextDrawFont( txt1, 0 );
  1470. TextDrawSetShadow( txt1, 0 );
  1471. TextDrawSetOutline( txt1, 1 );
  1472. TextDrawColor( txt1, COLOR_RED );
  1473. TimeTextForPlayer( a, txt1, 6000 );
  1474. // send message with final score
  1475. format (string, sizeof(string), "Final score from the turfwar in %s. %s %d - %s %d.",
  1476. turfs[ turf ][ turfName ],
  1477. TeamInfo[ attacker ][ TeamName ], TurfInfo[ turf ][ attacker ][ TurfAttackKills ],
  1478. TeamInfo[ defender ][ TeamName ], TurfInfo[ turf ][ defender ][ TurfAttackKills ]);
  1479. SendClientMessage(a, TeamInfo[ defender ][ TeamColor ], string);
  1480. TeamInfo[ defender ][ TurfWarsLost ]++;
  1481. TeamInfo[ defender ][ TeamScore ]--;
  1482. }
  1483. else if (gTeam[ a ] == attacker) // send the message to winners
  1484. {
  1485. new msg2[ 256 ];
  1486. format(msg2,sizeof(msg2), "~g~We won the turf war against the ~y~%s ~g~in ~y~%s!",
  1487. TeamInfo[ defender ][ TeamName ], turfs[ turf ][ turfName ]);
  1488. new Text:txt2 = TextDrawCreate(200.0, 415.0, msg2);
  1489. TextDrawFont(txt2, 0);
  1490. TextDrawSetShadow(txt2, 0);
  1491. TextDrawSetOutline(txt2, 1);
  1492. TextDrawColor(txt2, COLOR_GREEN);
  1493. TimeTextForPlayer(a, txt2, 6000);
  1494. // send message with final score
  1495. format (string, sizeof(string), "Final score from the turfwar in %s. %s %d - %s %d.",
  1496. turfs[ turf ][ turfName ],
  1497. TeamInfo[ attacker ][ TeamName ], TurfInfo[ turf ][ attacker ][ TurfAttackKills ],
  1498. TeamInfo[ defender ][ TeamName ], TurfInfo[ turf ][ defender ][ TurfAttackKills ]);
  1499. SendClientMessage(a, TeamInfo[ attacker ][ TeamColor ], string);
  1500. TeamInfo[ attacker ][ TurfWarsWon ]++;
  1501. TeamInfo[ attacker ][ TeamScore ]++;
  1502.  
  1503. // give winners prize
  1504. SendClientMessage( a, COLOR_GREEN, "Well done. You received $1000 + 1 point.");
  1505. GivePlayerMoney( a, 1000 );
  1506. SetPlayerScore( a, GetPlayerScore(a)+1 );
  1507. // if teamscore >= TEAMSCORE give them all the turfs the defenders owns.
  1508. if (TeamInfo[ attacker ][ TeamScore ] >= TEAMSCORE) {
  1509. for (new i = 0; i < MAX_TURFS; i++) {
  1510. if (turfs[ i ][ TurfOwner ] == defender) {
  1511. if (turfs[ i ][ TurfWarStarted ] != 1) {
  1512. turfs[ i ][ TurfOwner ] = attacker;
  1513. turfs[ i ][ TurfColor ] = TeamInfo[ attacker ][ TeamColor ];
  1514. GangZoneShowForAll( i, turfs[ i ][ TurfColor ] );
  1515. new msg[ 256 ];
  1516. format(msg,sizeof(msg), "Excellent! Because of our teamscore: %d.~n~All their turfs belongs to us now.",
  1517. TeamInfo[ attacker ][ TeamScore ]);
  1518. new Text:txt = TextDrawCreate( 23.0, 125.0, msg );
  1519. TextDrawUseBox( txt, 1 );
  1520. TextDrawBoxColor( txt, 0x00000066 );
  1521. TextDrawTextSize( txt, 248.0, 0.0 );
  1522. TextDrawAlignment( txt, 0 );
  1523. TextDrawBackgroundColor( txt, 0x000000ff );
  1524. TextDrawFont( txt, 1 );
  1525. TextDrawLetterSize( txt, 0.29, 1.0 );
  1526. TextDrawColor( txt, 0xffffffff );
  1527. TextDrawSetOutline( txt, 1 );
  1528. TextDrawSetProportional( txt, 1 );
  1529. TimeTextForPlayer(a, txt, 6000);
  1530. }
  1531. }
  1532. }
  1533. }
  1534. }
  1535. }
  1536. // change the zone colour and reset the counters
  1537. turfs[ turf ][ TurfOwner ] = attacker;
  1538. turfs[ turf ][ TurfColor ] = TeamInfo[ attacker ][ TeamColor ];
  1539. GangZoneShowForAll( turf, turfs[ turf ][ TurfColor ] );
  1540. turfs[ turf ][ TurfAttacker ] = -1;
  1541. for (new c=0; c<MAX_TEAMS; c++) { TurfInfo[ turf ][ c ][ TurfKills ] =0; TurfInfo[ turf ][ c ][ TurfAttackKills ] =0; }
  1542. }
  1543. // when there are no kills in the turf
  1544. else if (TurfInfo[ turf ][ attacker ][ TurfAttackKills ] == 0 && TurfInfo[ turf ][ defender ][ TurfAttackKills ] == 0)
  1545. {
  1546. for (new id=0; id<SLOTS; id++) {
  1547. if (Spawned[id] == 1 && !GetPlayerInterior(id)) {
  1548. GetPlayerPos(id, x, y, z);
  1549. if (IsPlayerInTurf(id, turfs[turf][zMinX], turfs[turf][zMinY], turfs[turf][zMaxX], turfs[turf][zMaxY])) {
  1550. if (gTeam[id] == attacker) TurfInfo[ turf ][ attacker ][ MIT ]++;
  1551. if (gTeam[id] == defender) TurfInfo[ turf ][ defender ][ MIT ]++;
  1552. }
  1553. }
  1554. }
  1555. if (TurfInfo[ turf ][ attacker ][ MIT ] > TurfInfo[ turf ][ defender ][ MIT ])
  1556. {
  1557. for (new a=0; a<SLOTS; a++)
  1558. {
  1559. if (gTeam[ a ] == defender) { // send the message to losers
  1560. new msg1[ 256 ];
  1561. format(msg1,sizeof(msg1), "~r~The ~y~%s ~r~have taken over our turf in ~y~%s!",
  1562. TeamInfo[ attacker ][ TeamName ], turfs[ turf ][ turfName ]);
  1563. new Text:txt1 = TextDrawCreate(200.0, 400.0, msg1);
  1564. TextDrawFont( txt1, 0 );
  1565. TextDrawSetShadow( txt1, 0 );
  1566. TextDrawSetOutline( txt1, 1 );
  1567. TextDrawColor( txt1, COLOR_RED );
  1568. TimeTextForPlayer( a, txt1, 6000 );
  1569. // send message
  1570. format (string, sizeof(string), "They beated us with their overwhelming presence. They had %d members on our turf.",
  1571. TurfInfo[ turf ][ attacker ][ MIT ]);
  1572. SendClientMessage(a, TeamInfo[ defender ][ TeamColor ], string);
  1573. TeamInfo[ defender ][ TurfWarsLost ]++;
  1574. TeamInfo[ defender ][ TeamScore ]--;
  1575. }
  1576. else if (gTeam[ a ] == attacker) { // send the message to winners
  1577. new msg2[ 256 ];
  1578. format(msg2,sizeof(msg2), "~g~We won the turf war against the ~y~%s ~g~in ~y~%s!",
  1579. TeamInfo[ defender ][ TeamName ], turfs[ turf ][ turfName ]);
  1580. new Text:txt2 = TextDrawCreate(200.0, 415.0, msg2);
  1581. TextDrawFont(txt2, 0);
  1582. TextDrawSetShadow(txt2, 0);
  1583. TextDrawSetOutline(txt2, 1);
  1584. TextDrawColor(txt2, COLOR_GREEN);
  1585. TimeTextForPlayer(a, txt2, 6000);
  1586. // send message
  1587. format (string, sizeof(string), "We beated them with our overwhelming presence. We had %d members on their turf.",
  1588. TurfInfo[ turf ][ attacker ][ MIT ]);
  1589. SendClientMessage(a, TeamInfo[ attacker ][ TeamColor ], string);
  1590. TeamInfo[ attacker ][ TurfWarsWon ]++;
  1591. TeamInfo[ attacker ][ TeamScore ]++;
  1592.  
  1593. // give winners prize
  1594. SendClientMessage( a, COLOR_GREEN, "Well done. You received $1000 + 1 point.");
  1595. GivePlayerMoney( a, 1000 );
  1596. SetPlayerScore( a, GetPlayerScore(a)+1 );
  1597. }
  1598. }
  1599. // change the zone colour and reset the counters
  1600. turfs[ turf ][ TurfOwner ] = attacker;
  1601. turfs[ turf ][ TurfColor ] = TeamInfo[ attacker ][ TeamColor ];
  1602. GangZoneShowForAll( turf, turfs[ turf ][ TurfColor ] );
  1603. turfs[ turf ][ TurfAttacker ] = -1;
  1604. for (new c=0; c<MAX_TEAMS; c++) { TurfInfo[ turf ][ c ][ TurfKills ] =0; TurfInfo[ turf ][ c ][ TurfAttackKills ] =0; }
  1605. }
  1606. else
  1607. {
  1608. for (new a=0; a<SLOTS; a++)
  1609. {
  1610. if (gTeam[ a ] == defender) { // send the message to winners
  1611. new msg3[ 256 ];
  1612. format(msg3,sizeof(msg3), "~g~That showed them. The turf in ~y~%s ~g~remain ours.", turfs[ turf ][ turfName ]);
  1613. new Text:txt3 = TextDrawCreate(200.0, 355.0, msg3);
  1614. TextDrawFont( txt3, 0 );
  1615. TextDrawSetShadow( txt3, 0 );
  1616. TextDrawSetOutline( txt3, 1 );
  1617. TextDrawColor( txt3, COLOR_GREEN );
  1618. TimeTextForPlayer( a, txt3, 6000 );
  1619. // send message
  1620. SendClientMessage( a, TeamInfo[ defender ][ TeamColor ], "Those fools thinking they can take over our turf.");
  1621. TeamInfo[ defender ][ TurfWarsWon ]++;
  1622. TeamInfo[ defender ][ TeamScore ]++;
  1623.  
  1624. // give winners prize
  1625. SendClientMessage( a, COLOR_GREEN, "Well done. You received $1000 + 1 point.");
  1626. GivePlayerMoney( a, 1000 );
  1627. SetPlayerScore( a,GetPlayerScore(a)+1 );
  1628. }
  1629. else if (gTeam[ a ] == attacker) { // send the message to losers
  1630. new msg4[ 256 ];
  1631. format(msg4,sizeof(msg4), "~r~We lost the turfwar against the ~y~%s ~r~in ~y~%s!",
  1632. TeamInfo[ defender ][ TeamName ], turfs[ turf ][ turfName ]);
  1633. new Text:txt4 = TextDrawCreate(200.0, 430.0, msg4);
  1634. TextDrawFont( txt4, 0 );
  1635. TextDrawSetShadow( txt4, 0 );
  1636. TextDrawSetOutline( txt4, 1 );
  1637. TextDrawColor( txt4, COLOR_RED );
  1638. TimeTextForPlayer( a, txt4, 6000 );
  1639. // send message
  1640. SendClientMessage( a, TeamInfo[ attacker ][ TeamColor ], "Pity, we were in the minority.");
  1641. TeamInfo[ attacker ][ TurfWarsLost ]++;
  1642. TeamInfo[ attacker ][ TeamScore ]--;
  1643. }
  1644. }
  1645. // change the zone colour and reset the counters
  1646. turfs[ turf ][ TurfOwner ] = defender;
  1647. turfs[ turf ][ TurfColor ] = TeamInfo[ defender ][ TeamColor ];
  1648. GangZoneShowForAll( turf, turfs[ turf ][ TurfColor ] );
  1649. turfs[ turf ][ TurfAttacker ] = -1;
  1650. for (new c=0; c<MAX_TEAMS; c++) { TurfInfo[ turf ][ c ][ TurfKills ] =0; TurfInfo[ turf ][ c ][ TurfAttackKills ] =0; }
  1651. }
  1652. }
  1653. // when it's a draw (not 0-0) or defenders have more kills
  1654. else
  1655. {
  1656. for (new a=0; a<SLOTS; a++)
  1657. {
  1658. if (gTeam[ a ] == defender) { // send the message to winners
  1659. new msg3[ 256 ];
  1660. format(msg3,sizeof(msg3), "~g~That showed them. The turf in ~y~%s ~g~remain ours.", turfs[ turf ][ turfName ]);
  1661. new Text:txt3 = TextDrawCreate(200.0, 355.0, msg3);
  1662. TextDrawFont( txt3, 0 );
  1663. TextDrawSetShadow( txt3, 0 );
  1664. TextDrawSetOutline( txt3, 1 );
  1665. TextDrawColor( txt3, COLOR_GREEN );
  1666. TimeTextForPlayer( a, txt3, 6000 );
  1667. // send message with final score
  1668. format (string, sizeof(string), "Final score from the turfwar in %s. %s %d - %s %d.",
  1669. turfs[ turf ][ turfName ],
  1670. TeamInfo[ defender ][ TeamName ], TurfInfo[ turf ][ defender ][ TurfAttackKills ],
  1671. TeamInfo[ attacker ][ TeamName ], TurfInfo[ turf ][ attacker ][ TurfAttackKills ]);
  1672. SendClientMessage(a, TeamInfo[ defender ][ TeamColor ], string);
  1673. TeamInfo[ defender ][ TurfWarsWon ]++;
  1674. TeamInfo[ defender ][ TeamScore ]++;
  1675.  
  1676. // give winners prize
  1677. SendClientMessage( a, COLOR_GREEN, "Well done. You received $1000 + 1 point.");
  1678. GivePlayerMoney( a, 1000 );
  1679. SetPlayerScore( a,GetPlayerScore(a)+1 );
  1680. }
  1681. else if (gTeam[ a ] == attacker) { // send the message to losers
  1682. new msg4[ 256 ];
  1683. format(msg4,sizeof(msg4), "~r~We lost the turfwar against the ~y~%s ~r~in ~y~%s!",
  1684. TeamInfo[ defender ][ TeamName ], turfs[ turf ][ turfName ]);
  1685. new Text:txt4 = TextDrawCreate(200.0, 430.0, msg4);
  1686. TextDrawFont( txt4, 0 );
  1687. TextDrawSetShadow( txt4, 0 );
  1688. TextDrawSetOutline( txt4, 1 );
  1689. TextDrawColor( txt4, COLOR_RED );
  1690. TimeTextForPlayer( a, txt4, 6000 );
  1691. // send message with final score
  1692. format (string, sizeof(string), "Final score from the turfwar in %s. %s %d - %s %d.",
  1693. turfs[ turf ][ turfName ],
  1694. TeamInfo[ defender ][ TeamName ], TurfInfo[ turf ][ defender ][ TurfAttackKills ],
  1695. TeamInfo[ attacker ][ TeamName ], TurfInfo[ turf ][ attacker ][ TurfAttackKills ]);
  1696. SendClientMessage(a, TeamInfo[ attacker ][ TeamColor ], string);
  1697. TeamInfo[ attacker ][ TurfWarsLost ]++;
  1698. TeamInfo[ attacker ][ TeamScore ]--;
  1699. }
  1700. }
  1701. // if teamscore >= TEAMSCORE reset the teamscore.
  1702. if (TeamInfo[ attacker ][ TeamScore ] >= TEAMSCORE) TeamInfo[ attacker ][ TeamScore ] =0;
  1703. // change the zone colour and reset the counters
  1704. turfs[ turf ][ TurfOwner ] = defender;
  1705. turfs[ turf ][ TurfColor ] = TeamInfo[ defender ][ TeamColor ];
  1706. GangZoneShowForAll( turf, turfs[ turf ][ TurfColor ] );
  1707. turfs[ turf ][ TurfAttacker ] = -1;
  1708. for (new c=0; c<MAX_TEAMS; c++) { TurfInfo[ turf ][ c ][ TurfKills ] =0; TurfInfo[ turf ][ c ][ TurfAttackKills ] =0; }
  1709. }
  1710. }
  1711. }
  1712. //==============================================================================
  1713.  
  1714. public OnPlayerSelectedMenuRow( playerid, row )
  1715. {
  1716. new Float:x, Float:y, Float:z;
  1717. new Menu:current;
  1718. current = GetPlayerMenu( playerid );
  1719. if (current == TKMenu)
  1720. {
  1721. switch(row)
  1722. {
  1723. case 0: {
  1724. HideMenuForPlayer( TKMenu, playerid );
  1725. SendClientMessage( TheKiller[playerid], COLOR_RED, "*** Very kind of this person he doesn't punish you for teamkilling!" );
  1726. }
  1727. case 1: {
  1728. HideMenuForPlayer( TKMenu, playerid );
  1729. SetPlayerInterior( TheKiller[playerid], 6 );
  1730. SetPlayerPos( TheKiller[playerid], 264.6296, 77.1372, 1001.0390);
  1731. ResetPlayerWeapons( TheKiller[playerid] );
  1732. SetPlayerColor( TheKiller[playerid], COLOR_ORANGE );
  1733. SendClientMessage( TheKiller[playerid], COLOR_RED, "*** You've been jailed for teamkilling!" );
  1734. }
  1735. case 2: {
  1736. HideMenuForPlayer( TKMenu, playerid );
  1737. SetPlayerHealth( TheKiller[playerid], 0 );
  1738. SendClientMessage( TheKiller[playerid], COLOR_RED, "*** You've been sentenced to death for teamkilling!" );
  1739. }
  1740. case 3: {
  1741. HideMenuForPlayer( TKMenu, playerid );
  1742. GivePlayerMoney( TheKiller[playerid], -5000 );
  1743. SendClientMessage( TheKiller[playerid], COLOR_RED, "*** You've been fined $5000 for teamkilling!" );
  1744. }
  1745. case 4: {
  1746. HideMenuForPlayer( TKMenu, playerid );
  1747. GetPlayerPos( TheKiller[playerid], x, y, z );
  1748. SetPlayerPos( TheKiller[playerid], x, y, z+1000 );
  1749. SendClientMessage( TheKiller[playerid], COLOR_RED, "*** You've been dropped from the sky for teamkilling!" );
  1750. }
  1751. case 5: {
  1752. HideMenuForPlayer( TKMenu, playerid );
  1753. GetPlayerPos( TheKiller[playerid], x, y, z );
  1754. CreateExplosion( x, y, z, 10, 10 );
  1755. SetPlayerHealth( TheKiller[playerid], 0 );
  1756. SendClientMessage( TheKiller[playerid], COLOR_RED, "*** You've been blown up for teamkilling!" );
  1757. }
  1758. case 6: {
  1759. HideMenuForPlayer( TKMenu, playerid );
  1760. SetPlayerHealth( TheKiller[playerid], 30 );
  1761. SendClientMessage( TheKiller[playerid], COLOR_RED, "*** 70 percent of your health is taken away for teamkilling!" );
  1762. }
  1763. }
  1764. }
  1765. return 1;
  1766. }
  1767. //==============================================================================
  1768.  
  1769. public OnPlayerCommandText(playerid, cmdtext[])
  1770. {
  1771. if (!IsPlayerConnected(playerid)) return 0; // Check for undisconnected bug.
  1772. new
  1773. i,
  1774. c;
  1775. while ((c = cmdtext[i++])) if (c < 0x20 || c > 0x7E) return 0; // Check for illegal characters.
  1776.  
  1777. dcmd(kill, 4, cmdtext);
  1778. dcmd(help, 4, cmdtext);
  1779. dcmd(turfhelp, 8, cmdtext);
  1780. dcmd(commands, 8, cmdtext);
  1781. dcmd(rules, 5, cmdtext);
  1782. dcmd(credits, 7, cmdtext);
  1783. dcmd(report, 6, cmdtext);
  1784. dcmd(me, 2, cmdtext);
  1785. dcmd(hitman, 6, cmdtext);
  1786. dcmd(bounties, 8, cmdtext);
  1787. dcmd(buyweapon, 9, cmdtext);
  1788. dcmd(list, 4, cmdtext);
  1789. dcmd(list2, 5, cmdtext);
  1790. dcmd(seepm, 5, cmdtext);
  1791. dcmd(hidepm, 6, cmdtext);
  1792. dcmd(on, 2, cmdtext);
  1793. dcmd(off, 3, cmdtext);
  1794. dcmd(a, 1, cmdtext);
  1795. dcmd(teamids, 7, cmdtext);
  1796. dcmd(teamstats, 9, cmdtext);
  1797. dcmd(sellpoints, 10, cmdtext);
  1798.  
  1799. return 0;
  1800. }
  1801. //==============================================================================
  1802.  
  1803. dcmd_kill(playerid, cmdtext[]) {
  1804. #pragma unused cmdtext
  1805. SetPlayerHealth( playerid, 0 );
  1806. return 1;
  1807. }
  1808. dcmd_help(playerid, cmdtext[]) {
  1809. #pragma unused cmdtext
  1810. SendClientMessage(playerid, COLOR_RED,"LSTW2 Ultimate help");
  1811. SendClientMessage(playerid, COLOR_YELLOW,"This is a Team Death Match gamemode where you can kill players to receive money and points.");
  1812. SendClientMessage(playerid, COLOR_YELLOW,"You can take over turfs with your team. Type /turfhelp for more info.");
  1813. SendClientMessage(playerid, COLOR_YELLOW,"You can purchase weapons in the ammunation that you will have every time you spawn.");
  1814. SendClientMessage(playerid, COLOR_YELLOW,"See a rulebreaker? Use /report <id> <reason>. And see your teams stats: /teamstats (teamid)");
  1815. SendClientMessage(playerid, COLOR_YELLOW,"You can see the server rules under /rules. Type ![message] to talk in teamchat.");
  1816. SendClientMessage(playerid, COLOR_ORANGE,"Type /commands for a full list of commands.");
  1817. return 1;
  1818. }
  1819. dcmd_turfhelp(playerid, cmdtext[]) {
  1820. #pragma unused cmdtext
  1821. SendClientMessage(playerid, COLOR_RED,"LSTW2 Ultimate Turf help");
  1822. SendClientMessage(playerid, COLOR_YELLOW,"There are 2 ways to provoke a turfwar. 1) Kill 5 players in a specific area.");
  1823. SendClientMessage(playerid, COLOR_YELLOW,"2) Or get at least 10 members in a turf for a short amount of time.");
  1824. SendClientMessage(playerid, COLOR_YELLOW,"The turf you´ve attacked, will flash with a red color on your radar.");
  1825. SendClientMessage(playerid, COLOR_YELLOW,"If you see a turf flashing with a white color, it means the turf");
  1826. SendClientMessage(playerid, COLOR_YELLOW,"is under attack, but not by your team.");
  1827. SendClientMessage(playerid, COLOR_YELLOW,"After 3 minutes the team with the most kills in that area wins the turfwar.");
  1828. SendClientMessage(playerid, COLOR_YELLOW,"Or when there are no kills in a turf the team with the most members wins!");
  1829. SendClientMessage(playerid, COLOR_GREEN,"The winners will receive $1000 + 1 point.");
  1830. return 1;
  1831. }
  1832. dcmd_commands(playerid, cmdtext[]) {
  1833. #pragma unused cmdtext
  1834. SendClientMessage(playerid, COLOR_RED,"LSTW2 Ultimate commands");
  1835. SendClientMessage(playerid, COLOR_YELLOW,"/help | /turfhelp | /commands | /credits");
  1836. SendClientMessage(playerid, COLOR_YELLOW,"/pm <playerid> <message> | !<message>");
  1837. SendClientMessage(playerid, COLOR_YELLOW,"/buyweapon <weaponid> <amount> | /list | /list2");
  1838. SendClientMessage(playerid, COLOR_YELLOW,"/teamstats (teamid) | /teamids | /sellpoints <amount>");
  1839. SendClientMessage(playerid, COLOR_YELLOW,"/hitman <playerid> <amount> | /bounties");
  1840. SendClientMessage(playerid, COLOR_YELLOW,"/report <playerid> <reason> | /me <message>");
  1841. return 1;
  1842. }
  1843. dcmd_rules(playerid, cmdtext[]) {
  1844. #pragma unused cmdtext
  1845. SendClientMessage(playerid, COLOR_RED,"LSTW2 Ultimate server rules");
  1846. SendClientMessage(playerid, COLOR_YELLOW,"There are several rules which you need to follow to avoid a punishment:");
  1847. SendClientMessage(playerid, COLOR_YELLOW,"1. No any kind of cheating is allowed.");
  1848. SendClientMessage(playerid, COLOR_YELLOW,"2. No insulting/flaming or spam is allowed.");
  1849. SendClientMessage(playerid, COLOR_YELLOW,"3. Weapons bugs allowed, although no-reload bug is forbidden.");
  1850. SendClientMessage(playerid, COLOR_YELLOW,"4. Don't annoy the admins or anybody else.");
  1851. SendClientMessage(playerid, COLOR_YELLOW,"5. Don't abuse or spam, /me and /report commands.");
  1852. SendClientMessage(playerid, COLOR_YELLOW,"6. Don't camp exit doors continuously.");
  1853. SendClientMessage(playerid, COLOR_YELLOW,"7. Don't fight in ammunation and food places.");
  1854. SendClientMessage(playerid, COLOR_YELLOW,"8. No racism.");
  1855. return 1;
  1856. }
  1857. dcmd_credits(playerid, cmdtext[]) {
  1858. #pragma unused cmdtext
  1859. SendClientMessage(playerid, COLOR_RED,"LSTW2 Ultimate credits");
  1860. SendClientMessage(playerid, COLOR_YELLOW,"Gamemode by: [W]Hustler");
  1861. SendClientMessage(playerid, COLOR_YELLOW,"Credits to: Pir4t3, Simon, Mike, Luka,");
  1862. SendClientMessage(playerid, COLOR_YELLOW,"Jetmax, Sintax, -Seif-, Lethal, Popo,");
  1863. return 1;
  1864. }
  1865. dcmd_report(playerid, text[]) {
  1866. if(strlen(text) > 0) {
  1867. new string[256], playername[MAX_PLAYER_NAME];
  1868. GetPlayerName(playerid, playername, sizeof(playername));
  1869. format(string, sizeof(string), "Report from %s(%d): %s", playername, playerid, text[0]);
  1870. SendAdminMessage(COLOR_RED, string);
  1871. format(string, sizeof(string), "Report sent to currently online admins.");
  1872. SendClientMessage(playerid, COLOR_ORANGE, string);
  1873. }
  1874. else {
  1875. new string[256];
  1876. format(string, sizeof(string), "Usage: /report [id] [reason]");
  1877. SendClientMessage(playerid, COLOR_WHITE, string);
  1878. }
  1879. return 1;
  1880. }
  1881. dcmd_me(const playerid, message[])
  1882. {
  1883. if (!strlen(message)) {
  1884. SendClientMessage(playerid,COLOR_RED,"USAGE : /me [message]");
  1885. }
  1886. else {
  1887. new pname[ MAX_PLAYER_NAME ], string[ 256 ];
  1888. GetPlayerName( playerid, pname, sizeof( pname ));
  1889. format( string, 256, "%s %s", pname, message );
  1890. SendClientMessageToAll( COLOR_ME, string );
  1891. }
  1892. return 1;
  1893. }
  1894. dcmd_hitman(playerid, cmdtext[])
  1895. {
  1896. #pragma unused cmdtext
  1897. new string[256];
  1898. new sendername[MAX_PLAYER_NAME];
  1899. new giveplayer[MAX_PLAYER_NAME];
  1900. new giveplayerid, moneys, idx;
  1901. new tmp[256];
  1902. tmp = strtok(cmdtext, idx);
  1903.  
  1904. if(!strlen(tmp)) {
  1905. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hitman [playerid] [amount]");
  1906. return 1;
  1907. }
  1908. giveplayerid = strval(tmp);
  1909.  
  1910. tmp = strtok(cmdtext, idx);
  1911. if(!strlen(tmp)) {
  1912. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hitman [playerid] [amount]");
  1913. return 1;
  1914. }
  1915. moneys = strval(tmp);
  1916.  
  1917. if(moneys > AC_GetPlayerMoney(playerid)) {
  1918. SendClientMessage(playerid, COLOR_RED, "You don't have enough money!");
  1919. return 1;
  1920. }
  1921. if(moneys < 100) {
  1922. SendClientMessage(playerid, COLOR_RED, "A bounty must be $100 at least!");
  1923. return 1;
  1924. }
  1925. if(bounty[giveplayerid] == 100000) {
  1926. SendClientMessage(playerid, COLOR_RED, "A bounty can't be more than $100000!");
  1927. return 1;
  1928. }
  1929. if(IsPlayerConnected(giveplayerid)==0) {
  1930. SendClientMessage(playerid, COLOR_RED, "No such player exists.");
  1931. return 1;
  1932. }
  1933.  
  1934. bounty[giveplayerid]+=moneys;
  1935. GivePlayerMoney(playerid, 0-moneys);
  1936.  
  1937. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  1938. GetPlayerName(playerid, sendername, sizeof(sendername));
  1939.  
  1940. format(string, sizeof(string), "%s has had a $%d bounty put on his head from %s (total: $%d).", giveplayer, moneys, sendername, bounty[giveplayerid]);
  1941. SendClientMessageToAll(COLOR_ORANGE, string);
  1942.  
  1943. format(string, sizeof(string), "You have had a $%d bounty put on you from %s (id: %d).", moneys, sendername, playerid);
  1944. SendClientMessage(giveplayerid, COLOR_RED, string);
  1945. return 1;
  1946. }
  1947. dcmd_bounties(playerid, cmdtext[])
  1948. {
  1949. #pragma unused cmdtext
  1950. new string[256];
  1951. new giveplayer[MAX_PLAYER_NAME];
  1952. // new tmp[256];
  1953. new x;
  1954. SendClientMessage(playerid, COLOR_GREEN, "Current Bounties:");
  1955. for(new i=0; i < SLOTS; i++) {
  1956. if(IsPlayerConnected(i) && bounty[i] > 0) {
  1957. GetPlayerName(i, giveplayer, sizeof(giveplayer));
  1958. format(string, sizeof(string), "%s%s(%d): $%d", string,giveplayer,i,bounty[i]);
  1959.  
  1960. x++;
  1961. if(x > 3) {
  1962. SendClientMessage(playerid, COLOR_YELLOW, string);
  1963. x = 0;
  1964. format(string, sizeof(string), "");
  1965. } else {
  1966. format(string, sizeof(string), "%s, ", string);
  1967. }
  1968. }
  1969. }
  1970. if(x <= 3 && x > 0) {
  1971. string[strlen(string)-2] = '.';
  1972. SendClientMessage(playerid, COLOR_YELLOW, string);
  1973. }
  1974. return 1;
  1975. }
  1976. dcmd_buyweapon(playerid, cmdtext[]) {
  1977. #pragma unused cmdtext
  1978. new string[256];
  1979. new idx, weaponid;
  1980. new tmp[256], tmp2[256];
  1981. tmp = strtok(cmdtext, idx);
  1982. tmp2 = strtok(cmdtext, idx);
  1983.  
  1984. if(!strlen(tmp) || !strlen(tmp2)) {
  1985. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buyweapon [weapon_number] [amount]");
  1986. return 1;
  1987. }
  1988. weaponid = strval(tmp);
  1989. new ammos = strval(tmp2);
  1990.  
  1991. if(IsPlayerInCheckpoint(playerid)==0 || playerCheckpoint[playerid]!=CP_AMMU && playerCheckpoint[playerid]!=CP_AMMU_2) {
  1992. SendClientMessage(playerid, COLOR_YELLOW, "You need to be in an Ammunation to buy weapons.");
  1993. return 1;
  1994. }
  1995. if(AC_GetPlayerMoney(playerid) < weaponCost[weaponid]*ammos) {
  1996. SendClientMessage(playerid, COLOR_RED, "You don't have enough money!");
  1997. return 1;
  1998. }
  1999. if(weaponid < 0 || weaponid > MAX_WEAPONS-1){
  2000. SendClientMessage(playerid, COLOR_RED, "Invalid weapon number.");
  2001. return 1;
  2002. }
  2003. if(ammos < 1) {
  2004. SendClientMessage(playerid, COLOR_RED, "Invalid weapon amount.");
  2005. return 1;
  2006. }
  2007.  
  2008. format (string, sizeof(string), "You bought %d %s's for when you spawn.",ammos,weaponNames[weaponid]);
  2009. SendClientMessage(playerid, COLOR_GREEN, string);
  2010.  
  2011. GivePlayerWeapon(playerid, weaponIDs[weaponid], weaponAmmo[weaponid]*ammos);
  2012. playerWeapons[playerid][weaponid] += ammos;
  2013.  
  2014. GivePlayerMoney(playerid, 0-(weaponCost[weaponid]*ammos));
  2015. return 1;
  2016. }
  2017. dcmd_list(playerid, cmdtext[]) {
  2018. #pragma unused cmdtext
  2019. new string[256];
  2020. new weaponstemp = MAX_WEAPONS;
  2021. if(IsPlayerInCheckpoint(playerid)==0 || playerCheckpoint[playerid]!=CP_AMMU && playerCheckpoint[playerid]!=CP_AMMU_2) {
  2022. SendClientMessage(playerid, COLOR_YELLOW, "You need to be in an ammunation checkpoint.");
  2023. return 1;
  2024. }
  2025. if(weaponstemp>8) {
  2026. weaponstemp = 8;
  2027. }
  2028. SendClientMessage(playerid, COLOR_GREEN, "Weapon List 1/2:");
  2029. for(new i = 0; i < weaponstemp; i++) {
  2030. format (string, sizeof(string), "%d. %s - $%d",i,weaponNames[i],weaponCost[i]);
  2031. SendClientMessage(playerid, COLOR_YELLOW, string);
  2032. }
  2033. return 1;
  2034. }
  2035. dcmd_list2(playerid, cmdtext[]) {
  2036. #pragma unused cmdtext
  2037. new string[256];
  2038. if(IsPlayerInCheckpoint(playerid)==0 || playerCheckpoint[playerid]!=CP_AMMU && playerCheckpoint[playerid]!=CP_AMMU_2) {
  2039. SendClientMessage(playerid, COLOR_YELLOW, "You need to be in an ammunation checkpoint.");
  2040. return 1;
  2041. }
  2042. SendClientMessage(playerid, COLOR_GREEN, "Weapon List 2/2:");
  2043. for(new i = 8; i < MAX_WEAPONS; i++) {
  2044. format (string, sizeof(string), "%d. %s - $%d",i,weaponNames[i],weaponCost[i]);
  2045. SendClientMessage(playerid, COLOR_YELLOW, string);
  2046. }
  2047. return 1;
  2048. }
  2049. dcmd_seepm(playerid, cmdtext[]) {
  2050. #pragma unused cmdtext
  2051. if (!IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "You're not an admin.");
  2052. else {
  2053. ShowPM[playerid]= 1;
  2054. SendClientMessage(playerid, COLOR_GREEN, "You can see PM's now.");
  2055. }
  2056. return 1;
  2057. }
  2058. dcmd_hidepm(playerid, cmdtext[]) {
  2059. #pragma unused cmdtext
  2060. if (!IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "You're not an admin.");
  2061. else {
  2062. ShowPM[playerid]= 0;
  2063. SendClientMessage(playerid, COLOR_RED, "You can't see PM's anymore.");
  2064. }
  2065. return 1;
  2066. }
  2067. dcmd_on(playerid, cmdtext[]) {
  2068. #pragma unused cmdtext
  2069. if (!IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "You're not an admin.");
  2070. else {
  2071. SetPlayerColor(playerid, COLOR_WHITE);
  2072. PlayerOnDuty[playerid] =1;
  2073. }
  2074. return 1;
  2075. }
  2076. dcmd_off(playerid, cmdtext[]) {
  2077. #pragma unused cmdtext
  2078. if (!IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "You're not an admin.");
  2079. else {
  2080. SetPlayerToTeamColor(playerid);
  2081. PlayerOnDuty[playerid]=0;
  2082. }
  2083. return 1;
  2084. }
  2085. dcmd_a(playerid, cmdtext[]) {
  2086. #pragma unused cmdtext
  2087. new sendername[MAX_PLAYER_NAME];
  2088. new string[256], idx;
  2089. if (!IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_RED, "You're not an admin.");
  2090. else {
  2091. GetPlayerName(playerid, sendername, sizeof(sendername));
  2092. new length = strlen(cmdtext);
  2093. while ((idx < length) && (cmdtext[idx] <= ' '))
  2094. {
  2095. idx++;
  2096. }
  2097. new offset = idx;
  2098. new result[64];
  2099. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  2100. {
  2101. result[idx - offset] = cmdtext[idx];
  2102. idx++;
  2103. }
  2104. result[idx - offset] = EOS;
  2105. if(!strlen(result))
  2106. {
  2107. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /a <message>");
  2108. return 1;
  2109. }
  2110. format(string, sizeof(string), "[AdminChat]%s: %s", sendername, result);
  2111. SendAdminMessage(COLOR_ACHAT,string);
  2112. return 1;
  2113. }
  2114. return 1;
  2115. }
  2116. dcmd_teamids(playerid, cmdtext[]) {
  2117. #pragma unused cmdtext
  2118. SendClientMessage(playerid, COLOR_RED, "These are the teamid's.");
  2119. SendClientMessage(playerid, COLOR_WHITE, "Aztecas: 0 | Vagos: 1 | Ballas: 2 | O.G.F: 3 | Dealers: 4");
  2120. SendClientMessage(playerid, COLOR_WHITE, "Cops: 5 | Bikers: 6 | Rappers: 7 | Guards: 8 | Hoodlums: 9 | Workers: 10");
  2121. return 1;
  2122. }
  2123. dcmd_teamstats(playerid, cmdtext[])
  2124. {
  2125. #pragma unused cmdtext
  2126. new giveteamid, idx, tmp[256];
  2127. tmp = strtok(cmdtext, idx);
  2128.  
  2129. if (!strlen(tmp))
  2130. {
  2131. for (new i = 0; i < MAX_TURFS; i++) {
  2132. new msg[ 256 ];
  2133. format(msg, sizeof(msg), "~w~%s stats:~n~~g~Turfwars Won: %d~n~~r~Turfwars Lost: %d~n~~w~Rivals killed: %d~n~Homies lost: %d~n~~y~Turfs: %d~n~~w~Teamscore: %d",
  2134. TeamInfo[ gTeam[playerid] ][ TeamName ], TeamInfo[ gTeam[playerid] ][ TurfWarsWon ],
  2135. TeamInfo[ gTeam[playerid] ][ TurfWarsLost ], TeamInfo[ gTeam[playerid] ][ RivalsKilled ],
  2136. TeamInfo[ gTeam[playerid] ][ HomiesDied ], OwnedTurfs(), TeamInfo[ gTeam[playerid] ][ TeamScore ]);
  2137. new Text:txt = TextDrawCreate( 33.0, 261.0, msg);
  2138. TextDrawUseBox( txt, 1 );
  2139. TextDrawBoxColor( txt, 0x00000066 );
  2140. TextDrawTextSize( txt, 141.0, 0.0 );
  2141. TextDrawAlignment( txt, 0 );
  2142. TextDrawBackgroundColor( txt, 0x000000ff );
  2143. TextDrawFont( txt, 1 );
  2144. TextDrawLetterSize( txt, 0.29, 1.0 );
  2145. TextDrawColor( txt, 0xffffffff );
  2146. TextDrawSetOutline( txt, 1 );
  2147. TextDrawSetProportional( txt, 1 );
  2148. TextDrawSetShadow( txt, 1 );
  2149. TimeTextForPlayer( playerid, txt, 6000 );
  2150. return 1;
  2151. }
  2152. }
  2153. giveteamid = strval(tmp);
  2154. if ((giveteamid < 0 || giveteamid > 14)) {
  2155. SendClientMessage(playerid, COLOR_RED, "No such teamid! Look at the teamid's.");
  2156. SendClientMessage(playerid, COLOR_WHITE, "Azteca: 0 | Vagos: 1 | Balla: 2 | O.G.F: 3 | Dealer: 4");
  2157. SendClientMessage(playerid, COLOR_WHITE, "Cop: 5 | Biker: 6 | Rapper: 7 | Guard: 8 | Hoodlum: 9 | Worker: 10");
  2158. return 1;
  2159. }
  2160. for (new i = 0; i < MAX_TURFS; i++) {
  2161. new msg[ 256 ];
  2162. format(msg, sizeof(msg), "~w~%s stats:~n~~g~Turfwars Won: %d~n~~r~Turfwars Lost: %d~n~~w~Rivals killed: %d~n~Homies lost: %d~n~~y~Turfs: %d~n~~w~Teamscore: %d",
  2163. TeamInfo[ giveteamid ][ TeamName ], TeamInfo[ giveteamid ][ TurfWarsWon ],
  2164. TeamInfo[ giveteamid ][ TurfWarsLost ], TeamInfo[ giveteamid ][ RivalsKilled ],
  2165. TeamInfo[ giveteamid ][ HomiesDied ], OwnedTurfs2(giveteamid), TeamInfo[ giveteamid ][ TeamScore ]);
  2166. new Text:txt = TextDrawCreate( 33.0, 261.0, msg);
  2167. TextDrawUseBox( txt, 1 );
  2168. TextDrawBoxColor( txt, 0x00000066 );
  2169. TextDrawTextSize( txt, 141.0, 0.0 );
  2170. TextDrawAlignment( txt, 0 );
  2171. TextDrawBackgroundColor( txt, 0x000000ff );
  2172. TextDrawFont( txt, 1 );
  2173. TextDrawLetterSize( txt, 0.29, 1.0 );
  2174. TextDrawColor( txt, 0xffffffff );
  2175. TextDrawSetOutline( txt, 1 );
  2176. TextDrawSetProportional( txt, 1 );
  2177. TextDrawSetShadow( txt, 1 );
  2178. TimeTextForPlayer( playerid, txt, 6000 );
  2179. return 1;
  2180. }
  2181. return 1;
  2182. }
  2183. dcmd_sellpoints(playerid, cmdtext[]) {
  2184. #pragma unused cmdtext
  2185. new string[ 256 ], tmp[ 256 ];
  2186. new sendername[ MAX_PLAYER_NAME ];
  2187. new idx;
  2188.  
  2189. tmp = strtok(cmdtext,idx);
  2190. new setting = strval(tmp);
  2191. if (!strlen(tmp)){
  2192. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellpoints [amount]");
  2193. return 1;
  2194. }
  2195. else if (GetPlayerScore( playerid ) <= 0 ) {
  2196. SendClientMessage( playerid, COLOR_RED, "You don't have enough points." );
  2197. return 1;
  2198. }
  2199. else if (setting > 0) {
  2200. GetPlayerName(playerid, sendername, sizeof(sendername));
  2201. SetPlayerScore( playerid, GetPlayerScore(playerid)-setting );
  2202. GivePlayerMoney( playerid, setting*250 );
  2203. format(string,sizeof(string),"*** You've sold %d points.", setting);
  2204. SendClientMessage( playerid, COLOR_GREEN, string );
  2205. format(string,sizeof(string),"*** %s(%d) sold %d points.", sendername, playerid, setting);
  2206. SendAdminMessage( COLOR_RED, string );
  2207. }
  2208. else SendClientMessage( playerid, COLOR_WHITE, "USAGE: /sellpoints [amount]" );
  2209. return 1;
  2210. }
  2211. //==============================================================================
  2212.  
  2213. public OnPlayerEnterCheckpoint(playerid)
  2214. {
  2215. switch(getCheckpointType(playerid))
  2216. {
  2217. case CP_AMMU: {
  2218. SendClientMessage(playerid, COLOR_GREEN, "You can purchase weapons here so that you have them every");
  2219. SendClientMessage(playerid, COLOR_GREEN, "time you spawn. You can purchase more than once for more ammo.");
  2220. SendClientMessage(playerid, COLOR_YELLOW, "Type /buyweapon <weapon number> <weapon_amount> and /list or /list2 for a list of weapons.");
  2221. }
  2222. case CP_AMMU_2: {
  2223. SendClientMessage(playerid, COLOR_GREEN, "You can purchase weapons here so that you have them every");
  2224. SendClientMessage(playerid, COLOR_GREEN, "time you spawn. You can purchase more than once for more ammo.");
  2225. SendClientMessage(playerid, COLOR_YELLOW, "Type /buyweapon <weapon number> <weapon_amount> and /list or /list2 for a list of weapons.");
  2226. }
  2227. }
  2228. return 1;
  2229. }
  2230. //==============================================================================
  2231.  
  2232. public OnPlayerPickUpPickup(playerid, pickupid)
  2233. {
  2234. if(gDropPickup[pickupid] != -1) {
  2235. DestroyPickup(pickupid);
  2236. KillTimer(gDropPickup[pickupid]);
  2237. gDropPickup[pickupid] = -1;
  2238. }
  2239. return 1;
  2240. }
  2241. //==============================================================================
  2242.  
  2243. public PickupDestroy(pickupid)
  2244. {
  2245. DestroyPickup(pickupid);
  2246. gDropPickup[pickupid] = -1;
  2247. }
  2248. //==============================================================================
  2249.  
  2250. public TimeTextForPlayer( playerid, Text:text, time )
  2251. {
  2252. TextDrawShowForPlayer( playerid, text );
  2253. SetTimerEx( "DestroyTextTimer", time, 0, "i", _:text );
  2254. }
  2255.  
  2256. public DestroyTextTimer( Text:text ) TextDrawDestroy( text );
  2257. //==============================================================================
  2258.  
  2259. public OnPlayerText( playerid, text[] )
  2260. {
  2261. if (!IsPlayerConnected( playerid )) return 0; // Check for undisconnected bug.
  2262. new
  2263. i,
  2264. c;
  2265. while ((c = text[i++])) if (c < 0x20 || c > 0x7E) return 0; // Check for illegal characters.
  2266.  
  2267. if (text[0] == '!')
  2268. {
  2269. new string[256], name[24];
  2270. GetPlayerName(playerid, name, 24);
  2271. format(string, 256, "[TEAM] %s: %s", name, text[1]);
  2272. for (new a = 0; a < SLOTS; a++) {
  2273. if (IsPlayerConnected(a)) {
  2274. if (gTeam[a] == gTeam[playerid]) SendClientMessage(a, AZTECAS_COLOR, string);
  2275. }
  2276. }
  2277. return 0;
  2278. }
  2279.  
  2280. return 1;
  2281. }
  2282. //==============================================================================
  2283.  
  2284. public OnPlayerPrivmsg( playerid, recieverid, text[] )
  2285. {
  2286. if (!IsPlayerConnected( playerid )) return 0; // Check for undisconnected bug.
  2287. new
  2288. i,
  2289. c;
  2290. while ((c = text[i++])) if (c < 0x20 || c > 0x7E) return 0; // Check for illegal characters.
  2291.  
  2292. new string[ 256 ], name[ 24 ], name2[ 24 ];
  2293. GetPlayerName( recieverid, name, 24 );
  2294. GetPlayerName( playerid, name2, 24 );
  2295. format( string, sizeof(string),"*** [PM] %s(%d) to %s(%d): %s", name2, playerid, name, recieverid, text);
  2296. for (new k = 0; k < SLOTS; k ++) {
  2297. if (IsPlayerConnected( k )) {
  2298. if (IsPlayerAdmin( k )) {
  2299. if (ShowPM[ k ] != 0) {
  2300. if (k != playerid && k != recieverid) {
  2301. SendClientMessage(k, COLOR_GREY, string);
  2302. }
  2303. }
  2304. }
  2305. }
  2306. }
  2307. return 1;
  2308. }
  2309. //==============================================================================
  2310.  
  2311. public GameModeInitExitFunc( )
  2312. {
  2313. for (new i = 0; i < SLOTS; i++) {
  2314. if (IsPlayerConnected( i )) {
  2315. PlayerPlaySound( i, 1069, 0.0, 0.0, 0.0 );
  2316. }
  2317. }
  2318. SetTimer( "GameModeExitFunc", 4000, 0 );
  2319. return 1;
  2320. }
  2321. //==============================================================================
  2322.  
  2323. public GameModeExitFunc( ) {
  2324. GameModeExit( );
  2325. return 1;
  2326. }
  2327. //==============================================================================
  2328.  
  2329. public SendAdminMessage( color, string[] )
  2330. {
  2331. for (new i = 0; i < SLOTS; i++) {
  2332. if (IsPlayerConnected( i )) {
  2333. if (IsPlayerAdmin( i )) {
  2334. SendClientMessage( i, color, string );
  2335. }
  2336. }
  2337. }
  2338. }
  2339. //==============================================================================
  2340.  
  2341. stock AC_ResetPlayerMoney( playerid )
  2342. {
  2343. lTMoney[ playerid ] = 0;
  2344. lSMoney[ playerid ] = 0;
  2345.  
  2346. ResetPlayerMoney( playerid );
  2347. return 1;
  2348. }
  2349.  
  2350. stock AC_GivePlayerMoney( playerid, money )
  2351. {
  2352. lTMoney[ playerid ] += money;
  2353. lSMoney[ playerid ] = 0;
  2354.  
  2355. GivePlayerMoney( playerid, money );
  2356. return 1;
  2357. }
  2358.  
  2359. stock AC_GetPlayerMoney( playerid ) return lTMoney[ playerid ];
  2360. //---------------------------------
  2361.  
  2362. stock DropPlayerWeapons(playerid)
  2363. {
  2364. new Float:x, Float:y, Float:z, Float:nx, Float:ny;
  2365. new wep, val, pickupid, ammo, temp[10], bool:deny;
  2366.  
  2367. GetPlayerPos(playerid,x,y,z);
  2368.  
  2369. for(new i=0; i<13; i++) {
  2370. deny = false;
  2371. GetPlayerWeaponData(playerid, i, wep, ammo);
  2372. for(new m=0; m<sizeof(gDenyWeaponDrop); m++) {
  2373. if(gDenyWeaponDrop[m] == wep) { deny = true; break; }
  2374. }
  2375. if (!deny && wep != 0 && ammo > 0) {
  2376. format(temp,sizeof(temp),"%.0f", x);
  2377. val = strval(temp);
  2378. nx = RandomEx(val-2,val+2);
  2379. format(temp,sizeof(temp),"%.0f", y);
  2380. val = strval(temp);
  2381. ny = RandomEx(val-2,val+2);
  2382. pickupid = CreatePickup(GetWeaponPickupID(wep),3,nx,ny,z);
  2383. gDropPickup[pickupid] = SetTimerEx("PickupDestroy",DROP_LENGTH,0,"i",pickupid);
  2384. }
  2385. }
  2386. return 1;
  2387. }
  2388.  
  2389. stock GetWeaponPickupID(weaponid)
  2390. {
  2391. new pickupid;
  2392. switch(weaponid)
  2393. {
  2394. case 1: { pickupid = 331; }
  2395. case 2: { pickupid = 333; }
  2396. case 3: { pickupid = 334; }
  2397. case 4: { pickupid = 335; }
  2398. case 5: { pickupid = 336; }
  2399. case 6: { pickupid = 337; }
  2400. case 7: { pickupid = 338; }
  2401. case 8: { pickupid = 339; }
  2402. case 9: { pickupid = 341; }
  2403. case 10: { pickupid = 321; }
  2404. case 11: { pickupid = 322; }
  2405. case 12: { pickupid = 323; }
  2406. case 13: { pickupid = 324; }
  2407. case 14: { pickupid = 325; }
  2408. case 15: { pickupid = 326; }
  2409. case 16: { pickupid = 342; }
  2410. case 17: { pickupid = 343; }
  2411. case 18: { pickupid = 344; }
  2412. case 22: { pickupid = 346; }
  2413. case 23: { pickupid = 347; }
  2414. case 24: { pickupid = 348; }
  2415. case 25: { pickupid = 349; }
  2416. case 26: { pickupid = 350; }
  2417. case 27: { pickupid = 351; }
  2418. case 28: { pickupid = 352; }
  2419. case 29: { pickupid = 353; }
  2420. case 30: { pickupid = 355; }
  2421. case 31: { pickupid = 356; }
  2422. case 32: { pickupid = 372; }
  2423. case 33: { pickupid = 357; }
  2424. case 34: { pickupid = 358; }
  2425. case 35: { pickupid = 359; }
  2426. case 36: { pickupid = 360; }
  2427. case 37: { pickupid = 361; }
  2428. case 38: { pickupid = 362; }
  2429. case 39: { pickupid = 363; }
  2430. case 40: { pickupid = 364; }
  2431. case 41: { pickupid = 365; }
  2432. case 42: { pickupid = 366; }
  2433. default: { pickupid = 0; }
  2434. }
  2435. return pickupid;
  2436. }
  2437.  
  2438. stock RandomEx(min, max)
  2439. {
  2440. new output;
  2441. output = max-min;
  2442. output = random(output);
  2443. output = min+output;
  2444. return output;
  2445. }
  2446. //-------------------------------
  2447.  
  2448. stock OwnedTurfs( )
  2449. {
  2450. new turf, playerid;
  2451. for (new i = 0; i < MAX_TURFS; i++) if (turfs[ i ][TurfOwner] == gTeam[playerid]) turf++;
  2452. return turf;
  2453. }
  2454. stock OwnedTurfs2( teamid )
  2455. {
  2456. new turf;
  2457. for (new i = 0; i < MAX_TURFS; i++) if (turfs[ i ][TurfOwner] == teamid) turf++;
  2458. return turf;
  2459. }
  2460. //==============================================================================
  2461.  
  2462. strtok(const string[], &index)
  2463. {
  2464. new length = strlen(string);
  2465. while ((index < length) && (string[index] <= ' '))
  2466. {
  2467. index++;
  2468. }
  2469.  
  2470. new offset = index;
  2471. new result[20];
  2472. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  2473. {
  2474. result[index - offset] = string[index];
  2475. index++;
  2476. }
  2477. result[index - offset] = EOS;
  2478. return result;
  2479. }
  2480.  
  2481. //------------------------------------------------------------------------------
  2482. isStringSame(const string1[], const string2[], len) {
  2483. for(new i = 0; i < len; i++) {
  2484. if(string1[i]!=string2[i])
  2485. return 0;
  2486. if(string1[i] == 0 || string1[i] == '\n')
  2487. return 1;
  2488. }
  2489. return 1;
  2490. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement