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



about commands - xploit101 - 06.09.2009

I got some problems cant make any commands on my GM, tried in different ways and still have erros

lets take a simple command
Код:
if(strcmp(cmd, "/handsup", true) == 0)
{
  SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
  return 1;
}
When i compile it gives me ERROS

Код:
invalid function or declaration
invalid function or declaration
2 problem When im tryin to make command in 2nd way its jst doesn't work, when i type it >server say Unknow command
simple command
Код:
dcmd_kill1(playerid, cmdtext[]) {
  #pragma unused cmdtext
  SetPlayerHealth( playerid, 20 );
  return 1;
}



Re: about commands - Zezombia - 06.09.2009

pawn Код:
if(strcmp(cmdtext, "/handsup", true) == 0)
    {
      SetPlayerSpecialAction(playerid, SPECIAL_ACTION_HANDSUP);
      return 1;
    }
That compiles just fine for me. What the exact line(s) your having the errors on?

Edit:

Actually, I use tested the whole thing:

http://pastebin.com/f122c63e2

And it works fine. Even the /kill1 command.


Re: about commands - The_Tough - 06.09.2009

Quote:
Originally Posted by xploit101
Код:
dcmd_kill1(playerid, cmdtext[]) {
  #pragma unused cmdtext
  SetPlayerHealth( playerid, 20 );
  return 1;
}
Код:
dcmd_kill1(playerid,params[]) {
  #pragma unused params
  SetPlayerHealth(playerid,0.00 );
  return 1;