OnPlayerText
#1

Hello, i wanna that it look like this: Playername (5): text
But this dont work here it writes it like this: Playername: (5) text
Who can help?

Код:
format(stringbig,sizeof(stringbig),"(%d) %s", playerid, text);
                SendPlayerMessageToAll(playerid,stringbig);
Reply
#2

pawn Код:
public OnPlayerText( playerid, text[] )
{
     new string[ 128 ], player_name[MAX_PLAYER_NAME];
     GetPlayerName(playerid, player_name, MAX_PLAYER_NAME);
     format(string, sizeof string, "%s (%d): %s", player_name, playerid, text);
     return SendClientMessageToAll( GetPlayerColor( playerid ), string );
}
This should work. You can change the "%s (%d): %s" to whatever you feel like! Also, change GetPlayerColor( playerid ) to -1 if you want the message to always be sent in white. Cheers!
Reply
#3

Player Message (not client) starts with: "PlayerNameHere: " and it gets the color of the player. The rest are white.

So use client message instead.

pawn Код:
new
    sz_Name[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, sz_Name, MAX_PLAYER_NAME );
format( stringbig, sizeof( stringbig ), "%s {FFFFFF}(%d): %s", sz_Name, playerid, text);
SendClientMessageToAll( GetPlayerColor( playerid ), stringbig );
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)