[Tutorial] Alternated command terms for ZCMD. [QUICK&EASY]
#1

Alternated command terms.

This tutorial will be quick and easy, its so easy to do and compensates for how useful it is, in this you will learn how to create this altered function term for ZeeX's ZCMD command processor.


Firstly, lets create the definition of the altered command line.
Код:
#define ALTCOMMAND:%1->%2;           \
COMMAND:%1(playerid, params[])   \
return cmd_%2(playerid, params);
Next, we create the command.
Код:
COMMAND:fullhealth(playerid, params[])
{
     SetPlayerHealth(playerid, 100);
     return 1;
}
After doing the following step above, write this into your script, preferably just below your command.
Код:
ALTCOMMAND:fh->fullhealth;
Then, your whole command should appear and look like this. After compilation you can execute the command with the term you used in the alt-command, and perform the same functions as the original command.
Код:
COMMAND:fullhealth(playerid, params[])
{
	SetPlayerHealth(playerid, 100);
	return 1;
}
ALTCOMMAND:fh->fullhealth;
There you have it, completed.
You can now create simple command altered terms from using this tutorial.
I hope you enjoyed and I also hope this helped anyone who is viewing this thread.
If any queries please comment below.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)