Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*------------------------------------------------------------------------------------
- Filterscript created by Ciaran. You do not have to keep the credits, but it
- would be nice if you did. If you want to thank me, the best thing you can do
- is +Rep me on the forums as I am releasing a server and I need 15 reputation
- to make a SAMP server advertisement. Good luck and enjoy.
- Link to forum account: http://forum.sa-mp.com/member.php?u=225556
- -----------------------------------------------------------------------------------*/
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- LoadVehicles();
- print("Dropcar Vehicles loaded.");
- return 1;
- }
- #else
- #endif
- //Color Defines
- #define COLOR_GREEN 0x33AA33FF
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_GREY 0xAFAFAFFF
- //Vehicle Thife Cooldown
- new thiefcooldown[MAX_PLAYERS];
- //Vehicle Thief Cars
- new NormalCar[30];
- new BigCar[30];
- new HugeCar[30];
- stock LoadVehicles()
- {
- //NOTE:
- /* These vehicles are placed across Las Venturas. Just create your own vehicle locations
- and change them below if your server is not in LV. */
- //Thief Cars - Standard
- NormalCar[0] = CreateVehicle(401,1916.3652000,708.3321000,10.4451000,359.7643000,0,0,600);
- NormalCar[1] = CreateVehicle(405,2817.5991000,939.3661000,10.3751000,180.9467000,0,0,600);
- NormalCar[2] = CreateVehicle(436,2652.4353000,1085.8291000,10.4452000,272.3191000,0,0,600);
- NormalCar[3] = CreateVehicle(480,2363.3252000,1668.6544000,10.4453000,90.4974000,0,0,600);
- NormalCar[4] = CreateVehicle(496,2594.2485000,1973.7075000,10.4399000,89.0643000,0,0,600);
- NormalCar[5] = CreateVehicle(562,1424.5597000,973.3416000,9.8010000,358.6743000,0,0, 600);
- NormalCar[6] = CreateVehicle(507,2672.3608000,2000.9481000,10.4531000,269.8076000,0,0,600);
- NormalCar[7] = CreateVehicle(541,2186.7891000,1979.1039000,10.4452000,90.1544000,0,0,600);
- NormalCar[8] = CreateVehicle(517,2580.5398000,2249.5718000,10.4453000,180.4235000,0,0,600);
- NormalCar[9] = CreateVehicle(533,2822.0874000,2232.1304000,10.4454000,271.2804000,0,0,600);
- NormalCar[10] = CreateVehicle(566,1906.6366000,2075.6453000,10.4454000,89.9817000,0,0,600);
- NormalCar[11] = CreateVehicle(587,2200.9709000,2528.9373000,10.4416000,359.8749000,0,0,600);
- NormalCar[12] = CreateVehicle(603,2086.5383000,2398.8909000,10.4441000,90.1794000,0,0,600);
- NormalCar[13] = CreateVehicle(410,1413.4421000,711.4407000,10.4452000,90.5417000,0,0,600);
- NormalCar[14] = CreateVehicle(545,2069.0674000,2395.9634000,19.0546000,89.5119000,0,0,600);
- NormalCar[15] = CreateVehicle(415,2107.2109000,1408.8610000,10.4453000,179.0183000,0,0,600);
- NormalCar[16] = CreateVehicle(412,2078.5803000,2419.4592000,27.6484000,271.0032000,0,0,600);
- //Thief Cars - Medium
- BigCar[0] = CreateVehicle(400,2132.3506000,1016.1492000,10.4454000,270.0213000,0,0,600);
- BigCar[1] = CreateVehicle(418,1870.0366000,1179.5073000,10.4600000,179.9870000,0,0,600);
- BigCar[2] = CreateVehicle(459,1621.6951000,1970.3406000,10.4454000,3.7933000,0,0,600);
- BigCar[3] = CreateVehicle(479,1708.7927000,2243.8684000,10.4452000,183.4580000,0,0,600);
- BigCar[4] = CreateVehicle(554,2599.2188000,1684.5198000,10.4453000,269.7698000,0,0,600);
- BigCar[5] = CreateVehicle(440,1385.6763000,2256.2178000,10.4453000,269.6565000,0,0,600);
- BigCar[6] = CreateVehicle(561,2096.3516000,2413.6638000,49.1482000,89.9355000,0,0,600);
- BigCar[7] = CreateVehicle(579,1117.9724000,2090.0386000,10.4415000,272.4155000,0,0,600);
- //Thief Cars - Large
- HugeCar[0] = CreateVehicle(414,2042.4340000,2142.8801000,10.4452000,90.9155000,0,0,600);
- HugeCar[1] = CreateVehicle(456,1135.7478000,2260.5737000,10.4523000,90.9393000,0,0,600);
- HugeCar[2] = CreateVehicle(456,2829.8643000,2309.5530000,10.4452000,0.1173000,0,0,600);
- HugeCar[3] = CreateVehicle(498,2104.1272000,2043.1400000,10.4454000,270.4098000,0,0,600);
- }
- /*
- If you have a hotwire system orsomething similar on your server, un-comment the code below
- to spawn the cars with their engine off. */
- public OnVehicleSpawn(vehicleid)
- {
- if(IsNormalCar(vehicleid))
- {
- SetVehicleParamsEx(vehicleid, 1, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid, 7.0, 1702.9716,960.5179,10.8203))
- {
- new standardprice, biggerprice, hugeprice, string[128];
- new rcash1 = random(150);
- new rcash2 = random(200);
- new rcash3 = random(250);
- new vehicleid = GetPlayerVehicleID(playerid);
- if(IsNormalCar(vehicleid))
- {
- standardprice = rcash1+200;
- SendClientMessage(playerid, COLOR_GREY, "---------------------------------------------------------");
- //SendClientMessage(playerid, COLOR_GREY, "Type: Standard Vehicle");
- format(string, sizeof(string), "Payment: $%d", standardprice);
- SendClientMessage(playerid, COLOR_GREEN, string);
- SendClientMessage(playerid, COLOR_GREY, "You can drop off another car in five minutes.");
- SendClientMessage(playerid, COLOR_GREY, "---------------------------------------------------------");
- GivePlayerMoney(playerid, standardprice);
- SetVehicleToRespawn(GetPlayerVehicleID(playerid));
- DisablePlayerCheckpoint(playerid);
- return 1;
- }
- else if(IsBigCar(vehicleid))
- {
- biggerprice = rcash2+300;
- SendClientMessage(playerid, COLOR_GREY, "---------------------------------------------------------");
- //SendClientMessage(playerid, COLOR_GREY, "Type: Big Vehicle");
- format(string, sizeof(string), "Payment: $%d", biggerprice);
- SendClientMessage(playerid, COLOR_GREEN, string);
- SendClientMessage(playerid, COLOR_GREY, "You can drop off another car in five minutes.");
- SendClientMessage(playerid, COLOR_GREY, "---------------------------------------------------------");
- GivePlayerMoney(playerid, biggerprice);
- SetVehicleToRespawn(GetPlayerVehicleID(playerid));
- DisablePlayerCheckpoint(playerid);
- return 1;
- }
- else if(IsHugeCar(vehicleid))
- {
- hugeprice = rcash3+400;
- SendClientMessage(playerid, COLOR_GREY, "---------------------------------------------------------");
- //SendClientMessage(playerid, COLOR_GREY, "Type: Huge Vehicle");
- format(string, sizeof(string), "Payment: $%d", hugeprice);
- SendClientMessage(playerid, COLOR_GREEN, string);
- SendClientMessage(playerid, COLOR_GREY, "You can drop off another car in five minutes.");
- SendClientMessage(playerid, COLOR_GREY, "---------------------------------------------------------");
- GivePlayerMoney(playerid, hugeprice);
- SetVehicleToRespawn(GetPlayerVehicleID(playerid));
- DisablePlayerCheckpoint(playerid);
- return 1;
- }
- }
- return 1;
- }
- CMD:dropcar(playerid, params[])
- {
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not driving a vehicle.");
- new vehicleid = GetPlayerVehicleID(playerid);
- new currenttime = gettime();
- if(currenttime >= (thiefcooldown[playerid] + 900))
- {
- if(IsNormalCar(vehicleid))
- {
- SetPlayerCheckpoint(playerid, 1702.9716,960.5179,10.8203, 7.0);
- SendClientMessage(playerid, COLOR_WHITE, "Drop off the vehicle at the red marker.");
- return 1;
- }
- if(IsBigCar(vehicleid))
- {
- SetPlayerCheckpoint(playerid, 1702.9716,960.5179,10.8203, 7.0);
- SendClientMessage(playerid, COLOR_WHITE, "Drop off the vehicle at the red marker.");
- return 1;
- }
- if(IsHugeCar(vehicleid))
- {
- SetPlayerCheckpoint(playerid, 1702.9716,960.5179,10.8203, 7.0);
- SendClientMessage(playerid, COLOR_WHITE, "Drop off the vehicle at the red marker.");
- return 1;
- }
- thiefcooldown[playerid] = currenttime;
- }
- else
- {
- new str[55];
- format(str, sizeof(str), "You cannot use this command for another %d seconds.", ((thiefcooldown[playerid] + 900) - currenttime));
- SendClientMessage(playerid, COLOR_GREY, str);
- }
- return 1;
- }
- stock IsNormalCar(vehicleid)
- {
- for(new i=0; i<17; i++)
- {
- if(vehicleid == NormalCar[i]) return 1;
- }
- return 0;
- }
- stock IsBigCar(vehicleid)
- {
- for(new i=0; i<8; i++)
- {
- if(vehicleid == BigCar[i]) return 1;
- }
- return 0;
- }
- stock IsHugeCar(vehicleid)
- {
- for(new i=0; i<4; i++)
- {
- if(vehicleid == HugeCar[i]) return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment