I need some help, adding multiple commands.
#1

I'm a "mid class" scripter, not the best, but I dont suck, but I have 1 thing I've been wondering about.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/help", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid,0xFFFFFFAA,"Need help?");
        return 1;
    }
    return 0;
}

There, I have 1 simple, shit command, but I want more! Where do I add it? Can someone explain it to me! PLEASE!!

Best regards,

Klutty.
Reply
#2

hmm, well, err...

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 if (strcmp("/help", cmdtext, true) == 0)
 {
   SendClientMessage(playerid,0xFFFFFFAA,"Need help?");
   return 1;
 }

 if (strcmp("/othercommand", cmdtext, true) == 0)
 {
   SendClientMessage(playerid,0xFFFFFFAA,"Another command!");
   return 1;
 }

 return 0;
}
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if (strcmp("/help", cmdtext, true) == 0)
  {
   SendClientMessage(playerid,0xFFFFFFAA,"Need help?");
   return 1;
  }

  if (strcmp("/commands", cmdtext, true) == 0)
  {
   SendClientMessage(playerid,0xFFFFFFAA,"Need commands?");
   return 1;
  }
  return 0;
}
Reply
#4

Use pawn tags..
Reply
#5

Quote:
Originally Posted by MenaceX^
Use pawn tags..
Which ones are pawn tags? The ones on the right side or..?
Reply
#6

Код:
pawn Код:
// your code here
Reply
#7

Quote:
Originally Posted by Rav
Код:
pawn Код:
// your code here
Oh, thank you.


THANKS FOR ALL THE HELP EVERYONE!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)