Help warning on string2
#1

this is the line
PHP код:
stock SendHelpersMessage(color,const string2[]) 
Why have warning ??
PHP код:
 warning 219local variable "string2" shadows a variable at a preceding level 
Reply
#2

Because that variable is defined at a higher level. The warning is pretty clear. You have something like;
pawn Код:
new string2[128];

// later
stock SendHelpersMessage(color,const string2[])
Reply
#3

I try this ..
I try 50 60 70 10
all !
and warning ..
Reply
#4

HELP please?
Reply
#5

Go onto your script and press ctrl+F. Then type "String2". You will find something similar to:

Код:
new string2[128];
DELETE IT and try again.

Vince made it quiet clear as well as the warning itself!
Reply
#6

WHAT !?
I delete new string2[180];
and now :
undefined symbol "string2"
Reply
#7

Okay..

1) just put back the "new string2" which you deleted..
2) change the name of "string2" on:

pawn Код:
stock SendHelpersMessage(color,const string2[])
maybe change it to?

pawn Код:
stock SendHelpersMessage(color,const string234[])
3) Change all the "string2" names in the stock to "string234" (or w/e you put as the variable name)
Reply
#8

Warning ..
WHy?!?!?
Reply
#9

Well, u can't add global variables into functions headers. Dont do anything, just do this

pawn Код:
stock SendHelpersMessage(color,string[])
{
       //..make what should it do
}
Reply
#10

Quote:
Originally Posted by lonako45
Посмотреть сообщение
WHAT !?
I delete new string2[180];
and now :
undefined symbol "string2"
Delete string2, get the line of that undefined symbol...ctrl+g enter the line number, above it somewhere inside the same function, add new string2[180]. Then go back to where you're doing your message thing and add the new string.

So, delete the global variable
add it locally on the functions that need it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)