Guest User

Untitled

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