SA-MP Forums Archive
how can i have the cmds used by players sent to me ? - 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: how can i have the cmds used by players sent to me ? (/showthread.php?tid=588049)



how can i have the cmds used by players sent to me ? - YoussefHammad - 05.09.2015

say for example a player uses /kill (known command) how can i make that when they use the cmd it sends me a msg (as an owner) saying ("<player name> has used <command>") , Note: i'm using zcmd(CMD) thats why i failed to do this , it was going to be easy if it was in OnPlayerCommandText. Also , i want it to send me BOTH known and unkown commands. Any help ?

Thanks


Re: how can i have the cmds used by players sent to me ? - SickAttack - 05.09.2015

Use one of ZCMD's callbacks (when a player performs a command).


Re: how can i have the cmds used by players sent to me ? - Harith - 05.09.2015

on top after include put this
Quote:

#define loop(%1,%2) for (new %1 = 0; %1 < %2; %1++)
new szString[MAX_PLAYERS];
new Notify[MAX_PLAYERS];

Quote:

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(szString, sizeof(szString), "[CMD]%s[%d] Has Used Command: %s", PlayerName, playerid, cmdtext);
SendClientMessageToNotify(szString);
}
return 1;
}

Put This Stock
Quote:

stock SendClientMessageToNotify(message[]) {
loop(i, MAX_PLAYERS) {
if (IsPlayerConnected(i)) {
if (IsPlayerAdmin(playerid)) {
if(Notify[i] == 1) {
SendClientMessage(i, -1, message);
}
}
}
}
return 1;
}

This Code Is Not Belong To Me Just Trying To Help You


Re: how can i have the cmds used by players sent to me ? - YoussefHammad - 05.09.2015

thank u very much , +repped