26.08.2015, 11:22
To get the player's name, which method would be better to use? Like creating a global variable and getting the player's name on connect then use that var to fetch the name wherever you want.
I mean, for example
Then using that var to get the player's name like;
Or creating a local variable to get the player's name inside the kick command is better?
I mean, for example
PHP код:
static
g_PlayerName[MAX_PLAYER_NAME][MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, g_PlayerName[playerid], MAX_PLAYER_NAME);
return 1;
}
PHP код:
CMD:kick(playerid, params[])
{
// Some codes
format(string, sizeof(string), "Admin %s has kicked %s", g_PlayerName[playerid], gPlayerName[id]);
// More codes
return 1;
}