SA-MP Forums Archive
[FilterScript] adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car (/showthread.php?tid=252231)

Pages: 1 2


adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - admantis - 30.04.2011

adm_Rent

Oh, so I was bored and I made this in 20 mins.

What is this?

With adm_Rent you can create easily rental vehicles, this can help you to develop your roleplay server and system, the rent cost is flexible and customizable.


How to add rental cars?
You can create rental vehicles with the following function:
pawn Code:
CreateRentalVehicle(modelid, x, y, z, angle, color1, color2);
Place that code under OnFilterScriptInit allocated in this code and that will be all!


Commands
There are various commands in this script:
/rentcar : rent a vehicle for the defined cost
/unrentcar : unrent your vehicle
/exitrental : used to exit a rental vehicle if you're frozen
/addrental : commands for admins to generate a 'CreateRentalVehicle' function


Features
- Auto unrent on disconnect
- Easy to change rent cost
- Easy to add rental vehicles
- Can't rent someone's else vehicle
- Utilizes zcmd for faster commands

If you encounter any bug simply report it here, also if you have any questions..


Download
http://pastebin.com/Zp8ZKsg8
Download the link, add your rental vehicles and compile!


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - StreetGT - 30.04.2011

Good Work mate


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - admantis - 30.04.2011

Thank you. If anybody is unsure on how to use this tell it here.


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - hackzor4 - 30.04.2011

Good job !


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - BizzyD - 30.04.2011

Very nice job


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - StreetGT - 01.05.2011

for next update, i give you a suggestion:

pawn Code:
CreateRentalVehicle(modelid, x, y, z, angle, color1, color2, rentprice);



Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - admantis - 01.05.2011

^Very good idea, I will add it when I've time


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - TiMxD - 09.06.2011

I need help setting this up
I get the filterscript part. I just don't get:

pawn Code:
CreateRentalVehicle(modelid, x, y, z, angle, color1, color2);



Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - Darklom - 28.07.2011

Quote:
Originally Posted by TiMxD
View Post
I need help setting this up
I get the filterscript part. I just don't get:

pawn Code:
CreateRentalVehicle(modelid, x, y, z, angle, color1, color2);
Seriously?
modelid - ID of the car
x - x position
y - y position
z - z position
angle - the angle
color1 - the first color
color2 - the second color
Dun dun dunnnn.


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - Kerlan - 11.10.2011

Can't you call your car?


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - JamieVic - 21.11.2013

Added this filterscript to my server.

Easy to use and flexible customization, good work!


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - Wizzy951 - 21.11.2013

Quote:
Originally Posted by JamieVic
Посмотреть сообщение
Added this filterscript to my server.

Easy to use and flexible customization, good work!
You are bumping 2 years old thread! Weird!


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - b0b - 22.11.2013

Hello, i use this! But, i dont now, wher i but this
CreateRentalVehicle(555, -1551.492309, 2575.194091, 55.440063, 179.260147, -1, -1);


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - hanm13 - 27.05.2014

My engine command is :
Код:
		if(!strcmp(cmd, "/engine", true))
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(IsPlayerInAnyVehicle(playerid))
			{
			    if(!IsPlayerInAnyVehicle(playerid))
				{
					SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a vehicle !");
					return 1;
				}
				if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_GRAD2, "Only the driver can do this!");
			    if(IsAPublicCar(idcar))/*
		   		{
 		   	 		SendClientMessage(playerid, COLOR_GREY, "You don't have the keys to this vehicle.");
	   				return 1;
		   		}*/
		   		
			    if(IsADmv(idcar) || IsAHarvest(idcar) || IsADrugHarvest(idcar) || IsASweeper(idcar) || pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
					return 1;
					
	        	if(Gas[idcar] == 0)
	        	    return SendClientMessage(playerid,COLOR_GREY,"   No fuel in this vehicle! Call a Mechanic (555)!");
	        	    
	        /*	new	vID = GetPlayerVehicleID(playerid);
	        	if (GetPVarInt(playerid, "Renting") == 0 || !IsRentedCar(vID) || IsRentableCar(vID))
	        	    return SendClientMessage(playerid,COLOR_GREY,"   You can't start the car you are not rented");*/

                if(dying[playerid] == 1)
                    return SendClientMessage(playerid,COLOR_GREY,"   Do not Bug Abuse!");
	    		if(!engineOn[idcar])
					{
 				       if(GetPlayerState(playerid) != PLAYER_STATE_PASSENGER)
						{
    						new playerveh = GetPlayerVehicleID(playerid);
					    	engineOn[idcar] = true;
					    	PutPlayerInVehicle(playerid, playerveh, 0);
					    	TogglePlayerControllable(playerid,1);
			    			GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
							bootopen = 0;
							bonnetopen = 0;
							alarmon = 0;
							lightson = 0;
					    	format(string, sizeof(string), "* %s spins the key and starts vehicle's engine.", sendername);
					    	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
							return 1;
						}
						return 1;
					}
					else if(engineOn[idcar])
	    			{
	        			if(GetPlayerState(playerid) != PLAYER_STATE_PASSENGER)
						{
					    	engineOn[idcar] = false;
        			 		GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
							bootopen = 0;
							bonnetopen = 0;
							alarmon = 0;
							lightson = 0;
					    	TogglePlayerControllable(playerid, 0);
					    	format(string, sizeof(string), "* %s spins the key and turns off the vehicle's engine.", sendername);
					    	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
							return 1;
						}
						return 1;
					}
				}
	    	}
	    	return 1;
		}
How I can do if its rented car and you dont you are dont own this car
or its not rented car but its renable you cant start the engine
Or if the car Is not rented by me and its rentablecar you cant start the engine


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - Alex Magaсa - 27.05.2014

nice work!


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - Shank - 27.05.2014

Very user friendly! Good work.


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - iRaiDeN - 27.05.2014

Nice!


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - hanm13 - 27.05.2014

Nice work but Need more updates, and How I can do what I asked...?


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - hanm13 - 02.06.2014

BUMP


Re: adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car - Inn0cent - 02.06.2014

Script it.