how to define a vehicle
#1

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])?
Reply
#2

PHP код:
for(new x;x<sizeof(RentVehicle);x++)
    {
RentVehicle[x//your codes with it.
    

PHP код:
IsRentVehicle(carid)
{
    for(new 
0sizeof(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 
            
        

Reply
#3

Thanks alot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)