Warnings Overload, Help required.
#1

Warnings Overload


Firstly, I'm getting these warnings on the following line.

Код:
warning 219: local variable "G" shadows a variable at a preceding level
warning 219: local variable "A" shadows a variable at a preceding level
pawn Код:
stock RGBA(R, G, B, A) return ( R * 16777216 ) + ( G * 65536 ) + ( B * 256 ) + A ;
Then, these warnings on the following piece of code.
Код:
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3145) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3146) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3147) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3148) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3149) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3150) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3151) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3152) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3153) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3154) : warning 213: tag mismatch
pawn Код:
new PlayerText:SGWelcome[MAX_PLAYERS];
3145-3154
pawn Код:
SGWelcome[playerid] = TextDrawCreate(166.273895, 363.182495, "~y~S~w~tunters_~y~G~w~od");
    TextDrawLetterSize(SGWelcome[playerid], 1.405627, 5.123327);
    TextDrawAlignment(SGWelcome[playerid], 1);
    TextDrawColor(SGWelcome[playerid], -1);
    TextDrawSetShadow(SGWelcome[playerid], 0);
    TextDrawSetOutline(SGWelcome[playerid], 1);
    TextDrawBackgroundColor(SGWelcome[playerid], 255);
    TextDrawFont(SGWelcome[playerid], 1);
    TextDrawSetProportional(SGWelcome[playerid], 1);
    TextDrawSetShadow(SGWelcome[playerid], 0);
then, this on that,
Код:
warning 219: local variable "str" shadows a variable at a preceding level
pawn Код:
if(!success)
    {
        new str[90];
        if(strlen(cmdtext) > 12)
        {
            strmid(str, cmdtext, 0, 12);
            strcat(str, "...");
        }
        else strcat(str, cmdtext);
        format(str,sizeof(str),"The command ~y~%s ~w~does not exist, To see all commands use ~y~/cmds", str);
        PlayerTextDrawSetString(playerid,wrongcmd[playerid],str);
        PlayerTextDrawShow(playerid,wrongcmd[playerid]);
        SetTimerEx("HideWrongTD", 8000, false, "i", playerid);
    }
and finally,
Код:
warning 204: symbol is assigned a value that is never used: "RegisteredPlayers"
pawn Код:
new pRegID[MAX_PLAYERS];
pawn Код:
RegisteredPlayers = pRegID[playerid];

And thanks in advance..
Reply
#2

I just wonder how you got that REPs and you can't fix those warnings, Anyway REPs doesn't matter.

Код:
warning 219: local variable "G" shadows a variable at a preceding level
warning 219: local variable "A" shadows a variable at a preceding level
This means you have already defined 'G' and 'A' in your script, Change them to something else or delete them.

Код:
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3145) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3146) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3147) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3148) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3149) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3150) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3151) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3152) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3153) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3154) : warning 213: tag mismatch
Change 'PlayerText:' to 'Text:'.

Код:
warning 219: local variable "str" shadows a variable at a preceding level
Same as above.

Код:
warning 204: symbol is assigned a value that is never used: "RegisteredPlayers"
Symbol is assigned a value that is NEVER USED, Make sense?
Reply
#3

Код:
warning 219: local variable "G" shadows a variable at a preceding level
warning 219: local variable "A" shadows a variable at a preceding level

stock RGBA(R, G, B, A) return ( R * 16777216 ) + ( G * 65536 ) + ( B * 256 ) + A ;
Probably they are already defined!Try to rename them


Код:
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3145) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3146) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3147) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3148) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3149) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3150) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3151) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3152) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3153) : warning 213: tag mismatch
C:\Users\Tayyab-PC\Desktop\Server\gamemodes\SG.pwn(3154) : warning 213: tag mismatch
Код:
new Text:SGWelcome[MAX_PLAYERS];

for(new playerid = 0; playerid  < MAX_PLAYERS; playerid ++) 
{

    SGWelcome[playerid] = TextDrawCreate(166.273895, 363.182495, "~y~S~w~tunters_~y~G~w~od");
    TextDrawLetterSize(SGWelcome[playerid], 1.405627, 5.123327);
    TextDrawAlignment(SGWelcome[playerid], 1);
    TextDrawColor(SGWelcome[playerid], -1);
    TextDrawSetShadow(SGWelcome[playerid], 0);
    TextDrawSetOutline(SGWelcome[playerid], 1);
    TextDrawBackgroundColor(SGWelcome[playerid], 255);
    TextDrawFont(SGWelcome[playerid], 1);
    TextDrawSetProportional(SGWelcome[playerid], 1);
    TextDrawSetShadow(SGWelcome[playerid], 0);

//close with }
Код:
if(!success)
    {
        new string2[90];
        if(strlen(cmdtext) > 12)
        {
            strmid(string2, cmdtext, 0, 12);
            strcat(string2, "...");
        }
        else strcat(string2, cmdtext);
        format(string2,sizeof(string2),"The command ~y~%s ~w~does not exist, To see all commands use ~y~/cmds", string2);
        PlayerTextDrawSetString(playerid,wrongcmd[playerid],string2);
        PlayerTextDrawShow(playerid,wrongcmd[playerid]);
        SetTimerEx("HideWrongTD", 8000, false, "i", playerid);
    }
Код:
warning 204: symbol is assigned a value that is never used: "RegisteredPlayers"

new pRegID[MAX_PLAYERS];

RegisteredPlayers = pRegID[playerid];
And the last one you made but its never used! Use it or simple delte it RegisteredPlayers = pRegID[playerid];
Reply
#4

Pro tip: prefix all globals with g and you will never have problems again. Also just don't use generic variable names like "str". A variable's name should be defined by its purpose, e.g. name, text, message, title, ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)