[FilterScript] [FS] Vehicle Hire System
#1

Joe's Vehicle Hire System 2.0
What does it do?
With this vehicle you can add Hireable vehicles easily with one line.
When you get into a hire vehicle, A message will pop up saying it's a Hire vehicle.
And will list the commands availbe.


When you type '/hire' in a unhired hire vehicle:
And so on..
Changes in V2.0:
You can hire a vehicle for a certin amount of time which is defined in the CreateHireVehicle code.
When there's one minute until rent time expiry, A message will say so.
You will automaticly return the vehicle once the Time expiry has been reached.
Changes in V3.0:
Optimized code.
VehicleID conflicts upon GMX fixed. - Not 100% sure, /v still causes bugs.
When you destroy your vehicle, it will be returned.
USES ZCMD.
USES SSCANF2.
SCRIPTS:
-> ZCMD <-
-> SSCANF2 <-
-> FOREACH <-

Sounds good, so how do I do it?
Firstly, download the script from the download link below.
Seconly, once you've installed it, open up 'Hire.pwn'.
Then find the 'public OnFilterScriptInit()' callback.
Inside this callback is where you create your Hire Vehicles.
I have made 4 examples.
V1.1:
pawn Code:
/*CreateHireVehicle(ModelID, X, Y, Z, Rotation, Color1, Color2, Price);*/
CreateHireVehicle(451, 524.259704, -1290.022094, 16.948589, 310.302642, 15, 15, 3000); // Grotti ~ Turismo Hire
CreateHireVehicle(451, 534.313842, -1290.038574, 16.948661, 314.290283, 15, 15, 3000); // Grotti ~ Turismo Hire
CreateHireVehicle(506, 552.631225, -1289.209838, 16.835329, 1.806509, 15, 15, 2800); // Grotti ~ SuperGT Hire
CreateHireVehicle(415, 564.112976, -1277.986083, 17.014154, 102.518310, 15, 15, 2500); // Grotti ~ Cheetah Hire
V2.0:
pawn Code:
/*CreateHireVehicle(ModelID, X, Y, Z, Rotation, Color1, Color2, Price, Time(IN MINUTES!!!));*/
CreateHireVehicle(451, 524.259704, -1290.022094, 16.948589, 310.302642, 15, 15, 3000, 60); // Grotti ~ Turismo Hire
CreateHireVehicle(451, 534.313842, -1290.038574, 16.948661, 314.290283, 15, 15, 3000, 60); // Grotti ~ Turismo Hire
CreateHireVehicle(506, 552.631225, -1289.209838, 16.835329, 1.806509, 15, 15, 2800, 60); // Grotti ~ SuperGT Hire
CreateHireVehicle(415, 564.112976, -1277.986083, 17.014154, 102.518310, 15, 15, 2500, 60); // Grotti ~ Cheetah Hire
You can make as many as you want.
Nice, so, are there any bugs?
There are no bugs with this script, however if you use a vehicle spawner, this may cause conflictions.
So what are the commands?
Hire version:
/Hire
/Unhire
/Exitveh
BONUS: /Hireveh - Type /hireveh ingame to see more info.
Rent version:
/Rent
/Unrent
/Exitveh
BONUS: /Hireveh - Type /hireveh ingame to see more info.
Credits:
ME, because if I didn't script this, it wouldn't be here.
'Grim_' Coding help in Scripting Discussions.
'Kyosaur!!!' Coding help over MSN.
'Guedes' Testing.
Download V1.1:
Hire version:
Rent version:
Download V2.0:
Hire version:
Rent version:
Download V3.0:
USES ZCMD.
USES SSCANF2.
SCRIPTS:
Hire version:
Rent version:
Reply
#2

Looks good but when I think of hire, I think humans. You should make it /rent.
Reply
#3

hire? lolwut
Reply
#4

hire is the same thing as rental car don't make a huge fucking deal about it, anyways nice FS
Reply
#5

You -HIRE- or -RENT- A car, their both the same things, don't get a stiffy over it.

V1.1
- OnVehicleDeath had an uneeded loop and some other stuff.
- Changed some text and commands to 'rent' etc.

Download link updated.
Reply
#6

Nice job i like it.
Reply
#7

Look's good but does it save the vehicles
Reply
#8

Quote:
Originally Posted by park4bmx
Look's good but does it save the vehicles
You use the command '/hireveh' when you're in a vehicle ingame.
This will save your vehicle (XYZA MODEL) and Colors + price.
This will save into 'hirevehicles.pwn' in your scriptfiles folder.
You copy and paste them to OnFilterScriptInt();
Reload the Filterscript, and they will be there.

When somebody hires a vehicle and disconnects, the vehicle gets respawned and unhired, to avoid all the vehicles being hired etc.
Just a failsafe thing.

However you can add it yourself at your own risk of the above.

Exampe: 100 players on server, 20 of them have hire vehicles, you have 20 hire vehicles, so their all used up, when they disconnect, it's still theirs! a restart would then be needed to unhire them.

So yeah, the disconnect resetting is just a Fail-safe thing, though maybe I'll re-write part of the script so you get the vehicle for XX minutes then it's returned.
Reply
#9

Version 2.0 Is out!

More info on the first post.

Sorry for Double!
Reply
#10

V3.0 Out

Optimised code
VehicleID conflicts upon GMX fixed
When vehicle destroyed, will unhire.

NOTE:
V3.0 USES ZCMD, SSCANF2 AND FOREACH, IT WILL NOT WORK WITHOUT THESE!
DO NOT REPLY ABOUT THIS SCRIPT NOT WORKING IF YOU'RE USING V3.0 AND YOU HAVEN'T GOT ZCMD, SSCANF2 AND FOREACH.
ZCMD, SSCANF2, FOREACH AVAILABLE ON FIRST POST.
Reply
#11

good job
Reply
#12

HAHA!!! Nice title XD
Reply
#13

What's so funny? [FS]Vehicle Hire System?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)