Posts: 108
Threads: 21
Joined: Aug 2016
Is there a way to send admin a message with any/every command a player types?
PHP код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
new string[120];
format(string,sizeof(string),"%s(%d) Typed %s",PlayerName,playerid,cmdtext);
SendAdminMessage(-1);
return 1;
}
is this correct?
Posts: 3,085
Threads: 37
Joined: Nov 2012
Reputation:
0
Well you have the right idea, yes. But you're not actually sending 'string' through the SendAdminMessage function. Do you want it to show for invalid commands too? What if someone spams "/givemefreemoney"? The text will spam even when the command doesn't exist.
I suggest you make use of the 'success' parameter in the callback.
Posts: 108
Threads: 21
Joined: Aug 2016
Quote:
Originally Posted by Threshold
Well you have the right idea, yes. But you're not actually sending 'string' through the SendAdminMessage function. Do you want it to show for invalid commands too? What if someone spams "/givemefreemoney"? The text will spam even when the command doesn't exist.
I suggest you make use of the 'success' parameter in the callback.
|
Hmm,this is sooo true I forgot about this but there's Cleo hacks that get activated with /aimbot for example that won't give a success result as it won't exist in the script guess this is the only way?
Posts: 1,266
Threads: 6
Joined: Oct 2014
Quote:
Originally Posted by Threshold
Well if OnPlayerCommandText is being NOP'd when they type it, then there really isn't anything you can do with the current state SA-MP is in. I think you'd be better off alerting admins when they type certain commands rather than typing 'any' command.
Example:
PHP код:
if(!strcmp(cmdtext, "/aimbot", true, 7))
|
if a command is client sided, for ex this /aimbot the OnPlayerCommandText callback won't be called.