OnPlayerClickTextDraw
#1

Yo,
Is it possible to disable ESC button until OnPlayerSpawn?
I need this coz I made selectable textdraw as login... and when someone presses esc he cant select anymore.
Reply
#2

Why you not try this:

When they press ESC and if they not logged in then show the drawn next time if they do this more then 3 time kick.
Reply
#3

OnPlayerClickTextDraw gets called with INVALID_TEXT_DRAW. Do note however, OnPlayerClickPLAYERTextDraw is NOT.
Reply
#4

Really easy to fix do something like this....

Code:
new bool:CloseTextDraw[MAX_PLAYERS];

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
	// Close code
	if(Text:INVALID_TEXT_DRAW == clickedid)
	{
	        if(!CloseTextDraw[playerid])  SelectTextDraw(playerid, 0x00FF00FF);
                else 
                {
                    HideTextDraws(playerid);
                    CloseTextDraw[playerid] = false;
                 }
	}

        // Close Click
	if(Text:Close_Click == clickedid)
        {
               CloseTextDraw[playerid] = true;
               CancelSelectTextDraw(playerid);
        }

HideTextDraws(playerid)
{
     TextDrawHideForPlayer(playerid, MyDraw);
}

}
Reply
#5

Quote:
Originally Posted by MP2
View Post
OnPlayerClickTextDraw gets called with INVALID_TEXT_DRAW. Do note however, OnPlayerClickPLAYERTextDraw is NOT.
And what is the difference between those two?
only that one is called with INVALID_TEXT_DRAW and another is not?
Reply
#6

Gangasta: That would be correct.

The difference is one is for player textdraws the other is for standard global textdraws both can be intermixed and even if your only using player textdraws OnPlayerClickTextDraw() will still be called when cancelling your textdraw selection or pressing esc.
Reply
#7

Quote:
Originally Posted by [uL]Pottus
View Post
Gangasta: That would be correct.

The difference is one is for player textdraws the other is for standard global textdraws both can be intermixed and even if your only using player textdraws OnPlayerClickTextDraw() will still be called when cancelling your textdraw selection or pressing esc.
so should I use your script or OnPlayerClickPlayerTextDraw?
Reply
#8

My script will prevent any clickable textdraws from closing player textdraws and global textdraws alike by pressing escape it will only close when you do these lines which can actually be done anywhere in the script.

CloseTextDraw[playerid] = true;
CancelSelectTextDraw(playerid);
Reply
#9

I have set my login textdraws to OnPlayerClickPlayerTextDraw but when I click ESC it still Canceles select.
Reply
#10

You need to this as well!

Code:
new bool:CloseTextDraw[MAX_PLAYERS];

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
	// Close code
	if(Text:INVALID_TEXT_DRAW == clickedid)
	{
	        if(!CloseTextDraw[playerid])  SelectTextDraw(playerid, 0x00FF00FF);
                else 
                {
                    HideTextDraws(playerid);
                    CloseTextDraw[playerid] = false;
                 }
	}

        // Close Click you can remove this
	if(Text:Close_Click == clickedid)
        {
               // These two lines will close the textdraw put them where you need them in your script!
               CloseTextDraw[playerid] = true;
               CancelSelectTextDraw(playerid);
        }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)