18.06.2016, 16:31
Quote:
YourShadow, are you going to try out my command ID suggestion from before?
https://sampforum.blast.hk/showthread.php?pid=3711131#pid3711131 |
YourShadow, are you going to try out my command ID suggestion from before?
https://sampforum.blast.hk/showthread.php?pid=3711131#pid3711131 |
YourShadow, are you going to try out my command ID suggestion from before?
https://sampforum.blast.hk/showthread.php?pid=3711131#pid3711131 |
Your? Also, I frist wrote idea with ids, so also that's my idea/suggestion, not only yours.
|
Maybe do something like this:
PHP Code:
|
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: |
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 } } |
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:
|
YourShadow, are you going to try out my command ID suggestion from before?
https://sampforum.blast.hk/showthread.php?pid=3711131#pid3711131 |
But this cannot be changed as a custom input during runtime. I know that you can call a command as such, but we used to call any with a custom input. For example: http://pastebin.com/raw/K7huGFvb
Where everything passed is handled the same as a typed command... |
CMD:callcommand(playerid, params[]) { new public[32], pid, cmd[32], parameters[128]; if(sscanf(params, "us[32]s[128]", pid, cmd, parameters)) return SendClientMessage(playerid, -1, "* /callcommand [playerid] [command name] [parameters]"); format(public, sizeof(public), "cmd_%s", cmd); CallLocalFunction(public, "is", pid, parameters); return 1; }
[19:29:06] [Pawn.CMD] command 'attachforall' has been registered [19:29:06] [Pawn.CMD] command 'attachforme' has been registered [19:29:06] [Pawn.CMD] command 'online' has been registered
Something isn't working right for me.
Run time error 19 after including this, tried to remove it and add zcmd, worked fine. Yes I do have the plugin in the folder & in config. Edit: fixed by renaming pawn.cmd to pawn_cmd. Edit2: Код:
[19:29:06] [Pawn.CMD] command 'attachforall' has been registered [19:29:06] [Pawn.CMD] command 'attachforme' has been registered [19:29:06] [Pawn.CMD] command 'online' has been registered |
#include <a_samp>
#include <easy-mysql>
#include <YSI\y_hooks>
#include <Pawn.CMD>
plugins pawncmd mysql sscanf streamer
Sorry for late response but here:
PHP код:
Код:
plugins pawncmd mysql sscanf streamer |