difference between this
#1

Hello what is the difference of this

pawn Код:
enum info
{
   Cash,
   Admin
};
new Player[MAX_PLAYERS][info];
and this

pawn Код:
enum info
{
    Cash,
    Admin
};
static Player[MAX_PLAYERS][info];
and what should i use?
Reply
#2

You should use the first one, I'm not sure about the second one.

Just use the first one, you'll be fine.

pawn Код:
enum info << this is the enums
{
   Cash, < this is the info
   Admin < same, info
};
new Player[MAX_PLAYERS][info]; < this to define ''Player'' is the enums of ''info'',
Exmaple usage:
if (Player[playerid][Cash] ==> 500)
Reply
#3

If u use static you can't use this variable on other scripts. Means if u use 'new' in any include you can use this variable in your gamemode but if you use static you can not use it in your gamemode.
Reply
#4

static has two uses.

If it is used on a global variable, it limits the scope of the variable to the current file.

If used on a local variable, it basically makes the local variable a global variable whose scope is what the scope of the local variable would be (i.e. it retains the value).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)