OnPlayerText
#1

Код:
public OnPlayerText(playerid, text[])
{
    new chat[200], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(chat, sizeof(chat), "%s (%d): {009900}%s", name, playerid, text);
    SendClientMessageToAll(0xFFFFFFFF, chat);
    return 0;
}
So, as a cop, I'm having a blue color(SetPlayerColor) and I added this so I wanted to make if you have the blue colour, your text should also be the blue.
And now, after I've added this, my color is white on mainchat no matter that I have blue color(SetPlayerColor) and it shows the greenish text.

Could you help me how to make so if I have the blue colour as a cop, and when I chat on the main chat, I actually get blue colour instead of white.

The script I've scripted is wrong. Thank you.
Reply
#2

What'd you probably have to do is check whether or not the player is a cop, and if so he'll talk using his the color in SetPlayerColor.
Reply
#3

Use this
Код:
public OnPlayerText(playerid, text[])
{
if(GetPlayerTeam(playerid) == cop) //edit this!!!
{
    new chat[200], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(chat, sizeof(chat), "%s (%d): {009900}%s", name, playerid, text);
    SendClientMessageToAll(GetPlayerColor(playerid), chat);
    return 0;
}
}
Reply
#4

ah so with the teams, alright, thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)