[FS] Vehicle Hire System -
Joe_ - 25.05.2010
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:
Re: [FS] Vehicle Hire System -
v0nz - 25.05.2010
Looks good but when I think of hire, I think humans. You should make it /rent.
Re: [FS] Vehicle Hire System -
luigifan9 - 26.05.2010
hire? lolwut
Re: [FS] Vehicle Hire System -
Steven82 - 26.05.2010
hire is the same thing as rental car don't make a huge fucking deal about it, anyways nice FS
Re: [FS] Vehicle Hire System -
Joe_ - 26.05.2010
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.
Re: [FS] Vehicle Hire System -
Mr L - 26.05.2010
Nice job i like it.
Re: [FS] Vehicle Hire System -
park4bmx - 26.05.2010
Look's good but does it save the vehicles
Re: [FS] Vehicle Hire System -
Joe_ - 26.05.2010
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.
Re: [FS] Vehicle Hire System -
Joe_ - 26.05.2010
Version 2.0 Is out!
More info on the first post.
Sorry for Double!
[FS] Vehicle Hire System -
Joe_ - 09.06.2010
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.
Re: [FS] Vehicle Hire System -
vyper - 09.06.2010
good job
Re: [FS] Vehicle Hire System -
LasVegasMafiaStoriesRP - 10.06.2010
HAHA!!! Nice title XD
Re: [FS] Vehicle Hire System -
Joe_ - 10.06.2010
What's so funny? [FS]Vehicle Hire System?