[SOLVED] Commmands donґt work (/help) -
Flashy - 01.06.2010
Hello again,
I have a little problem with my commands. I createt some help commands to help the players in my server. So I have:
/help
/help commands
/help teams
/help money
But the problem is that when I type in: /help commands it shows me the text from /help not from /help commands.
How can I set it that when I type /help commands it shows my the text from this?
Код:
if(strcmp(cmd, "/help", true) == 0)
{
SendClientMessage(playerid, YELLOW,"General Help");
return true;
}
if(strcmp(cmd, "/help commands", true) == 0)
{
SendClientMessage(playerid, YELLOW,"Commands Help");
return true;
}
Re: Commmands donґt work -
ReVo_ - 01.06.2010
Use strtok.
Re: Commmands donґt work -
-Rebel Son- - 01.06.2010
Let me show you alittle trick. instead of doing
Код:
if(strcmp(cmd, "/help", true) == 0)
do it like this
Код:
if(!strcmp(cmdtext,"/help",true)) {
and to fix your codes.
Код:
if(!strcmp(cmdtxt,"/help",true)) {
SendClientMessage(playerid, YELLOW,"General Help");
return 1;}
if(!strcmp(cmdtxt,"/commands",true)) {
SendClientMessage(playerid, YELLOW,"Commands Help");
return 1;}
To use your commands type "/help" and "/commands"
Re: Commmands donґt work -
Flashy - 01.06.2010
@ _Ч§hмf†ҐЧ™_ :
Do you command than looks like that: /help command or like that: /help, /command ?
Cause I already have a /command. I wanna a /help command
Re: Commmands donґt work -
MastahServers - 01.06.2010
pawn Код:
if(strcmp(cmd, "/help", true) == 0)
{
SendClientMessage(playerid, YELLOW,"General Help");
}
else if(strcmp(cmd, "commands", true) == 0)
{
SendClientMessage(playerid, YELLOW,"Commands Help");
return 1;
}
This should work. It automatically generates as a SPACE
Re: Commmands donґt work -
Naxix - 01.06.2010
You cut just delete the space in "commands help" as well.
Re: Commmands donґt work -
Flashy - 01.06.2010
Well, I have some overlap with some gamemodes so I just changed the help topics to /helpcmds, /helpteams and /helpmoney.
This for sure works.
But anyways, thanks for your help
Re: [SOLVED] Commmands donґt work (/help) -
MadeMan - 01.06.2010
Change cmd to cmdtext in your strcmp line.
Re: [SOLVED] Commmands donґt work (/help) -
[XST]O_x - 01.06.2010
But,you can just do:
pawn Код:
if (strcmp("/help commands", cmdtext, true, 14) == 0)//14 Is number of characters including space and /.
{
SendClientMessage(playerid, YELLOW,"General Help");
return true;
}