OnPlayerStateChange - A code screws it up ?
#6

Quote:
Originally Posted by Black Axe
Посмотреть сообщение
Jesse - Your code is showing those 2 warnings

PHP код:
D:\Folder\gamemodes\MyScript.pwn(27724) : warning 206redundant testconstant expression is non-zero
D
:\Folder\gamemodes\MyScript.pwn(27726) : warning 219local variable "string" shadows a variable at a preceding level 
I am guessing line 27724 is: " if(USE_TEXTDRAW_SET == 2)"
And if I am right I am also guessing that "USE_TEXTDRAW_SET" is a "#define" instead of an variable ( "new USE_TEXTDRAW_SET;" )
Because it's defined and not a variable ( A number which can change. ) it's a constant number ( It will always be the same. ) so the warning tells you that the "if" statement isn't needed and doesn't work as it will always be true or false.

For the second warning, that probably means that you have a global variable ( A variable created somewhere in the script out of the functions and publics etc etc. ) or that there's another "new string[number here];" in your OnPlayerKeyStateChange.

Jesse
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)