28.12.2015, 14:55
Do this
PHP код:
new MechanicJobCars[2];
MechanicJobCars[0] = CreateVehicle( .... );
MechanicJobCars[1] = CreateVehicle( .... );
public OnPlayerStateChange(playerid, newstate, oldstate) {
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) { //if they entered the certain vehicle as driver
for(new i; i < sizeof(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;
}