Warning 219:
#1

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
Reply
#2

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

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

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

show me that . .
Reply
#6

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)
Reply
#7

Thank's misiur , it work's
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)