Color check not working
#1

Instead of returning the error message if it's not a police vehicle, the script just continues like the player isn't a cop.

pawn Код:
if(GetPlayerColor(playerid) == COLOR_POLICE){
if(GetVehicleModel(vid) != 596 || GetVehicleModel(vid) != 597 || GetVehicleModel(vid) != 598 ||       GetVehicleModel(vid) != 599 || GetVehicleModel(vid) != 601 || GetVehicleModel(vid) != 427){
return SendClientMessage(playerid, COLOR_RED, "[ERROR:] You can do this only with the police vehicles while on-duty.");
}
}
Reply
#2

pawn Код:
if(GetPlayerColor(playerid) == COLOR_POLICE){
  if(GetVehicleModel(vid) == 596 || GetVehicleModel(vid) == 597 || GetVehicleModel(vid) == 598 || GetVehicleModel(vid) == 599 || GetVehicleModel(vid) == 601 || GetVehicleModel(vid) == 427)
{
return SendClientMessage(playerid, COLOR_RED, "[ERROR:] You can do this only with the police vehicles while on-duty.");
}
}
try this.
Reply
#3

pawn Код:
if(GetPlayerColor(playerid) == COLOR_POLICE)
{
    if(GetVehicleModel(vid) != 596 || GetVehicleModel(vid) != 597 || GetVehicleModel(vid) != 598 ||       GetVehicleModel(vid) != 599 || GetVehicleModel(vid) != 601 || GetVehicleModel(vid) != 427) return SendClientMessage(playerid, COLOR_RED, "[ERROR:] You can do this only with the police vehicles while on-duty.");
}
?
Reply
#4

I tried the code of both of you, but it's not working. It still returns the error message, even if the vehicle is a police one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)