How to call ****** command? - 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: How to call ****** command? (
/showthread.php?tid=582434)
How to call ****** command? -
DusanInfinity - 20.07.2015
Ex: I have this command:
Код:
YCMD:handsup(playerid, params[],help)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
return 1;
}
And this:
Код:
YCMD:handsupbaybe(playerid, params[],help)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
return 1;
}
They are same...
When i use zcmd, i write second command like this:
Код:
CMD:handsupbaybe(playerid, params[]) return cmd_handsup(playerid,params[]);
How to do it with y_commands?
This is just ex, but i need it for more commands to make easier game for players...
Re: How to call ****** command? -
Abagail - 20.07.2015
Quote:
Originally Posted by ******
You should really be thinking about WHY you want to call the command! Commands are an interface to code functionality for users. If you need to use that code from other places in your script you are doing it the wrong way! Put the code in a separate function and call that instead.
|
Simply put the code directly or if it's called a LOT make it into a function and call the function.
Re: How to call ****** command? -
Kyle - 20.07.2015
Command_ReProcess(playerid, "/CMD:handsupbaybe", false);
Easier shortcut: Command_AddAltNamed("handsup", "handsupbaybe");
Re: How to call ****** command? -
DusanInfinity - 22.07.2015
Thank you!