SA-MP Forums Archive
[Tutorial] Alternated command terms for ZCMD. [QUICK&EASY] - 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Alternated command terms for ZCMD. [QUICK&EASY] (/showthread.php?tid=490716)



Alternated command terms for ZCMD. [QUICK&EASY] - Blunt - 27.01.2014

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.



Re: Alternated command terms for ZCMD. [QUICK&EASY] - Lordzy - 28.01.2014

Looks pretty neat if some of them are using it, nice idea. It would be good if you explain on the macros part too as it's one of the major part of this tutorial.


Re: Alternated command terms for ZCMD. [QUICK&EASY] - Blunt - 29.01.2014

@Lordz - I'll do it another time, haven't got time right now but I'm sure this is helpful for a few people already.


Re: Alternated command terms for ZCMD. [QUICK&EASY] - Excelize - 29.01.2014

Nice explanation and detail, Good job!


Re: Alternated command terms for ZCMD. [QUICK&EASY] - DobbysGamertag - 29.01.2014

you should probably go into detail about what the method actually is, otherwise, nice tutorial.


Re: Alternated command terms for ZCMD. [QUICK&EASY] - Blunt - 30.01.2014

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
you should probably go into detail about what the method actually is, otherwise, nice tutorial.
I'll update this tutorial monday, thanks


Re: Alternated command terms for ZCMD. [QUICK&EASY] - Renaldasj - 01.02.2014

why you when you are creating command use params[] if they won't be in the command? simplest way:

CMDmth(playerid) return SendClientMessage ( playerid, -1,"Hey!");


Re: Alternated command terms for ZCMD. [QUICK&EASY] - Blunt - 02.02.2014

I generally thought you had to include the 'params[]' part of the code. Oh well, learn something new every day, haha.


Re: Alternated command terms for ZCMD. [QUICK&EASY] - AutoMativeX - 03.02.2014

Are you able to do ALTCMD instead of ALTCOMMAND?


Re: Alternated command terms for ZCMD. [QUICK&EASY] - Deathlane - 03.02.2014

Quote:
Originally Posted by AutoMativeX
Посмотреть сообщение
Are you able to do ALTCMD instead of ALTCOMMAND?
Just change

pawn Код:
#define ALTCOMMAND:%1->%2;           \
COMMAND:%1(playerid, params[])   \
return cmd_%2(playerid, params);
to

pawn Код:
#define ALTCMD:%1->%2;           \
COMMAND:%1(playerid, params[])   \
return cmd_%2(playerid, params);