How to make commands ?
#1

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 ?
Reply
#2

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;
}
Reply
#3

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 !
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)