SA-MP Forums Archive
Warning (+rep) - 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 (+rep) (/showthread.php?tid=350194)



Warning (+rep) - RaulSTARs - 11.06.2012

Hello , Today I did a command for Donator Rank, but I have a problem
gmraul.pwn(18193) : warning 204: symbol is assigned a value that is never used: "carid"
The Line "18193" it's else if(GetPLayer... with pPcarkey2

Code :
pawn Код:
else if(strcmp(x_nr,"neon",true) == 0)
            {
                new carid;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
               
                else { return 1; }
                if(PlayerInfo[playerid][pDonateRank] < 2)
                {
                SendClientMessage(playerid, 0x4FA7FFFF, "*** Trebuie sa ai cont donator !");
                return 1;
                }
                  ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "Pick Neon Color", "Blue\nRed\nGreen\nWhite\nPink\nYellow\nPolice Strobe\nInterior Lights\nBack Neon\nFront neon\nUndercover Roof Light\nRemove All Neon", "Select", "Cancel");
                 PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
                    return 1;
    }
How can I fix it?


Re: Warning (+rep) - JaTochNietDan - 11.06.2012

Well the issue is simple, you are initializing a variable called "carid", you store information in it but you never make use of that information. Therefore the variable is completely useless and a waste of allocated memory


Re: Warning (+rep) - RaulSTARs - 11.06.2012

And How Can I fix it? Im newbie..


Re: Warning (+rep) - JaTochNietDan - 11.06.2012

Well what do you do with something that is useless? Remove it!

Your carid variable is useless, so remove it

Or, alternatively, make use of it!