SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 25/04/2012, 02:33 PM   #1
calin1996
Banned
 
Join Date: Oct 2011
Location: http://www.lcsnet.ro/billing/aff.php?aff=490
Posts: 178
Reputation: 0
Exclamation Compile error(warning 219: local variable "string" shadows a variable at a preceding level)

Most of the errors are on brackets,some not.....:
pawn Code:
D:\lucru\GMM\pawno\include\utils.inc(1) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\Dini.inc(239) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1208) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1242) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1276) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1313) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1390) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1677) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1766) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1794) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1822) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1843) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1939) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(1960) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2084) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2103) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2118) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2145) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2160) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2183) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2206) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2292) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2338) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2357) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2364) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2462) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2471) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(2792) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(3112) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\GMM\pawno\include\JunkBuster.inc(3250) : warning 201: redefinition of constant/macro (symbol "OnPlayerEnterRaceCheckpoint")
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(2888) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(2929) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(3062) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(3373) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(4373) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(4387) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(4400) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(4410) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(4439) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(4461) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(4556) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(4571) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(4624) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(4749) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(5265) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(5710) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(5720) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(5730) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(5740) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(6388) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(6516) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(6585) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(6653) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(6873) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(6885) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7305) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7335) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7354) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7373) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7392) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7411) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7430) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7449) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7468) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7487) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7506) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7525) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7544) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7563) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7582) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(7601) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(8078) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(8751) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(9076) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(9591) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(9666) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(9861) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(10645) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(11277) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(11278) : warning 219: local variable "msgbox" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(11299) : error 003: declaration of a local variable must appear in a compound block
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(11302) : error 055: start of function body without function header
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(11314) : error 010: invalid function or declaration
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(12145) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(15130) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(15211) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(15311) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(15496) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17440) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17446) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17462) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17476) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17490) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17504) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17518) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17532) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17549) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17566) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17580) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17595) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17610) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(17740) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(54060) : warning 225: unreachable code
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(54179) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(54306) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(54624) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(54663) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(56797) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(56845) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(56877) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(57226) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(58323) : warning 219: local variable "string" shadows a variable at a preceding level
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(58530) : warning 203: symbol is never used: "msgbox"
D:\lucru\1_3_samp\1.3 samp\gamemodes\lucru.pwn(58530) : warning 203: symbol is never used: "string"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
pawn Code:
msgbox="____________________| %s |____________________";
        format(string,sizeof string,msgbox, name);
        msgbox="Nivel:[%d] Sex:[%s] Varsta:[%d] Telefon:[%d] Nivel-Donator:[%s] Oua de Paste:[%d] Cost-Nivel:[%d]    %d\n\nMoney:    %d\n\nHealth:    %.1f\n\nArmour:    %.1f\n\nDeaths:    %d\n\nKilled:    %d";
        format(string,sizeof string,msgbox, level,atext,age,pnumber,drank,cocosei,costlevel);
        msgbox="Ore Jucate:[%d] Record-Pescuit:[%d] Arestari:[%d] Job:[%s] Respect:[%d/%d] Caritate/Puncte:[%d/%d]";
        format(string,sizeof string,msgbox, ptime,bigfish,arrests,jtext,exp,expamount);
        msgbox="Cann/Coca:[%d/%d] Materiale:[%d] Echipa:[%s] Organizatie:[%s] Grad:[%s] Accent[%s]";
        format(string,sizeof string,msgbox, drugs,drugs2,mats,ttext,ftext,rtext,PlayerInfo[playerid][pAccent]);
        msgbox="Cann/Coca:[%d/%d] Materiale:[%d] Echipa:[%s] Organizatie:[%s] Grad:[%s] Accent[%s]";
        format(string,sizeof string,msgbox, drugs,drugs2,mats,ttext,ftext,rtext,PlayerInfo[playerid][pAccent]);
        if (PlayerInfo[playerid][pAdmin] >= 1)
        {
            msgbox="Casa:[%d] Afacere:[%d] Int:[%d] LumeVirtuala:[%d/%d] Locatie:[%d] Bani:[ %d RON + %d RON = %d RON]";
            format(string,sizeof string,msgbox, housekey,bizkey,intir,virworld,virworld2,local,banigramada,banibanca,totalsold);
        }
    }
}
calin1996 is offline   Reply With Quote
Old 25/04/2012, 02:36 PM   #2
SuperViper
High-roller
 
