Announce command not functioning correctly
#1

Ok, so this is my announce command i made it with a text draw.

Код:
dcmd_announce(playerid,params[])
{
  if (level[playerid] >= 1)
  if (announce == 0)
  	{
		new result[128], idx, string[128];
		result = bigstrtok(params, idx);
		if(!strlen(result))
		{
			SendClientMessage(playerid, orange, "Error: /announce message");
			SendClientMessage(playerid, orange, "This will announce a message to all players!");
			return 1;
		}
		format(string, sizeof(string), "[Admin]: %s", result);
		Announce0 = TextDrawCreate(1.000000,310.000000,string);
		Announce1 = TextDrawCreate(73.000000,311.000000,"  ");
		TextDrawUseBox(Announce1,1);
		TextDrawBoxColor(Announce1,0x0000ffff);
		TextDrawTextSize(Announce1,0.000000,3.000000);
		TextDrawAlignment(Announce0,0);
		TextDrawAlignment(Announce1,0);
		TextDrawBackgroundColor(Announce0,0x000000ff);
		TextDrawBackgroundColor(Announce1,0x000000ff);
		TextDrawFont(Announce0,3);
		TextDrawLetterSize(Announce0,0.499999,1.400000);
		TextDrawFont(Announce1,3);
		TextDrawLetterSize(Announce1,1.000000,1.000000);
		TextDrawColor(Announce0,0xff0000ff);
		TextDrawColor(Announce1,0xffffffff);
		TextDrawSetOutline(Announce0,1);
		TextDrawSetOutline(Announce1,1);
		TextDrawSetProportional(Announce0,1);
		TextDrawSetProportional(Announce1,1);
		TextDrawSetShadow(Announce0,1);
		TextDrawSetShadow(Announce1,1);
		TextDrawShowForAll(Announce0);
		SetTimer("AnnounceTimer", 5000, false);
		SendClientMessageToAll(dpink, string);
 }
	else SendClientMessage(playerid, red, "Error: You are either not a admin or you are not a admin with the correct level.");
	else if(announce == 1) SendClientMessage(playerid, orange, "Please wait for the current message to expire before sending a new one!.");
	return 1;
}
And the timer:

Код:
public AnnounceTimer(playerid)
{
	announce = 1;
	TextDrawHideForAll(Announce0);
}
Basicaly i wanted it so another admin couldn't use announce untill the timer destroyed the text draw but it doesn't work any help?
Reply


Messages In This Thread
Announce command not functioning correctly - by [mad]MLK - 05.10.2009, 21:44
Re: Announce command not functioning correctly - by iLinx - 05.10.2009, 21:57
Re: Announce command not functioning correctly - by _Vortex - 06.10.2009, 00:46
Re: Announce command not functioning correctly - by [mad]MLK - 06.10.2009, 19:18

Forum Jump:


Users browsing this thread: 1 Guest(s)