SAMP Gitlab CI Test
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

529 lines
20 KiB

5 years ago
  1. //----------------------------------------------------------
  2. //
  3. // GRAND LARCENY 1.0
  4. // A freeroam gamemode for SA-MP 0.3
  5. //
  6. //----------------------------------------------------------
  7. #include <a_samp>
  8. #include <core>
  9. #include <float>
  10. #include "../include/gl_common.inc"
  11. #include "../include/gl_spawns.inc"
  12. #pragma tabsize 0
  13. //----------------------------------------------------------
  14. #define COLOR_WHITE 0xFFFFFFFF
  15. #define COLOR_NORMAL_PLAYER 0xFFBB7777
  16. #define CITY_LOS_SANTOS 0
  17. #define CITY_SAN_FIERRO 1
  18. #define CITY_LAS_VENTURAS 2
  19. new total_vehicles_from_files=0;
  20. // Class selection globals
  21. new gPlayerCitySelection[MAX_PLAYERS];
  22. new gPlayerHasCitySelected[MAX_PLAYERS];
  23. new gPlayerLastCitySelectionTick[MAX_PLAYERS];
  24. new Text:txtClassSelHelper;
  25. new Text:txtLosSantos;
  26. new Text:txtSanFierro;
  27. new Text:txtLasVenturas;
  28. //new thisanimid=0;
  29. //new lastanimid=0;
  30. //----------------------------------------------------------
  31. main()
  32. {
  33. print("\n---------------------------------------");
  34. print("Running Grand Larceny - by the SA-MP team\n");
  35. print("---------------------------------------\n");
  36. }
  37. //----------------------------------------------------------
  38. public OnPlayerConnect(playerid)
  39. {
  40. GameTextForPlayer(playerid,"~w~Grand Larceny",3000,4);
  41. SendClientMessage(playerid,COLOR_WHITE,"Welcome to {88AA88}G{FFFFFF}rand {88AA88}L{FFFFFF}arceny");
  42. // class selection init vars
  43. gPlayerCitySelection[playerid] = -1;
  44. gPlayerHasCitySelected[playerid] = 0;
  45. gPlayerLastCitySelectionTick[playerid] = GetTickCount();
  46. //SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);
  47. /*
  48. Removes vending machines
  49. RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 6000.0);
  50. RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 6000.0);
  51. RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 6000.0);
  52. RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 6000.0);
  53. RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 6000.0);
  54. */
  55. /*
  56. new ClientVersion[32];
  57. GetPlayerVersion(playerid, ClientVersion, 32);
  58. printf("Player %d reports client version: %s", playerid, ClientVersion);*/
  59. return 1;
  60. }
  61. //----------------------------------------------------------
  62. public OnPlayerSpawn(playerid)
  63. {
  64. if(IsPlayerNPC(playerid)) return 1;
  65. new randSpawn = 0;
  66. SetPlayerInterior(playerid,0);
  67. TogglePlayerClock(playerid,0);
  68. ResetPlayerMoney(playerid);
  69. GivePlayerMoney(playerid, 30000);
  70. if(CITY_LOS_SANTOS == gPlayerCitySelection[playerid]) {
  71. randSpawn = random(sizeof(gRandomSpawns_LosSantos));
  72. SetPlayerPos(playerid,
  73. gRandomSpawns_LosSantos[randSpawn][0],
  74. gRandomSpawns_LosSantos[randSpawn][1],
  75. gRandomSpawns_LosSantos[randSpawn][2]);
  76. SetPlayerFacingAngle(playerid,gRandomSpawns_LosSantos[randSpawn][3]);
  77. }
  78. else if(CITY_SAN_FIERRO == gPlayerCitySelection[playerid]) {
  79. randSpawn = random(sizeof(gRandomSpawns_SanFierro));
  80. SetPlayerPos(playerid,
  81. gRandomSpawns_SanFierro[randSpawn][0],
  82. gRandomSpawns_SanFierro[randSpawn][1],
  83. gRandomSpawns_SanFierro[randSpawn][2]);
  84. SetPlayerFacingAngle(playerid,gRandomSpawns_SanFierro[randSpawn][3]);
  85. }
  86. else if(CITY_LAS_VENTURAS == gPlayerCitySelection[playerid]) {
  87. randSpawn = random(sizeof(gRandomSpawns_LasVenturas));
  88. SetPlayerPos(playerid,
  89. gRandomSpawns_LasVenturas[randSpawn][0],
  90. gRandomSpawns_LasVenturas[randSpawn][1],
  91. gRandomSpawns_LasVenturas[randSpawn][2]);
  92. SetPlayerFacingAngle(playerid,gRandomSpawns_LasVenturas[randSpawn][3]);
  93. }
  94. //SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);
  95. /*
  96. SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,200);
  97. SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,200);
  98. SetPlayerSkillLevel(playerid,WEAPONSKILL_DESERT_EAGLE,200);
  99. SetPlayerSkillLevel(playerid,WEAPONSKILL_SHOTGUN,200);
  100. SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200);
  101. SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,200);
  102. SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,200);
  103. SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,200);
  104. SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,200);
  105. SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,200);
  106. SetPlayerSkillLevel(playerid,WEAPONSKILL_SNIPERRIFLE,200);*/
  107. GivePlayerWeapon(playerid,WEAPON_COLT45,100);
  108. //GivePlayerWeapon(playerid,WEAPON_MP5,100);
  109. TogglePlayerClock(playerid, 0);
  110. return 1;
  111. }
  112. //----------------------------------------------------------
  113. public OnPlayerDeath(playerid, killerid, reason)
  114. {
  115. new playercash;
  116. // if they ever return to class selection make them city
  117. // select again first
  118. gPlayerHasCitySelected[playerid] = 0;
  119. if(killerid == INVALID_PLAYER_ID) {
  120. ResetPlayerMoney(playerid);
  121. } else {
  122. playercash = GetPlayerMoney(playerid);
  123. if(playercash > 0) {
  124. GivePlayerMoney(killerid, playercash);
  125. ResetPlayerMoney(playerid);
  126. }
  127. }
  128. return 1;
  129. }
  130. //----------------------------------------------------------
  131. ClassSel_SetupCharSelection(playerid)
  132. {
  133. if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) {
  134. SetPlayerInterior(playerid,11);
  135. SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
  136. SetPlayerFacingAngle(playerid,0.0);
  137. SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
  138. SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
  139. }
  140. else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) {
  141. SetPlayerInterior(playerid,3);
  142. SetPlayerPos(playerid,-2673.8381,1399.7424,918.3516);
  143. SetPlayerFacingAngle(playerid,181.0);
  144. SetPlayerCameraPos(playerid,-2673.2776,1394.3859,918.3516);
  145. SetPlayerCameraLookAt(playerid,-2673.8381,1399.7424,918.3516);
  146. }
  147. else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) {
  148. SetPlayerInterior(playerid,3);
  149. SetPlayerPos(playerid,349.0453,193.2271,1014.1797);
  150. SetPlayerFacingAngle(playerid,286.25);
  151. SetPlayerCameraPos(playerid,352.9164,194.5702,1014.1875);
  152. SetPlayerCameraLookAt(playerid,349.0453,193.2271,1014.1797);
  153. }
  154. }
  155. //----------------------------------------------------------
  156. // Used to init textdraws of city names
  157. ClassSel_InitCityNameText(Text:txtInit)
  158. {
  159. TextDrawUseBox(txtInit, 0);
  160. TextDrawLetterSize(txtInit,1.25,3.0);
  161. TextDrawFont(txtInit, 0);
  162. TextDrawSetShadow(txtInit,0);
  163. TextDrawSetOutline(txtInit,1);
  164. TextDrawColor(txtInit,0xEEEEEEFF);
  165. TextDrawBackgroundColor(txtClassSelHelper,0x000000FF);
  166. }
  167. //----------------------------------------------------------
  168. ClassSel_InitTextDraws()
  169. {
  170. // Init our observer helper text display
  171. txtLosSantos = TextDrawCreate(10.0, 380.0, "Los Santos");
  172. ClassSel_InitCityNameText(txtLosSantos);
  173. txtSanFierro = TextDrawCreate(10.0, 380.0, "San Fierro");
  174. ClassSel_InitCityNameText(txtSanFierro);
  175. txtLasVenturas = TextDrawCreate(10.0, 380.0, "Las Venturas");
  176. ClassSel_InitCityNameText(txtLasVenturas);
  177. // Init our observer helper text display
  178. txtClassSelHelper = TextDrawCreate(10.0, 415.0,
  179. " Press ~b~~k~~GO_LEFT~ ~w~or ~b~~k~~GO_RIGHT~ ~w~to switch cities.~n~ Press ~r~~k~~PED_FIREWEAPON~ ~w~to select.");
  180. TextDrawUseBox(txtClassSelHelper, 1);
  181. TextDrawBoxColor(txtClassSelHelper,0x222222BB);
  182. TextDrawLetterSize(txtClassSelHelper,0.3,1.0);
  183. TextDrawTextSize(txtClassSelHelper,400.0,40.0);
  184. TextDrawFont(txtClassSelHelper, 2);
  185. TextDrawSetShadow(txtClassSelHelper,0);
  186. TextDrawSetOutline(txtClassSelHelper,1);
  187. TextDrawBackgroundColor(txtClassSelHelper,0x000000FF);
  188. TextDrawColor(txtClassSelHelper,0xFFFFFFFF);
  189. }
  190. //----------------------------------------------------------
  191. ClassSel_SetupSelectedCity(playerid)
  192. {
  193. if(gPlayerCitySelection[playerid] == -1) {
  194. gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
  195. }
  196. if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) {
  197. SetPlayerInterior(playerid,0);
  198. SetPlayerCameraPos(playerid,1630.6136,-2286.0298,110.0);
  199. SetPlayerCameraLookAt(playerid,1887.6034,-1682.1442,47.6167);
  200. TextDrawShowForPlayer(playerid,txtLosSantos);
  201. TextDrawHideForPlayer(playerid,txtSanFierro);
  202. TextDrawHideForPlayer(playerid,txtLasVenturas);
  203. }
  204. else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) {
  205. SetPlayerInterior(playerid,0);
  206. SetPlayerCameraPos(playerid,-1300.8754,68.0546,129.4823);
  207. SetPlayerCameraLookAt(playerid,-1817.9412,769.3878,132.6589);
  208. TextDrawHideForPlayer(playerid,txtLosSantos);
  209. TextDrawShowForPlayer(playerid,txtSanFierro);
  210. TextDrawHideForPlayer(playerid,txtLasVenturas);
  211. }
  212. else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) {
  213. SetPlayerInterior(playerid,0);
  214. SetPlayerCameraPos(playerid,1310.6155,1675.9182,110.7390);
  215. SetPlayerCameraLookAt(playerid,2285.2944,1919.3756,68.2275);
  216. TextDrawHideForPlayer(playerid,txtLosSantos);
  217. TextDrawHideForPlayer(playerid,txtSanFierro);
  218. TextDrawShowForPlayer(playerid,txtLasVenturas);
  219. }
  220. }
  221. //----------------------------------------------------------
  222. ClassSel_SwitchToNextCity(playerid)
  223. {
  224. gPlayerCitySelection[playerid]++;
  225. if(gPlayerCitySelection[playerid] > CITY_LAS_VENTURAS) {
  226. gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
  227. }
  228. PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
  229. gPlayerLastCitySelectionTick[playerid] = GetTickCount();
  230. ClassSel_SetupSelectedCity(playerid);
  231. }
  232. //----------------------------------------------------------
  233. ClassSel_SwitchToPreviousCity(playerid)
  234. {
  235. gPlayerCitySelection[playerid]--;
  236. if(gPlayerCitySelection[playerid] < CITY_LOS_SANTOS) {
  237. gPlayerCitySelection[playerid] = CITY_LAS_VENTURAS;
  238. }
  239. PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
  240. gPlayerLastCitySelectionTick[playerid] = GetTickCount();
  241. ClassSel_SetupSelectedCity(playerid);
  242. }
  243. //----------------------------------------------------------
  244. ClassSel_HandleCitySelection(playerid)
  245. {
  246. new Keys,ud,lr;
  247. GetPlayerKeys(playerid,Keys,ud,lr);
  248. if(gPlayerCitySelection[playerid] == -1) {
  249. ClassSel_SwitchToNextCity(playerid);
  250. return;
  251. }
  252. // only allow new selection every ~500 ms
  253. if( (GetTickCount() - gPlayerLastCitySelectionTick[playerid]) < 500 ) return;
  254. if(Keys & KEY_FIRE) {
  255. gPlayerHasCitySelected[playerid] = 1;
  256. TextDrawHideForPlayer(playerid,txtClassSelHelper);
  257. TextDrawHideForPlayer(playerid,txtLosSantos);
  258. TextDrawHideForPlayer(playerid,txtSanFierro);
  259. TextDrawHideForPlayer(playerid,txtLasVenturas);
  260. TogglePlayerSpectating(playerid,0);
  261. return;
  262. }
  263. if(lr > 0) {
  264. ClassSel_SwitchToNextCity(playerid);
  265. }
  266. else if(lr < 0) {
  267. ClassSel_SwitchToPreviousCity(playerid);
  268. }
  269. }
  270. //----------------------------------------------------------
  271. public OnPlayerRequestClass(playerid, classid)
  272. {
  273. if(IsPlayerNPC(playerid)) return 1;
  274. if(gPlayerHasCitySelected[playerid]) {
  275. ClassSel_SetupCharSelection(playerid);
  276. return 1;
  277. } else {
  278. if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING) {
  279. TogglePlayerSpectating(playerid,1);
  280. TextDrawShowForPlayer(playerid, txtClassSelHelper);
  281. gPlayerCitySelection[playerid] = -1;
  282. }
  283. }
  284. return 0;
  285. }
  286. //----------------------------------------------------------
  287. public OnGameModeInit()
  288. {
  289. SetGameModeText("Grand Larceny");
  290. ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
  291. ShowNameTags(1);
  292. SetNameTagDrawDistance(40.0);
  293. EnableStuntBonusForAll(0);
  294. DisableInteriorEnterExits();
  295. SetWeather(2);
  296. SetWorldTime(11);
  297. //SetObjectsDefaultCameraCol(true);
  298. //UsePlayerPedAnims();
  299. //ManualVehicleEngineAndLights();
  300. //LimitGlobalChatRadius(300.0);
  301. ClassSel_InitTextDraws();
  302. // Player Class
  303. AddPlayerClass(298,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  304. AddPlayerClass(299,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  305. AddPlayerClass(300,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  306. AddPlayerClass(301,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  307. AddPlayerClass(302,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  308. AddPlayerClass(303,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  309. AddPlayerClass(304,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  310. AddPlayerClass(305,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  311. AddPlayerClass(280,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  312. AddPlayerClass(281,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  313. AddPlayerClass(282,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  314. AddPlayerClass(283,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  315. AddPlayerClass(284,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  316. AddPlayerClass(285,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  317. AddPlayerClass(286,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  318. AddPlayerClass(287,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  319. AddPlayerClass(288,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  320. AddPlayerClass(289,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  321. AddPlayerClass(265,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  322. AddPlayerClass(266,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  323. AddPlayerClass(267,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  324. AddPlayerClass(268,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  325. AddPlayerClass(269,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  326. AddPlayerClass(270,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  327. AddPlayerClass(1,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  328. AddPlayerClass(2,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  329. AddPlayerClass(3,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  330. AddPlayerClass(4,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  331. AddPlayerClass(5,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  332. AddPlayerClass(6,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  333. AddPlayerClass(8,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  334. AddPlayerClass(42,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  335. AddPlayerClass(65,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  336. //AddPlayerClass(74,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  337. AddPlayerClass(86,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  338. AddPlayerClass(119,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  339. AddPlayerClass(149,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  340. AddPlayerClass(208,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  341. AddPlayerClass(273,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  342. AddPlayerClass(289,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  343. AddPlayerClass(47,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  344. AddPlayerClass(48,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  345. AddPlayerClass(49,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  346. AddPlayerClass(50,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  347. AddPlayerClass(51,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  348. AddPlayerClass(52,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  349. AddPlayerClass(53,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  350. AddPlayerClass(54,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  351. AddPlayerClass(55,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  352. AddPlayerClass(56,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  353. AddPlayerClass(57,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  354. AddPlayerClass(58,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  355. AddPlayerClass(68,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  356. AddPlayerClass(69,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  357. AddPlayerClass(70,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  358. AddPlayerClass(71,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  359. AddPlayerClass(72,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  360. AddPlayerClass(73,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  361. AddPlayerClass(75,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  362. AddPlayerClass(76,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  363. AddPlayerClass(78,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  364. AddPlayerClass(79,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  365. AddPlayerClass(80,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  366. AddPlayerClass(81,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  367. AddPlayerClass(82,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  368. AddPlayerClass(83,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  369. AddPlayerClass(84,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  370. AddPlayerClass(85,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  371. AddPlayerClass(87,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  372. AddPlayerClass(88,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  373. AddPlayerClass(89,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  374. AddPlayerClass(91,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  375. AddPlayerClass(92,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  376. AddPlayerClass(93,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  377. AddPlayerClass(95,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  378. AddPlayerClass(96,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  379. AddPlayerClass(97,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  380. AddPlayerClass(98,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  381. AddPlayerClass(99,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  382. // SPECIAL
  383. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
  384. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt");
  385. // LAS VENTURAS
  386. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
  387. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
  388. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
  389. // SAN FIERRO
  390. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt");
  391. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
  392. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
  393. // LOS SANTOS
  394. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
  395. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
  396. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
  397. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
  398. // OTHER AREAS
  399. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
  400. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt");
  401. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
  402. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt");
  403. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");
  404. printf("Total vehicles from files: %d",total_vehicles_from_files);
  405. return 1;
  406. }
  407. //----------------------------------------------------------
  408. public OnPlayerUpdate(playerid)
  409. {
  410. if(!IsPlayerConnected(playerid)) return 0;
  411. if(IsPlayerNPC(playerid)) return 1;
  412. // changing cities by inputs
  413. if( !gPlayerHasCitySelected[playerid] &&
  414. GetPlayerState(playerid) == PLAYER_STATE_SPECTATING ) {
  415. ClassSel_HandleCitySelection(playerid);
  416. return 1;
  417. }
  418. // No weapons in interiors
  419. //if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
  420. //SetPlayerArmedWeapon(playerid,0); // fists
  421. //return 0; // no syncing until they change their weapon
  422. //}
  423. // Don't allow minigun
  424. if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN) {
  425. Kick(playerid);
  426. return 0;
  427. }
  428. /* No jetpacks allowed
  429. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) {
  430. Kick(playerid);
  431. return 0;
  432. }*/
  433. /* For testing animations
  434. new msg[128+1];
  435. new animlib[32+1];
  436. new animname[32+1];
  437. thisanimid = GetPlayerAnimationIndex(playerid);
  438. if(lastanimid != thisanimid)
  439. {
  440. GetAnimationName(thisanimid,animlib,32,animname,32);
  441. format(msg, 128, "anim(%d,%d): %s %s", lastanimid, thisanimid, animlib, animname);
  442. lastanimid = thisanimid;
  443. SendClientMessage(playerid, 0xFFFFFFFF, msg);
  444. }*/
  445. return 1;
  446. }
  447. //----------------------------------------------------------