22.01.2011, 15:40
I don't understand one aspect of PAWN. If I make a variable, is that variable specific for each player or everyone can use it? Hmm, I'll show on an example:
If PLAYER_1 types /getname and his name is saved in a variable "PlayerName" (name is saved in it when he connected) he will get a SendClientMessage "Your name is PLAYER_1".
now, if a PLAYER_2 types /getname, will he get his name or he will get in SendClientMessage the PLAYER_1's name?
If a global variable looks like this (above main() ):
new PlayerName[MAX_PLAYER_NAME] ;
or do I have to do:
new PlayerName[MAX_PLAYERS][MAX_PLAYER_NAME]
![Huh?](images/smilies/confused.gif)
Please help me out, I'm confused
If PLAYER_1 types /getname and his name is saved in a variable "PlayerName" (name is saved in it when he connected) he will get a SendClientMessage "Your name is PLAYER_1".
now, if a PLAYER_2 types /getname, will he get his name or he will get in SendClientMessage the PLAYER_1's name?
If a global variable looks like this (above main() ):
new PlayerName[MAX_PLAYER_NAME] ;
or do I have to do:
new PlayerName[MAX_PLAYERS][MAX_PLAYER_NAME]
![Huh?](images/smilies/confused.gif)
Please help me out, I'm confused