How To get The name of The Player?
#1

Example
My name Is Windrush
i Want To Add This
" 's House "
And it Will Be
" Windrush's House"
Reply
#2

Save the owner of the house and when you load the houses, load owner's name and show it with a formatted message.

PS: I think this is what you meant, not the function for player's name.
Reply
#3

i See but i dont how how to do it
Reply
#4

If you're refering to ******' post: GetPlayerName
Otherwise, what do you use for saving the house data?
Reply
#5

pawn Код:
GetPlayerName(playerid,+"'s House")
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
Reply
#6

You mean this?
pawn Код:
"%s's house"
Well, here's an example:
Usually for getting the player name, we use the function 'GetPlayerName'. You must create a name variable first and execute it to get player name function to use it well.
pawn Код:
public OnPlayerConnect(playerid) //When a player connects, this callback is called.
{
 new name[MAX_PLAYER_NAME]; //We created a name variable 'name'.
 GetPlayerName(playerid, name, sizeof(name)); //We're getting player's name and also executing the name variable.
 new string[128]; //The normal send client message just don't support floats directly, so we must format to show a message with player name.
 format(string, sizeof(string), "%s has joined the server.", name); //We are formatting it. '%s'  stands for a text format and here we've executed our name variable at last. So '%s' will be considered as player's name.
 SendClientMessageToAll(0xFF0000, string); //Sends all the message - formatted string message.
 return 1;
}
https://sampwiki.blast.hk/wiki/GetPlayerName
https://sampwiki.blast.hk/wiki/format
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)