Clicked made textdraw but doesn't click
#1

I guess tittle says it all. I have made 2 clicked textdraws but can't even click them why?

pawn Код:
RegisterTD[13] = TextDrawCreate(296.799926, 267.155548, "Register~n~");
        TextDrawLetterSize(RegisterTD[13], 0.237197, 0.913066);
        TextDrawAlignment(RegisterTD[13], 1);
        TextDrawColor(RegisterTD[13], -1);
        TextDrawSetShadow(RegisterTD[13], 0);
        TextDrawSetOutline(RegisterTD[13], 0);
        TextDrawBackgroundColor(RegisterTD[13], 255);
        TextDrawFont(RegisterTD[13], 2);
        TextDrawSetProportional(RegisterTD[13], 1);
        TextDrawSetShadow(RegisterTD[13], 0);
        TextDrawSetSelectable(RegisterTD[13], true);


        RegisterTD[14] = TextDrawCreate(307.599945, 286.071014, "Quit");
        TextDrawLetterSize(RegisterTD[14], 0.258399, 0.937954);
        TextDrawAlignment(RegisterTD[14], 1);
        TextDrawColor(RegisterTD[14], -1);
        TextDrawSetShadow(RegisterTD[14], 0);
        TextDrawSetOutline(RegisterTD[14], 0);
        TextDrawBackgroundColor(RegisterTD[14], 255);
        TextDrawFont(RegisterTD[14], 2);
        TextDrawSetProportional(RegisterTD[14], 1);
        TextDrawSetShadow(RegisterTD[14], 0);
        TextDrawSetSelectable(RegisterTD[14], true);
P.S:
REGISTER/QUIT texts are not the same textdraws with the blue boxes behind.
Reply
#2

https://sampwiki.blast.hk/wiki/SelectTextdraw

and if that doesnt work it could be because you are simply missing TextDrawTextSize.
I personally use boxes for textdraws I want to set selectable, cuts down any sort of bugs I might encounter.
For the future textdraws, use Box and use aligment center for them, easier to setup.
Reply
#3

So i deleted and made on simple test named register with blue box behind it but it doesnt even hover..
PHP код:
        RegisterTD[11] = TextDrawCreate(294.399932281.093322"Register");
        
TextDrawLetterSize(RegisterTD[11], 0.2371960.913066);
        
TextDrawTextSize(RegisterTD[11], 341.0000000.000000);
        
TextDrawAlignment(RegisterTD[11], 1);
        
TextDrawColor(RegisterTD[11], -1);
        
TextDrawUseBox(RegisterTD[11], 1);
        
TextDrawBoxColor(RegisterTD[11], 8388512);
        
TextDrawSetShadow(RegisterTD[11], 0);
        
TextDrawSetOutline(RegisterTD[11], 0);
        
TextDrawBackgroundColor(RegisterTD[11], 255);
        
TextDrawFont(RegisterTD[11], 2);
        
TextDrawSetProportional(RegisterTD[11], 1);
        
TextDrawSetShadow(RegisterTD[11], 0);
        
TextDrawSetSelectable(RegisterTD[11], true); 
my show textdraw function
PHP код:
stock ShowRegisterScreen(playerid)
{
    for(new 
iisizeof(RegisterTD); i++)
    {
        
TextDrawShowForPlayer(playeridRegisterTD[i]);
    }
    
SelectTextDraw(playerid,COLOR_BLACK);
    return 
1;

The function i call it
PHP код:
function OnAccountCheck(playerid)
{
    new 
rowsfields,string[300];
    
cache_get_data(rowsfieldsmysql);
        if(
rows
        {
            
cache_get_field_content(0"Password"pinfo[playerid][Password], mysql129);
           
            
pinfo[playerid][ID] = cache_get_field_content_int(0"ID"); 
            
printf("Pass Hash: %s"pinfo[playerid][Password]); 
               
format(string,sizeof(string),""COL_WHITE"Welcome back "COL_LIGHTBLUE"%s "COL_WHITE" to Chaos "COL_BLUE"Cops "COL_WHITE"N "COL_RED"Robbers"COL_WHITE" Server developed by Unlimited Gaming. \nACCOUNT : "COL_LIGHTBLUE"REGISTERED"COL_WHITE"\nPlease "COL_GREEN"login "COL_WHITE" to continue.",GPN(playerid));
            
ShowPlayerDialog(playeriddloginDIALOG_STYLE_PASSWORD,""COL_WHITE"Login to CCNR",string,"Login","Quit"); 
        }
        else 
        {
                
ShowRegisterScreen(playerid);
                
pinfo[playerid][Banned] = 0;
        }
    return 
1;

Reply
#4

OnPlayerClickTextDraw Might help u..if dont work..pm me
PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid

if(
clickedid == yourtextdraw)
 { 
SendClientMessage(playerid0xFFFFFFAA"working or whatever ur code which u want to put"); 
CancelSelectTextDraw(playerid); 

return 
1

Reply
#5

Quote:
Originally Posted by UndefinedName
Посмотреть сообщение
OnPlayerClickTextDraw Might help u..if dont work..pm me
PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid

if(
clickedid == yourtextdraw)
 { 
SendClientMessage(playerid0xFFFFFFAA"working or whatever ur code which u want to put"); 
CancelSelectTextDraw(playerid); 

return 
1

I have already do that but It doesn't even set the color black when I hover its like the textdraw is not selectable
Reply
#6

bro this will work .. if u dont use OnPlayerClickTextDraw
then how he would be clickable..
Edit:COLOR WILL WORK ...I made clickable textdraws for my gm.. with color red.and they are working
SelectTextDraw(playerid, 0xA3B4C5FF); //////////color working//its from mine gm

PHP код:
if(clickedid == kk)
           {
            
ClassDialog(playerid);
            
SendClientMessage(playerid,COLOR_PINK,"*Test - .");
        
           } 
i tested know and its working xd
Reply
#7

try to use 1 instead of true :c?

PHP код:
TextDrawSetSelectable(RegisterTD[13], 1); 
PHP код:
TextDrawSetSelectable(RegisterTD[14], 1); 
Reply
#8

Quote:
Originally Posted by jlalt
Посмотреть сообщение
try to use 1 instead of true :c?

PHP код:
TextDrawSetSelectable(RegisterTD[13], 1); 
PHP код:
TextDrawSetSelectable(RegisterTD[14], 1); 
For once more jlalt you are here to help me so I have added you on the credits of the server I will test later if that's the problem but I don't really think that this is the problem.
Reply
#9

Increase the Y-axis of the text size.

0 = false, everything else is true. So '1' is equal to 'true' and vice versa. It only makes a difference when you work with multiple return values, which is not the case here.
Reply
#10

PHP код:
TextDrawTextSize(RegisterTD[11], 341.00000040.000000);  //change 40 to what seems best for u 
This.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)