23.12.2013, 11:50
@EnzoMetlc - If you do not understand what Konstantinos said, I'll elaborate it, so he means, you could use one (1) variable to get the Players name using OnPlayerConnect then you can just use the variable where ever you want, without using the function GetPlayerName five(5) times or more than that, the example code will be shown below.
Result
Hope you understand it
PS: Matthew_Sixx is my roleplay name :P
pawn Code:
#include <a_samp>
#include <YSI\y_va>
main()
{
}
new
PlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, PlayerName[playerid], 24);
return true;
}
public OnPlayerSpawn(playerid)
{
return SendClientMessageToAllEx(-1, "[DEBUG]: GetPlayerName - %s[%i]", PlayerName[playerid], playerid);
}
stock SendClientMessageToAllEx(colour, const fmat[], va_args<>)
{
new
str[145];
va_format(str, sizeof (str), fmat, va_start<2>);
return SendClientMessageToAll(colour, str);
}
Code:
[12:55:20] [DEBUG]: GetPlayerName - Matthew_Sixx[0]
PS: Matthew_Sixx is my roleplay name :P