SA-MP Forums Archive
warning 211: possibly unintended assignment - 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: warning 211: possibly unintended assignment (/showthread.php?tid=565225)



warning 211: possibly unintended assignment - ChromeAmazing - 26.02.2015

Provided with the code shown:
PHP код:
                case 0:
                {
                     [
B]if(PlayerInfo[playerid][Mask] = 1) return SendClientMessage(playeridGREY"You already have purchased this item before.");[/B]
                     
SafeGivePlayerMoney(playerid,-500);
                     
SendClientMessage(playeridLIBLUE"Market: You have purchased a mask! You may now use /mask [on/off], but remember to follow mask rules!");
                     
PlayerInfo[playerid][Mask] = 1;
                     return 
1;
                } 
I have marked line ([B] coded) with this warning: warning 211: possibly unintended assignment


Re: warning 211: possibly unintended assignment - 1fret - 26.02.2015

Change this
if(PlayerInfo[playerid][Mask]=1)

To this
if(PlayerInfo[playerid][Mask] == 1)


Re: warning 211: possibly unintended assignment - ChromeAmazing - 26.02.2015

Thank you.