Little problem with textdraw
#1

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.
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

Thx azamx is working.
Reply
#5

Why would you use OPU for this?
Reply
#6

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


Forum Jump:


Users browsing this thread: 2 Guest(s)