19.06.2016, 21:08
Quote:
Lol, your idea? No. The original topic on that in this thread was MY idea on more YCMD-like features, starting here.
And in reply to that, YourShadow suggested this: |
Quote:
Maybe something like this
Code:
CMD:command(playerid, params[], cmd_id) Code:
public OnPlayerReceivedCommand(playerid, cmd_id, params[], bool:exists) { switch(cmd_id) { // CODE GOES HERE } } |
Quote:
Not a bad idea, but not what I was picturing... But still not a bad idea.
Here's what I had in mind. - Not ignoring the return value of commands: Allow commands to return whatever integer the scripter wants. Returning '0' would result in the default actions, the unknown command stuff. You could also add a new parameter to the callback, a 'result'. The 'result' parameter would hold the value returned by the command. - Add a function for disabling/enabling specific commands for specific players. SetPlayerCommandAllowed or something similiar, parameters: (playerid, cmdname[], bool:allow) Setting 'allow' to false would return '0' if the player used this command, otherwise the command would execute. Or, you could add yet another parameter to the callback, 'bool:allowed'. You would set this to the value set by the scripter. Then we could easily handle what happens when a player used a command they aren't allowed to use. pawn Code:
|
Quote:
YourShadow, are you going to try out my command ID suggestion from before?
https://sampforum.blast.hk/showthread.php?pid=3711131#pid3711131 |