Next to the name (id number) show
#1

Next to the name (id number) show
Reply
#2

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...
Reply
#3

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
Reply
#4

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
Reply
#5

Yes, you're right. Edited.
Reply
#6

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
Reply
#7

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'.
Reply
#8

helping for everyone thanks
Reply
#9

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
Reply
#10

guys he want how to make if we chat show [GM] and his name that [GM] are not rename but onplayertext
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)