Next to the name (id number) show -
y@sin1 - 23.03.2011
Next to the name (id number) show
Re: Next to the name (id number) show -
xRyder - 23.03.2011
Something like this:
pawn Код:
public OnPlayerText(playerid, text[])
{
new pname[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, pname, sizeof(name));
format(str, sizeof(str)," %s (%d): %s ", name, playerid, text)
SendClientMEssageToAll(color, str)
return 1;
}
[Not sure it this is gonna work, 'cause I made it really fast...]
Take a look what I did and it will give you an idea...
Re: Next to the name (id number) show -
Biesmen - 23.03.2011
Hm, try this:
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[128], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s(%d): %s",playername, playerid, text);
SendClientMessageToAll(0xFFFFFFAA, string);
return 0;
}
Edit: Someone was faster than me
Re: Next to the name (id number) show -
aircombat - 23.03.2011
guys i think it should be return 0; cause that code will send 2 messages the one u created and the original one
so u gotta return 0 at OnPlayerText
Re: Next to the name (id number) show -
Biesmen - 23.03.2011
Yes, you're right. Edited.
Re: Next to the name (id number) show -
aircombat - 23.03.2011
use instead of SendClientMessageToAll(0xFFFFFFAA, string);
use :
Код:
SendClientMessageToAll(GetPlayerColor(playerid),string);
that means if the player color is red , the msg is red , if he's green then the msg is green
Re: Next to the name (id number) show -
Biesmen - 23.03.2011
Quote:
Originally Posted by [GM]Sasino97
All players Names Colors Are White Now How To change it?
i want Team_Pakistan 0 Green
Team_Japan 1 to Red
|
In your case, try this:
On top of the script:
pawn Код:
#define COLOR_GREEN 0x32CD32AA
#define COLOR_RED 0xFF0000AA
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[128], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s(%d): %s",playername, playerid, text);
if(gTeam[playerid] == Team_Pakistan) { SendClientMessageToAll(COLOR_GREEN, string); }
if(gTeam[playerid] == Team_Japan) { SendClientMessageToAll(COLOR_RED, string); }
return 0;
}
But you could also set the player's color to Red or Green, and use an other method like GetPlayerColor(playerid); instead of the "if(gTeam[....])" 'checks'.
Re: Next to the name (id number) show -
y@sin1 - 23.03.2011
helping for everyone thanks
Re: Next to the name (id number) show -
aircombat - 23.03.2011
Quote:
Originally Posted by [GM]Sasino97
easy way on paksitan team do this but "Green" instead of Red and in Japan red and it worked
pawn Код:
SetPlayerColor(playerid, Red);
|
GetPlayerColor wont just use red and green it was just an example i gave , it means the message they type get their color in the "Tab" list
Re: Next to the name (id number) show -
afizie98 - 22.08.2011
guys he want how to make if we chat show [GM] and his name that [GM] are not rename but onplayertext