Renting Car system
#1

I am making a car rent system. So far I have the cars defined as rentcars. I also have so when you enter then it brings up a dialog asking whether to rent or to get out. I need to know what would be the best way about defining the rent cars to that player for 30 minutes.

pawn Код:
if(dialogid == RENT_MENU)
{
    if(response)
    {

    }
}
Reply
#2

Best thing is to make a var for player for instance:
RentVehicle[MAX_PLAYERS];

When player connects:
RentVehicle[playerid] = INVALID_VEHICLE_ID;

pawn Код:
stock IsVehicleRented(vehicle)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        return true;
    }
    return false;
}
OnPlayerStateChange:
if the player is driver as a new state, use the stock above and send him the proper messages.

In /rentvehicle cmd also check if the vehicle is taken by someone else if not then just set the RentVehicle value to the vehicle id.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)