SA-MP Forums Archive
textdraw help - 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)
+--- Thread: textdraw help (/showthread.php?tid=434535)



textdraw help - MichaelWharton101 - 03.05.2013

So I made a command so when it is used it shows me the textdraw, but when I use the command I want the textdraw to only show for 10sec... How would I do this?


Re: textdraw help - Giroud12 - 03.05.2013

Post ur script first !
Or try this


Re: textdraw help - Giroud12 - 03.05.2013

https://sampwiki.blast.hk/wiki/SetTimer


Re: textdraw help - MichaelWharton101 - 03.05.2013

Login Screen command

Код:
CMD:loginscreen(playerid, params[])
{
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(sscanf(params, "s[16]", params))
	{
	    SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /loninscreen [on/off]");
	    return 1;
	}
	if(!strcmp(params, "on", true))
	{
	    SendClientMessage(playerid, COLOR_WHITE, " You have toggled the loginscreen {33AA33}on{FFFFFF}.");
 		TextDrawShowForPlayer(playerid,MainMenuTxtdraw[0]);
    	TextDrawShowForPlayer(playerid,MainMenuTxtdraw[1]);
	    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[2]);
	    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[3]);
	    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[4]);
	    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[5]);
	    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[6]);
	    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[7]);
	    TextDrawShowForPlayer(playerid,MainMenuTxtdraw[8]);
	}
	else if(!strcmp(params, "off", true))
	{
	    SendClientMessage(playerid, COLOR_WHITE, " You have toggled Join Messages {FF9900}off{FFFFFF}.");
	    TextDrawHideForPlayer(playerid,MainMenuTxtdraw[0]);
	    TextDrawHideForPlayer(playerid,MainMenuTxtdraw[1]);
	    TextDrawHideForPlayer(playerid,MainMenuTxtdraw[2]);
	    TextDrawHideForPlayer(playerid,MainMenuTxtdraw[3]);
	    TextDrawHideForPlayer(playerid,MainMenuTxtdraw[4]);
	    TextDrawHideForPlayer(playerid,MainMenuTxtdraw[5]);
	    TextDrawHideForPlayer(playerid,MainMenuTxtdraw[6]);
	    TextDrawHideForPlayer(playerid,MainMenuTxtdraw[7]);
	    TextDrawHideForPlayer(playerid,MainMenuTxtdraw[8]);
	}
	return 1;
}
but i want it so you do not have to type /loginscreen off, just so it auto go away in 10 sec


Re: textdraw help - Pottus - 03.05.2013

Do this....

pawn Код:
forward HideMainMenuTxtDraw(playerid);
public HideMainMenuTxtDraw(playerid)
{
    for(new i = 0; i < 9; i++) { TextDrawHideForPlayer(playerid,MainMenuTxtdraw[i]); }
}
Now you can set a timer to hide your TD's

SetTimerEx("HideMainMenuTxtDraw", 8940, false, "i", playerid); // 8940 is approximately 10 seconds


Re: textdraw help - MichaelWharton101 - 03.05.2013

where would I add this? Thanks for the help


Re: textdraw help - Pottus - 03.05.2013

Add it where you need to I really don't know because I don't have your script in front of me.