how to add Player near the name on the chat and player actions
#1

Hello can someone help me i wanna add the ID of the player near the name when he write in the chat and in his actions : example : Andre02(2): text
and
Andre02(2) has teleported to you
Andre02(2) has Joined the server
etc...
hope you can help me thank you
Reply
#2

Download this script!

Click here
Reply
#3

Quote:
Originally Posted by GrandParadise
Посмотреть сообщение
Download this script!

Click here
Why would he need to download a script for? At least use pastbin next time other using useless mirrors to download the file witch we do not know what it contains. His asked a simple question, although this should be in scripting help not under Server Support.

pawn Код:
new string[128], name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s (%d): %s", name, playerid, text);
It should look like Andre02(2): text if you used it correctly under the correct function. To get the users ID, use "playerid". I've shown a valid example shown above.
Reply
#4

Quote:
Originally Posted by Death1300
Посмотреть сообщение
pawn Код:
new string[128], name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s (%d): %s", name, playerid, text);
It should look like Andre02(2): text if you used it correctly under the correct function. To get the users ID, use "playerid". I've shown a valid example shown above.
i should add that pawn where under OnPlayerText ? because i copied and pasted the pawn that you added there and it didnt add the ID near the name.
Reply
#5

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[144], name[MAX_PLAYER_NAME+1];

    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s (%d): %s", name, playerid, text);

    return false;
}
Reply
#6

Quote:
Originally Posted by Mionee
Посмотреть сообщение
pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[144], name[MAX_PLAYER_NAME+1];

    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s (%d): %s", name, playerid, text);

    return false;
}
it doesn't let me chat.
Reply
#7

https://sampwiki.blast.hk/wiki/SendPlayerMessageToAll
Reply
#8

done that link worked thank you
Reply
#9

Try This !!
pawn Код:
public OnPlayerText(playerid, text[])
{
    new pName[MAX_PLAYERS], string[24;]
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "{%06x}%s | %d{FFFFFF}: %s", (GetPlayerColor(playerid) >>> 8), pName, playerid, text);
    SendClientMessageToAll(-1, string);
    SetPlayerChatBubble(playerid, text, 0xFFFFFFFF, 75.0, 5000);
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)