Textdraw only showing at 2 locations.
#1

I'd like to have a certain textdraw only show at 2 locations on my server. However, it works at one location, but not the other. It doesn't show up at all on the second one. I'm curious of why, or maybe someone could help figure this out.

pawn Код:
if(PlayerToPoint(50.0, i, 1400.3022,-3122.9741,9.6987) || PlayerToPoint(50.0, i, -2636.56,1403.46,906.46))
            {
                format(string, sizeof(string), "Tickets: %d", Tickets[i]);
                TextDrawSetString(TicketText[i], string);
                TextDrawShowForPlayer(i, TicketText[i]);
                TextDrawShowForPlayer(i, TicketText1[i]);
                if(PlayerInfo[i][pAdmin] < 1) SetPlayerArmedWeapon(i, 0);
            }
            if(!PlayerToPoint(50.0, i, 1400.3022,-3122.9741,9.6987) || !PlayerToPoint(50.0, i, -2636.56,1403.46,906.46))
            {
                TextDrawHideForPlayer(i, TicketText[i]);
                TextDrawHideForPlayer(i, TicketText1[i]);
            }
            if(!PlayerToPoint(160.0, i, 1400.3022,-3122.9741,9.6987))
            {
                if(ListeningCarnival[i] != 0)
                {
                    ListeningCarnival[i] = 0;
                    StopAudioStreamForPlayer(i);
                }
            }
This is the point I'd like it to show at:
pawn Код:
PlayerToPoint(50.0, i, -2636.56,1403.46,906.46
Reply
#2

I just used the code above and it not longer shows at the first coordinate area nor at the second area.
Does anyone have any idea how I can get the textdraw to show at BOTH areas when they enter, but disappear when they leave the range?
Reply
#3

pawn Код:
if(!PlayerToPoint(50.0, i, 1400.3022,-3122.9741,9.6987) && !PlayerToPoint(50.0, i, -2636.56,1403.46,906.46))
Or... if that's not what you're trying to achieve...
pawn Код:
if(!PlayerToPoint(50.0, i, 1400.3022,-3122.9741,9.6987))
    {
        TextDrawHideForPlayer(i, TicketText[i]);
    }
    if(!PlayerToPoint(50.0, i, -2636.56,1403.46,906.46))
    {
                TextDrawHideForPlayer(i, TicketText1[i]);
    }
On this line:
pawn Код:
if(!PlayerToPoint(50.0, i, 1400.3022,-3122.9741,9.6987) || !PlayerToPoint(50.0, i, -2636.56,1403.46,906.46))
The symbols '||' represent OR, so you're saying if the player is not within 50 of this point, or they're not in 50 of the other point, then hide both textdraws. So for both the textdraws to stay up, you would have to be in range of BOTH points, so you will need to check if they are not within one point AND not within the other before you hide the textdraws. So change || (OR) to && (AND).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)