How to create a /help command? -
Xtreme4ever - 10.07.2010
Hey, I just downloaded a GM, But there was no /help, or /rules command, so i wanted to add it. BUT, i dont know how. I need your help ! Please, Answer me quick!
Re: How to create a /help command? -
OverSwap - 10.07.2010
here take this:
PHP код:
if(!strcmp(cmdtext,"/help",true))
{
SendClientMessage(playerid,0xFFFFFFAA,"Help command!");
return 1;
}
you can edit the SendClientMessage
or add more things to the command
Re: How to create a /help command? -
Xtreme4ever - 10.07.2010
Where do i locate this, Cuz i opened my amx/pwn (i forgot which one) folder with Microsoft Office...
Where and How to locate this ?
Re: How to create a /help command? -
OverSwap - 10.07.2010
on public OnPlayerCommandText
Re: How to create a /help command? -
Xtreme4ever - 10.07.2010
The problem is How, Cuz its an already created server, but there is no /rules, and /help. and in that thing, there is already another command which is /killme
Re: How to create a /help command? -
Xtreme4ever - 10.07.2010
its like this:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/killme", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
return 1;
}
return 0;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
Re: How to create a /help command? -
OverSwap - 10.07.2010
so after return 1; } create new line and put my text in there.
Re: How to create a /help command? -
Xtreme4ever - 10.07.2010
And where do i write the rules?
Re: How to create a /help command? -
Xtreme4ever - 10.07.2010
now its like this:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/killme", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
return 1;
if(!strcmp(cmdtext,"/help",true))
{
SendClientMessage(playerid,0xFFFFFFAA,"Help command!");
return 1;
}
}
Re: How to create a /help command? -
OverSwap - 10.07.2010
fix:
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/killme", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
return 1;
}
if(!strcmp(cmdtext,"/help",true))
{
SendClientMessage(playerid,0xFFFFFFAA,"Help command!");
return 1;
}
}
put a } after an end of command,public,etc...
u didn't put } on the end of /killme