Colors - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Colors (
/showthread.php?tid=120531)
Colors -
WThieves - 11.01.2010
Hi, How can i mak teamcolors in the chat, i have:
Quote:
format(string, sizeof(string), "%s (%d) : %s", sendername, playerid, text);
|
What do i have to add so (sendername, playerid) = ("%s (%d)) changes to a color?
Thank you.
Re: Colors -
Calgon - 11.01.2010
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s (%d): %s", name, playerid, text);
switch(GetPlayerTeam(playerid))
{
case 0: SendClientMessageToAll(GREEN, string);
case 1: SendClientMessageToAll(YELLOW, string);
case 2: SendClientMessageToAll(RED, string);
default: SendClientMessageToAll(WHITE, string);
}
return 0;
}
I haven't defined the colours, you'll have to change them, they were there as an example.
Re: Colors -
WThieves - 11.01.2010
Quote:
Originally Posted by CalgonX
pawn Код:
public OnPlayerText(playerid, text[]) { new string[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s (%d): %s", name, playerid, text); switch(GetPlayerTeam(playerid)) { case 0: SendClientMessageToAll(GREEN, string); case 1: SendClientMessageToAll(YELLOW, string); case 2: SendClientMessageToAll(RED, string); default: SendClientMessageToAll(WHITE, string); } return 0; }
I haven't defined the colours, you'll have to change them, they were there as an example.
|
Yes but this changes the whole string to a colour, but it should be only the id and the name , so the text is white!
Re: Colors -
Calgon - 11.01.2010
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
pawn Код:
public OnPlayerText(playerid, text[]) { new string[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s (%d): %s", name, playerid, text); switch(GetPlayerTeam(playerid)) { case 0: SendClientMessageToAll(GREEN, string); case 1: SendClientMessageToAll(YELLOW, string); case 2: SendClientMessageToAll(RED, string); default: SendClientMessageToAll(WHITE, string); } return 0; }
I haven't defined the colours, you'll have to change them, they were there as an example.
|
Yes but this changes the whole string to a colour, but it should be only the id and the name , so the text is white!
|
Not possible by team.
https://sampwiki.blast.hk/wiki/OnPlayerText
Re: Colors -
WThieves - 11.01.2010
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
pawn Код:
public OnPlayerText(playerid, text[]) { new string[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s (%d): %s", name, playerid, text); switch(GetPlayerTeam(playerid)) { case 0: SendClientMessageToAll(GREEN, string); case 1: SendClientMessageToAll(YELLOW, string); case 2: SendClientMessageToAll(RED, string); default: SendClientMessageToAll(WHITE, string); } return 0; }
I haven't defined the colours, you'll have to change them, they were there as an example.
|
Yes but this changes the whole string to a colour, but it should be only the id and the name , so the text is white!
|
Not possible by team.
https://sampwiki.blast.hk/wiki/OnPlayerText
|
What do you mean with this, and what am i supposed to do with that wikisamp? i've already got text the only thing i want to know is how to make a part of the text (name) another color.
Re: Colors -
Calgon - 11.01.2010
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
pawn Код:
public OnPlayerText(playerid, text[]) { new string[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s (%d): %s", name, playerid, text); switch(GetPlayerTeam(playerid)) { case 0: SendClientMessageToAll(GREEN, string); case 1: SendClientMessageToAll(YELLOW, string); case 2: SendClientMessageToAll(RED, string); default: SendClientMessageToAll(WHITE, string); } return 0; }
I haven't defined the colours, you'll have to change them, they were there as an example.
|
Yes but this changes the whole string to a colour, but it should be only the id and the name , so the text is white!
|
Not possible by team.
https://sampwiki.blast.hk/wiki/OnPlayerText
|
What do you mean with this, and what am i supposed to do with that wikisamp? i've already got text the only thing i want to know is how to make a part of the text (name) another color.
|
I mean that you can't do that with strings, it's simply impossible.
Re: Colors -
WThieves - 11.01.2010
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
pawn Код:
public OnPlayerText(playerid, text[]) { new string[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s (%d): %s", name, playerid, text); switch(GetPlayerTeam(playerid)) { case 0: SendClientMessageToAll(GREEN, string); case 1: SendClientMessageToAll(YELLOW, string); case 2: SendClientMessageToAll(RED, string); default: SendClientMessageToAll(WHITE, string); } return 0; }
I haven't defined the colours, you'll have to change them, they were there as an example.
|
Yes but this changes the whole string to a colour, but it should be only the id and the name , so the text is white!
|
Not possible by team.
https://sampwiki.blast.hk/wiki/OnPlayerText
|
What do you mean with this, and what am i supposed to do with that wikisamp? i've already got text the only thing i want to know is how to make a part of the text (name) another color.
|
I mean that you can't do that with strings, it's simply impossible.
|
Then how can i do it then??
Re: Colors -
Calgon - 11.01.2010
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
pawn Код:
public OnPlayerText(playerid, text[]) { new string[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s (%d): %s", name, playerid, text); switch(GetPlayerTeam(playerid)) { case 0: SendClientMessageToAll(GREEN, string); case 1: SendClientMessageToAll(YELLOW, string); case 2: SendClientMessageToAll(RED, string); default: SendClientMessageToAll(WHITE, string); } return 0; }
I haven't defined the colours, you'll have to change them, they were there as an example.
|
Yes but this changes the whole string to a colour, but it should be only the id and the name , so the text is white!
|
Not possible by team.
https://sampwiki.blast.hk/wiki/OnPlayerText
|
What do you mean with this, and what am i supposed to do with that wikisamp? i've already got text the only thing i want to know is how to make a part of the text (name) another color.
|
I mean that you can't do that with strings, it's simply impossible.
|
Then how can i do it then??
|
Are you completely retarded? It's
not possible.
Re: Colors -
WThieves - 11.01.2010
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by WThieves
Quote:
Originally Posted by CalgonX
pawn Код:
public OnPlayerText(playerid, text[]) { new string[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s (%d): %s", name, playerid, text); switch(GetPlayerTeam(playerid)) { case 0: SendClientMessageToAll(GREEN, string); case 1: SendClientMessageToAll(YELLOW, string); case 2: SendClientMessageToAll(RED, string); default: SendClientMessageToAll(WHITE, string); } return 0; }
I haven't defined the colours, you'll have to change them, they were there as an example.
|
Yes but this changes the whole string to a colour, but it should be only the id and the name , so the text is white!
|
Not possible by team.
https://sampwiki.blast.hk/wiki/OnPlayerText
|
What do you mean with this, and what am i supposed to do with that wikisamp? i've already got text the only thing i want to know is how to make a part of the text (name) another color.
|
I mean that you can't do that with strings, it's simply impossible.
|
Then how can i do it then??
|
Are you completely retarded? It's not possible.
|
No i'm not retarded!!! I saw it on tons of other servers, i can even get images for you:
[img width=960 height=768]http://home.tiscali.nl/heisterkamp/cruise2.jpg[/img]
See, only the name is another color, i just picked a random server!
Re: Colors -
MadeMan - 11.01.2010
Just use SetPlayerColor.