Show a what command player uses on irc
#10

I dunno, I put this format
Код:
format(string, sizeof(string), "[CmdTxt]: %s[%i] typed the command: /%s", name, playerid, cmdtext);
to the test via SendClientMessage and got

Quote:

[13:19:07] [CmdTxt]: Wo_Hong_Dong[0] typed the command: //version

Now, /version is a zcmd command I put in to test. I do not think it will pick up anything that is not zcmd, so check that this is all thought of.

You'll have trouble getting the params from the command after it's been passed to OnPlayerCommandPerformed, as that was on the previous section of code. So if you need the params, you'll have to make a player based array, to track the last set of params to pass onto this, but you will run into a problem where the params that were entered for the last param accepting command, will show up for instance, if you have a command after which has no params, and it's used.


For instance, if I had "/pm 1 Hi Dude", then used "/version". If not checked, I'll end up showing in the second command response, "/version 1 Hi Dude" if the array isn't cleared out upon showing in this callback.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)