Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Yashas - 13.12.2016
Quote:
Originally Posted by Nero_3D
- No idea why you added the cmdid parameter to the command
- Makes it harder to change the command processor
- Isn't even needed, you just could use cid_commandname
|
You need it for reassigned commands.
Код:
//abc is not an alternate command to xyz but has it's command function reassigned to that of xyz
CMD:xyz(cmdid, playerid, params[])
{
if(cmdid == cid_xyz) //directly using variables is faster than using GetCommandID
{
//player used /xyz
}
else if(cmdid == cid_abc) //cid_xyz and cid_abc are defined by SmartCMD
{
//player used /abc
}
return CMD_SUCCESS;
}
I can get rid of cmdid and introduce a new function, GetCurrentCommandID but this would dirty the code.
I will have to think about it.
Quote:
Originally Posted by Nero_3D
[*]Benchmark script is outdated (on first page) some functions are undefined[/LIST]
|
Will update soon.
[QUOTE=Nero_3D;3811977][*]You should change the prefix and macro names, makes it impossible to test in one go
Do it like in ycmd, only add a compatibility macro while using your own namespace[/LIST]
I have no clue how YCMD works nor did I understand what you tried to say.
Quote:
Originally Posted by Nero_3D
I know therefor I said "add a compatibility macro" then I could undef CMD and it still works without interfering
The other reason was about the prefix "cmd_", if you change something and it isn't compatible to the old format you should change the prefix too
|
Will think about it.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
zsoolt997 - 16.12.2016
Does it support accent? I mean й, у, ő, etc.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Yashas - 16.12.2016
SmartCMD does not allow you to use such characters. If I am not wrong, y_commands support such characters.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
wallee - 11.01.2017
This is really nice man i have 2 questions:
- do i need to check IsPlayerConnected in every command i make or do you do that in include?
- can you tell me what is this:
enum (*=2)
Ty
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Yashas - 14.01.2017
SmartCMD does not have any internal IsPlayerConnected. You can add one in OnPlayerCommandReceived.
enum(*2) tells the compiler to ensure that every entry inside the enum has twice the value of the entry preceding it.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Yashas - 26.04.2017
How many of you are using it?
Is everything working?
What do you think about the command state system? Do you use it? Should it be removed? The state system does not allow you to manually assign states using the
PAWN syntax. Anyone could manually set the state instead of this include providing such a system. This makes the command state system of SmartCMD redundant and harmful (because it does not let you use the PAWN syntax).
If you are using YSI, ensure that YSI is included before SmartCMD (
Github Issue #5).
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
AndySedeyn - 26.04.2017
Quote:
Originally Posted by Yashas
How many of you are using it?
Is everything working?
What do you think about the command state system? Do you use it? Should it be removed? The state system does not allow you to manually assign states using the PAWN syntax. Anyone could manually set the state instead of this include providing such a system. This makes the command state system of SmartCMD redundant and harmful (because it does not let you use the PAWN syntax).
If you are using YSI, ensure that YSI is included before SmartCMD ( Github Issue #5).
|
Started using it in all my projects the day you released it - it's a great include. I have yet to explore the territory of command states, so count that as not in use for me. The rest is working as intended.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
wallee - 26.04.2017
Quote:
Originally Posted by Yashas
How many of you are using it?
Is everything working?
What do you think about the command state system? Do you use it? Should it be removed? The state system does not allow you to manually assign states using the PAWN syntax. Anyone could manually set the state instead of this include providing such a system. This makes the command state system of SmartCMD redundant and harmful (because it does not let you use the PAWN syntax).
If you are using YSI, ensure that YSI is included before SmartCMD ( Github Issue #5).
|
I'm using it since the time of my last post in this topic (11/01/17) and didn't run into any problems so far. I don't know what are command states so i don't use it. If you meant flags yes i'm using those.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Jeroen52 - 18.08.2017
I'm having issues that whenever a command has been disabled it can not be enabled.
This is the code I'm using, most of it has been directly copied from the tutorial and modified so it works properly in the gamemode.
PHP код:
forward CommandDisabled(cmdid, playerid, params[]);
public CommandDisabled(cmdid, playerid, params[])
{
SendErrorMessage(playerid, -1, "The command has been disabled.");
return 1;
}
CMD<DISABLECMDS>:disablecmd(cmdid, playerid, params[])
{
if(!adminCheck(playerid, 5)) return 0;
switch(ReassignCommandFunction(GetCommandID(params), "CommandDisabled"))
{
case -1: return SendClientMessage(playerid, COLOR_RED, "The entered command does not exist.");
case 0: return SendClientMessage(playerid, COLOR_RED, "The entered command is already disabled.");
case 1: return SendClientMessage(playerid, COLOR_WHITE, "The entered command has been "COL_RED"disabled"COL_WHITE".");
}
return CMD_SUCCESS;
}
CMD<DISABLECMDS>:enablecmd(cmdid, playerid, params[])
{
if(!adminCheck(playerid, 5)) return 0;
new cmd_func[MAX_FUNC_NAME], cid = GetCommandID(params);
GetCommandFunctionName(cid, cmd_func);
switch(ReassignCommandFunction(cid, cmd_func))
{
case -1: return SendClientMessage(playerid, COLOR_RED, "The entered command does not exist.");
case 0: return SendClientMessage(playerid, COLOR_RED, "The entered command is already enabled.");
case 1: return SendClientMessage(playerid, COLOR_WHITE, "The entered command has been "COL_GREEN"enabled"COL_WHITE".");
}
return CMD_SUCCESS;
}
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
LosHermanos - 18.08.2017
Good Work.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Banditul18 - 23.09.2017
PHP код:
forward disabled(cmdid, playerid, params[])
public disabled(cmdid, playerid, params[])
{
return SendClientMessage(playerid, RED, "The command has been disabled.");
}
CMD<ACMD>:disablecmd(cmdid, playerid, params[])
{
switch(ReassignCommandFunction(GetCommandID(params), "disabled"))
{
case -1: return SendClientMessage(playerid, RED, "The entered command does not exist.");
case 0: return SendClientMessage(playerid, RED, "The entered command is already disabled.");
case 1: return SendClientMessage(playerid, RED, "The entered command has been disabled.");
}
return CMD_SUCCESS;
}
CMD<ACMD>:enablecmd(cmdid, playerid, params[])
{
new cmd_func[MAX_FUNC_NAME], cid = GetCommandID(params);
GetCommandFunctionName(cid, cmd_func);
switch(ReassignCommandFunction(cid, cmd_func))
{
case -1: return SendClientMessage(playerid, RED, "The entered command does not exist.");
case 0: return SendClientMessage(playerid, RED, "The entered command is already enabled.");
case 1: return SendClientMessage(playerid, RED, "The entered command has been enabled.");
}
return CMD_SUCCESS;
}
This not working, i disable a command and i can't enable it back lol
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Jeroen52 - 23.09.2017
Quote:
Originally Posted by Banditul18
PHP код:
forward disabled(cmdid, playerid, params[])
public disabled(cmdid, playerid, params[])
{
return SendClientMessage(playerid, RED, "The command has been disabled.");
}
CMD<ACMD>:disablecmd(cmdid, playerid, params[])
{
switch(ReassignCommandFunction(GetCommandID(params), "disabled"))
{
case -1: return SendClientMessage(playerid, RED, "The entered command does not exist.");
case 0: return SendClientMessage(playerid, RED, "The entered command is already disabled.");
case 1: return SendClientMessage(playerid, RED, "The entered command has been disabled.");
}
return CMD_SUCCESS;
}
CMD<ACMD>:enablecmd(cmdid, playerid, params[])
{
new cmd_func[MAX_FUNC_NAME], cid = GetCommandID(params);
GetCommandFunctionName(cid, cmd_func);
switch(ReassignCommandFunction(cid, cmd_func))
{
case -1: return SendClientMessage(playerid, RED, "The entered command does not exist.");
case 0: return SendClientMessage(playerid, RED, "The entered command is already enabled.");
case 1: return SendClientMessage(playerid, RED, "The entered command has been enabled.");
}
return CMD_SUCCESS;
}
This not working, i disable a command and i can't enable it back lol
|
I'm having the same issues, as was described a while ago in my post.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Yashas - 01.10.2017
I don't check the forums often.
I'll get to know about the issues through the github repo much faster than here.
I'm sorry for the late response though. I'll look into the matter and find a suitable fix.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
m4karow - 01.10.2017
is there any way to make special letter support for the commands or the alternate? (i mean й,б,ű etc)
the script dont have to distinguish the a and 'б' just let it work
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Yashas - 05.12.2017
Fix for Issue #6 (ReassignCommandFunction)
Working Branch =
i6-fix
Include with proposed fix can be found in the above branch (
direct link)
If nobody faces any issue, I'll merge it into the master branch.
TL;DR (or I don't know what you are talking about):
There was a bug. The bug has been fixed in
this version of the include (which is not the main include). You can use it. Report if you find issues. If no issues are found, I'll move the fix to the main include.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Jeroen52 - 05.12.2017
Quote:
Originally Posted by Yashas
Fix for Issue #6 (ReassignCommandFunction)
Working Branch = i6-fix
Include with proposed fix can be found in the above branch ( direct link)
If nobody faces any issue, I'll merge it into the master branch.
TLR (or I don't know what you are talking about):
There was a bug. The bug has been fixed in this version of the include (which is not the main include). You can use it. Report if you find issues. If no issues are found, I'll move the fix to the main include.
|
Код:
../pawno/include\SmartCMD\smartcmd.inc(1308) : warning 217: loose indentation
Other than that, going to merge it and test it right now.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Yashas - 20.12.2017
Has anyone tried the fix?
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Jeroen52 - 20.12.2017
Quote:
Originally Posted by Yashas
Has anyone tried the fix?
|
I have tried the fix, it works.
But I haven't tested the fix extensively.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Yashas - 21.12.2017
Quote:
Originally Posted by dani16
Gooooooooooood woooork. Is there a counter that can specify how long it takes to perform a command?
|
You can use the profiler plugin to find out how long your commands take to execute.
If you want to find out the number of times a command is used, you can use the `cmdid` parameter of `OnPlayerCommandReceived` as the index for an array which keeps counting.
Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+) -
Yashas - 25.12.2017
Currently the default flags (CMD_DEFAULT_FLAG) apply only to the commands for which the flags haven't been given explicitly.
Should it apply to all commands irrespective of whether flags have been given or not? This can be done by ORing with the flags which have been given explicitly with the default flags but this creates an issue if the flags aren't being used as bitfields. In that case, the flags will be ORed with 0 which won't mess with the flags.
What do you prefer?