SA-MP Forums Archive
commands help - 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: commands help (/showthread.php?tid=71408)



commands help - mike_l - 01.04.2009

ok when making script commands do i have to um ...put this again or what

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,0xAA3333AA,"Test command"); // Do something here
return 1;
}
return 0;
}


Re: commands help - Sdhoirm - 01.04.2009

No, in the OnPlayerCommandText just add the commands: (or use dcmd or whatever)

pawn Код:
if (strcmp("/help", cmdtext, true, 10) == 0)
  {
    SendClientMessage(playerid,0xAA3333AA,"Test command"); // Do something here
   return 1;
  }

if (strcmp("/anothercmd", cmdtext, true, 10) == 0)
  {
   // Do something here
   return 1;
  }



Re: commands help - mike_l - 01.04.2009

ok thanks