What have i done wrong in this if statement
#1

pawn Код:
if(gTeam[playerid] != POLICE || gTeam[playerid] != STAT) return SendClientMessage(playerid, COLOR_RED2, "[ERROR] :{FFFFFF} To use this command you need to be in Stat or police");
As the title says, what have i done wrong? it always says im not in the cop or stat team but yet i am..
Reply
#2

change || to && cus in this case if you are police and not stat it will enter in, and if you are stat and not police it will enter in || means OR and && means AND

EDIT: i believe you want to check if player is not police and is not stat
Reply
#3

Yeah, so just another case of the old || and && mixup.
pawn Код:
if(gTeam[playerid] != POLICE && gTeam[playerid] != STAT) return SendClientMessage(playerid, COLOR_RED2, "[ERROR] :{FFFFFF} To use this command you need to be in Stat or police");
This seems like it should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)