SA-MP Forums Archive
How to make 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: How to make commands ? (/showthread.php?tid=188073)



How to make commands ? - antsolen - 06.11.2010

Hi, I want to make two command, but how?
Evrytime i try to make i get 2 errors :
(i want make /help command and /cmds)
Код:
C:\Documents and Settings\Andero\Desktop\Server\gamemodes\Stunters.pwn(150) : error 055: start of function body without function header
C:\Documents and Settings\Andero\Desktop\Server\gamemodes\Stunters.pwn(151) : error 010: invalid function or declaration
C:\Documents and Settings\Andero\Desktop\Server\gamemodes\Stunters.pwn(154) : error 010: invalid function or declaration
C:\Documents and Settings\Andero\Desktop\Server\gamemodes\Stunters.pwn(156) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
There is the code :

Код:
public OnPlayerCommandText(playerid, cmdtext[])

{
 if (strcmp("/cmds", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, 0xFFFFFFFF, "[TELES] COMING SOON");
		return 1;
	}
	return 0;
}
{
 if (strcmp("/help", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, 0xFFFFFFFF, "[HELP] USE /cmds FOR COMMANDS !");
		return 1;
	}
	return 0;
}
Any ideas ?


Re: How to make commands ? - ViruZZzZ_ChiLLL - 06.11.2010

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if (strcmp("/cmds", cmdtext, true, 10) == 0)
  {
        SendClientMessage(playerid, 0xFFFFFFFF, "[TELES] COMING SOON");
  }
  if(strcmp("/help", cmdtext, true, 10) == 0)
  {
        SendClientMessage(playerid, 0xFFFFFFFF, "[HELP] USE /cmds FOR COMMANDS !");
  }
  return 0;
}



Re: How to make commands ? - antsolen - 06.11.2010

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if (strcmp("/cmds", cmdtext, true, 10) == 0)
  {
        SendClientMessage(playerid, 0xFFFFFFFF, "[TELES] COMING SOON");
  }
  if(strcmp("/help", cmdtext, true, 10) == 0)
  {
        SendClientMessage(playerid, 0xFFFFFFFF, "[HELP] USE /cmds FOR COMMANDS !");
  }
  return 0;
}
Omg thank you , you rocks !