Yellow color
#1

Hello all! I have a simple question. I am kinda new to scripting so its not that easy for me yet, I've tried several solutions but it seems to not working.

Okay so basically. This code

Код:
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
format(string, sizeof(string), "%s says: %s", sendername, text);
I want to add yellow color to it so when an admin is on duty and writes at the chat its written in yellow and not regular color.

So it looks like Name_Lastname says: Hello!

How can I do this?

Thanks!
Reply
#2

use this :-
pawn Код:
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
format(string, sizeof(string), "%s says: %s", sendername, text);
SetPlayerColor(playerid, COLOR_YELLOW);
}
By it, it will be as :-
Firstname_Lastaname:text......
Reply
#3

Add "if(PlayerInfo[playerid][pAdminDuty] == 1)
{
format(string, sizeof(string), "%s says: %s", sendername, text);" to OnPlayerText, and use SendClientMessage.

SendClientMessageToAll(0xFFFF00AA, string);
Remember to return 0;

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        format(string, sizeof(string), "%s says: %s", sendername, text);
        SendClientMessageToAll(0xFFFF00AA, string);
        return 0; //VERY IMPORTANT!
    }
    return 1;
}
Reply
#4

@Simpalk: It gives me the regular color when using /b and when using normal chat (IC chat) it gives me a strange circle and only says:

No name either.

@gtakilleriv: C:\Users\Administrator\Desktop\All Server Files\Infinity Gaming LSRP Server\RP\gamemodes\larp.pwn(75535) : warning 225: unreachable code
C:\Users\Administrator\Desktop\All Server Files\Infinity Gaming LSRP Server\RP\gamemodes\larp.pwn(75567) : warning 225: unreachable code
C:\Users\Administrator\Desktop\All Server Files\Infinity Gaming LSRP Server\RP\gamemodes\larp.pwn(75599) : warning 225: unreachable code
C:\Users\Administrator\Desktop\All Server Files\Infinity Gaming LSRP Server\RP\gamemodes\larp.pwn(75629) : warning 225: unreachable code
Reply
#5

Im sorry. I didn't add the full code maybe the errors are caused cuz of that.

please have a look onto this code and try to help me

pawn Код:
if(PlayerInfo[playerid][pAdminDuty] == 1)
            {
                format(string, sizeof(string), "%s says: %s", sendername, text);
                SetPlayerChatBubble(playerid, string, COLOR_NICERED, 20.0, 8000);
                ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (Local Admin): %s",d1,m1,y1,h1,mi1,s1, sendername, text);
                ChatLog(string);
            }
Reply
#6

When using /b as an admin on duty it gives me a strange circle and "says: b" Doesn't come up a name nor the text I wrote.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)