Announce command not functioning correctly - 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: Announce command not functioning correctly (
/showthread.php?tid=100703)
Announce command not functioning correctly -
[mad]MLK - 05.10.2009
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?
Re: Announce command not functioning correctly -
iLinx - 05.10.2009
try sscanf
Re: Announce command not functioning correctly -
_Vortex - 06.10.2009
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
Re: Announce command not functioning correctly -
[mad]MLK - 06.10.2009
*Bump, i did what vortex said still no luck still can put 2 messages up