SA-MP Forums Archive
Player variable [MAX_PLAYERS char] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Player variable [MAX_PLAYERS char] (/showthread.php?tid=422664)



Player variable [MAX_PLAYERS char] - PaulDinam - 14.03.2013

Is it to use:

new pLogged[MAX_PLAYERS char];
or
new pLogged[MAX_PLAYERS];

I heard it's better pLogged.

and I have to use this brackets? { instead of [



Re: Player variable [MAX_PLAYERS char] - Djole1337 - 14.03.2013

You'll save memory by using char variables.

it works like
pawn Код:
new bool: pLogged[MAX_PLAYERS char];

// You reset values onplayerconnect
pLogged{playerid} = false;
// Blahblah...
// Now you can check if player is logged

if (!pLogged{playerid})
{
    return SendClientMessage(playerid, -1, "You're not logged"), 0;
}
// etc...



Re: Player variable [MAX_PLAYERS char] - PaulDinam - 14.03.2013

Alright thank you.