Textdraw Not-clickable
#1

Hello guys , im adding a new textdraw zones at my login Screen With Two things ( Register and Login )(clickable)

but those lasts wont work , ( i cant click on them ) have a loook on my codes ,

Why i cant click ingame on Login or Register ..
PHP код:
// TextDraws
new Text:TDLoginUB;
new 
Text:TDLogin;
new 
Text:TDSiteUB;
new 
Text:TDSite;
new 
Text:TDRegUB;
new 
Text:TDReg;
new 
Text:TDName;
new 
Text:TDBG; 
PHP код:
stock ShowGUI(playerid)
{
    
TextDrawShowForPlayer(playerid, TDLoginUB);
    
TextDrawShowForPlayer(playerid, TDLogin);
    
TextDrawShowForPlayer(playerid, TDSiteUB);
    
TextDrawShowForPlayer(playerid, TDRegUB);
    
TextDrawShowForPlayer(playerid, TDReg);
    
TextDrawShowForPlayer(playerid, TDName);
    
TextDrawShowForPlayer(playerid, TDBG);
}
stock ShowArea(playerid)
{
    
TextDrawShowForPlayer(playerid, TDLoginUB);
    
TextDrawShowForPlayer(playerid, TDLogin);
    
TextDrawShowForPlayer(playerid, TDSiteUB);
    
TextDrawShowForPlayer(playerid, TDRegUB);
    
TextDrawShowForPlayer(playerid, TDReg);
    
TextDrawShowForPlayer(playerid, TDName);
    
TextDrawShowForPlayer(playerid, TDBG);
}
stock HideGUI(playerid)
{
    
TextDrawHideForPlayer(playerid, TDLoginUB);
    
TextDrawHideForPlayer(playerid, TDLogin);
    
TextDrawHideForPlayer(playerid, TDSiteUB);
    
TextDrawHideForPlayer(playerid, TDRegUB);
    
TextDrawHideForPlayer(playerid, TDReg);
    
TextDrawHideForPlayer(playerid, TDName);
    
TextDrawHideForPlayer(playerid, TDBG);
} 
PHP код:
public OnPlayerRequestClass(playerid, classid)
.
.
.         
ShowArea(playerid);
        
ShowGUI(playerid);
.
. 
PHP код:

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(
clickedid == TDLogin)
        {
            
ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_PASSWORD,"Welcome, Please Log-In","Account Successfuly Registred into the database!\nType your password below to log-in","Log-in","Quit");
        }
    if(
clickedid == TDReg)
        {
            
ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"{FFFFFF}Register","{FFFFFF}Type Your Password Below To Register a New Account.","Register","Quit");
        }
    return 
1;
} 
PHP код:
stock HideArea(playerid)
{
    
TextDrawHideForPlayer(playerid, TDLoginUB);
    
TextDrawHideForPlayer(playerid, TDLogin);
    
TextDrawHideForPlayer(playerid, TDSiteUB);
    
TextDrawHideForPlayer(playerid, TDRegUB);
    
TextDrawHideForPlayer(playerid, TDReg);
    
TextDrawHideForPlayer(playerid, TDName);
    
TextDrawHideForPlayer(playerid, TDBG);
}
//------------------------------------------------------------------------------------------------------ 
PHP код:
//--- textdraws Login System
    
TDBG = TextDrawCreate(426.000000, 17.739999, "usebox");
    
TextDrawLetterSize(TDBG, 0.000000, 37.638889);
    
TextDrawTextSize(TDBG, 629.500000, 0.000000);
    
TextDrawAlignment(TDBG, 3);
    
TextDrawColor(TDBG, 16777215);
    
TextDrawUseBox(TDBG, true);
    
TextDrawBoxColor(TDBG, 376926784);
    
TextDrawSetShadow(TDBG, 0);
    
TextDrawSetOutline(TDBG, 0);
    
TextDrawBackgroundColor(TDBG, 16777215);
    
TextDrawFont(TDBG, 0);
    
    
TDLoginUB = TextDrawCreate(618.000000, 155.000000, "usebox");
    
TextDrawLetterSize(TDLoginUB, 0.000000, 2.750000);
    
TextDrawTextSize(TDLoginUB, 435.000000, 0.000000);
    
TextDrawAlignment(TDLoginUB, 3);
    
TextDrawColor(TDLoginUB, 0);
    
TextDrawUseBox(TDLoginUB, true);
    
TextDrawBoxColor(TDLoginUB, 102);
    
TextDrawSetShadow(TDLoginUB, 0);
    
TextDrawSetOutline(TDLoginUB, 0);
    
TextDrawFont(TDLoginUB, 0);
    
TDSiteUB = TextDrawCreate(626.500000, 230.540008, "usebox");
    
TextDrawLetterSize(TDSiteUB, 0.000000, 3.603329);
    
TextDrawTextSize(TDSiteUB, 429.500000, 0.000000);
    
TextDrawAlignment(TDSiteUB, 3);
    
TextDrawColor(TDSiteUB, 0);
    
TextDrawUseBox(TDSiteUB, true);
    
TextDrawBoxColor(TDSiteUB, 102);
    
TextDrawSetShadow(TDSiteUB, 0);
    
TextDrawSetOutline(TDSiteUB, 0);
    
TextDrawFont(TDSiteUB, 0);
    
TDRegUB = TextDrawCreate(618.000000, 185.000000, "usebox");
    
