Job cars respawn when exit them. [+REP]
#2

Do this
PHP код:
new MechanicJobCars[2];
MechanicJobCars[0] = CreateVehicle( .... );
MechanicJobCars[1] = CreateVehicle( .... );
public 
OnPlayerStateChange(playeridnewstateoldstate) {
    if(
oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) { //if they entered the certain vehicle as driver
        
for(new isizeof(MechanicJobCars); i++) { //Loop thru all mechanic job cars
            
if(IsPlayerInVehicle(playerid,MechanicJobCars[i]) { //if they entered car ID MechanicJobCar
                
if(PlayerJob[playerid] != 1) { //if their job isnt ID 1, change with your check
                    
RemovePlayerFromVehicle(playerid); //remove them from the vehicle if they dont have the job they need
                
}
            }
        }
    }
    return 
true;

Reply


Messages In This Thread
Job cars respawn when exit them. [+REP] - by EgyptForLife - 28.12.2015, 13:05
Re: Job cars respawn when exit them. [+REP] - by TwinkiDaBoss - 28.12.2015, 14:55
Re: Job cars respawn when exit them. [+REP] - by SmoW - 28.12.2015, 14:57
Re: Job cars respawn when exit them. [+REP] - by ATGOggy - 28.12.2015, 15:03

Forum Jump:


Users browsing this thread: 1 Guest(s)