Variables mixing.
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
Declare all your global variables as static in every file - unless you explicitly need to access that variable in another file - and your problems will be solved.
Thanks for helping, but same..

For example, in players.pwn I've changed

pawn Код:
new
    szName[MAX_PLAYERS][MAX_PLAYER_NAME],
    szIP[MAX_PLAYERS][16];
to

pawn Код:
static
    szName[MAX_PLAYERS][MAX_PLAYER_NAME],
    szIP[MAX_PLAYERS][16];
.

I've saved the file, and when I am compiling the main .pwn file, it gives

pawn Код:
System/classes.pwn(131) : error 017: undefined symbol "szName"
System/classes.pwn(131) : error 029: invalid expression, assumed zero
System/classes.pwn(131) : error 029: invalid expression, assumed zero
System/classes.pwn(131) : fatal error 107: too many error messages on one line
Line 131:
pawn Код:
format(szMembers, 810, "%s{33AA33}%d. {FF0000}%s\n", szMembers, ClassMembers, GetPlayerNameEx(i));
Defines:

pawn Код:
#define GetPlayerNameEx(%0)  (szName[%0])
#define GetPlayerIpEx(%0)    (szIP[%0])
Reply


Messages In This Thread
Variables mixing. - by BaubaS - 18.02.2012, 17:16
Re: Variables mixing. - by BaubaS - 18.02.2012, 19:47
Re: Variables mixing. - by Ash. - 18.02.2012, 19:50
Re: Variables mixing. - by iPLEOMAX - 18.02.2012, 19:51
Re: Variables mixing. - by BaubaS - 18.02.2012, 19:56
Re: Variables mixing. - by Ash. - 18.02.2012, 20:05
Re: Variables mixing. - by Vince - 18.02.2012, 20:07
Re: Variables mixing. - by BaubaS - 18.02.2012, 20:27
Re: Variables mixing. - by Ash. - 18.02.2012, 20:30
Re: Variables mixing. - by BaubaS - 18.02.2012, 20:32

Forum Jump:


Users browsing this thread: 1 Guest(s)