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(playeridTDLoginUB);
    
TextDrawShowForPlayer(playeridTDLogin);
    
TextDrawShowForPlayer(playeridTDSiteUB);
    
TextDrawShowForPlayer(playeridTDRegUB);
    
TextDrawShowForPlayer(playeridTDReg);
    
TextDrawShowForPlayer(playeridTDName);
    
TextDrawShowForPlayer(playeridTDBG);
}
stock ShowArea(playerid)
{
    
TextDrawShowForPlayer(playeridTDLoginUB);
    
TextDrawShowForPlayer(playeridTDLogin);
    
TextDrawShowForPlayer(playeridTDSiteUB);
    
TextDrawShowForPlayer(playeridTDRegUB);
    
TextDrawShowForPlayer(playeridTDReg);
    
TextDrawShowForPlayer(playeridTDName);
    
TextDrawShowForPlayer(playeridTDBG);
}
stock HideGUI(playerid)
{
    
TextDrawHideForPlayer(playeridTDLoginUB);
    
TextDrawHideForPlayer(playeridTDLogin);
    
TextDrawHideForPlayer(playeridTDSiteUB);
    
TextDrawHideForPlayer(playeridTDRegUB);
    
TextDrawHideForPlayer(playeridTDReg);
    
TextDrawHideForPlayer(playeridTDName);
    
TextDrawHideForPlayer(playeridTDBG);

PHP код:
public OnPlayerRequestClass(playeridclassid)
.
.
.         
ShowArea(playerid);
        
ShowGUI(playerid);
.

PHP код:

public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == TDLogin)
        {
            
ShowPlayerDialog(playerid1245DIALOG_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(playerid1246DIALOG_STYLE_INPUT,"{FFFFFF}Register","{FFFFFF}Type Your Password Below To Register a New Account.","Register","Quit");
        }
    return 
1;

PHP код:
stock HideArea(playerid)
{
    
TextDrawHideForPlayer(playeridTDLoginUB);
    
TextDrawHideForPlayer(playeridTDLogin);
    
TextDrawHideForPlayer(playeridTDSiteUB);
    
TextDrawHideForPlayer(playeridTDRegUB);
    
TextDrawHideForPlayer(playeridTDReg);
    
TextDrawHideForPlayer(playeridTDName);
    
TextDrawHideForPlayer(playeridTDBG);
}
//------------------------------------------------------------------------------------------------------ 
PHP код:
//--- textdraws Login System
    
TDBG TextDrawCreate(426.00000017.739999"usebox");
    
TextDrawLetterSize(TDBG0.00000037.638889);
    
TextDrawTextSize(TDBG629.5000000.000000);
    
TextDrawAlignment(TDBG3);
    
TextDrawColor(TDBG16777215);
    
TextDrawUseBox(TDBGtrue);
    
TextDrawBoxColor(TDBG376926784);
    
TextDrawSetShadow(TDBG0);
    
TextDrawSetOutline(TDBG0);
    
TextDrawBackgroundColor(TDBG16777215);
    
TextDrawFont(TDBG0);
    
    
TDLoginUB TextDrawCreate(618.000000155.000000"usebox");
    
TextDrawLetterSize(TDLoginUB0.0000002.750000);
    
TextDrawTextSize(TDLoginUB435.0000000.000000);
    
TextDrawAlignment(TDLoginUB3);
    
TextDrawColor(TDLoginUB0);
    
TextDrawUseBox(TDLoginUBtrue);
    
TextDrawBoxColor(TDLoginUB102);
    
TextDrawSetShadow(TDLoginUB0);
    
TextDrawSetOutline(TDLoginUB0);
    
TextDrawFont(TDLoginUB0);
    
TDSiteUB TextDrawCreate(626.500000230.540008"usebox");
    
TextDrawLetterSize(TDSiteUB0.0000003.603329);
    
TextDrawTextSize(TDSiteUB429.5000000.000000);
    
TextDrawAlignment(TDSiteUB3);
    
TextDrawColor(TDSiteUB0);
    
TextDrawUseBox(TDSiteUBtrue);
    
TextDrawBoxColor(TDSiteUB102);
    
TextDrawSetShadow(TDSiteUB0);
    
TextDrawSetOutline(TDSiteUB0);
    
TextDrawFont(TDSiteUB0);
    
TDRegUB TextDrawCreate(618.000000185.000000"usebox");
    
TextDrawLetterSize(TDRegUB0.0000002.750000);
    
TextDrawTextSize(TDRegUB435.0000000.000000);
    
TextDrawAlignment(TDRegUB3);
    
TextDrawColor(TDRegUB0);
    
TextDrawUseBox(TDRegUBtrue);
    
TextDrawBoxColor(TDRegUB102);
    
TextDrawSetShadow(TDRegUB0);
    
TextDrawSetOutline(TDRegUB0);
    
TextDrawFont(TDRegUB0);
    
TDSite TextDrawCreate(455.000000237.500000"~y~wWw.YourSite.Com");
    
TextDrawLetterSize(TDSite0.4499991.600000);
    
TextDrawAlignment(TDSite3);
    
TextDrawColor(TDSite, -1);
    
TextDrawSetShadow(TDSite0);
    
TextDrawSetOutline(TDSite1);
    
TextDrawBackgroundColor(TDSite51);
    
TextDrawFont(TDSite1);
    
TextDrawSetProportional(TDSite1);
    
TDReg TextDrawCreate(480.000000190.000000"Register");
    
TextDrawLetterSize(TDReg0.4499991.600000);
    
TextDrawAlignment(TDReg3);
    
TextDrawColor(TDReg0xFFFFFFFF);
    
TextDrawSetShadow(TDReg0);
    
TextDrawSetOutline(TDReg1);
    
TextDrawBackgroundColor(TDReg51);
    
TextDrawFont(TDReg2);
    
TextDrawSetProportional(TDReg1);
    
TDName TextDrawCreate(465.000000130.000000"SA-MP ~w~Server");
    
TextDrawLetterSize(TDName0.4974981.762398);
    
TextDrawAlignment(TDName3);
    
TextDrawColor(TDName, -16711681);
    
TextDrawSetShadow(TDName0);
    
TextDrawSetOutline(TDName1);
    
TextDrawBackgroundColor(TDName51);
    
TextDrawFont(TDName3);
    
TextDrawSetProportional(TDName1);
    
TDLogin TextDrawCreate(495.000000160.000000"LOGIN");
    
TextDrawLetterSize(TDLogin0.4499991.600000);
    
TextDrawAlignment(TDLogin3);
    
TextDrawColor(TDLogin0xFFFFFFFF);
    
TextDrawSetShadow(TDLogin0);
    
TextDrawSetOutline(TDLogin1);
    
TextDrawBackgroundColor(TDLogin51);
    
TextDrawFont(TDLogin2);
    
TextDrawSetProportional(TDLogin1); 
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: 1 Guest(s)