#1

Hello I want to ask how to make the player when talk in server type Above her name %s says: %s (text)
So On player text they will write up his name/skin Example says: %s.

NOTE: I dont mean This
Quote:

public OnPlayerText(playerid, text[])
{
new string[256];
format(string, sizeof(string), "%s",text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

-Sorry for my BAD ENG-
Reply
#2

Did you used https://sampwiki.blast.hk/wiki/SetPlayerChatBubble already?
Reply
#3

Code:
public OnPlayerText(playerid, text[])
{
 new string[256];
 new pName[32];
 GetPlayerName(playerid, pName, sizeof(pName));
 format(string, sizeof(string), "%s says: %s", pName, text);
 SendPlayerMessageToAll(-1, string);
 SetPlayerChatBubble(playerid, string, 0xFF0000FF, 100.0, 10000);
 return 0;
}
Edit Your own distance and expire time.
Reply
#4

@Generation-X:

Why do you use size 256 and 32 arrays? The maximum length of the text variable in OnPlayerText is 128 and the maximum length of the player name is 24 (MAX_PLAYER_NAME).
pawn Code:
new
   string[ 128 + MAX_PLAYER_NAME + 8 ], /* text + name + 'says' + spaces */
   pName[ MAX_PLAYER_NAME ];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)