SA-MP Forums Archive
Admin chat problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Admin chat problem (/showthread.php?tid=201828)



Admin chat problem - Face9000 - 22.12.2010

Hi,i've this admin chat cmd:

pawn Код:
dcmd_a(playerid, params[])
{
    new ChatMessage[256],name[24];
    if(sscanf(params, "s", ChatMessage)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /a [message]");

    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    new string[256];
    format(string,sizeof(string),"AdmChat %s [%d]: %s",name,playerid,ChatMessage);
    IRC_GroupSay(gGroupID, IRC_ADMINCHANNEL, string);

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][AdminLevel] >= 2)
        {
        SendClientMessage(i, COLOR_GOLD, string);
        AdminCLog(string);
        PlayerPlaySound(i, 1137, 0.0, 0.0, 0.0);
        }
    }
    return 1;
}
I have admin variables but all players can use it.Why?


Re: Admin chat problem - XePloiT - 22.12.2010

add this at the top of the command...
pawn Код:
if(/*Check if player isn't an admin*/) return SendClientMessage(playerid,COLOR_WHITE,"You are not an admin!");