[FilterScript] adm_Rent | Create easy rental vehicles! | 1 line: 1 rental car
#1

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!
Reply
#2

Good Work mate
Reply
#3

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

Good job !
Reply
#5

Very nice job
Reply
#6

for next update, i give you a suggestion:

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

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

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);
Reply
#9

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.
Reply
#10

Can't you call your car?
Reply
#11

Added this filterscript to my server.

Easy to use and flexible customization, good work!
Reply
#12

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!
Reply
#13

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

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
Reply
#15

nice work!
Reply
#16

Very user friendly! Good work.
Reply
#17

Nice!
Reply
#18

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

BUMP
Reply
#20

Script it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)