[help]Can someone sort this out for me???
#7

Fixed a few things, but yea, it's like this:

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128], name[MAX_PLAYER_NAME];
    if(Adminvariable[playerid] == 1)
    {
        format(string, sizeof(string), "[V.I.P] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_GREEN, string);
        return 0;
    }
    if(Adminvariable[playerid] == 2)
    {
        format(string, sizeof(string), "[Moderator] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_GREEN, string);
        return 0;
    }
    else if(Adminvariable[playerid] >= 3)
    {
        format(string, sizeof(string), "[%d Admin] %s: %s", Adminvariable[playerid], GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_ORANGE, string);
        return 0;
    }
    else if(Adminvariable[playerid] == 0)
    {
        format(string, sizeof(string), "[Player] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_WHITE, string);
        return 0;
    }
    else if(Leadervariable[playerid] == 1)
    {
        format(string, sizeof(string), "[Leader] %s: %s", GetPlayerName(playerid, name, sizeof(name)), text);
        SendClientMessageToAll(playerid, COLOR_BLUE, string);
        return 0;
    }

    if(IsPlayerConnected(playerid))
    {
        new msg[256];
        format(msg,sizeof(msg),"(%d){FFFFFF} %s",playerid, text);
        SendPlayerMessageToAll(playerid,msg);
        return 0;
    }
    return 1;
}
Yes, use the new Adminvariable[MAX_PLAYERS]; at the top for a global variable.

For more smoothness and professionalism in the script, I suggest using enums for your playerinfo. If you already are, simply add the Admin variable in it.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)