Advertisement
Guest User

Untitled

a guest
Dec 18th, 2008
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.31 KB | None | 0 0
  1. /* == [Conditions] == *\
  2. # This Filterscript was scripted by Mike for release on the San Andreas Multiplayer forums.
  3. # Do not remove any credits or sell this script.
  4. # Selling this script on the SA:MP market will get your ass banned.
  5.  
  6. CREDITS:
  7.  
  8. Main Scripter ~ Mike
  9. Vnames array ~ WeeDarr
  10. */
  11.  
  12. #error Please agree to the conditions.
  13. //Remove/Comment the above line if you agree to the conditions.
  14.  
  15. #include <a_samp>
  16.  
  17. /* ===[DEFINES]=== */
  18. #define car_names //Remove this is you dont want the car names.
  19. #define wait_time 4 //How many minutes must a player wait to sell another car?
  20. #define reset_time 5 //How any seconds until the players camera resets?
  21. #define last_car_bonus 100 //Whoever sells the last car will get 100 points, you may change this
  22. #define sell_car_bonus 10 //How many points will a player get EVERYTIME he sells a car?
  23. #define show_export_cmd "/showexport" //What command will be used to view the export board?
  24. #define hide_export_cmd "/hideexport" //What command will be used to hide the export board?
  25. #define clear_export_cmd "/clearexport" //What command will be used to clear the export (admins)?
  26. #define car_names_cmd "/carnames" //What command can be used to hide or show car names when a player enters a vehicle?
  27. #define help_pickup true //Do you want the pickup to be shown next to the board for help?
  28. #define use_icon true //Should the MapIcon be shown?
  29. #define sell_car_sound 1137 //Choose the sound ID for when you enter the checkpoint with a vehicle and its sold
  30. #define slamvan_price 50000 //Price of the Slamvan
  31. #define blista_price 30000 //Price of the Blista Compact
  32. #define stafford_price 15000 //Price of the Stafford
  33. #define sabre_price 5000 //Price of the Sabre
  34. #define FCR_price 30000 //Price of the FCR-600
  35. #define cheetah_price 30000 //Price of the Cheetah
  36. #define rancher_price 15000 //Price of the Rancher
  37. #define stallion_price 10000 //Price of the Stallion
  38. #define tanker_price 70000 //Price of the Tanker
  39. #define comet_price 50000 //Price of the Comet
  40. #define sold_for_gametext 4 //Select the Gametext style, used on the gametext that says for example: "FCR-600 sold for $50000"
  41. #define already_sold_gametext 5 //The gametext used if a vehicle is already sold
  42.  
  43. /* ===[COLORS]=== */
  44. #define COLOR_GREEN 0x33AA33AA //GREEN
  45. #define COLOR_WHITE 0xFFFFFFAA //WHITE
  46. #define COLOR_RED 0xFF0000AA //RED
  47. #define COLOR_YELLOW 0xFFFF00AA //YELLOW
  48. #define COLOR_ORANGE 0xFF9900AA //ORANGE
  49.  
  50. /* ===[FORWARDS]=== */
  51. forward excam(playerid); //The timer for the camera resetting after selling a car
  52. forward exdel(playerid); //The delay between selling cars
  53.  
  54. /* ===[VARIABLES]=== */
  55. new sold1; //Slamvan
  56. new sold2; //Blista Compact
  57. new sold3; //Stafford
  58. new sold4; //Sabre
  59. new sold5; //FCR-600
  60. new sold6; //Cheetah
  61. new sold7; //Rancher
  62. new sold8; //Stallion
  63. new sold9; //Tanker
  64. new sold10; //Comet
  65.  
  66. new cross1;
  67. new cross2;
  68. new cross3;
  69. new cross4;
  70. new cross5;
  71. new cross6;
  72. new cross7;
  73. new cross8;
  74. new cross9;
  75. new cross10;
  76.  
  77. new board; //Used for DestroyObject OnFilterScriptExit.
  78. new writing; //Used for DestroyObject OnFilterScriptExit.
  79.  
  80. #if help_pickup == true //If "help_pickup" is defined as "true"
  81. new exhelp; //Pickup
  82. #endif
  83. new sellon[MAX_PLAYERS]; //Allowed to sell a car?
  84. new checkon[MAX_PLAYERS]; //Checkpoint visable?
  85.  
  86. new carnames[MAX_PLAYERS]; //Carnames snabled?
  87.  
  88. new Float:oldpos[200][4]; //Saves the position when someone types the command to show
  89. // the export board and sets it then someone types the command for hiding the export board.
  90.  
  91. /* ===[ARRAYS]=== */
  92. new vNames[][] = //Thankyou WeeDarr for giving me this array
  93. {
  94. "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster",
  95. "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
  96. "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer",
  97. "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach",
  98. "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow",
  99. "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair",
  100. "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic",
  101. "Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton",
  102. "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher",
  103. "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick",
  104. "Boxvillde", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher",
  105. "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt", "Tanker", "Roadtrain",
  106. "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck",
  107. "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan",
  108. "Blade", "Freight", "Streak", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder",
  109. "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster", "Monster",
  110. "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
  111. "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30",
  112. "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
  113. "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car", "Police Car", "Police Car",
  114. "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs",
  115. "Boxville", "Tiller", "Utility Trailer"
  116. };
  117.  
  118. public OnFilterScriptInit()
  119. {
  120. print("\n--------------------------------------");
  121. print("Mikes Car Export Script"); //Print stuff in the console, remove if you wish
  122. print("--------------------------------------\n");
  123.  
  124. board = CreateObject(3077, -1534.66, 154.03, 2.50, 0.00, 0.00, 360.00); //Board object
  125. writing = CreateObject(3087, -1534.51, 154.05, 2.52, 0.00, 0.00, 180.00); //Writing object
  126. #if help_pickup == true //If "help_pickup" is defined as "true"
  127. exhelp = CreatePickup(1239,23,-1538.0724,154.1241,3.5547); //The pickup
  128. #endif
  129. for(new i=0; i < MAX_PLAYERS; i++)
  130. {
  131. #if use_icon == true
  132. SetPlayerMapIcon(i, 20, -1545.0740,128.1534,3.5547, 55, 0 ); //Set the map icon for the player
  133. #endif
  134. if(sellon[i] == 0) //If they cant sell cars
  135. {
  136. sellon[i] = 1; //Enable all players to sell cars
  137. }
  138. if(checkon[i] == 0) //If the checkpoint isnt visable by the player
  139. {
  140. if(IsPlayerConnected(i))
  141. {
  142. SetPlayerCheckpoint(i, -1545.0740,128.1534,3.5547, 9.0); //Set the checkpoint for all players IF they ARE connected.
  143. checkon[i] = 1; //Set the variable called "checkon" to 1
  144. }
  145. }
  146. }
  147. return 1;
  148. }
  149.  
  150. public OnFilterScriptExit()
  151. {
  152. for(new i=0; i < MAX_PLAYERS; i++)
  153. {
  154. #if use_icon == true
  155. RemovePlayerMapIcon(i,20);
  156. #endif
  157. if(IsPlayerConnected(i) && checkon[i] == 1) //If they are online and the checkpoint is active
  158. {
  159. DisablePlayerCheckpoint(i); //Remove the checkpoint
  160. }
  161. }
  162. #if help_pickup == true //If "help_pickup" is defined as "true"
  163. DestroyPickup(exhelp); //Destroy the pickup
  164. #endif
  165. if(sold1 == 1) //If its sold
  166. {
  167. DestroyObject(cross1); //Destroy the cross
  168. sold1 = 0; //And set the variable to "not sold"
  169. }
  170. if(sold2 == 1) //If its sold
  171. {
  172. DestroyObject(cross2); //Destroy the cross
  173. sold2 = 0; //And set the variable to "not sold"
  174. }
  175. if(sold3 == 1) //If its sold
  176. {
  177. DestroyObject(cross3); //Destroy the cross
  178. sold3 = 0; //And set the variable to "not sold"
  179. }
  180. if(sold4 == 1) //If its sold
  181. {
  182. DestroyObject(cross4); //Destroy the cross
  183. sold4 = 0; //And set the variable to "not sold"
  184. }
  185. if(sold5 == 1) //If its sold
  186. {
  187. DestroyObject(cross5); //Destroy the cross
  188. sold5 = 0; //And set the variable to "not sold"
  189. }
  190. if(sold6 == 1) //If its sold
  191. {
  192. DestroyObject(cross6); //Destroy the cross
  193. sold6 = 0; //And set the variable to "not sold"
  194. }
  195. if(sold7 == 1) //If its sold
  196. {
  197. DestroyObject(cross7); //Destroy the cross
  198. sold7 = 0; //And set the variable to "not sold"
  199. }
  200. if(sold8 == 1) //If its sold
  201. {
  202. DestroyObject(cross8); //Destroy the cross
  203. sold8 = 0; //And set the variable to "not sold"
  204. }
  205. if(sold9 == 1) //If its sold
  206. {
  207. DestroyObject(cross9); //Destroy the cross
  208. sold9 = 0; //And set the variable to "not sold"
  209. }
  210. if(sold10 == 1) //If its sold
  211. {
  212. DestroyObject(cross10); //Destroy the cross
  213. sold10 = 0; //And set the variable to "not sold"
  214. }
  215. DestroyObject(writing); //Destroy the writing on the board
  216. DestroyObject(board); //Destroy the board
  217. print("\n--------------------------------------");
  218. print("Mikes Car Export Script - Unloaded"); //Print stuff in the console, remove if you wish
  219. print("--------------------------------------\n");
  220. return 1;
  221. }
  222.  
  223. public OnPlayerConnect(playerid)
  224. {
  225. carnames[playerid] = 1; //Enable the carnames when you enter/exit a vehicle
  226. sellon[playerid] = 1; //Enable the player to sell cars
  227. SetPlayerCheckpoint(playerid, -1545.0740,128.1534,3.5547, 9.0); //Set the checkpoint
  228. checkon[playerid] = 1; //The checkpoint Is visible to the player.
  229. #if use_icon == true //If "use_icon" is defined as "true"
  230. SetPlayerMapIcon(playerid, 20, -1545.0740,128.1534,3.5547, 55, 0 ); //Set the map icon for the player
  231. #endif
  232. return 1;
  233. }
  234. public OnPlayerDisconnect(playerid,reason)
  235. {
  236. sellon[playerid] = 1; //Enable the player to sell cars
  237. if(checkon[playerid] == 1) //If they are online and the checkpoint is active
  238. {
  239. DisablePlayerCheckpoint(playerid); //Remove the checkpoint
  240. } //Remove the checkpoint
  241. checkon[playerid] = 0; //Set the checkpoint variable to 0
  242. return 1;
  243. }
  244.  
  245. public OnPlayerCommandText(playerid, cmdtext[])
  246. {
  247. new str1[128]; //Create "str1"
  248. new str2[128]; //Create "str2"
  249. new str3[128]; //Create "str3"
  250. new str4[128]; //Create "str4"
  251. format(str1, sizeof(str1), "%s",show_export_cmd); //Format "str1"
  252. format(str2, sizeof(str2), "%s",hide_export_cmd); //Format "str2"
  253. format(str3, sizeof(str3), "%s",clear_export_cmd);//Format "str3"
  254. format(str4, sizeof(str4), "%s",car_names_cmd); //Format "str4"
  255. if (strcmp(str1,cmdtext,true) == 0) //If he types the command to show export
  256. {
  257. GetPlayerPos(playerid,oldpos[playerid][0],oldpos[playerid][1],oldpos[playerid][2]); //Save his current position in the "oldpos" variable
  258. SetPlayerPos(playerid,-1534.6313,150.5789,1.5547); //Set his position to under the board (under the floor, cant be seen)
  259. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); //Set the camera infront of the board
  260. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); //Face the camera at the board
  261. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); //Play a sound (definable)
  262. new str5[128]; //Define "str5"
  263. format(str5, sizeof(str4), "Type %s to go to your last position!",hide_export_cmd); //Format "str5"
  264. SendClientMessage(playerid, COLOR_GREEN,str5); //send the "str5" message
  265. return 1;
  266. }
  267. if (strcmp(str2,cmdtext,true) == 0) //If he types the command to hide export
  268. {
  269. SetPlayerPos(playerid,oldpos[playerid][0],oldpos[playerid][1],oldpos[playerid][2]); //Set his position that was saved in the "oldpos" variable
  270. SetCameraBehindPlayer(playerid); //Reset the players camera
  271. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); //Play a Sound
  272. return 1;
  273. }
  274. if (strcmp(str3, cmdtext, true) == 0) //If a player types the command to clear export
  275. {
  276. if(IsPlayerAdmin(playerid)) //If the player is admin
  277. {
  278. for(new i=0; i < MAX_PLAYERS; i++)
  279. {
  280. if(sellon[i] == 0) //If they cant sell
  281. {
  282. sellon[i] = 1; //Enable all players to sell cars
  283. }
  284. }
  285. if(sold1 == 1) //If this vehicle has been sold and crossed off
  286. {
  287. DestroyObject(cross1); //Destroy the cross object
  288. sold1 = 0; //Enable this vehicle to be sold again
  289. }
  290. if(sold2 == 1) //If this vehicle has been sold and crossed off
  291. {
  292. DestroyObject(cross2); //Destroy the cross object
  293. sold2 = 0; //Enable this vehicle to be sold again
  294. }
  295. if(sold3 == 1) //If this vehicle has been sold and crossed off
  296. {
  297. DestroyObject(cross3); //Destroy the cross object
  298. sold3 = 0; //Enable this vehicle to be sold again
  299. }
  300. if(sold4 == 1) //If this vehicle has been sold and crossed off
  301. {
  302. DestroyObject(cross4); //Destroy the cross object
  303. sold4 = 0; //Enable this vehicle to be sold again
  304. }
  305. if(sold5 == 1) //If this vehicle has been sold and crossed off
  306. {
  307. DestroyObject(cross5); //Destroy the cross object
  308. sold5 = 0; //Enable this vehicle to be sold again
  309. }
  310. if(sold6 == 1) //If this vehicle has been sold and crossed off
  311. {
  312. DestroyObject(cross6); //Destroy the cross object
  313. sold6 = 0; //Enable this vehicle to be sold again
  314. }
  315. if(sold7 == 1) //If this vehicle has been sold and crossed off
  316. {
  317. DestroyObject(cross7); //Destroy the cross object
  318. sold7 = 0; //Enable this vehicle to be sold again
  319. }
  320. if(sold8 == 1) //If this vehicle has been sold and crossed off
  321. {
  322. DestroyObject(cross8); //Destroy the cross object
  323. sold8 = 0; //Enable this vehicle to be sold again
  324. }
  325. if(sold9 == 1) //If this vehicle has been sold and crossed off
  326. {
  327. DestroyObject(cross9); //Destroy the cross object
  328. sold9 = 0; //Enable this vehicle to be sold again
  329. }
  330. if(sold10 == 1) //If this vehicle has been sold and crossed off
  331. {
  332. DestroyObject(cross10); //Destroy the cross object
  333. sold10 = 0; //Enable this vehicle to be sold again
  334. }
  335. }
  336. else
  337. {
  338. return SendClientMessage(playerid,0xFF0000AA,"You are not RCON."); //If the player isnt an RCON admin, it will tell him.
  339. }
  340. SendClientMessageToAll(0xDC143CAA,"Car Export Reset."); //Otherwise tell all players that export has been reset!
  341. return 1;
  342. }
  343. if (strcmp(str4, cmdtext, true) == 0) //If a player types the command to enable or disable the carnames
  344. {
  345. if(carnames[playerid] == 0) //If the players carnames are disabled
  346. {
  347. carnames[playerid] = 1; //Enable them
  348. SendClientMessage(playerid, COLOR_GREEN,"Car Names Enabled."); //And tell him they are now enabled
  349. }
  350. else //Otherwise
  351. {
  352. carnames[playerid] = 0; //Disabled the car names
  353. SendClientMessage(playerid, COLOR_RED,"Car Names Disabled."); //And tell him they are now disabled
  354. }
  355. return 1;
  356. }
  357. if (strcmp("/exlist", cmdtext, true) == 0) //If a player types /exlist
  358. {
  359. SendClientMessage(playerid,COLOR_ORANGE,"You can sell...");
  360. if(sold1 == 0) //If its not sold
  361. {
  362. new stringy1[128];
  363. format(stringy1, sizeof(stringy1), "A Slamvan for $%d",slamvan_price); //Format "stringy1"
  364. SendClientMessage(playerid,COLOR_WHITE,stringy1);
  365. }
  366. if(sold2 == 0) //If its not sold
  367. {
  368. new stringy2[128];
  369. format(stringy2, sizeof(stringy2), "A Blista Compact for $%d",blista_price); //Format "stringy2"
  370. SendClientMessage(playerid,COLOR_WHITE,stringy2);
  371. }
  372. if(sold3 == 0) //If its not sold
  373. {
  374. new stringy3[128];
  375. format(stringy3, sizeof(stringy3), "A Stafford for $%d",stafford_price); //Format "stringy3"
  376. SendClientMessage(playerid,COLOR_WHITE,stringy3);
  377. }
  378. if(sold4 == 0) //If its not sold
  379. {
  380. new stringy4[128];
  381. format(stringy4, sizeof(stringy4), "A Sabre for $%d",sabre_price); //Format "stringy4"
  382. SendClientMessage(playerid,COLOR_WHITE,stringy4);
  383. }
  384. if(sold5 == 0) //If its not sold
  385. {
  386. new stringy5[128];
  387. format(stringy5, sizeof(stringy5), "An FCR-600 for $%d",FCR_price); //Format "stringy5"
  388. SendClientMessage(playerid,COLOR_WHITE,stringy5);
  389. }
  390. if(sold6 == 0) //If its not sold
  391. {
  392. new stringy6[128];
  393. format(stringy6, sizeof(stringy6), "A Cheetah for $%d",cheetah_price); //Format "stringy6"
  394. SendClientMessage(playerid,COLOR_WHITE,stringy6);
  395. }
  396. if(sold7 == 0) //If its not sold
  397. {
  398. new stringy7[128];
  399. format(stringy7, sizeof(stringy7), "A Rancher for $%d",rancher_price); //Format "stringy7"
  400. SendClientMessage(playerid,COLOR_WHITE,stringy7);
  401. }
  402. if(sold8 == 0) //If its not sold
  403. {
  404. new stringy8[128];
  405. format(stringy8, sizeof(stringy8), "A Stallion for $%d",stallion_price); //Format "stringy8"
  406. SendClientMessage(playerid,COLOR_WHITE,stringy8);
  407. }
  408. if(sold9 == 0) //If its not sold
  409. {
  410. new stringy9[128];
  411. format(stringy9, sizeof(stringy9), "A Tanker for $%d",tanker_price); //Format "stringy9"
  412. SendClientMessage(playerid,COLOR_WHITE,stringy9);
  413. }
  414. if(sold10 == 0) //If its not sold
  415. {
  416. new stringy10[128];
  417. format(stringy10, sizeof(stringy10), "A Comet for $%d",comet_price); //Format "stringy10"
  418. SendClientMessage(playerid,COLOR_WHITE,stringy10);
  419. }
  420. return 1;
  421. }
  422. return 0; //if all else fails return "SERVER: Unknown Command"!
  423. }
  424.  
  425.  
  426. public OnPlayerEnterCheckpoint(playerid) //When a player goes into the checkpoint
  427. {
  428. if(!IsPlayerInAnyVehicle(playerid)) //If the player isnt in a vehicle
  429. {
  430. return SendClientMessage(playerid,COLOR_RED,"You must be in a vehicle!");
  431. }
  432. new gtstr[128]; //Define gtstr
  433. if(sellon[playerid] == 0) //if he cant sell cars (sold one latley)
  434. {
  435. return GameTextForPlayer(playerid,"~R~Come back later!",3000,sold_for_gametext); //Tell him to return later
  436. }
  437. //Slamvan
  438. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 535) //If its a Slamvan
  439. {
  440. if(sold1 == 0) //If it has not been sold
  441. {
  442. sold1 = 1; //Now its sold, so we can set the variable
  443. sellon[playerid] = 0; //We have sold a vehicle so we have to wait 5 minutes to sell again
  444. SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again
  445. new string[128];
  446. new string2[128];
  447. format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2"
  448. SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage
  449. DestroyVehicle(GetPlayerVehicleID(playerid)); //Respawn the Slamvan
  450. GivePlayerMoney(playerid,slamvan_price); //Give the player that cash
  451. SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus );
  452. format(gtstr, sizeof(gtstr), "~G~slamvan sold for~N~~Y~$%i~W~!",slamvan_price); //Format "gtstr"
  453. GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext
  454. cross1 = CreateObject(3086, -1534.65, 154.05, 2.51, 0.00, 0.00, 180.00); //The cross-out object for the blackboard
  455. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); //Camera
  456. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); //Camera
  457. SetTimerEx("excam",reset_time*1000, false, "i", playerid); //Reset the camera and the player in whatever secondsa are defined
  458. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); //Sound
  459. new name[16]; //Define "Name"
  460. GetPlayerName(playerid,name,16); //Get the players name and store it in the "name" variable
  461. format(string, sizeof(string), "\"%s\" has sold the Slamvan for $%i!",name,slamvan_price); //Format "string"
  462. SendClientMessageToAll(COLOR_GREEN, string); //Send "string" as a SCM
  463. }
  464. else if(sold1 == 1) //If slamvan is already sold
  465. {
  466. GameTextForPlayer(playerid,"~R~slamvan ~W~has already been sold!",3000,already_sold_gametext); //Tell them its sold
  467. }
  468. }
  469. //Blista Compact
  470. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 496)
  471. {
  472. if(sold2 == 0)
  473. {
  474. sold2 = 1;
  475. sellon[playerid] = 0;
  476. SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again
  477. new string[128];
  478. new string2[128];
  479. format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2"
  480. SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage
  481. DestroyVehicle(GetPlayerVehicleID(playerid));
  482. GivePlayerMoney(playerid,blista_price);
  483. SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus );
  484. format(gtstr, sizeof(gtstr), "~G~blista compact sold for~N~~Y~$%i~W~!",blista_price); //Format "string"
  485. GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext
  486. cross2 = CreateObject(3086, -1534.45, 154.05, 2.26, 0.00, 0.00, 180.00);
  487. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547);
  488. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031);
  489. SetTimerEx("excam",reset_time*1000, false, "i", playerid);
  490. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0);
  491. new name[16];
  492. GetPlayerName(playerid,name,16);
  493. format(string, sizeof(string), "\"%s\" has sold the Blista Compact for $%i!",name,blista_price);
  494. SendClientMessageToAll(COLOR_GREEN, string);
  495. }
  496. else if(sold2 == 1)
  497. {
  498. GameTextForPlayer(playerid,"~R~blista compact ~W~has already been sold!",3000,already_sold_gametext);
  499. }
  500. }
  501. //Stafford
  502. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 580)
  503. {
  504. if(sold3 == 0)
  505. {
  506. sold3 = 1;
  507. sellon[playerid] = 0;
  508. SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again
  509. new string[128];
  510. new string2[128];
  511. format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2"
  512. SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage
  513. DestroyVehicle(GetPlayerVehicleID(playerid));
  514. GivePlayerMoney(playerid,stafford_price);
  515. SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus );
  516. format(gtstr, sizeof(gtstr), "~G~stafford sold for~N~~Y~$%i~W~!",stafford_price); //Format "string"
  517. GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext
  518. cross3 = CreateObject(3086, -1534.62, 154.05, 1.99, 0.00, 0.00, 180.00);
  519. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547);
  520. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031);
  521. SetTimerEx("excam",reset_time*1000, false, "i", playerid);
  522. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0);
  523. new name[16];
  524. GetPlayerName(playerid,name,16);
  525. format(string, sizeof(string), "\"%s\" has sold the Stafford for $%i!",name,stafford_price);
  526. SendClientMessageToAll(COLOR_GREEN, string);
  527. }
  528. else if(sold3 == 1)
  529. {
  530. GameTextForPlayer(playerid,"~R~stafford ~W~has already been sold!",3000,already_sold_gametext);
  531. }
  532. }
  533. //Sabre
  534. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 475)
  535. {
  536. if(sold4 == 0)
  537. {
  538. sold4 = 1;
  539. sellon[playerid] = 0;
  540. SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again
  541. new string[128];
  542. new string2[128];
  543. format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2"
  544. SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage
  545. DestroyVehicle(GetPlayerVehicleID(playerid));
  546. GivePlayerMoney(playerid,sabre_price);
  547. SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus );
  548. format(gtstr, sizeof(gtstr), "~G~sabre sold for~N~~Y~$%i~W~!",sabre_price); //Format "string"
  549. GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext
  550. cross4 = CreateObject(3086, -1534.73, 154.05, 1.73, 0.00, 0.00, 180.00);
  551. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547);
  552. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031);
  553. SetTimerEx("excam",reset_time*1000, false, "i", playerid);
  554. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0);
  555. new name[16];
  556. GetPlayerName(playerid,name,16);
  557. format(string, sizeof(string), "\"%s\" has sold the Sabre for $%i!",name,sabre_price);
  558. SendClientMessageToAll(COLOR_GREEN, string);
  559. }
  560. else if(sold4 == 1)
  561. {
  562. GameTextForPlayer(playerid,"~R~Sabre ~W~has already been sold!",3000,already_sold_gametext);
  563. }
  564. }
  565. //FCR-900
  566. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 521)
  567. {
  568. if(sold5 == 0)
  569. {
  570. sold5 = 1;
  571. sellon[playerid] = 0;
  572. SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again
  573. new string[128];
  574. new string2[128];
  575. format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2"
  576. SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage
  577. DestroyVehicle(GetPlayerVehicleID(playerid));
  578. GivePlayerMoney(playerid,FCR_price);
  579. SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus );
  580. format(gtstr, sizeof(gtstr), "~G~FCR-600 sold for~N~~Y~$%i~W~!",FCR_price); //Format "string"
  581. GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext
  582. cross5 = CreateObject(3086, -1534.68, 154.05, 1.45, 0.00, 0.00, 180.00);
  583. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547);
  584. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031);
  585. SetTimerEx("excam",reset_time*1000, false, "i", playerid);
  586. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0);
  587. new name[16];
  588. GetPlayerName(playerid,name,16);
  589. format(string, sizeof(string), "\"%s\" has sold the FCR-600 for $%i!",name,FCR_price);
  590. SendClientMessageToAll(COLOR_GREEN, string);
  591. }
  592. else if(sold4 == 1)
  593. {
  594. GameTextForPlayer(playerid,"~R~FCR-600 ~W~has already been sold!",3000,already_sold_gametext);
  595. }
  596. }
  597. //Cheetah
  598. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 415)
  599. {
  600. if(sold6 == 0)
  601. {
  602. sold6 = 1;
  603. sellon[playerid] = 0;
  604. SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again
  605. new string[128];
  606. new string2[128];
  607. format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2"
  608. SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage
  609. DestroyVehicle(GetPlayerVehicleID(playerid));
  610. GivePlayerMoney(playerid,cheetah_price);
  611. SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus );
  612. format(gtstr, sizeof(gtstr), "~G~cheetah sold for~N~~Y~$%i~W~!",cheetah_price); //Format "string"
  613. GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext
  614. cross6 = CreateObject(3086, -1532.76, 154.05, 2.55, 0.00, 0.00, 180.00);
  615. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547);
  616. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031);
  617. SetTimerEx("excam",reset_time*1000, false, "i", playerid);
  618. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0);
  619. new name[16];
  620. GetPlayerName(playerid,name,16);
  621. format(string, sizeof(string), "\"%s\" has sold the Cheetah for $%i!",name,cheetah_price);
  622. SendClientMessageToAll(COLOR_GREEN, string);
  623. }
  624. else if(sold6 == 1)
  625. {
  626. GameTextForPlayer(playerid,"~R~Cheetah ~W~has already been sold!",3000,already_sold_gametext);
  627. }
  628. }
  629. //Rancher
  630. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 489)
  631. {
  632. if(sold7 == 0)
  633. {
  634. sold7 = 1;
  635. sellon[playerid] = 0;
  636. SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again
  637. new string[128];
  638. new string2[128];
  639. format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2"
  640. SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage
  641. DestroyVehicle(GetPlayerVehicleID(playerid));
  642. GivePlayerMoney(playerid,rancher_price);
  643. SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus );
  644. format(gtstr, sizeof(gtstr), "~G~rancher sold for~N~~Y~$%i~W~!",rancher_price); //Format "string"
  645. GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext
  646. cross7 = CreateObject(3086, -1532.67, 154.04, 2.27, 0.00, 0.00, 180.00);
  647. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547);
  648. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031);
  649. SetTimerEx("reset_time*1000",reset_time*1000, false, "i", playerid);
  650. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0);
  651. new name[16];
  652. GetPlayerName(playerid,name,16);
  653. format(string, sizeof(string), "\"%s\" has sold the Rancher for $%i!",name,rancher_price);
  654. SendClientMessageToAll(COLOR_GREEN, string);
  655. }
  656. else if(sold7 == 1)
  657. {
  658. GameTextForPlayer(playerid,"~R~Rancher ~W~has already been sold!",3000,already_sold_gametext);
  659. }
  660. }
  661. //Stallion
  662. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 439)
  663. {
  664. if(sold8 == 0)
  665. {
  666. sold8 = 1;
  667. sellon[playerid] = 0;
  668. SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again
  669. new string[128];
  670. new string2[128];
  671. format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2"
  672. SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage
  673. DestroyVehicle(GetPlayerVehicleID(playerid));
  674. GivePlayerMoney(playerid,stallion_price);
  675. SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus );
  676. format(gtstr, sizeof(gtstr), "~G~stallion sold for~N~~Y~$%i~W~!",stallion_price); //Format "string"
  677. GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext
  678. cross8 = CreateObject(3086, -1532.77, 154.04, 2.03, 0.00, 0.00, 180.00 );
  679. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547);
  680. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031);
  681. SetTimerEx("excam",reset_time*1000, false, "i", playerid);
  682. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0);
  683. new name[16];
  684. GetPlayerName(playerid,name,16);
  685. format(string, sizeof(string), "\"%s\" has sold the Stallion for $%i!",name,stallion_price);
  686. SendClientMessageToAll(COLOR_GREEN, string);
  687. }
  688. else if(sold8 == 1)
  689. {
  690. GameTextForPlayer(playerid,"~R~Stallion ~W~has already been sold!",3000,already_sold_gametext);
  691. }
  692. }
  693. //Tanker
  694. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 514)
  695. {
  696. if(sold9 == 0)
  697. {
  698. sold9 = 1;
  699. sellon[playerid] = 0;
  700. SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again
  701. new string[128];
  702. new string2[128];
  703. format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2"
  704. SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage
  705. DestroyVehicle(GetPlayerVehicleID(playerid));
  706. GivePlayerMoney(playerid,tanker_price);
  707. SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus );
  708. format(gtstr, sizeof(gtstr), "~G~tanker sold for~N~~Y~$%i~W~!",tanker_price); //Format "string"
  709. GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext
  710. cross9 = CreateObject(3086, -1532.77, 154.02, 1.75, 0.00, 0.00, 180.00);
  711. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547);
  712. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031);
  713. SetTimerEx("excam",reset_time*1000, false, "i", playerid);
  714. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0);
  715. new name[16];
  716. GetPlayerName(playerid,name,16);
  717. format(string, sizeof(string), "\"%s\" has sold the Tanker for $%i!",name,tanker_price);
  718. SendClientMessageToAll(COLOR_GREEN, string);
  719. }
  720. else if(sold9 == 1)
  721. {
  722. GameTextForPlayer(playerid,"~R~Tanker ~W~has already been sold!",3000,already_sold_gametext);
  723. }
  724. }
  725. //Comet
  726. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 480)
  727. {
  728. if(sold10 == 0)
  729. {
  730. sold10 = 1;
  731. sellon[playerid] = 0;
  732. SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again
  733. new string[128];
  734. new string2[128];
  735. format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2"
  736. SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage
  737. DestroyVehicle(GetPlayerVehicleID(playerid));
  738. GivePlayerMoney(playerid,comet_price);
  739. SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus );
  740. format(gtstr, sizeof(gtstr), "~G~slamvan sold for~N~~Y~$%i~W~!",comet_price); //Format "string"
  741. GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext
  742. cross10 = CreateObject(3086, -1532.86, 154.04, 1.48, 0.00, 0.00, 180.00);
  743. SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547);
  744. SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031);
  745. SetTimerEx("excam",reset_time*1000, false, "i", playerid);
  746. PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0);
  747. new name[16];
  748. GetPlayerName(playerid,name,16);
  749. format(string, sizeof(string), "\"%s\" has sold the Comet for $%i!",name,comet_price);
  750. SendClientMessageToAll(COLOR_GREEN, string);
  751. }
  752. else if(sold10 == 1)
  753. {
  754. GameTextForPlayer(playerid,"~R~Comet ~W~has already been sold!",3000,already_sold_gametext);
  755. }
  756. }
  757. if(sold1 == 1 && sold2 == 1 && sold3 == 1 && sold4 == 1 && sold5 == 1 && sold6 == 1 && sold7 == 1 && sold8 == 1 && sold9 == 1 && sold10 == 1)
  758. {
  759. return reloadexport(playerid);
  760. }
  761. return 1;
  762. }
  763.  
  764. reloadexport(playerid) //This is called when all cars are sold
  765. {
  766. SendClientMessageToAll(COLOR_RED,"The Car Export List Has Been Completed! List Reset!");
  767. SendClientMessage(playerid,COLOR_RED,"YOU SOLD THE LAST CAR!"); //Tells the person he sold the last car
  768. new string[128];
  769. format(string, sizeof(string), "Received +%d points! [REASON: Sold Last Car].",last_car_bonus); //Format "string"
  770. SetPlayerScore(playerid, GetPlayerScore(playerid) + last_car_bonus );
  771. SendClientMessage(playerid,COLOR_YELLOW,string); //Give him 100 points
  772. DestroyObject(cross1);
  773. sold1 = 0;
  774. DestroyObject(cross2);
  775. sold2 = 0;
  776. DestroyObject(cross3);
  777. sold3 = 0;
  778. DestroyObject(cross4);
  779. sold4 = 0;
  780. DestroyObject(cross5);
  781. sold5 = 0;
  782. DestroyObject(cross6);
  783. sold6 = 0;
  784. DestroyObject(cross7);
  785. sold7 = 0;
  786. DestroyObject(cross8);
  787. sold8 = 0;
  788. DestroyObject(cross9);
  789. sold9 = 0;
  790. DestroyObject(cross10);
  791. sold10 = 0;
  792. return 1;
  793. }
  794.  
  795. #if help_pickup == true
  796. public OnPlayerPickUpPickup(playerid, pickupid)
  797. {
  798.  
  799. if (pickupid == exhelp) //If he picks up the help pickup
  800. {
  801. SendClientMessage(playerid,COLOR_ORANGE,"Car Export Help");
  802. SendClientMessage(playerid,COLOR_WHITE,"Car Export allows players to sell cars for cash and score.");
  803. SendClientMessage(playerid,COLOR_WHITE,"You can see what cars are available to be sold on the blackboard or by /exlist.");
  804. SendClientMessage(playerid,COLOR_WHITE,"When you deliver a car on the list to the red checkpoint");
  805. SendClientMessage(playerid,COLOR_WHITE,"it will be crossed off the list and nobody else can sell that car.");
  806. SendClientMessage(playerid,COLOR_WHITE,"Prices vary depending on the car");
  807. SendClientMessage(playerid,COLOR_WHITE,"Happy hunting!");
  808. }
  809. }
  810. #endif
  811. public excam(playerid)
  812. {
  813. SetCameraBehindPlayer(playerid);
  814. PlayerPlaySound(playerid,1149,0.0,0.0,0.0);
  815. }
  816.  
  817. public exdel(playerid)
  818. {
  819. if(sellon[playerid] == 0) //If he can't sell (To aviod bugs)
  820. {
  821. SendClientMessage(playerid, COLOR_GREEN,"CAR EXPORT: You May Now Sell Another Car!"); //Send him a notification
  822. sellon[playerid] = 1; //The player can now sell another car
  823. }
  824. }
  825.  
  826. //Car names - Thankyou WeeDarr for giving me the array
  827.  
  828. #if defined car_names
  829. public OnPlayerStateChange(playerid, newstate, oldstate)
  830. {
  831. if(carnames[playerid] == 1)
  832. {
  833. if(GetPlayerState(playerid) ==2)
  834. {
  835. new string[128];
  836. format(string, sizeof(string), "%s",vNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
  837. GameTextForPlayer(playerid, string, 2000, 1);
  838. }
  839. }
  840. return 1;
  841. }
  842. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement