11.09.2018, 12:22
Quote:
why not?
look it: Code:
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "!cmd", true)) { SendClientMessage(playerid, -1, "Message 1"); return 1; } if(!strcmp(cmdtext, "&cmd", true)) { SendClientMessage(playerid, -1, "Message 2"); return 1; } if(!strcmp(cmdtext, "@cmd", true)) { SendClientMessage(playerid, -1, "Message 3"); return 1; } return 0; } |
ZCMD and PawnCMD create a public function for your command to call when the player types it. That's why they are so much faster.
The command you type gets directly called instead of compared to hundreds of strings.
So making a command like this:
Code:
CMD:test(playerid, params[]) { }
Using symbols would make these part of the function name, which isn't possible as such. Not sure if you could use some tricks to get around it.
Of course you could substitute these symbols with something like a prefix.
You could just as well use ZCMD for it and modify it to use OnPlayerText and replace (eg.) '$' with something else before calling your Command.
I'm not sure if many people need this, so I don't know if it would be worth implementing. But that's not up to me anyway :P