Color check not working - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Color check not working (
/showthread.php?tid=309686)
Color check not working -
Outcast - 08.01.2012
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.");
}
}
Re: Color check not working -
V_LOPE - 08.01.2012
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.
AW: Color check not working -
Drebin - 08.01.2012
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.");
}
?
Re: Color check not working -
Outcast - 09.01.2012
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.