SA-MP Forums Archive
/announce problem ! - 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 problem ! (/showthread.php?tid=138819)



/announce problem ! - Kirchhoff - 03.04.2010

If you are admin 103 you can tipe /announce [style] [text] the "style is from 0 to 6 "

Example : /announce 3 asdfgs . They all disappear from the screen except the style : 2 . I wanna make it dissapear after a time like the other styles . Here is the command code :


Код:
	if(strcmp(cmd, "/announce", true) == 0)
	{
	  tmp = strtok(cmdtext, idx);
		if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 103)
		{
			new txtid;
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GREY, "USAGE: /announce [type] [text]");
				return 1;
			}
			txtid = strval(tmp);
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GREY, "USAGE: /announce [type] [text]");
				return 1;
			}
			format(string, sizeof(string), "~w~%s",result);
			GameTextForAll(string, 5000, txtid);
			format(string, sizeof(string), "-ANNOUNCE- %s",result);
			//ircSay(EchoConnection, EchoChan, string);
			return 1;
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use this command.");
		}
		return 1;



Re: /announce problem ! - Babul - 03.04.2010

at https://sampwiki.blast.hk/wiki/GameTextStyle it says just that style wont disappear until you respawn >-<


Re: /announce problem ! - Kirchhoff - 03.04.2010

ty