TextDrawLetterSize(TDRegUB, 0.000000, 2.750000);
    
TextDrawTextSize(TDRegUB, 435.000000, 0.000000);
    
TextDrawAlignment(TDRegUB, 3);
    
TextDrawColor(TDRegUB, 0);
    
TextDrawUseBox(TDRegUB, true);
    
TextDrawBoxColor(TDRegUB, 102);
    
TextDrawSetShadow(TDRegUB, 0);
    
TextDrawSetOutline(TDRegUB, 0);
    
TextDrawFont(TDRegUB, 0);
    
TDSite = TextDrawCreate(455.000000, 237.500000, "~y~wWw.YourSite.Com");
    
TextDrawLetterSize(TDSite, 0.449999, 1.600000);
    
TextDrawAlignment(TDSite, 3);
    
TextDrawColor(TDSite, -1);
    
TextDrawSetShadow(TDSite, 0);
    
TextDrawSetOutline(TDSite, 1);
    
TextDrawBackgroundColor(TDSite, 51);
    
TextDrawFont(TDSite, 1);
    
TextDrawSetProportional(TDSite, 1);
    
TDReg = TextDrawCreate(480.000000, 190.000000, "Register");
    
TextDrawLetterSize(TDReg, 0.449999, 1.600000);
    
TextDrawAlignment(TDReg, 3);
    
TextDrawColor(TDReg, 0xFFFFFFFF);
    
TextDrawSetShadow(TDReg, 0);
    
TextDrawSetOutline(TDReg, 1);
    
TextDrawBackgroundColor(TDReg, 51);
    
TextDrawFont(TDReg, 2);
    
TextDrawSetProportional(TDReg, 1);
    
TDName = TextDrawCreate(465.000000, 130.000000, "SA-MP ~w~Server");
    
TextDrawLetterSize(TDName, 0.497498, 1.762398);
    
TextDrawAlignment(TDName, 3);
    
TextDrawColor(TDName, -16711681);
    
TextDrawSetShadow(TDName, 0);
    
TextDrawSetOutline(TDName, 1);
    
TextDrawBackgroundColor(TDName, 51);
    
TextDrawFont(TDName, 3);
    
TextDrawSetProportional(TDName, 1);
    
TDLogin = TextDrawCreate(495.000000, 160.000000, "LOGIN");
    
TextDrawLetterSize(TDLogin, 0.449999, 1.600000);
    
TextDrawAlignment(TDLogin, 3);
    
TextDrawColor(TDLogin, 0xFFFFFFFF);
    
TextDrawSetShadow(TDLogin, 0);
    
TextDrawSetOutline(TDLogin, 1);
    
TextDrawBackgroundColor(TDLogin, 51);
    
TextDrawFont(TDLogin, 2);
    
TextDrawSetProportional(TDLogin, 1); 
Reply
#2

You are not using TextDrawSetSelectable function.
Reply
#3

pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == TDLogin)
        {
            ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_PASSWORD,"Welcome, Please Log-In","Account Successfuly Registred into the database!\nType your password below to log-in","Log-in","Quit");
        }
    if(clickedid == TDReg)
        {
            ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"{FFFFFF}Register","{FFFFFF}Type Your Password Below To Register a New Account.","Register","Quit");
        }
    return 1;
}
This will cause problems without if(_:clickedid != INVALID_TEXT_DRAW) and you don't have CancelSelectTextDraw neither.

Have it like this.
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(_:clickedid != INVALID_TEXT_DRAW)
    {
        if(clickedid == TDLogin)
        {
            ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_PASSWORD,"Welcome, Please Log-In","Account Successfuly Registred into the database!\nType your password below to log-in","Log-in","Quit");
        }
        if(clickedid == TDReg)
        {
            ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"{FFFFFF}Register","{FFFFFF}Type Your Password Below To Register a New Account.","Register","Quit");
        }
    }
    CancelSelectTextdraw(playerid);
    return 1;
}
Reply
#4

Quote:
Originally Posted by Turn
Посмотреть сообщение
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == TDLogin)
        {
            ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_PASSWORD,"Welcome, Please Log-In","Account Successfuly Registred into the database!\nType your password below to log-in","Log-in","Quit");
        }
    if(clickedid == TDReg)
        {
            ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"{FFFFFF}Register","{FFFFFF}Type Your Password Below To Register a New Account.","Register","Quit");
        }
    return 1;
}
This will cause problems without if(_:clickedid != INVALID_TEXT_DRAW) and you don't have CancelSelectTextDraw neither.

Have it like this.
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(_:clickedid != INVALID_TEXT_DRAW)
    {
        if(clickedid == TDLogin)
        {
            ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_PASSWORD,"Welcome, Please Log-In","Account Successfuly Registred into the database!\nType your password below to log-in","Log-in","Quit");
        }
        if(clickedid == TDReg)
        {
            ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,"{FFFFFF}Register","{FFFFFF}Type Your Password Below To Register a New Account.","Register","Quit");
        }
    }
    CancelSelectTextdraw(playerid);
    return 1;
}

i've donewhat shu said but nothing the problem still there .. i cant click on them ,



Larceny i added that but nothing same problem ..
Reply
#5

I forgot to say, you also have to use SelectTextDraw.
Reply
#6

same problem ...
Reply
#7

Can you show the code after you added it?
Reply


Forum Jump:


Users browsing this thread: