SA-MP Forums Archive
Textdraw show/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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraw show/hide (/showthread.php?tid=171635)



Textdraw show/hide - Wrath2k10 - 27.08.2010

public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i; i < MAX_PICKUPS; i++)
{
if(GetHouseID(playerid) == pickupid)
{
TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
TextDrawShowForPlayer(playerid, Textdraw4[playerid]);
TextDrawShowForPlayer(playerid, Textdraw5[playerid]);
TextDrawShowForPlayer(playerid, Textdraw6[playerid]);
}
else
{
TextDrawHideForPlayer(playerid, Textdraw0[playerid]);
TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
TextDrawHideForPlayer(playerid, Textdraw2[playerid]);
TextDrawHideForPlayer(playerid, Textdraw3[playerid]);
TextDrawHideForPlayer(playerid, Textdraw4[playerid]);
TextDrawHideForPlayer(playerid, Textdraw5[playerid]);
TextDrawHideForPlayer(playerid, Textdraw6[playerid]);
}
}
return 0;
}

I am trying to achieve the following thing:
When a player enters a pickup, show the textdraw (1-6) and when they leave that point, hide the textdraw

Any idea?


Re: Textdraw show/hide - Nonameman - 27.08.2010

Do it with a Timer which checks if IsPlayerInRangeOfPoint(), then set a value to 'true' and show the txtdraws for him, that follows if the player entered the point you want, and if he isn't at this point, and the value is 'true', set it to 'false' and hide the txtdraws for him.

Or, work with checkpoints, because it has an Enter/Leave function.

EDIT: If you choose a way to make it, I can make it for you.