Log All Commands.
#1

Is there a way to send admin a message with any/every command a player types?

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
new 
string[120];
format(string,sizeof(string),"%s(%d) Typed %s",PlayerName,playerid,cmdtext);
SendAdminMessage(-1);
    return 
1;

is this correct?
Reply
#2

Yes it is
Reply
#3

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

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?
Reply
#5

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"true7)) 
Reply
#6

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"true7)) 
if a command is client sided, for ex this /aimbot the OnPlayerCommandText callback won't be called.
Reply
#7

Quote:
Originally Posted by jlalt
Посмотреть сообщение
if a command is client sided, for ex this /aimbot the OnPlayerCommandText callback won't be called.
I know that... I literally just said that.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)