[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
#2

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.
Reply
#3

@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.
Reply
#4

Nice explanation and detail, Good job!
Reply
#5

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

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
Reply
#7

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!");
Reply
#8

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

Are you able to do ALTCMD instead of ALTCOMMAND?
Reply
#10

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)