/asay command help?
#4

pawn Код:
CMD:asay(playerid, params[])
{
    new tmp[256], playername[25], tmp2[256],string[256];
    if (adlvl[playerid] < 1) return 0;
    if(sscanf(params, "s[128]", tmp)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /asay [message]");
    if(adlvl[playerid] == 1)
    {
        GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
        format(tmp2, sizeof(tmp2), "say %s", tmp);
        format(string, sizeof(string), "* Administrator: %s", tmp);
        SendClientMessageToAll(COL_LEVEL1, string);
    }
    else if(adlvl[playerid] == 2)
    {
        GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
        format(tmp2, sizeof(tmp2), "say %s", tmp);
        format(string, sizeof(string), "* Administrator: %s", tmp);
        SendClientMessageToAll(COL_LEVEL2, string);
    }
    else if(adlvl[playerid] == 3)
    {
        GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
        format(tmp2, sizeof(tmp2), "say %s", tmp);
        format(string, sizeof(string), "* Administrator: %s", tmp);
        SendClientMessageToAll(COL_LEVEL3, string);
    }
    else if(adlvl[playerid] == 4)
    {
        GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
        format(tmp2, sizeof(tmp2), "say %s", tmp);
        format(string, sizeof(string), "* Administrator: %s", tmp);
        SendClientMessageToAll(COL_LEVEL4, string);
    }
    if(adminuc[playerid] == 0)
    {
        format(string, 128, "Admin Log: [asay] %s: %s.", playername, tmp);
        SendMessageToAdmins(COLOR_ADMIN, string);
    }
    printf("[asay] %s: %s", playername, tmp);
    return 1;
}
Here it is


Edit: Missed a bracket.
Reply


Messages In This Thread
/asay command help? - by Tass007 - 03.02.2016, 04:22
Re: /asay command help? - by Zamora - 03.02.2016, 04:58
Re: /asay command help? - by Tass007 - 03.02.2016, 05:06
Re: /asay command help? - by Zamora - 03.02.2016, 05:22
Re: /asay command help? - by Tass007 - 03.02.2016, 05:31

Forum Jump:


Users browsing this thread: 2 Guest(s)