SA-MP Forums Archive
Warning 219: - 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 219: (/showthread.php?tid=364900)



Warning 219: - farCry.xD - 01.08.2012

Hey , I get this error :
pawn Код:
C:\Documents and Settings\nearCry\Desktop\ASTA\filterscripts\ladmin.pwn(3158) : warning 219: local variable "playerid" shadows a variable at a preceding level
At the line :
pawn Код:
new slot, ammo, weap, Count, WeapName[24], WeapSTR[128], p; WeapSTR = "Weaps: ";
Why ?:O


Re: Warning 219: - [KHK]Khalid - 01.08.2012

This line looks fine. May you show some lines above/below this line?


Re: Warning 219: - SEnergy - 01.08.2012

you are declaring local variable "playerid" which is declared by default by samp server


Re: Warning 219: - farCry.xD - 01.08.2012

I just maked something like #define p playerid
Is from this ?


Re: Warning 219: - Devilxz97 - 01.08.2012

show me that . .


Re: Warning 219: - Misiur - 01.08.2012

The #define is preprocessor rule which changes all occurances matching the pattern with your defined substitution. In you case (with #define p playerid) line
pawn Код:
new slot, ammo, weap, Count, WeapName[24], WeapSTR[128], p; WeapSTR = "Weaps: ";
Changes before compilation into
pawn Код:
new slot, ammo, weap, Count, WeapName[24], WeapSTR[128], playerid; WeapSTR = "Weaps: ";
Simple solution is to change local variable name from p to p2, and other solution is to change the define (but I assume you use it heavily in your code, so this is your call)


Re: Warning 219: - farCry.xD - 01.08.2012

Thank's misiur , it work's