Advertisement
Guest User

Jacob

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