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

try sscanf
Reply
#3

pawn Код:
new announce;

//Ongamemodeinit
announce = 0;

//When the announce works sucsfully
announce = 1;

//within the announce command
if(announce == 1) return SendClientMessage(playerid,color,"An announcement is alreaddy been displayed");

//when the timer is killed
announce = 0;
try that
Reply
#4

*Bump, i did what vortex said still no luck still can put 2 messages up
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)