SA-MP Forums Archive
Help: 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: Help: Possibly unintended assignment (/showthread.php?tid=406284)



Help: Possibly unintended assignment - jakejohnsonusa - 09.01.2013

I keep getting this annoying warning with the bellow code: warning 211: possibly unintended assignment

Please DON'T tell me "It's just a warning" ... I KNOW. But it's annoying. How can I fix it, whats wrong with the code?

Thanks: jakejohnsonusa

Code that gives error:

pawn Код:
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
                        {
                            format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
                            SendClientMessage(playerid, COLOR_WHITE, "Type /equip for equipment  -  Type /undercover to see UC Skins!");
                            if (PlayerInfo[playerid][pSex] = 1)
                            {
                                new rand = random(6)//change it to the number of skins you want
                                switch(rand)
                                {
                                case 0: PlayerInfo[playerid][pChar] = 265;
                                case 1: PlayerInfo[playerid][pChar] = 266;
                                case 2: PlayerInfo[playerid][pChar] = 267;
                                case 3: PlayerInfo[playerid][pChar] = 280;
                                case 4: PlayerInfo[playerid][pChar] = 281;
                                case 5: PlayerInfo[playerid][pChar] = 282;
                                }
                            }
                            else
                            {
                                new rand = random(3)//change it to the number of skins you want
                                switch(rand)
                                {
                                case 0: PlayerInfo[playerid][pChar] = 93;
                                case 1: PlayerInfo[playerid][pChar] = 211;
                                case 2: PlayerInfo[playerid][pChar] = 233;
                                }
                                SetPlayerAttachedObject(playerid, 4, 19142,1,0.1,0.036,0.009,0,0,0,1.02,1.02,1.02);
                                policevest[playerid] = 1;
                            }
                            new factionskin = PlayerInfo[playerid][pChar];
                            SetPlayerSkin(playerid, factionskin);
                            SafeGivePlayerWeapon(playerid, 24, 300);
                            SafeGivePlayerWeapon(playerid, 41, 300);
                            SafeGivePlayerWeapon(playerid, 25, 100);
                        }
On the line that has:
pawn Код:
if (PlayerInfo[playerid][pSex] = 1)



Re : Help: Possibly unintended assignment - yusei - 09.01.2013

if (PlayerInfo[playerid][pSex] == 1)

Enjoy


Re: Help: Possibly unintended assignment - jakejohnsonusa - 09.01.2013

Oh duh :P

Thanks man!
+1 Rep for the quick help!