Help: Possibly unintended assignment
#1

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)
Reply
#2

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

Enjoy
Reply
#3

Oh duh :P

Thanks man!
+1 Rep for the quick help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)