How to create a /help command?
#1

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

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

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

on public OnPlayerCommandText
Reply
#5

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

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

so after return 1; } create new line and put my text in there.
Reply
#8

And where do i write the rules?
Reply
#9

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;
}
}
Reply
#10

fix:
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
if (
strcmp("/killme"cmdtexttrue10) == 0)
{
SetPlayerHealth(playerid0);
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)