SA-MP Forums Archive
I need some help, adding multiple commands. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need some help, adding multiple commands. (/showthread.php?tid=69670)



I need some help, adding multiple commands. - Klutty - 19.03.2009

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.


Re: I need some help, adding multiple commands. - [RP]Rav - 19.03.2009

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;
}



Re: I need some help, adding multiple commands. - Vetle - 19.03.2009

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;
}



Re: I need some help, adding multiple commands. - MenaceX^ - 19.03.2009

Use pawn tags..


Re: I need some help, adding multiple commands. - Klutty - 19.03.2009

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


Re: I need some help, adding multiple commands. - [RP]Rav - 19.03.2009

Код:
pawn Код:
// your code here



Re: I need some help, adding multiple commands. - Klutty - 19.03.2009

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


THANKS FOR ALL THE HELP EVERYONE!!