textdraw help
#1

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

Post ur script first !
Or try this
Reply
#3

https://sampwiki.blast.hk/wiki/SetTimer
Reply
#4

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
Reply
#5

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
Reply
#6

where would I add this? Thanks for the help
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)