IC chat color
#1

Hi,I need your help,I have /aduty and I want when player do /aduty to change his IC chat,now is looking like this: My_Nick says:text ,and I want to make it like ((My_Nick:text)) and if possible to be in red color... This is something like OOC chat but i dont want to write /b to my text looks like this but automatically just when player is on admin duty
Reply
#2

Maybe something like this:

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(pInfo[playerid][OnDuty] == 1) //change it to yours
    {
        new string[128];
        GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"((%s says: %s))",string,text[1]);
        SendClientMessageToAll(-1,string);
        return 0;
    }
    return 1;
}
And use:
pawn Код:
pInfo[playerid][OnDuty] = 1; //or what ever your using
on your OnDuty command.

Not tested but i think will work!
Reply
#3

Here is my /aduty
pawn Код:
if(!strcmp(cmdtext, "/adminduty", true) || !strcmp(cmdtext, "/aduty", true)) // By Ellis
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Morate se prvo prijaviti !");
                return 1;
            }
            if(PlayerInfo[playerid][pAdmin] > 0)
            {
                if(AdminDuty[playerid] == 0)
                {
                    AdminDuty[playerid] = 1;
                    SetPlayerArmour(playerid, 100);
                    SetPlayerHealth(playerid, 100);
                    SetPlayerColor(playerid,TEAM_VAGOS_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "{DABB3E}[Admin] %s(ID:%d) je na duznosti.", sendername,playerid);
                    ABroadCast(COLOR_YELLOW,string,1);
                    //DutyLabel[playerid] = Create3DTextLabel("{F3FF02}Admin na Duznosti!\n Ne ometaj!",0xFF000099,0,0,0,50,-1,1);
                    Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0.6);
                    SetPlayerSkin(playerid, 113);
                    if(PlayerInfo[playerid][pAdmin] >= 8)
                    {
                        for(new i = 0; i < sizeof(CarInfo); i++)
                        {
                            SetVehicleParamsForPlayer(i,playerid,0,0);
                        }
                    }
                    return 1;
                }
                else if(AdminDuty[playerid] == 1)
                {
                    Delete3DTextLabel(DutyLabel[playerid]);
                    AdminDuty[playerid] = 0;
                    SetPlayerArmour(playerid, 0);
                    SetPlayerHealth(playerid, 100);
                    SetPlayerColor(playerid,TEAM_HIT_COLOR);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "{DABB3E}[Admin] %s(ID:%d) vise nije na duznosti.", sendername,playerid);
                    new stariskin = PlayerInfo[playerid][pChar];
                    SetPlayerSkin(playerid, stariskin);
                    ABroadCast(COLOR_YELLOW,string,1);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Niste Admin !");
                return 1;
            }
        }
        return 1;
    }
Need to be in prox detector not to all
Reply
#4

Use this:

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(AdminDuty[playerid] == 1)
    {
        new string[128];
        GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"((%s says: %s))",string,text[1]);
        SendClientMessageToAll(-1,string);
        return 0;
    }
    return 1;
}
Reply
#5

1. It compile with no warning and errors BUT its not working my gamemode say Run time error 17: "Invalid/unsupported P-code file format"
2.It need to be with prox detector not SendClientMessageToAll
Reply
#6

1. Check your plugins if are included correctly.
2. You can do it by your self i think, i dont know how prox detector works!
Reply
#7

Well it was working all the time ,so I think plugins are not a problem,anything else?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)