Guest User

Freeroam

a guest
Nov 3rd, 2010
934
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.30 KB | None | 0 0
  1. //----------------------------------------------------------
  2. //
  3. // Exclusive Freeroam
  4. // Freeroam Gamemode made by SampStunta
  5. //
  6. //----------------------------------------------------------
  7.  
  8. #include <a_samp>
  9. #include <gl_common>
  10. #include <gl_spawns>
  11.  
  12. #pragma tabsize 0
  13. #pragma unused gArmySpawns
  14. #pragma unused gMedicalSpawns
  15. #pragma unused gPoliceSpawns
  16.  
  17. //----------------------------------------------------------
  18.  
  19. #define COLOR_WHITE 0xFFFFFFFF
  20. #define COLOR_NORMAL_PLAYER 0xFF4444FF
  21. #define COLOR_PURPLE 0x9900FFAA
  22. #define COLOR_YELLOW 0xFFFF00AA
  23.  
  24. #define CITY_LOS_SANTOS 0
  25. #define CITY_SAN_FIERRO 1
  26. #define CITY_LAS_VENTURAS 2
  27.  
  28. #define Dialog_Cmds 5
  29.  
  30. new total_vehicles_from_files=0;
  31.  
  32. new gPlayerCitySelection[MAX_PLAYERS];
  33. new gPlayerHasCitySelected[MAX_PLAYERS];
  34. new gPlayerLastCitySelectionTick[MAX_PLAYERS];
  35.  
  36. new Text:txtClassSelHelper;
  37. new Text:txtLosSantos;
  38. new Text:txtSanFierro;
  39. new Text:txtLasVenturas;
  40.  
  41. forward NoSpawnKill(playerid);
  42. //----------------------------------------------------------
  43.  
  44. main()
  45. {
  46. print("\n---------------------------------------");
  47. print("Exclusive Freeroam - By SampStunta\n");
  48. print("---------------------------------------\n");
  49. }
  50.  
  51. //----------------------------------------------------------
  52.  
  53. public OnPlayerConnect(playerid)
  54. {
  55. SendClientMessage(playerid,COLOR_WHITE,"Welcome to the Exclusive Freeroam Server");
  56. new string[64], pName[MAX_PLAYER_NAME];
  57. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  58. format(string,sizeof string,"%s has joined the Exclusive Freeroam Server!",pName);
  59. SendClientMessageToAll(0xFFFFFFAA,string);
  60.  
  61. gPlayerCitySelection[playerid] = -1;
  62. gPlayerHasCitySelected[playerid] = 0;
  63. gPlayerLastCitySelectionTick[playerid] = GetTickCount();
  64.  
  65. SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);
  66.  
  67. return 1;
  68. }
  69.  
  70. public OnPlayerDisconnect(playerid)
  71. {
  72. new string[64], pName[MAX_PLAYER_NAME];
  73. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  74. format(string,sizeof string,"%s has left the Exclusive Freeroam Server...",pName);
  75. return 1;
  76. }
  77.  
  78. //----------------------------------------------------------
  79.  
  80. public OnPlayerSpawn(playerid)
  81. {
  82. if(IsPlayerNPC(playerid)) return 1;
  83.  
  84. new randSpawn = 0;
  85.  
  86. SetPlayerHealth(playerid,99999);
  87. SetTimerEx("NoSpawnKill",10000,0,"i",playerid);
  88.  
  89. SetPlayerInterior(playerid,0);
  90. TogglePlayerClock(playerid,0);
  91. ResetPlayerMoney(playerid);
  92. GivePlayerMoney(playerid, 30000);
  93.  
  94. new string[64], pName[MAX_PLAYER_NAME];
  95. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  96. format(string,sizeof string,"%s has spawned!",pName);
  97. SendClientMessageToAll(0xFFFFFFAA,string);
  98.  
  99. // if they ever return to class selection make them city
  100. // select again first
  101. gPlayerHasCitySelected[playerid] = 0;
  102.  
  103. if(CITY_LOS_SANTOS == gPlayerCitySelection[playerid]) {
  104. randSpawn = random(sizeof(gRandomSpawns_LosSantos));
  105. SetPlayerPos(playerid,
  106. gRandomSpawns_LosSantos[randSpawn][0],
  107. gRandomSpawns_LosSantos[randSpawn][1],
  108. gRandomSpawns_LosSantos[randSpawn][2]);
  109. SetPlayerFacingAngle(playerid,gRandomSpawns_LosSantos[randSpawn][3]);
  110. }
  111. else if(CITY_SAN_FIERRO == gPlayerCitySelection[playerid]) {
  112. randSpawn = random(sizeof(gRandomSpawns_SanFierro));
  113. SetPlayerPos(playerid,
  114. gRandomSpawns_SanFierro[randSpawn][0],
  115. gRandomSpawns_SanFierro[randSpawn][1],
  116. gRandomSpawns_SanFierro[randSpawn][2]);
  117. SetPlayerFacingAngle(playerid,gRandomSpawns_SanFierro[randSpawn][3]);
  118. }
  119. else if(CITY_LAS_VENTURAS == gPlayerCitySelection[playerid]) {
  120. randSpawn = random(sizeof(gRandomSpawns_LasVenturas));
  121. SetPlayerPos(playerid,
  122. gRandomSpawns_LasVenturas[randSpawn][0],
  123. gRandomSpawns_LasVenturas[randSpawn][1],
  124. gRandomSpawns_LasVenturas[randSpawn][2]);
  125. SetPlayerFacingAngle(playerid,gRandomSpawns_LasVenturas[randSpawn][3]);
  126. }
  127.  
  128. GivePlayerWeapon(playerid,WEAPON_COLT45,100);
  129. GivePlayerWeapon(playerid,WEAPON_MP5,100);
  130. TogglePlayerClock(playerid, 1);
  131.  
  132. return 1;
  133. }
  134.  
  135. //----------------------------------------------------------
  136.  
  137. public OnPlayerDeath(playerid, killerid, reason)
  138. {
  139. new playercash;
  140.  
  141. if(killerid == INVALID_PLAYER_ID) {
  142. ResetPlayerMoney(playerid);
  143. } else {
  144. playercash = GetPlayerMoney(playerid);
  145. if(playercash > 0) {
  146. GivePlayerMoney(killerid, playercash);
  147. ResetPlayerMoney(playerid);
  148. new string[64], pName[MAX_PLAYER_NAME];
  149. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  150. format(string,sizeof string,"%s has died!",pName);
  151. SendClientMessageToAll(0xFFFFFFAA,string);
  152. }
  153. }
  154. return 1;
  155. }
  156.  
  157. //----------------------------------------------------------
  158.  
  159. ClassSel_SetupCharSelection(playerid)
  160. {
  161. if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) {
  162. SetPlayerInterior(playerid,11);
  163. SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
  164. SetPlayerFacingAngle(playerid,0.0);
  165. SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
  166. SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
  167. }
  168. else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) {
  169. SetPlayerInterior(playerid,3);
  170. SetPlayerPos(playerid,-2673.8381,1399.7424,918.3516);
  171. SetPlayerFacingAngle(playerid,181.0);
  172. SetPlayerCameraPos(playerid,-2673.2776,1394.3859,918.3516);
  173. SetPlayerCameraLookAt(playerid,-2673.8381,1399.7424,918.3516);
  174. }
  175. else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) {
  176. SetPlayerInterior(playerid,3);
  177. SetPlayerPos(playerid,349.0453,193.2271,1014.1797);
  178. SetPlayerFacingAngle(playerid,286.25);
  179. SetPlayerCameraPos(playerid,352.9164,194.5702,1014.1875);
  180. SetPlayerCameraLookAt(playerid,349.0453,193.2271,1014.1797);
  181. }
  182.  
  183. }
  184.  
  185. //----------------------------------------------------------
  186. //
  187.  
  188. ClassSel_InitCityNameText(Text:txtInit)
  189. {
  190. TextDrawUseBox(txtInit, 0);
  191. TextDrawLetterSize(txtInit,1.25,3.0);
  192. TextDrawFont(txtInit, 0);
  193. TextDrawSetShadow(txtInit,0);
  194. TextDrawSetOutline(txtInit,1);
  195. TextDrawColor(txtInit,0xEEEEEEFF);
  196. TextDrawBackgroundColor(txtClassSelHelper,0x000000FF);
  197. }
  198.  
  199. //----------------------------------------------------------
  200.  
  201. ClassSel_InitTextDraws()
  202. {
  203. txtLosSantos = TextDrawCreate(10.0, 380.0, "L.S");
  204. ClassSel_InitCityNameText(txtLosSantos);
  205. txtSanFierro = TextDrawCreate(10.0, 380.0, "S.F");
  206. ClassSel_InitCityNameText(txtSanFierro);
  207. txtLasVenturas = TextDrawCreate(10.0, 380.0, "L.V");
  208. ClassSel_InitCityNameText(txtLasVenturas);
  209.  
  210. txtClassSelHelper = TextDrawCreate(10.0, 415.0," Press ~b~~k~~GO_LEFT~ ~w~or ~b~~k~~GO_RIGHT~ ~w~to switch cities.~n~ Press ~r~~k~~PED_FIREWEAPON~ ~w~to select.");
  211. TextDrawUseBox(txtClassSelHelper, 1);
  212. TextDrawBoxColor(txtClassSelHelper,0x222222BB);
  213. TextDrawLetterSize(txtClassSelHelper,0.3,1.0);
  214. TextDrawTextSize(txtClassSelHelper,400.0,40.0);
  215. TextDrawFont(txtClassSelHelper, 2);
  216. TextDrawSetShadow(txtClassSelHelper,0);
  217. TextDrawSetOutline(txtClassSelHelper,1);
  218. TextDrawBackgroundColor(txtClassSelHelper,0x000000FF);
  219. TextDrawColor(txtClassSelHelper,0xFFFFFFFF);
  220. }
  221.  
  222. //----------------------------------------------------------
  223.  
  224. ClassSel_SetupSelectedCity(playerid)
  225. {
  226. if(gPlayerCitySelection[playerid] == -1) {
  227. gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
  228. }
  229.  
  230. if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) {
  231. SetPlayerInterior(playerid,0);
  232. SetPlayerCameraPos(playerid,1630.6136,-2286.0298,110.0);
  233. SetPlayerCameraLookAt(playerid,1887.6034,-1682.1442,47.6167);
  234.  
  235. TextDrawShowForPlayer(playerid,txtLosSantos);
  236. TextDrawHideForPlayer(playerid,txtSanFierro);
  237. TextDrawHideForPlayer(playerid,txtLasVenturas);
  238. }
  239. else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) {
  240. SetPlayerInterior(playerid,0);
  241. SetPlayerCameraPos(playerid,-1300.8754,68.0546,129.4823);
  242. SetPlayerCameraLookAt(playerid,-1817.9412,769.3878,132.6589);
  243.  
  244. TextDrawHideForPlayer(playerid,txtLosSantos);
  245. TextDrawShowForPlayer(playerid,txtSanFierro);
  246. TextDrawHideForPlayer(playerid,txtLasVenturas);
  247. }
  248. else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) {
  249. SetPlayerInterior(playerid,0);
  250. SetPlayerCameraPos(playerid,1310.6155,1675.9182,110.7390);
  251. SetPlayerCameraLookAt(playerid,2285.2944,1919.3756,68.2275);
  252.  
  253. TextDrawHideForPlayer(playerid,txtLosSantos);
  254. TextDrawHideForPlayer(playerid,txtSanFierro);
  255. TextDrawShowForPlayer(playerid,txtLasVenturas);
  256. }
  257. }
  258.  
  259. //----------------------------------------------------------
  260.  
  261. ClassSel_SwitchToNextCity(playerid)
  262. {
  263. gPlayerCitySelection[playerid]++;
  264. if(gPlayerCitySelection[playerid] > CITY_LAS_VENTURAS) {
  265. gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
  266. }
  267. PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
  268. gPlayerLastCitySelectionTick[playerid] = GetTickCount();
  269. ClassSel_SetupSelectedCity(playerid);
  270. }
  271.  
  272. //----------------------------------------------------------
  273.  
  274. ClassSel_SwitchToPreviousCity(playerid)
  275. {
  276. gPlayerCitySelection[playerid]--;
  277. if(gPlayerCitySelection[playerid] < CITY_LOS_SANTOS) {
  278. gPlayerCitySelection[playerid] = CITY_LAS_VENTURAS;
  279. }
  280. PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
  281. gPlayerLastCitySelectionTick[playerid] = GetTickCount();
  282. ClassSel_SetupSelectedCity(playerid);
  283. }
  284.  
  285. //----------------------------------------------------------
  286.  
  287. ClassSel_HandleCitySelection(playerid)
  288. {
  289. new Keys,ud,lr;
  290. GetPlayerKeys(playerid,Keys,ud,lr);
  291.  
  292. if(gPlayerCitySelection[playerid] == -1) {
  293. ClassSel_SwitchToNextCity(playerid);
  294. return;
  295. }
  296.  
  297. // only allow new selection every ~500 ms
  298. if( (GetTickCount() - gPlayerLastCitySelectionTick[playerid]) < 500 ) return;
  299.  
  300. if(Keys & KEY_FIRE) {
  301. gPlayerHasCitySelected[playerid] = 1;
  302. TextDrawHideForPlayer(playerid,txtClassSelHelper);
  303. TextDrawHideForPlayer(playerid,txtLosSantos);
  304. TextDrawHideForPlayer(playerid,txtSanFierro);
  305. TextDrawHideForPlayer(playerid,txtLasVenturas);
  306. TogglePlayerSpectating(playerid,0);
  307. return;
  308. }
  309.  
  310. if(lr > 0) {
  311. ClassSel_SwitchToNextCity(playerid);
  312. }
  313. else if(lr < 0) {
  314. ClassSel_SwitchToPreviousCity(playerid);
  315. }
  316. }
  317.  
  318. //----------------------------------------------------------
  319.  
  320. public OnPlayerRequestClass(playerid, classid)
  321. {
  322. if(IsPlayerNPC(playerid)) return 1;
  323.  
  324. if(gPlayerHasCitySelected[playerid]) {
  325. ClassSel_SetupCharSelection(playerid);
  326. return 1;
  327. } else {
  328. if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING) {
  329. TogglePlayerSpectating(playerid,1);
  330. TextDrawShowForPlayer(playerid, txtClassSelHelper);
  331. gPlayerCitySelection[playerid] = -1;
  332. }
  333. }
  334.  
  335. return 0;
  336. }
  337.  
  338. //----------------------------------------------------------
  339.  
  340. public OnGameModeInit()
  341. {
  342. SetGameModeText("Exclusive Freeroam");
  343. ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
  344. ShowNameTags(1);
  345. SetNameTagDrawDistance(40.0);
  346. EnableStuntBonusForAll(0);
  347. DisableInteriorEnterExits();
  348. SetWeather(2);
  349.  
  350. LimitGlobalChatRadius(300.0);
  351.  
  352. ClassSel_InitTextDraws();
  353.  
  354. AddPlayerClass(1,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  355. AddPlayerClass(2,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  356. AddPlayerClass(269,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  357. AddPlayerClass(270,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  358. AddPlayerClass(271,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  359. AddPlayerClass(272,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  360. AddPlayerClass(47,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  361. AddPlayerClass(48,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  362. AddPlayerClass(49,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  363. AddPlayerClass(50,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  364. AddPlayerClass(51,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  365. AddPlayerClass(52,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  366. AddPlayerClass(53,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  367. AddPlayerClass(54,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  368. AddPlayerClass(55,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  369. AddPlayerClass(56,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  370. AddPlayerClass(57,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  371. AddPlayerClass(58,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  372. AddPlayerClass(68,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  373. AddPlayerClass(69,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  374. AddPlayerClass(70,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  375. AddPlayerClass(71,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  376. AddPlayerClass(72,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  377. AddPlayerClass(73,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  378. AddPlayerClass(75,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  379. AddPlayerClass(76,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  380. AddPlayerClass(78,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  381. AddPlayerClass(79,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  382. AddPlayerClass(80,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  383. AddPlayerClass(81,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  384. AddPlayerClass(82,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  385. AddPlayerClass(83,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  386. AddPlayerClass(84,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  387. AddPlayerClass(85,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  388. AddPlayerClass(87,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  389. AddPlayerClass(88,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  390. AddPlayerClass(89,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  391. AddPlayerClass(91,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  392. AddPlayerClass(92,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  393. AddPlayerClass(93,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  394. AddPlayerClass(95,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  395. AddPlayerClass(96,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  396. AddPlayerClass(97,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  397. AddPlayerClass(98,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  398. AddPlayerClass(99,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
  399.  
  400. // SPECIAL
  401. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
  402. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt");
  403.  
  404. // LAS VENTURAS
  405. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
  406. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
  407. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
  408.  
  409. // SAN FIERRO
  410. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt");
  411. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
  412. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
  413.  
  414. // LOS SANTOS
  415. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
  416. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
  417. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
  418. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
  419.  
  420. // OTHER AREAS
  421. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
  422. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt");
  423. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
  424. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt");
  425. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");
  426.  
  427. printf("Total vehicles from files: %d",total_vehicles_from_files);
  428.  
  429. return 1;
  430. }
  431.  
  432. //----------------------------------------------------------
  433.  
  434. public OnPlayerUpdate(playerid)
  435. {
  436. if(!IsPlayerConnected(playerid)) return 0;
  437.  
  438. if( !gPlayerHasCitySelected[playerid] &&
  439. GetPlayerState(playerid) == PLAYER_STATE_SPECTATING ) {
  440. ClassSel_HandleCitySelection(playerid);
  441. return 1;
  442. }
  443.  
  444. if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
  445. SetPlayerArmedWeapon(playerid,0);
  446. return 0;
  447. }
  448. // If someone uses a Minigun, they get banned.
  449. if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN) {
  450. Ban(playerid);
  451. return 0;
  452. }
  453.  
  454. return 1;
  455. }
  456. public OnPlayerCommandText(playerid, cmdtext[])
  457. {
  458. new cmd[256];
  459. new idx;
  460. cmd = strtok(cmdtext, idx);
  461. if(strcmp(cmdtext, "/credits", true) == 0) // Do NOT remove these!
  462. {
  463. SendClientMessage(playerid, COLOR_YELLOW, "------------------------------");
  464. SendClientMessage(playerid, COLOR_WHITE, "SampStunta - Scripter/Creator");
  465. SendClientMessage(playerid, COLOR_YELLOW, "------------------------------");
  466. return 1;
  467. }
  468. if(strcmp(cmdtext, "/help", true) == 0)
  469. {
  470. SendClientMessage(playerid, COLOR_YELLOW, "---------------------------------------------");
  471. SendClientMessage(playerid, COLOR_WHITE, "Objective: Just to freeroam around San Andreas");
  472. SendClientMessage(playerid, COLOR_WHITE, "/commands for a list of commands");
  473. SendClientMessage(playerid, COLOR_WHITE, "Creator: SampStunta");
  474. SendClientMessage(playerid, COLOR_WHITE, "Contacts:");
  475. SendClientMessage(playerid, COLOR_WHITE, "Email: [email protected]");
  476. SendClientMessage(playerid, COLOR_WHITE, "PM: SampStunta ( SA:MP Forums )");
  477. SendClientMessage(playerid, COLOR_YELLOW, "---------------------------------------------");
  478. return 1;
  479. }
  480. if(strcmp(cmdtext, "/commands", true) == 0)
  481. {
  482. if(strcmp(cmdtext,"/commands",true)==0)
  483. {
  484. ShowPlayerDialog(playerid,Dialog_Cmds, 0,"Commands", "/help\n/credits", "Okay","Close");
  485. return 1;
  486. }
  487. return 1;
  488. }
  489. if(strcmp(cmdtext, "/teleports", true) == 0)
  490. {
  491. SendClientMessage(playerid, COLOR_YELLOW, "---------------------------------------------");
  492. SendClientMessage(playerid, COLOR_WHITE, "/lsair");
  493. SendClientMessage(playerid, COLOR_YELLOW, "---------------------------------------------");
  494. return 1;
  495. }
  496. if(strcmp(cmdtext, "/lsair", true) == 0)
  497. {
  498. SetPlayerPos(playerid, -1358.7815,-213.3295,14.1484);
  499. SendClientMessage(playerid, COLOR_WHITE, "Welcome to Los Santos Airport!");
  500. return 1;
  501. }
  502.  
  503. if(strcmp(cmd, "/rules", true, 9) == 0)
  504.  
  505. {
  506. SendClientMessage(playerid, COLOR_YELLOW, "1.Dont Hack/Cheat,Results In A Perma Ban!");
  507. SendClientMessage(playerid, COLOR_YELLOW, "2.Dont Camp!Or Heli Camp!");
  508. SendClientMessage(playerid, COLOR_YELLOW, "3.Dont Spam /report Flood Or Advertise!");
  509. SendClientMessage(playerid, COLOR_YELLOW, "4.Dont Flame! Respect All Players And Admins!");
  510. SendClientMessage(playerid, COLOR_YELLOW, "5.Dont Ask To Be Admin! We Will Ask You!");
  511. SendClientMessage(playerid, COLOR_YELLOW, "6.Dont Not Heli(Blade)Kill!");
  512. return 1;
  513.  
  514. }
  515.  
  516. if(strcmp(cmd, "/noob", true) == 0)
  517.  
  518. {
  519. new string[128];
  520. new name[MAX_PLAYER_NAME];
  521. GetPlayerName(playerid, name, sizeof(name));
  522. SetPlayerName(playerid, "[NOOB]%s");
  523. format(string, sizeof(string), "%s is now a noob",name);
  524. SendClientMessageToAll(COLOR_WHITE, string);
  525. return 1;
  526. }
  527. if (strcmp("/changeskin", cmdtext, true, 5) == 0)
  528. {
  529. SetPlayerHealth(playerid, 0.0);
  530. ForceClassSelection(playerid);
  531. return 1;
  532. }
  533. if (strcmp("/havesex", cmdtext, true, 5) == 0)
  534. {
  535. new string[64], pName[MAX_PLAYER_NAME];
  536. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  537. format(string,sizeof string,"%s is now having sex!",pName);
  538. SendClientMessageToAll(0xFFFFFFAA,string);
  539. SendClientMessage(playerid, COLOR_PURPLE, "Have FUN!");
  540. return 1;
  541. }
  542. if (strcmp("/spam", cmdtext, true, 5) == 0)
  543. {
  544. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  545. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  546. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  547. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  548. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  549. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  550. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  551. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  552. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  553. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  554. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  555. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  556. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  557. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  558. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  559. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  560. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  561. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  562. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  563. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  564. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  565. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  566. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  567. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  568. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  569. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  570. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  571. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  572. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  573. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  574. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  575. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  576. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  577. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  578. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  579. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  580. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  581. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  582. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  583. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  584. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  585. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  586. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  587. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  588. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  589. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  590. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  591. SendClientMessage(playerid, COLOR_PURPLE, "SPAM");
  592. return 1;
  593. }
  594. return 0;
  595. }
  596. public NoSpawnKill(playerid)
  597. {
  598. SetPlayerHealth(playerid,100.0);
  599. return 1;
  600. }
Advertisement
Add Comment
Please, Sign In to add comment