Guten Abend,
Ich würde gerne folgenge Abfrage verkürtzen ohne das die Abfrage so viele Zeilen von dem Script beansprucht...
Habt ihr da eine Idee?
Code
public OnPlayerStateChange(playerid, newstate, oldstate){ if(newstate==PLAYER_STATE_DRIVER) { for(new i=0; i<sizeof(polizeicar); i++) { if(GetPlayerVehicleID(playerid)==polizeicar[i]) { if(GetPVarInt(playerid,"Fraktion")==1 || GetPVarInt(playerid,"Adminlevel")==1) { if(GetPVarInt(playerid,"Adminlevel")==1) { return 1; } if(i == 0 && GetPVarInt(playerid,"Rang") < 2) { RemovePlayerFromVehicle(playerid); } else if(i == 1 && GetPVarInt(playerid,"Rang") < 2) { RemovePlayerFromVehicle(playerid); } else if(i == 2 && GetPVarInt(playerid,"Rang") < 3) { RemovePlayerFromVehicle(playerid); } else if(i == 3 && GetPVarInt(playerid,"Rang") < 5) { RemovePlayerFromVehicle(playerid); } } else { RemovePlayerFromVehicle(playerid); } } } } return 1;}