Local chat color
#1

Код:
public OnPlayerText(playerid, text[])
{ 
    new message[128];

    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        format(message, sizeof(message), "%s (( %s ))", GetName(playerid), text);
        ProxDetector(30.0, playerid, message, COLOR_ORANGE);
    }
    else
    {
        format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
        ProxDetector(30.0, playerid, message, -1);
    }
    
    return 1;
}
Why didn't the text change to orange after i went on duty?
Reply
#2

Show Proxdetector Function
Reply
#3

Quote:
Originally Posted by ReD_HunTeR
Посмотреть сообщение
Show Proxdetector Function
Код:
stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
        }
    }
}
Reply
#4

thats weird, are you sure command for going onduty is setting [pAdminDuty] to "1" ?
Reply
#5

Quote:
Originally Posted by ReD_HunTeR
Посмотреть сообщение
thats weird, are you sure command for going onduty is setting [pAdminDuty] to "1" ?
Код:
CMD:aduty(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] == 1)
    {
        new Text3D:label = Create3DTextLabel("Game Administrator", 0xFFA500FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);

        SendClientMessage(playerid, COLOR_LAWNGREEN, "You are now on duty as a Game Administrator");

        PlayerInfo[playerid][pAdminDuty] = 1;
    }
    else
        return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a Game Administrator!");
    
    return 1;
}
Reply
#6

Try this:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new message[128];

    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        format(message, sizeof(message), "%s (( %s ))", GetName(playerid), text);
        ProxDetector(30.0, playerid, message, COLOR_ORANGE);
    }
    else
    {
        format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
        ProxDetector(30.0, playerid, message, -1);
    }
   
    return 0; //To stop the original message.
}
Reply
#7

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Try this:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new message[128];

    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        format(message, sizeof(message), "%s (( %s ))", GetName(playerid), text);
        ProxDetector(30.0, playerid, message, COLOR_ORANGE);
    }
    else
    {
        format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
        ProxDetector(30.0, playerid, message, -1);
    }
   
    return 0; //To stop the original message.
}
Doesn't work

edit: im stupid i kept typing in /b
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)