SA-MP Forums Archive
OnPlayerText Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerText Help (/showthread.php?tid=513022)



OnPlayerText Help - TazmaNiax - 14.05.2014

I need a little help with OnPlayerText, this my code
Код:
format(strg, sizeof(strg), "{808080}(%d):{FFFFFF}%s", playerid, text);
    SendPlayerMessageToAll(playerid, strg);
    format(strg, sizeof(strg), "%s", text);
	SetPlayerChatBubble(playerid, strg, COLOR_WHITE, 50.0, 1000*10);
and this code will be like this

and i don't want like this ^

i want to be like this

can help ?


Re: OnPlayerText Help - Lynn - 14.05.2014

pawn Код:
format(strg, sizeof(strg), "{FFFFFF}[%d]:%s", playerid, text);
SendPlayerMessageToAll(playerid, strg);
format(strg, sizeof(strg), "%s", text);
SetPlayerChatBubble(playerid, strg, COLOR_WHITE, 50.0, 1000*10);



Re: OnPlayerText Help - TazmaNiax - 14.05.2014

dude!, i want to be like this
Код:
Tazmania(12): LoL
not like this
Код:
Tazmania: (12): LoL



Re: OnPlayerText Help - SAMProductions - 14.05.2014

from my Gamemode;
pawn Код:
new textString[500], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(textString, sizeof(textString), "{%06x}%s {808080}(ID: %d): {FFFFFF}%s", (GetPlayerColor(playerid) >>> 8), pName, playerid, text);
    SendClientMessageToAll(-1, textString);
    SetPlayerChatBubble(playerid, textString, COLOR_WHITE, 50.0, 1000*10);
EDIT :-

Try This too;
pawn Код:
new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(strg, sizeof(strg), "{%06x}%s {808080}(ID: %d): {FFFFFF}%s", (GetPlayerColor(playerid) >>> 8), pName, playerid, text);
    SendPlayerMessageToAll(playerid, strg);
    format(strg, sizeof(strg), "%s", text);
    SetPlayerChatBubble(playerid, strg, COLOR_WHITE, 50.0, 1000*10);
NOTE :-

OnPlayerText must have "return 0;" so it won't show the default one, but shows the custom one.

For Example :-
pawn Код:
public OnPlayerText(playerid, text[])
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(strg, sizeof(strg), "{%06x}%s {808080}(ID: %d): {FFFFFF}%s", (GetPlayerColor(playerid) >>> 8), pName, playerid, text);
    SendPlayerMessageToAll(playerid, strg);
    format(strg, sizeof(strg), "%s", text);
    SetPlayerChatBubble(playerid, strg, COLOR_WHITE, 50.0, 1000*10);
    return 0;
}
or
pawn Код:
public OnPlayerText(playerid, text[])
{
    new textString[500], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(textString, sizeof(textString), "{%06x}%s {808080}(ID: %d): {FFFFFF}%s", (GetPlayerColor(playerid) >>> 8), pName, playerid, text);
    SendClientMessageToAll(-1, textString);
    SetPlayerChatBubble(playerid, textString, COLOR_WHITE, 50.0, 1000*10);
    return 0;
}



Re: OnPlayerText Help - TazmaNiax - 14.05.2014

Quote:

public OnPlayerText(playerid, text[])
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(strg, sizeof(strg), "{%06x}%s {808080}(ID: %d): {FFFFFF}%s", (GetPlayerColor(playerid) >>> , pName, playerid, text);
SendPlayerMessageToAll(playerid, strg);
format(strg, sizeof(strg), "%s", text);
SetPlayerChatBubble(playerid, strg, COLOR_WHITE, 50.0, 1000*10);
return 0;
}

LOL they will be like this

Код:
Tazmania: Tazmania(12) LOL



Re: OnPlayerText Help - TazmaNiax - 14.05.2014

btw its Solved! Thanks