Re: Pawn.CMD - the fastest and most functional command processor -
YourShadow - 18.06.2016
Quote:
Originally Posted by Crayder
|
Yes, it will be added in the next update.
Re: Pawn.CMD - the fastest and most functional command processor -
vannesenn - 18.06.2016
Quote:
Originally Posted by Crayder
|
Your? Also, I frist wrote idea with ids, so also that's my idea/suggestion, not only yours.
Re: Pawn.CMD - the fastest and most functional command processor -
YourShadow - 19.06.2016
Quote:
Originally Posted by Ralfie
Hi, previously we used to
CallRemoteFunction("OnPlayerCommandText", "is", id, "/forcecmd");
to force any command on a certain player. Is it possible to do that using the plugin now?
|
cmd_forcecmd(id, "params");
Re: Pawn.CMD - the fastest and most functional command processor -
Crayder - 19.06.2016
Quote:
Originally Posted by vannesenn
Your? Also, I frist wrote idea with ids, so also that's my idea/suggestion, not only yours.
|
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:
Originally Posted by YourShadow
Maybe do something like this:
PHP Code:
cmd_id:pm(CMD_PM);
cmd:pm(playerid, params[])
{
return 1;
}
alias:pm("sms");
public OnPlayerCommandReceived(playerid, cmdtext[]) // executed before cmd
{
return 1;
}
public OnPlayerCommandPerformed(playerid, cmd[], params[], cmdid, result) // executed after cmd
{
if (result == -1)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command.");
return;
}
if (cmdid == CMD_PM)
{
//
}
// else if ...
}
?
|
Re: Pawn.CMD - the fastest and most functional command processor -
vannesenn - 19.06.2016
Quote:
Originally Posted by Crayder
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:
|
I wrote this, mentioning IDs for commands.
Quote:
Originally Posted by vannesenn
Maybe something like this
Code:
CMD:command(playerid, params[], cmd_id)
. cmd_id is unique command ID(like dialogid for dialogs). And then
Code:
public OnPlayerReceivedCommand(playerid, cmd_id, params[], bool:exists)
{
switch(cmd_id)
{
// CODE GOES HERE
}
}
|
After my post, you wrote this, but I still don't see where you mentioned IDs
Quote:
Originally Posted by Crayder
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:
native SetPlayerCommandAllowed(playerid, cmdname[], bool:allow); forward OnPlayerReceivedCommand(playerid, cmd[], params[], bool:exists, result, bool:allowed);
Doing it this way would keep the speed minimal still, and make the scripters' lives easier.
|
And, after all, you wrote
Quote:
Originally Posted by Crayder
|
I don't see IDs in your suggestion(s). Can you Quote post where you suggested something with IDs? Thanks!
Re: Pawn.CMD - the fastest and most functional command processor -
Spmn - 19.06.2016
Quote:
Originally Posted by Ralfie
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...
|
Code:
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;
}
eg: /callcommand 0 ban 1
Note that I didn't put a slash in front of command name (ban instead of /ban)
Re: Pawn.CMD - the fastest and most functional command processor -
SecretBoss - 22.06.2016
Quote:
Originally Posted by YourShadow
Yeap.
PHP код:
CMD:returnsettings(playerid, params[]) return cmd_settings(playerid, params);
|
Params are not required on (I)ZCMD if you are not using them, are they required for your script?
Re: Pawn.CMD - the fastest and most functional command processor -
Luicy. - 22.06.2016
Thanks alot for this, works like a charm.
Reputation waits for you. ;3
Re: Pawn.CMD - the fastest and most functional command processor -
Luicy. - 22.06.2016
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
But still don't happen anything when I type any of these commands.
Re: Pawn.CMD - the fastest and most functional command processor -
YourShadow - 23.06.2016
Quote:
Originally Posted by Meller
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
But still don't happen anything when I type any of these commands.
|
Show your includes.
Re: Pawn.CMD - the fastest and most functional command processor -
SecretBoss - 23.06.2016
Well I run some tests and placing or not params wherever you don't need them won't cause any problem. Correct me if I am wrong
Re: Pawn.CMD - the fastest and most functional command processor -
YourShadow - 23.06.2016
Pawn.CMD was updated to version 3.0.
- Added macros "callcmd" to call a command. Example: callcmd::ban(playerid, "42");
- Added natives: PC_SetFlags, PC_GetFlags, PC_EmulateCommand, PC_RenameCommand, PC_DeleteCommand.
- Added macros "isnull" to check command's params.
- Removed call "logprintf" on command's registration.
- "cmdtext" was splitted into "cmd" and "params".
- Pawn.CMD is not compatible with zcmd style anymore.
Re: Pawn.CMD - the fastest and most functional command processor -
vannesenn - 23.06.2016
Why this?
Pawn.CMD is not compatible with zcmd style anymore."
Re: Pawn.CMD - the fastest and most functional command processor -
Heroes9614 - 23.06.2016
Thanks Bro
but why?
"Pawn.CMD is not compatible with zcmd style anymore."
Re: Pawn.CMD - the fastest and most functional command processor -
Crayder - 23.06.2016
Quote:
Originally Posted by Heroes9614
Thanks Bro
but why?
"Pawn.CMD is not compatible with zcmd style anymore."
|
The callbacks have changed params, everything else is in tact.
Re: Pawn.CMD - the fastest and most functional command processor -
Luicy. - 23.06.2016
Quote:
Originally Posted by YourShadow
Show your includes.
|
Sorry for late response but here:
PHP код:
#include <a_samp>
#include <easy-mysql>
#include <YSI\y_hooks>
#include <Pawn.CMD>
and
Код:
plugins pawncmd mysql sscanf streamer
If I remove pawncmd and Pawn.CMD and add ZCMD, it works. But with Pawn.CMD it don't return anything even if it's not a valid command.
Respuesta: Re: Pawn.CMD - the fastest and most functional command processor -
Whyd - 23.06.2016
Quote:
Originally Posted by YourShadow
Pawn.CMD was updated to version 3.0
|
Thank you for updating it works well!
Re: Pawn.CMD - the fastest and most functional command processor -
YourShadow - 24.06.2016
Quote:
Originally Posted by Meller
Sorry for late response but here:
PHP код:
#include <a_samp>
#include <easy-mysql>
#include <YSI\y_hooks>
#include <Pawn.CMD>
and
Код:
plugins pawncmd mysql sscanf streamer
If I remove pawncmd and Pawn.CMD and add ZCMD, it works. But with Pawn.CMD it don't return anything even if it's not a valid command.
|
Strange, I checked with YSI, and it worked...
Re: Pawn.CMD - the fastest and most functional command processor -
OstGot - 24.06.2016
Quote:
Originally Posted by YourShadow
Strange, I checked with YSI, and it worked...
|
There is
YSI 3 and
YSI 4 (and they differ from one another)
Re: Pawn.CMD - the fastest and most functional command processor -
YourShadow - 24.06.2016
I checked with YSI 4.