PDA

View Full Version : How to actoully get a players name?


Azzeto
14/10/2011, 07:20 AM
I am currently using a stock from VXRP, GetName but I want to know how I can just get an actoull name on a command, if you understand..

Heres the stock stock GetName(playerid)
{
new Name[MAX_PLAYER_NAME];

if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, Name, sizeof(Name));
}
else
{
Name = "Disconnected/Nothing";
}

return Name;
} But I want to know how to do that in a command..

Wesley221
14/10/2011, 07:35 AM
format( string, sizeof string, "Your name is: %s", GetName(playerid) )

Like that it works.

Tomejus
14/10/2011, 07:47 AM
new pName[ MAX_PLAYER_NAME ], string[ 128 ]; // variables.
GetPlayerName( playerid, pName, MAX_PLAYER_NAME ); // get name.
format( string, sizeof( string ), "Your name is: %s", pName ); // formating.
SendClientMessage( playerid, COLOR, string ); // Sending.

Wesley221
14/10/2011, 07:49 AM
new pName[ MAX_PLAYER_NAME ], string[ 128 ]; // variables.
GetPlayerName( playerid, pName, MAX_PLAYER_NAME ); // get name.
format( string, sizeof( string ), "Your name is: %s", pName ); // formating.
SendClientMessage( playerid, COLOR, string ); // Sending.


He wanted to get the name of a player, by using the stock he posted. Not the way like u did. Though, it would work.

Azzeto
14/10/2011, 08:21 AM
Na sorry if I didnt explain better :P I wanted to write it the way he did, so I would know how incase if I didnt have access to that stock, rep for you both though!