Prefixes
#1

How can I make prefixes in a command like /global?
So it checks; PlayerInfo[playerid][Padmin] == 0
When it's 0 it says : (global) Player arjanforgames : Hello
When it's 1 it says : (global) Helper arjanforgames: Sup
White colour is fine. I can change it myself when needed.
Reply
#2

pawn Код:
CMD:global(playerid, params[])
{
    new msg[128];
    if(!sscanf(params, "s", msg))
    {
        if(PlayerInfo[playerid][pOOCMuted] == 0) // Is he muted? change it to your variable.
        {
            if(PlayerInfo[playerid][pAdmin] == 0) // Player
            {
                new string[128];
                format(string, sizeof(string), "(Global) %s %s says: %s", PlayerStatus(playerid), pName, msg);
                SendClientMessage(playerid, COLOR_WHITE, msg);
            }
        }
    }
    return 1;
}
stock PlayerStatus(playerid)
{
    new status[64];
    if(PlayerInfo[playerid][pAdmin] == 0) return status = "Player";
    if(PlayerInfo[playerid][pAdmin] == 1) return status = "Helper";
    if(PlayerInfo[playerid][pAdmin] == 2) return status = "Moderator";
    if(PlayerInfo[playerid][pAdmin] == 3) return status = "Administrator";
    return status;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)