SuperViper's Avatar
 
Join Date: Sep 2011
Posts: 1,177
Reputation: 315
Default Re: Compile error(warning 219: local variable "string" shadows a variable at a preceding level)

You probably have a global variable called string. You should make them local instead.
SuperViper is offline   Reply With Quote
Old 25/04/2012, 02:37 PM   #3
calin1996
Banned
 
Join Date: Oct 2011
Location: http://www.lcsnet.ro/billing/aff.php?aff=490
Posts: 178
Reputation: 0
Default AW: Compile error(warning 219: local variable "string" shadows a variable at a preceding level)

How?
calin1996 is offline   Reply With Quote
Old 25/04/2012, 02:43 PM   #4
.FuneraL.
High-roller
 
.FuneraL.'s Avatar
 
Join Date: Feb 2012
Location: Pawno.exe
Posts: 2,081
Reputation: 146
Default Re: Compile error(warning 219: local variable "string" shadows a variable at a preceding level)

In this case, replace the variable name that is giving this warning, for example, put string2, str2, Etc...
.FuneraL. is offline   Reply With Quote
Old 25/04/2012, 02:43 PM   #5
SuperViper
High-roller
 
SuperViper's Avatar
 
Join Date: Sep 2011
Posts: 1,177
Reputation: 315
Default Re: Compile error(warning 219: local variable "string" shadows a variable at a preceding level)

If you defined the variable string outside of a function, remove it.
SuperViper is offline   Reply With Quote
Old 25/04/2012, 03:03 PM   #6
calin1996
Banned
 
Join Date: Oct 2011
Location: http://www.lcsnet.ro/billing/aff.php?aff=490
Posts: 178
Reputation: 0
Default AW: Compile error(warning 219: local variable "string" shadows a variable at a preceding level)

i've resolved it,but i have another problem,when i tipe /stats and hit enter,nothing happens,instead appear the msgbox
calin1996 is offline   Reply With Quote
Old 25/04/2012, 03:13 PM   #7
calin1996
Banned
 
Join Date: Oct 2011
Location: http://www.lcsnet.ro/billing/aff.php?aff=490
Posts: 178
Reputation: 0
Default AW: Compile error(warning 219: local variable "string" shadows a variable at a preceding level)

This is the command:
pawn Code:
if (strcmp(cmd, "/stats", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (gPlayerLogged[playerid] != 0)
            {
                ShowStats(playerid,playerid);
                OnPlayerUpdateSafe(playerid);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You are not logged in!");
            }
        }
        return 1;
    }
How i can make it show a msg box when i use it,the second PAWNOCODE on the first page is using msgbox items but it has no effect...
calin1996 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
warning 219: local variable "PlayerName" shadows a variable at a preceding level captainjohn Scripting Help 2 13/04/2012 07:44 PM
local variable "pName" shadows a variable at a preceding level Jack_Rocker Scripting Help 1 05/04/2012 06:00 PM
warning 219: local variable "PlayerName" shadows a variable at a preceding level [DC] Scripting Help 2 02/01/2012 06:29 PM
local variable "KillsName" shadows a variable at a preceding level (weird) ғαιιοцт Help Archive 40 14/10/2009 07:04 PM
local variable "tmp2" shadows a variable at a preceding level Battlaman Help Archive 2 04/08/2009 06:10 PM


All times are GMT. The time now is 03:12 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.