15.09.2013, 09:31
Hello SAMPians :P,
Is there a way to create a textdraw if player is in range of point and destroys the textdraw as soon as the player leaves the point?
If so, can you tell me how to do so, and where do I put the script at? Thanks.
Here's for example,
(P/S: The code is just for an example, it might not work :P)
So.. The part where it checks if IsPlayerInRangeOfPoint is done, but how to delete it after player isnt in it anymore?
Is there a way to create a textdraw if player is in range of point and destroys the textdraw as soon as the player leaves the point?
If so, can you tell me how to do so, and where do I put the script at? Thanks.
Here's for example,
pawn Код:
for(new i = 0; i < MAX_STADIUMS; ++i)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, StadiumInfo[i][sEX], StadiumInfo[i][sEY], StadiumInfo[i][sEZ]))
{
DefinedVar[playerid] = TextDrawCreate(85.000000, 322.000000, "Stadium Entrance, You Are At.");
textdrawscount++;
TextDrawAlignment(DefinedVar[playerid], 2);
TextDrawBackgroundColor(DefinedVar[playerid], 255);
TextDrawFont(DefinedVar[playerid], 0);
TextDrawLetterSize(DefinedVar[playerid], 0.809998, 1.500000);
TextDrawColor(DefinedVar[playerid], -1);
TextDrawSetOutline(DefinedVar[playerid], 1);
TextDrawSetProportional(DefinedVar[playerid], 1);
TextDrawShowForPlayer(playerid, DefinedVar[playerid]);
}
}
So.. The part where it checks if IsPlayerInRangeOfPoint is done, but how to delete it after player isnt in it anymore?