27.08.2013, 11:34
Best thing is to make a var for player for instance:
RentVehicle[MAX_PLAYERS];
When player connects:
RentVehicle[playerid] = INVALID_VEHICLE_ID;
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.
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;
}
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.