SA-MP Forums Archive
Send message to admins when cmd use - 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)
+--- Thread: Send message to admins when cmd use (/showthread.php?tid=419723)



Send message to admins when cmd use - Ananisiki - 02.03.2013

^^^^^^^^


Re: Send message to admins when cmd use - mittukuttan - 02.03.2013

Quote:

stock SendAdminMessage(color, const len[])

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][AdminLevel] >= 1) SendClientMessage(i, color, len);
}
return 1;
}

SendAdminMessage(-1, string);[/QUOTE]


Re: Send message to admins when cmd use - Ananisiki - 02.03.2013

^^^^^^^^


Re: Send message to admins when cmd use - mittukuttan - 02.03.2013

show the full thing of (!IsCnRAdmin


Re: Send message to admins when cmd use - Ananisiki - 02.03.2013

^^^^^^^^


Re: Send message to admins when cmd use - mittukuttan - 02.03.2013

stock SendAdminMessage(color, const len[])

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsCnRAdmin(playerid)) SendClientMessage(i, color, len);
}
return 1;
}
SendAdminMessage(-1, string);


Re: Send message to admins when cmd use - Gangster-rocks - 02.03.2013

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    new string[128];
    format(string, sizeof(string), "[cmd] [%s]: %s", GetPlayersName(playerid), cmdtext);
    print(string);
    SendAdminMessage(COLOR_RED1,string);
    if(!success)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Unknown command, type /cmds for most available commands.");
    }
    return 1;
}
Change SendAdminMessage to your function.


Re: Send message to admins when cmd use - Ananisiki - 03.03.2013

^^^^^^^^


Re: Send message to admins when cmd use - HarrisonC - 03.03.2013

pawn Код:
CMD:armour(playerid, params[])
{
    new name[MAX_PLAYER_NAME], Float:armour, string[255];
    if(isDead[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_RED, "You cannot use this command when dead.");
        return 1;
    }
    GetPlayerArmour(playerid, armour);
    if(armour >= 100)
    {
        SendClientMessage(playerid, COLOR_RED, "Your armour is already full.");
        return 1;
    }
    else
    {
        GetPlayerName(playerid, name, sizeof(name));
        SetPlayerChatBubble(playerid, "Armour refilled!", COLOR_YELLOW, 60, 3000);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have refilled your armour!");
        SetPlayerArmour(playerid, 100.0);
        format(string, sizeof(string), "Admin: %s has refilled their armour!", name);
        foreach(Player, i)
        {
            if(youradminvariable == whatever)
            {
                SendClientMessage(i, COLOURHERE, string);
            }
        }
    }
    return 1;
}