how can i have the cmds used by players sent to me ?
#1

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
Reply
#2

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

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
Reply
#4

thank u very much , +repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)