command in 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: command in command (
/showthread.php?tid=534960)
command in command -
noamch1997 - 01.09.2014
for example :
when player write /Full
its will do the commands /Life+/Armor
tnx
Re: command in command -
Beckett - 01.09.2014
https://sampwiki.blast.hk/wiki/SetPlayerHealth
https://sampwiki.blast.hk/wiki/SetPlayerArmour
AW: command in command -
CutX - 01.09.2014
Quote:
Originally Posted by noamch1997
for example :
when player write /Full
its will do the commands /Life+/Armor
tnx
|
so what you want is a command which executes 2 other commands?
easy, we use Command_ReProcess
pawn Код:
#include "a_samp"
#include "YSI\y_commands"
YCMD:life(playerid,params[],help)
{
SendClientMessage(playerid,-1,"LIFE");
return 1;
}
YCMD:armor(playerid,params[],help)
{
SendClientMessage(playerid,-1,"ARMOR");
return 1;
}
YCMD:full(playerid,params[],help)
{
Command_ReProcess(playerid, "/life", false);
Command_ReProcess(playerid, "/armor", false);
return 1;
}
now once you tyspe /full you will see both messages.
tested & works.
Re: command in command -
JuanStone - 01.09.2014
You can do what @CutX said.
Tell me that they make their commands.
pawn Код:
#include <a_samp>
#include <zcmd>
command(full, playerid, params[])
{
#pragma unused params
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 100.0);
return 1;
}