3 warnings whats wrong with this code?
#1

I get 3 warnings in this soon to be GM, Whats wrong with it?

Heres the pastebin:

Код:
C:\Documents and Settings\Anuj_2\Desktop\samp02Xserver.win32\pawno\include\utils.inc(1) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Anuj_2\Desktop\samp02Xserver.win32\gamemodes\fagget.pwn(424) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Anuj_2\Desktop\samp02Xserver.win32\gamemodes\fagget.pwn(464) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Reply
#2

rename all of the "string" In your gamemode to "string2", and the warnings should be gone XD
Reply
#3

You are lot of declared the "string".


Sorry, i'am speak in English but low.
Reply
#4

Global variable has the same name as local variable, rename it.
Reply
#5

You have defined string here, on line 59:
pawn Код:
new string[100];
As a global variable. That means it will be defined and work anywhere in the script.

But on line 464, your defining it again:
pawn Код:
new string[50];
And again, in strtok:
pawn Код:
strtok(const string[], &index)
Use this:
http://pastebin.com/m66ae1bdf
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)