SA-MP Forums Archive
Textdraw Won't hide? - 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 Won't hide? (/showthread.php?tid=648679)



Textdraw Won't hide? - kevann - 26.01.2018

This is the code for entering a custom inbterior:
Код:
SetFreezePos(playerid, Float:x, Float:y, Float:z)
{
    if(PlayerInfo[playerid][pFreezeTimer] >= 0)
	{
		KillTimer(PlayerInfo[playerid][pFreezeTimer]);
	}

    PlayerInfo[playerid][pFreezeTimer] = SetTimerEx("UnfreezePlayer", 3000, false, "ifff", playerid, x, y, z);
	SetPlayerPos(playerid, x, y, z);

    TogglePlayerControllable(playerid, false);
	TextDrawShowForPlayer(playerid, Loading[0]);
	TextDrawShowForPlayer(playerid, Loading[1]);
	TextDrawShowForPlayer(playerid, Loading[2]);
	TextDrawShowForPlayer(playerid, Loading[3]);
	TextDrawShowForPlayer(playerid, Loading[4]);
	TextDrawShowForPlayer(playerid, Loading[5]);
	SetTimer("HideLoadingTextdraw", 3000, false);
}
Код:
forward HideLoadingTextdraw(playerid);
public HideLoadingTextdraw(playerid)
{
		TextDrawHideForPlayer(playerid, Loading[0]);
		TextDrawHideForPlayer(playerid, Loading[1]);
		TextDrawHideForPlayer(playerid, Loading[2]);
		TextDrawHideForPlayer(playerid, Loading[3]);
		TextDrawHideForPlayer(playerid, Loading[4]);
		TextDrawHideForPlayer(playerid, Loading[5]);
		TextDrawHideForPlayer(playerid, Loading[6]);
	}
}



Re: Textdraw Won't hide? - AmigaBlizzard - 26.01.2018

PHP код:
SetTimerEx("HideLoadingTextdraw"3000false"i"playerid); 



Re: Textdraw Won't hide? - Wanheda - 27.01.2018

Along with the fix the guy above me metioned, I recommend you delete the "Loading[6]" if you are not showing it to the player at the first place. This could cause hiding some other random textdraw.


Re: Textdraw Won't hide? - Sew_Sumi - 27.01.2018

^^ This is semi incorrect.



But really, why are you showing 6 in total, then hiding 7... Does Loading[6] actually exist, or is this an unintentional occurrence?


Re: Textdraw Won't hide? - kevann - 27.01.2018

Redid the code a little but still does not work

Код:
SetFreezePos(playerid, Float:x, Float:y, Float:z)
{
    if(PlayerInfo[playerid][pFreezeTimer] >= 0)
	{
		KillTimer(PlayerInfo[playerid][pFreezeTimer]);
	}

    PlayerInfo[playerid][pFreezeTimer] = SetTimerEx("UnfreezePlayer", 3000, false, "ifff", playerid, x, y, z);
	SetPlayerPos(playerid, x, y, z);

    TogglePlayerControllable(playerid, false);
	TextDrawShowForPlayer(playerid, Loading[0]);
	TextDrawShowForPlayer(playerid, Loading[1]);
	TextDrawShowForPlayer(playerid, Loading[2]);
	TextDrawShowForPlayer(playerid, Loading[3]);
	TextDrawShowForPlayer(playerid, Loading[4]);
	TextDrawShowForPlayer(playerid, Loading[5]);
//	TextDrawShowForPlayer(playerid, Loading[6]);
	SetTimerEx("SafeLoadObjectsClear", 3000, false, "i", playerid);
}
Код:
forward SafeLoadObjectsClear(playerid);
public SafeLoadObjectsClear(playerid)
{

	TextDrawHideForPlayer(playerid, Loading[0]);
	TextDrawHideForPlayer(playerid, Loading[1]);
	TextDrawHideForPlayer(playerid, Loading[2]);
	TextDrawHideForPlayer(playerid, Loading[3]);
	TextDrawHideForPlayer(playerid, Loading[4]);
	TextDrawHideForPlayer(playerid, Loading[5]);
}



Re: Textdraw Won't hide? - Sew_Sumi - 27.01.2018

What's it even doing? and what's it supposed to do?

Are you sure the timer is even being 'started'?

Try using Printf or SendClientMessages to show it 'working' in game or in the log.


Re: Textdraw Won't hide? - kevann - 27.01.2018

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
What's it even doing? and what's it supposed to do?

Are you sure the timer is even being 'started'?

Try using Printf or SendClientMessages to show it 'working' in game or in the log.
I've made a texdrawbox that shows when entering custom interiors that says "Loading Objects" and it is suppose to show while freezed and removed once unfreezed. The first part work where it shows, but it won't hide the textdraws


Re: Textdraw Won't hide? - kevann - 27.01.2018

Solved it just a little misstypo