how to define a vehicle - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to define a vehicle (
/showthread.php?tid=598889)
how to define a vehicle -
AndreiWow - 18.01.2016
I want to make a renting system but I never did this and I'm not sure how to define a number of vehicles as being for rent, or atleast how to show the rent price when he enter it like.
new RentVehicle[4];
RentVehicle[0] = CreateStaticVehicle(
RentVehicle[1] = CreateStaticVehicle(
RentVehicle[2] = CreateStaticVehicle(
RentVehicle[3] = CreateStaticVehicle(
But how to send him a message when he enters these vehicles?
I think it is something like if(RentVehicle[1])
but how to make for all vehicles at the same time?
if(RentVehicle[1]) && (RentVehicle[2])?
Re: how to define a vehicle -
SoFahim - 18.01.2016
PHP код:
for(new x;x<sizeof(RentVehicle);x++)
{
RentVehicle[x] //your codes with it.
}
PHP код:
IsRentVehicle(carid)
{
for(new v = 0; v < sizeof(RentVehicle); v++)
{
if(carid == RentVehicle[v]) return 1;
}
return 0;
}
You just need to code something like this, to define all RentVehicle at once
After that , OnPlayerEnterVehicle :
PHP код:
(use "else" if there many already given )if(RentVehicle(vehicleid))
{
//your codes
}
Re: how to define a vehicle -
AndreiWow - 18.01.2016
Thanks alot