SA-MP Forums Archive
Need help in sending all the cmds to owner - 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: Need help in sending all the cmds to owner (/showthread.php?tid=417970)



Need help in sending all the cmds to owner - Marven - 23.02.2013

What should i put in the script so when ever a player types a cmd either its correct one or wrong one server will send admin level 7 a message like this " Cmd: Playername has typed "/pm marven hi hru? " something like this.


Respuesta: Need help in sending all the cmds to owner - Strier - 23.02.2013

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    new cmd1[256], stringo[128], tmp[256], idx, pName[MAX_PLAYERS_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    cmd1 = strtok(cmdtext, idx);
     format(stringo, sizeof(stringo), "|- [CMD] %s [id:%d] typed: %s -| ", pName ,playerid,cmdtext);
        for(new i = 0; i < MAX_PLAYERS; i++) {
            if(IsPlayerConnected(i)) {
                if(IsPlayerAdmin(i)) {
                    SendClientMessage(i, COLOR_GREY, stringo);
                }
            }
        }
I Think it should work.. didn't test it.