SA-MP Forums Archive
help - 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: help (/showthread.php?tid=226929)



help - omer5198 - 16.02.2011

i want to do that the admins will be able to see the commands and everything the players writing (including /pm and all that...) how can i do it? (i already defined admins and levels and all that...)
thx!
b.t.w: sorry for my bad english!


Re: help - _Tommy - 16.02.2011

You should add your last line to your signature, I see it everytime I read a post of yours
Anyway, run a loop through all players, check if he is an admin, if so - send him the message which the giveplayer id recives.


Re: help - omer5198 - 16.02.2011

give me an exemple i didnt understand


Re: help - omer5198 - 16.02.2011

anyone!?!?!?!??!


Re: help - alpha500delta - 16.02.2011

I dont know for strcmp or dcmd but if you use ZCMD you can do it with OnPlayerCommandPerformed in this way:
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, COLOR_HERE,"Unknown command! use /help if you forgot the commands");
    else
    {
        new str[75];
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, sizeof(pName));
        format(str, sizeof(str),"CMD: %s [%i] Command: \"%s\"",pName, playerid, cmdtext[0]);
        printf(str);
        SendRconMessage(COLOR_HERE, str);
    }
    return 1;
}
And for SendRconMessage (For the loop I would recommend foreach, but this will work to) You can use this:
pawn Код:
forward SendRconMessage(color, string[]);
public SendRconMessage(color, string[])
{
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
                if(IsPlayerConnected(i))
                {
                        if(IsPlayerAdmin(i))
                        {
                            SendClientMessage(i, color, string);
                        }
                }
        }
}