ZCMD and OnPlayerCommandText
#1

Okay I know that the OnPlayerCommandText callback is disabled when ZCMD is included but before I swapped over to ZCMD I had this little piece under OnPlayerCommandText it was to show to the owner every command that gets executed. Heres the code:

pawn Code:
new owner;
    owner = PlayerInfo[playerid][Owner] = 1;
    if(playerid != owner)
    {
        new str[128],name[MAX_PLAYER_NAME];
        GetPlayerName(playerid,name,sizeof(name));
        format(str,sizeof(str),"%s(%d):%s",name,playerid,cmdtext);
        SendClientMessage(owner,GREY,str);
    }
    else
    {
        return 1;
    }
now where would I put this now that ZCMD doesnt use OnPlayerCommandText?
Reply
#2

Yes I know, I read that it adds OnPlayerCommandReceived and OnPlayerCommandPerformed, I have changed it to both of these and it didnt work with either on the performed one it has another parameter "success", am I suppose to use this is any way?
Reply
#3

so which one do i put it on?
Reply
#4

You would need to use "OnPlayerCommandPerformed"..
Reply
#5

thanks, glad somebody finally told me
Reply
#6

Quote:
Originally Posted by mrcoolballs
View Post
thanks, glad somebody finally told me
However, don't assume you'll always be told the correct answer. If you thought about it, you would've figured it out.

Quote:
Originally Posted by Y_Less
View Post
I'd actually say put it in OnPlayerCommandRecieved - that way you get everything everyone types, not just real commands that people type.
That's a smart idea... I'll have to do that for a command log, rather then logging each individual command. You know what I mean?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)