SA-MP Forums Archive
Weird textdraw showing - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Weird textdraw showing (/showthread.php?tid=244890)



Weird textdraw showing - s1k - 29.03.2011

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?


Re: Weird textdraw showing - Backwardsman97 - 29.03.2011

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


Re: Weird textdraw showing - s1k - 29.03.2011

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