Help with /Announce.
#1

Hi, i created a command /announce in which you say something and it appears as gametext. It works fine, but the problem i can't fix is it shows Unknown Command even that it is working fine. Here's the script:

Код:
COMMAND:announce(playerid, params[])
{
  new announce1, string[150];
  if(ALygis[playerid] >= 5)
  {
  	if(sscanf(params,"s",announce1))
  	{
    	SendClientMessage(playerid,orandzine,"{FBDF89}[FunZoneLT]>> /announce [pranesimas]");
  	}
    format( string, sizeof(string), "~g~%s", announce1);
    GameTextForAll( string, 6000, 3 );
  }
  else
  {
    SendClientMessage(playerid,raudona,"[FunZoneLT]>> Jus negalite naudoti sitos komandos.");
  }
  return 1;
}
Does anyone know how to fix this?
Reply
#2

Mhm, that should work, are you sure you typed "gmx" on the server console a.k.a. did you restart your server?
Reply
#3

Everthing works just fine, but the problem is that it shows me a message Unknown Command even though it works fine. If i type /announce a its fine, but if there's more characters like /announce aaaaaaaaaaaaaaaaaaaa it shows the game text, but it shows unknown command to...
Reply
#4

pawn Код:
CMD:announce(playerid, params[])
{

    if(!IsPlayerAdminEx(playerid)) return NotAdmin(playerid);
    new text[256];
    if(sscanf(params, "s[256]",text))
    {
   
        return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /announce [text]");
    }

    GameTextForAll(text,3000,5);
    return 1;
   

}
Reply
#5

Or Just add a
pawn Код:
return 1;
Reply
#6

Thank you it works!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)