SA-MP Forums Archive
ZCMD and OnPlayerCommandText - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ZCMD and OnPlayerCommandText (/showthread.php?tid=173397)



ZCMD and OnPlayerCommandText - mrcoolballs - 02.09.2010

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?


Re: ZCMD and OnPlayerCommandText - mrcoolballs - 02.09.2010

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?


Re: ZCMD and OnPlayerCommandText - mrcoolballs - 02.09.2010

so which one do i put it on?


Re: ZCMD and OnPlayerCommandText - Scenario - 02.09.2010

You would need to use "OnPlayerCommandPerformed"..


Re: ZCMD and OnPlayerCommandText - mrcoolballs - 02.09.2010

thanks, glad somebody finally told me


Re: ZCMD and OnPlayerCommandText - Scenario - 02.09.2010

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?