Guest User

Untitled

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