Modifing ZCMD - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Modifing ZCMD (
/showthread.php?tid=290601)
Modifing ZCMD -
DRIFT_HUNTER - 16.10.2011
Today i get idea to make admin commands more simple for scripting and reading.
Since i use ZCMD my basic command look's like:
pawn Код:
CMD:mycommand(playerid, params[])
{
return 1;
}
And i made a small function to check is player admin level (or higher)
pawn Код:
CMD:myadmincommand(playerid, params[])
{
LevelCheck(playerid, 2);//These will check is player level 2 or higher if no it will return error message
return 1;
}
But now i get even better idea for that.I thinking about adding 3rd parameter to zcmd
pawn Код:
CMD:command(playerid, params[], Level)
{
return 1;
}
The problem is that i always get some error or warnings or whatever
I wondering is anyone successfully modified ZCMD to something like these?
And dont say use YCMD...
Re: Modifing ZCMD -
DRIFT_HUNTER - 16.10.2011
Quote:
Originally Posted by ******
You can't just say that with no reason. You want a more advanced command processor, but don't want to use a more advanced command processor - care to explain the logic there? ZCMD is quick and simple, YCMD is more feature packed to support things like this.
So unless you can give a good reason why not, I am just going to say "use YCMD" anyway:
Use YCMD!
|
I know that YCMD have many..many..futures and yes its best command processor i know (compare speed and futures)
I like zcmd more cos its simple...i like my code look's clean and and i think i can make these level check rely easy with a macro...
Here is what i have so far but its fail....
pawn Код:
#define LevelCheck(%0,%1)\
do{\
if(pInfo[%0][pLevel] < %1) return SendError(%0, "You are not allowed to use that command");\
}\
while(False)
#define ADMCMD:%0(%1,%2,%3)\
forward cmd_%0(%1,%2); \
public cmd_%0(%1,%2)\
do{\
LevelCheck(%1, %3);\
}\
while(False)
stock
bool:False = false,
STR[128];