21.08.2016, 15:56
Quote:
|
In the beginning, we'll create a #define to define the max players. Put this on top of your script, but below the includes.
PHP Code:
|
PHP Code:
#undef MAX_PLAYERS
#define MAX_PLAYERS 100
All the includes above the re-definition will use the default MAX_PLAYERS, which is 500.
You should always re-define MAX_PLAYERS under #include <a_samp>
PHP Code:
#include <a_samp>
#undef MAX_PLAYERS
#define MAX_PLAYERS 100
#include <sscanf2>
// #include ...
It's supposed to be "ud"
You should check if the player is connected or else the user can set INVALID_PLAYER_ID's level which would cause errors.
Because INVALID_PLAYER_ID > MAX_PLAYERS-1.
So, add this after the sscanf check:
PHP Code:
if (giveplayerid == INVALID_PLAYER_ID) // We use that instead of IsPlayerConnected because sscanf2 automatically does that with "u"
return SendClientMessage(playerid, -1, "Player is not connected.");
A lot of new scripters that are looking for tutorials that teach how to make a registration system might get confused and think this is the same thing.


