Weird textdraw showing
#1

I have a textdraw that shows up randomly when a player is not supposed to have it.

pawn Код:
if(Iter_Count(Cops) > 0) //if any cops online
    {
        if(!IsPlayerCop(playerid)) //is the person a civilian
        {
            if(wanted >= 2)
            {
                      TextDrawShowForPlayer(playerid, Text:GetPVarInt(playerid, "Textdraw0"));
             }
        else TextDrawHideForPlayer(playerid, Text:GetPVarInt(playerid, "Textdraw0"));
    }
    else TextDrawHideForPlayer(playerid, Text:GetPVarInt(playerid, "Textdraw0"));
}
else TextDrawHideForPlayer(playerid, Text:GetPVarInt(playerid, "Textdraw0"));

//under on player connect

SetPVarInt(playerid, "Textdraw0", _:TextDrawCreate(564.000000, 391.000000, " blah"));
etc....
Where it says TextDrawShowForPlayer

THAT IS THE ONLY PLACE IN THE WHOLE SCRIPT WHERE THAT IS CALLED AND COULD BE SHOWN

So I have no idea how the textdraw is showing up on the players screen. Thanks.

(P.S: When I tested, there were 0 cops online, and my wanted level was 0. How could this happen when i check for that?)

Any other reason how this could be happening?
Reply
#2

Make sure there's not a logic error in your Iter_Count function.
Reply
#3

Even if there was, it would still cancel when it hits !IsPlayerCop and wanted >= 25
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)