SA-MP Forums Archive
Little problem with 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: Little problem with textdraw (/showthread.php?tid=531175)



Little problem with textdraw - prooftzm - 11.08.2014

Hi all. I made a safe zone textdraw. When the player is in safe zone, the textdraw shows up.
But when player is not in a safezone, the textdraw doesn't hide.

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 130,1642.0690,-2241.6035,13.4940))
    {
        TextDrawShowForPlayer(playerid,safezone);
    }
        return 1;
}
forward SafeZone(playerid);
public SafeZone(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 155.0 ,1642.0690,-2241.6035,13.4940))
    {
        TextDrawShowForPlayer(playerid,safezone);
    }
    if(!IsPlayerInRangeOfPoint(playerid, 155.0 ,1642.0690,-2241.6035,13.4940))
    {
        TextDrawHideForPlayer(playerid,safezone);
    }
    return 1;
}
shitty thing.


Re: Little problem with textdraw - AzaMx - 11.08.2014

try this?

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 130,1642.0690,-2241.6035,13.4940))
    {
        TextDrawShowForPlayer(playerid,safezone);
    }
    else if(!IsPlayerInRangeOfPoint(playerid, 155.0 ,1642.0690,-2241.6035,13.4940)) //remove this if no needed i think
    }//remove this if no needed i think
        TextDrawHideForPlayer(playerid,safezone);//remove this if no needed i think
    }//remove this if no needed i think
        return 1;
}

forward SafeZone(playerid);
public SafeZone(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 155.0 ,1642.0690,-2241.6035,13.4940))
    {
        TextDrawShowForPlayer(playerid,safezone);
    }
    else if(!IsPlayerInRangeOfPoint(playerid, 155.0 ,1642.0690,-2241.6035,13.4940))
    {
        TextDrawHideForPlayer(playerid,safezone);
    }
    return 1;
}



Re: Little problem with textdraw - SKAzini - 11.08.2014

pawn Код:
forward SafeZone(playerid);
public SafeZone(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 155.0, 1642.0690, -2241.6035, 13.4940) || IsPlayerInRangeOfPoint(playerid, 130.0, 1642.0690, -2241.6035, 13.4940)))
        TextDrawShowForPlayer(playerid, safezone);
    else
        TextDrawHideForPlayer(playerid, safezone);
    return 1;
}
Also, make sure that the timer is repeating itself and not just running once.


Re: Little problem with textdraw - prooftzm - 11.08.2014

Thx azamx is working.


Re: Little problem with textdraw - Pottus - 11.08.2014

Why would you use OPU for this?


Re: Little problem with textdraw - AzaMx - 12.08.2014

Quote:
Originally Posted by prooftzm
Посмотреть сообщение
Thx azamx is working.
You are welcome