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: help (
/showthread.php?tid=334905)
help -
[M.A]Angel[M.A] - 16.04.2012
how to script chat id?
example:
Test(ID:0): Hi
Not:
Test
ID:0) Hi
Re: help -
]Rafaellos[ - 16.04.2012
To do this, you need to add new random colours because with default samp random colour dont work.
Than add:
pawn Код:
public OnPlayerText( playerid, text[] )
{
new string[128], VBName[MAX_PLAYER_NAME];
GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
format(string, sizeof(string),"{%h}%s[ID:%d]:{FFFFFF} %s" ,GetPlayerColor(playerid) >>> 8, VBName,playerid,text);
SendClientMessageToAll(-1,string);
SetPlayerChatBubble(playerid, text, COLOR_WHITE, 100.0, 10000);
return 0;
}
If someone know how to do this with samp random colours, it will better!
Re: help -
RollTi - 16.04.2012
pawn Код:
public OnPlayerText(playerid, text[])
{
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "%s(ID:%d): {FFFFFF}%s", name, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), str);
return 0;
}
Re: help -
[M.A]Angel[M.A] - 16.04.2012
What is " GetPlayerColor(playerid) >>> 8, VBName,playerid,text);"?
Re: help -
]Rafaellos[ - 16.04.2012
Quote:
Originally Posted by RollTi
pawn Код:
public OnPlayerText(playerid, text[]) { new str[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(str, sizeof(str), "%s(ID:%d): {FFFFFF}%s", name, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), str); return 0; }
|
I try it yours before 1 month, but the Name colour is black.
Re: help -
[M.A]Angel[M.A] - 16.04.2012
Quote:
Originally Posted by RollTi
pawn Код:
public OnPlayerText(playerid, text[]) { new str[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(str, sizeof(str), "%s(ID:%d): {FFFFFF}%s", name, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), str); return 0; }
|
Thanks!!
Re: help -
]Rafaellos[ - 16.04.2012
Quote:
Originally Posted by [M.A]Angel[M.A]
What is " GetPlayerColor(playerid) >>> 8, VBName,playerid,text);"?
|
GetPlayerColor(playerid) >>> 8: This will get Name tag colour.
VBName: The player's name
playerid: The player's id
text: The test that player text.
Re: help -
[M.A]Angel[M.A] - 16.04.2012
Quote:
Originally Posted by ]Rafaellos[
I try it yours before 1 month, but the Name colour is black.
|
Thank you too , 2 code's usefull!
Re: help -
[M.A]Angel[M.A] - 16.04.2012
Quote:
Originally Posted by ]Rafaellos[
I try it yours before 1 month, but the Name colour is black.
|
Right! , problem
i tried your one i dont know if works
Re: help -
]Rafaellos[ - 16.04.2012
If you want i will give you the random colours code, so you can use it too.