Textdraw - 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 (
/showthread.php?tid=363641)
Textdraw -
Qur - 28.07.2012
Hey.. I want to make a textdraw when player reach a point..
like if he stand in front of a shop so textdraw will show up..
and if he move from that point the textdraw will hide...
I know I should do that with SetTimerEx.. but I already tried but I think I was doing something wrong..
someone can show me how to do it right?
Thanks..
Re: Textdraw -
Kindred - 28.07.2012
pawn Код:
new InPoint[MAX_PLAYERS];
if(IsPlayerInRangeOfPoint(playerid, 6, PosX, PosY, PosZ) && InPoint[playerid] != 1)
{
ShowTextDrawStock(playerid);
InPoint[playerid] = 1;
return 1;
}
if(InPoint[playerid] == 1)
{
InPoint[playerid] = 0;
HideTextDrawStock(playerid);
}
stock ShowTextDrawStock(playerid)
{
TextDrawShowForPlayer(playerid, textdrawidhere);
}
stock HideTextDrawStock(playerid)
{
TextDrawHideForPlayer(playerid, textdrawidhere);
}
Something like this is what I'd do, although I do not know the most efficient ways.
Then I'd place the if statements inside a player timer that is close to 1 second, or just OnPlayerUpdate.
Hope I helped.
PS: The InPoint variable is there to prevent the stock from being used every second, seeing as it would be very inefficient to call a stock every second or few times a second with 10+ players online.