26.05.2018, 01:23
I dunno, I put this format
to the test via SendClientMessage and got
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.
Код:
format(string, sizeof(string), "[CmdTxt]: %s[%i] typed the command: /%s", name, playerid, cmdtext);
Quote:
[13:19:07] [CmdTxt]: Wo_Hong_Dong[0] typed the command: //version |
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.