From normal cmds to zcmd
#1

I have some commands, but I want to change them to zcmd commands.
How would I do that.
I have one command if someone of you can convert it, then I will change all the other ones.
This is my command
Код:
if(!strcmp(cmdtext, "/help", true))
	{
		SendClientMessage(playerid, 0xFFFFFFFF, "Vehicle");
		SendClientMessage(playerid, 0xFFFFFFFF, "Use it like /help vehicle");
		return 1;
	}
Reply
#2

pawn Код:
CMD:help(playerid, params)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "Vehicle");
    SendClientMessage(playerid, 0xFFFFFFFF, "Use it like /help vehicle");
    return 1;
}
Reply
#3

What does the playerid and params here mean?
Код:
CMD:help(playerid, params)
And what do here strcmp and true here mean?
Код:
if(!strcmp(cmdtext, "/help", true))
Reply
#4

At ZCMD:
params is everything that you types after "/help ".

At normal cmds:
strcmp compares 2 strings. The 2 firsts args are strings. In the case what the player typed (cmdtext) and the "/help" string. True is a boolean, that points if ignore the case sensitive, or not.

If strcmp returns 0 the strings match.
Reply
#5

Quote:
Originally Posted by Rodney Francalim
Посмотреть сообщение
At ZCMD:
params is everything that you types after "/help ".

At normal cmds:
strcmp compares 2 strings. The 2 firsts args are strings. In the case what the player typed (cmdtext) and the "/help" string. True is a boolean, that points if ignore the case sensitive, or not.

If strcmp returns 0 the strings match.
Does ZCMD ignore the case sensitive, or not?
What can you do with the params of ZCMD?
Reply
#6

Quote:
Originally Posted by xX4m4zingXx
Посмотреть сообщение
Does ZCMD ignore the case sensitive, or not?
What can you do with the params of ZCMD?
It ignores the case sensitive part.

you can use the params for sscanf for example.

- When you type something for instance like: "/kill Fenix" the fenix part is counted as params.

Recommended for you to learn how to use sscanf by ******, it's really useful.

I hope I helped, good luck!
Reply
#7

Quote:
Originally Posted by Stanford
Посмотреть сообщение
It ignores the case sensitive part.

you can use the params for sscanf for example.

- When you type something for instance like: "/kill Fenix" the fenix part is counted as params.

Recommended for you to learn how to use sscanf by ******, it's really useful.

I hope I helped, good luck!
Thank you, this is very useful.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)