SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 02/03/2010, 08:13 PM   #1
ReactionGameServers
Big Clucker
 
Join Date: Dec 2009
Posts: 67
Reputation: 0
Default (19879) : warning 219: local variable "mod" shadows a variable at a preceding le

I get a warning and i want to get rid of it.

Code:
C:\Users\Joe\Desktop\Logical RP\gamemodes\logical-rp.pwn(19879) : warning 219: local variable "mod" shadows a variable at a preceding level
Here are the lines :

pawn Code:
tmp = strtok(cmdtext, idx);
                new mod = 100; // THIS IS THE LINE
                if(!strlen(tmp))
                {
                    format(string, sizeof(string), "USAGE: /buygun [gunname] [ammoamount]");
                    SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
                    SendClientMessage(playerid, COLOR_WHITE,"*** Guns & Ammo ***");
                    SendClientMessage(playerid, COLOR_GRAD2,string);
                    format(gunstring1, 256, "Weapons: parachute ($%d) golfclub ($%d) nightstick ($%d) baseballbat ($%d) shovel ($%d) poolcue ($%d)",
                    GunPrice[0][0]/100*mod,GunPrice[1][0]/100*mod,GunPrice[2][0]/100*mod,GunPrice[3][0]/100*mod,GunPrice[4][0]/100*mod,GunPrice[5][0]/100*mod,GunPrice[6][0]/100*mod);
                    SendClientMessage(playerid, COLOR_GRAD3, gunstring1);
                    format(gunstring2, 256, "Weapons: purpledildo ($%d) whitedildo ($%d) longwhitedildo ($%d) whitedildo2 ($%d) flowers ($%d) cane",
                    GunPrice[7][0]/100*mod,GunPrice[8][0]/100*mod,GunPrice[9][0]/100*mod,GunPrice[10][0]/100*mod,GunPrice[11][0]/100*mod,GunPrice[12][0]/100*mod);
                    SendClientMessage(playerid, COLOR_GRAD3, gunstring2);
                    format(gunstring3, 256, "Weapons: sdpistol ($%d) deagle ($%d) mp5 ($%d)",
                    GunPrice[13][0]/100*mod,GunPrice[14][0]/100*mod,GunPrice[15][0]/100*mod,GunPrice[16][0]/100*mod,GunPrice[17][0]/100*mod,GunPrice[18][0]/100*mod);
                    SendClientMessage(playerid, COLOR_GRAD3, gunstring3);
                    format(gunstring4, 256, "Weapons: shotgun ($%d) ak47 ($%d) m4 ($%d) rifle ($%d)",
                    GunPrice[19][0]/100*mod,GunPrice[20][0]/100*mod,GunPrice[21][0]/100*mod,GunPrice[22][0]/100*mod,GunPrice[23][0]/100*mod,GunPrice[24][0]/100*mod);
                    SendClientMessage(playerid, COLOR_GRAD3, gunstring4);
                    format(gunstring5, 256, "Weapons: pistolammo ($%d) shotgunammo ($%d) smgammo ($%d) assaultammo ($%d) rifleammo ($%d)",
                    GunPrice[25][0],GunPrice[26][0],GunPrice[27][0],GunPrice[28][0],GunPrice[29][0]);
                    SendClientMessage(playerid, COLOR_GRAD3, gunstring5);
                    SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
                    return 1;
                }
ReactionGameServers is offline  
Old 02/03/2010, 08:15 PM   #2
MPKaboose
Gangsta
 
MPKaboose's Avatar
 
Join Date: Mar 2008
Location: Romania, Timisoara
Posts: 872
Reputation: 0
Default Re: (19879) : warning 219: local variable "mod" shadows a variable at a preceding le

you already have defined "mod" rename it to "mod2" or something else
MPKaboose is offline  
Old 02/03/2010, 08:19 PM   #3
ReactionGameServers
Big Clucker
 
Join Date: Dec 2009
Posts: 67
Reputation: 0
Default Re: (19879) : warning 219: local variable "mod" shadows a variable at a preceding le

i have looked through the whole script and cant find 'mod' defined anywhere apart from there,

and when i change it to 'mod2' I get loads of errors :

Code:
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19886 -- 19887) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19889 -- 19890) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19892 -- 19893) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19895 -- 19896) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19916) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19921) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19926) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19931) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19936) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19941) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19946) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19951) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19956) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19961) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19966) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19971) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19976) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19981) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19986) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19991) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19996) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(20001) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(20006) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19879) : warning 204: symbol is assigned a value that is never used: "mod2"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


23 Errors.
ReactionGameServers is offline  
Old 02/03/2010, 08:20 PM   #4
Razvann
Huge Clucker
 
Join Date: Jul 2009
Posts: 301
Reputation: 4
Default Re: (19879) : warning 219: local variable "mod" shadows a variable at a preceding le

Quote:
Originally Posted by logicaL.
i have looked through the whole script and cant find 'mod' defined anywhere apart from there,

and when i change it to 'mod2' I get loads of errors :

Code:
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19886 -- 19887) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19889 -- 19890) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19892 -- 19893) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19895 -- 19896) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19916) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19921) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19926) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19931) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19936) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19941) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19946) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19951) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19956) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19961) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19966) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19971) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19976) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19981) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19986) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19991) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19996) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(20001) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(20006) : error 076: syntax error in the expression, or invalid function call
C:\Users\Joe\Desktop\Extreme RP\gamemodes\logical-rp.pwn(19879) : warning 204: symbol is assigned a value that is never used: "mod2"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


23 Errors.
Replace mod from that command with mod2.
Razvann is offline  
Old 02/03/2010, 08:23 PM   #5
ReactionGameServers
Big Clucker
 
Join Date: Dec 2009
Posts: 67
Reputation: 0
Default Re: (19879) : warning 219: local variable "mod" shadows a variable at a preceding le

EDIT : it was defined in dutils.inc so i removed it from dutils and fixed now
ReactionGameServers is offline  
 

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
[Solved] Shadows variable at preceding level? bajskorv123 Help Archive 2 06/01/2010 10:14 AM
local variable "KillsName" shadows a variable at a preceding level (weird) ғαιιοцт Help Archive 40 14/10/2009 07:04 PM
[Help]error 033: array must be indexed (variable "teleport") borisblat Help Archive 1 13/10/2009 02:51 PM
warning 219: local variable "timecounter" shadows a variable at a preceding leve PKRanger Help Archive 3 08/08/2009 04: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 09:35 AM.


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