[Ajuda] Textdraw Clicбvel, nгo Clica!
#1

Eu sempre tenho um sйrio problema com TextDraws. A Bola da Vez й essa tela

[Image: sa-mp-009.png]
Bom As Textdraws foram Criadas no TDEditor
Os Botхes que deveriam ser clicбveis, nгo aceitam cliques,
O que me faz ficar preso na Tela

O Codigo:
PHP код:
// Topo do GM
new Text:FCNewLogin[18];
     
//TextDraws
     
FCNewLogin[0] = TextDrawCreate(2.8000311.839995"box");
    
TextDrawLetterSize(FCNewLogin[0], 0.00000013.119996);
    
TextDrawTextSize(FCNewLogin[0], 638.0000000.000000);
    
TextDrawAlignment(FCNewLogin[0], 1);
    
TextDrawColor(FCNewLogin[0], -1);
    
TextDrawUseBox(FCNewLogin[0], 1);
    
TextDrawBoxColor(FCNewLogin[0], 255);
    
TextDrawSetShadow(FCNewLogin[0], 0);
    
TextDrawSetOutline(FCNewLogin[0], 0);
    
TextDrawBackgroundColor(FCNewLogin[0], 255);
    
TextDrawFont(FCNewLogin[0], 1);
    
TextDrawSetProportional(FCNewLogin[0], 1);
    
TextDrawSetShadow(FCNewLogin[0], 0);
    
FCNewLogin[1] = TextDrawCreate(313.19998175.759994"Seja_bem_vindo_ao_nosso_servidor~n~evite_ser_Punido,_leia_as_regras");
    
TextDrawLetterSize(FCNewLogin[1], 0.4000001.600000);
    
TextDrawAlignment(FCNewLogin[1], 2);
    
TextDrawColor(FCNewLogin[1], -1);
    
TextDrawSetShadow(FCNewLogin[1], 0);
    
TextDrawSetOutline(FCNewLogin[1], 1);
    
TextDrawBackgroundColor(FCNewLogin[1], 255);
    
TextDrawFont(FCNewLogin[1], 2);
    
TextDrawSetProportional(FCNewLogin[1], 1);
    
TextDrawSetShadow(FCNewLogin[1], 0);
    
FCNewLogin[2] = TextDrawCreate(310.00006121.253282"Faccoes_City");
    
TextDrawLetterSize(FCNewLogin[2], 1.6504004.713600);
    
TextDrawAlignment(FCNewLogin[2], 2);
    
TextDrawColor(FCNewLogin[2], -16776961);
    
TextDrawSetShadow(FCNewLogin[2], 2);
    
TextDrawSetOutline(FCNewLogin[2], 0);
    
TextDrawBackgroundColor(FCNewLogin[2], -1);
    
TextDrawFont(FCNewLogin[2], 0);
    
TextDrawSetProportional(FCNewLogin[2], 1);
    
TextDrawSetShadow(FCNewLogin[2], 2);
    
FCNewLogin[3] = TextDrawCreate(392.701965122.639961"loadsc2:loadsc2");
    
TextDrawLetterSize(FCNewLogin[3], 0.0000000.000000);
    
TextDrawTextSize(FCNewLogin[3], 283.000000159.000000);
    
TextDrawAlignment(FCNewLogin[3], 1);
    
TextDrawColor(FCNewLogin[3], -1);
    
TextDrawSetShadow(FCNewLogin[3], 0);
    
TextDrawSetOutline(FCNewLogin[3], 0);
    
TextDrawBackgroundColor(FCNewLogin[3], 255);
    
TextDrawFont(FCNewLogin[3], 4);
    
TextDrawSetProportional(FCNewLogin[3], 0);
    
TextDrawSetShadow(FCNewLogin[3], 0);
    
FCNewLogin[4] = TextDrawCreate(227.399963122.846611"loadsc1:loadsc1");
    
TextDrawLetterSize(FCNewLogin[4], 0.0000000.000000);
    
TextDrawTextSize(FCNewLogin[4], 283.000000159.000000);
    
TextDrawAlignment(FCNewLogin[4], 1);
    
TextDrawColor(FCNewLogin[4], -1);
    
TextDrawSetShadow(FCNewLogin[4], 0);
    
TextDrawSetOutline(FCNewLogin[4], 0);
    
TextDrawBackgroundColor(FCNewLogin[4], 255);
    
TextDrawFont(FCNewLogin[4], 4);
    
TextDrawSetProportional(FCNewLogin[4], 0);
    
TextDrawSetShadow(FCNewLogin[4], 0);
    
FCNewLogin[5] = TextDrawCreate(52.999828123.073303"loadsc7:loadsc7");
    
TextDrawLetterSize(FCNewLogin[5], 0.0000000.000000);
    
TextDrawTextSize(FCNewLogin[5], 283.000000159.000000);
    
TextDrawAlignment(FCNewLogin[5], 1);
    
TextDrawColor(FCNewLogin[5], -1);
    
TextDrawSetShadow(FCNewLogin[5], 0);
    
TextDrawSetOutline(FCNewLogin[5], 0);
    
TextDrawBackgroundColor(FCNewLogin[5], 255);
    
TextDrawFont(FCNewLogin[5], 4);
    
TextDrawSetProportional(FCNewLogin[5], 0);
    
TextDrawSetShadow(FCNewLogin[5], 0);
    
FCNewLogin[6] = TextDrawCreate(-126.200096123.126533"loadsc8:loadsc8");
    
TextDrawLetterSize(FCNewLogin[6], 0.0000000.000000);
    
TextDrawTextSize(FCNewLogin[6], 283.000000159.000000);
    
TextDrawAlignment(FCNewLogin[6], 1);
    
TextDrawColor(FCNewLogin[6], -1);
    
TextDrawSetShadow(FCNewLogin[6], 0);
    
TextDrawSetOutline(FCNewLogin[6], 0);
    
TextDrawBackgroundColor(FCNewLogin[6], 255);
    
TextDrawFont(FCNewLogin[6], 4);
    
TextDrawSetProportional(FCNewLogin[6], 0);
    
TextDrawSetShadow(FCNewLogin[6], 0);
    
FCNewLogin[7] = TextDrawCreate(336.500885123.179756"box");
    
TextDrawLetterSize(FCNewLogin[7], 0.00000017.279994);
    
TextDrawTextSize(FCNewLogin[7], 333.7002860.000000);
    
TextDrawAlignment(FCNewLogin[7], 1);
    
TextDrawColor(FCNewLogin[7], -1);
    
TextDrawUseBox(FCNewLogin[7], 1);
    
TextDrawBoxColor(FCNewLogin[7], 255);
    
TextDrawSetShadow(FCNewLogin[7], 0);
    
TextDrawSetOutline(FCNewLogin[7], 0);
    
TextDrawBackgroundColor(FCNewLogin[7], 255);
    
TextDrawFont(FCNewLogin[7], 1);
    
TextDrawSetProportional(FCNewLogin[7], 1);
    
TextDrawSetShadow(FCNewLogin[7], 0);
    
FCNewLogin[8] = TextDrawCreate(158.100860123.499710"box");
    
TextDrawLetterSize(FCNewLogin[8], 0.00000017.279994);
    
TextDrawTextSize(FCNewLogin[8], 155.0000000.000000);
    
TextDrawAlignment(FCNewLogin[8], 1);
    
TextDrawColor(FCNewLogin[8], -1);
    
TextDrawUseBox(FCNewLogin[8], 1);
    
TextDrawBoxColor(FCNewLogin[8], 255);
    
TextDrawSetShadow(FCNewLogin[8], 0);
    
TextDrawSetOutline(FCNewLogin[8], 0);
    
TextDrawBackgroundColor(FCNewLogin[8], 255);
    
TextDrawFont(FCNewLogin[8], 1);
    
TextDrawSetProportional(FCNewLogin[8], 1);
    
TextDrawSetShadow(FCNewLogin[8], 0);
    
FCNewLogin[9] = TextDrawCreate(512.101013122.485931"box");
    
TextDrawLetterSize(FCNewLogin[9], 0.00000017.359994);
    
TextDrawTextSize(FCNewLogin[9], 510.4000240.000000);
    
TextDrawAlignment(FCNewLogin[9], 1);
    
TextDrawColor(FCNewLogin[9], -1);
    
TextDrawUseBox(FCNewLogin[9], 1);
    
TextDrawBoxColor(FCNewLogin[9], 255);
    
TextDrawSetShadow(FCNewLogin[9], 0);
    
TextDrawSetOutline(FCNewLogin[9], 0);
    
TextDrawBackgroundColor(FCNewLogin[9], 255);
    
TextDrawFont(FCNewLogin[9], 1);
    
TextDrawSetProportional(FCNewLogin[9], 1);
    
TextDrawSetShadow(FCNewLogin[9], 0);
    
FCNewLogin[10] = TextDrawCreate(3.000027284.773254"box");
    
TextDrawLetterSize(FCNewLogin[10], 0.00000017.519990);
    
TextDrawTextSize(FCNewLogin[10], 638.0000000.000000);
    
TextDrawAlignment(FCNewLogin[10], 1);
    
TextDrawColor(FCNewLogin[10], -1);
    
TextDrawUseBox(FCNewLogin[10], 1);
    
TextDrawBoxColor(FCNewLogin[10], 255);
    
TextDrawSetShadow(FCNewLogin[10], 0);
    
TextDrawSetOutline(FCNewLogin[10], 1);
    
TextDrawBackgroundColor(FCNewLogin[10], 255);
    
TextDrawFont(FCNewLogin[10], 1);
    
TextDrawSetProportional(FCNewLogin[10], 1);
    
TextDrawSetShadow(FCNewLogin[10], 0);
    
FCNewLogin[11] = TextDrawCreate(316.300170281.093444"2015-2016__-__Versao_9.7.1");
    
TextDrawLetterSize(FCNewLogin[11], 0.4000001.600000);
    
TextDrawAlignment(FCNewLogin[11], 2);
    
TextDrawColor(FCNewLogin[11], -1);
    
TextDrawSetShadow(FCNewLogin[11], 0);
    
TextDrawSetOutline(FCNewLogin[11], 0);
    
TextDrawBackgroundColor(FCNewLogin[11], 255);
    
TextDrawFont(FCNewLogin[11], 2);
    
TextDrawSetProportional(FCNewLogin[11], 1);
    
TextDrawSetShadow(FCNewLogin[11], 0);
    
FCNewLogin[12] = TextDrawCreate(307.600830295.427246"-");
    
TextDrawLetterSize(FCNewLogin[12], 30.1275740.338134);
    
TextDrawAlignment(FCNewLogin[12], 2);
    
TextDrawColor(FCNewLogin[12], -1);
    
TextDrawSetShadow(FCNewLogin[12], 0);
    
TextDrawSetOutline(FCNewLogin[12], 0);
    
TextDrawBackgroundColor(FCNewLogin[12], 255);
    
TextDrawFont(FCNewLogin[12], 2);
    
TextDrawSetProportional(FCNewLogin[12], 1);
    
TextDrawSetShadow(FCNewLogin[12], 0);
    
FCNewLogin[13] = TextDrawCreate(221.599594313.946594"LOGAR");
    
TextDrawLetterSize(FCNewLogin[13], 0.2976001.271466);
    
TextDrawTextSize(FCNewLogin[13], 0.00000061.000000);
    
TextDrawAlignment(FCNewLogin[13], 2);
    
TextDrawColor(FCNewLogin[13], -1);
    
TextDrawUseBox(FCNewLogin[13], 1);
    
TextDrawBoxColor(FCNewLogin[13], -1061109690);
    
TextDrawSetShadow(FCNewLogin[13], 0);
    
TextDrawSetOutline(FCNewLogin[13], 0);
    
TextDrawBackgroundColor(FCNewLogin[13], -2139062017);
    
TextDrawFont(FCNewLogin[13], 2);
    
TextDrawSetProportional(FCNewLogin[13], 1);
    
TextDrawSetShadow(FCNewLogin[13], 0);
    
TextDrawSetSelectable(FCNewLogin[13], true);
    
FCNewLogin[14] = TextDrawCreate(318.102478313.946594"REGISTRAR");
    
TextDrawLetterSize(FCNewLogin[14], 0.2976001.271466);
    
TextDrawTextSize(FCNewLogin[14], 0.00000068.000000);
    
TextDrawAlignment(FCNewLogin[14], 2);
    
TextDrawColor(FCNewLogin[14], -1);
    
TextDrawUseBox(FCNewLogin[14], 1);
    
TextDrawBoxColor(FCNewLogin[14], -1061109690);
    
TextDrawSetShadow(FCNewLogin[14], 0);
    
TextDrawSetOutline(FCNewLogin[14], 0);
    
TextDrawBackgroundColor(FCNewLogin[14], -2139062017);
    
TextDrawFont(FCNewLogin[14], 2);
    
TextDrawSetProportional(FCNewLogin[14], 1);
    
TextDrawSetShadow(FCNewLogin[14], 0);
    
TextDrawSetSelectable(FCNewLogin[14], true);
    
FCNewLogin[15] = TextDrawCreate(318.102478354.349060"ESQUECI MINHA SENHA");
    
TextDrawLetterSize(FCNewLogin[15], 0.2976001.271466);
    
TextDrawTextSize(FCNewLogin[15], 0.000000138.000000);
    
TextDrawAlignment(FCNewLogin[15], 2);
    
TextDrawColor(FCNewLogin[15], -1);
    
TextDrawUseBox(FCNewLogin[15], 1);
    
TextDrawBoxColor(FCNewLogin[15], -1061109690);
    
TextDrawSetShadow(FCNewLogin[15], 0);
    
TextDrawSetOutline(FCNewLogin[15], 0);
    
TextDrawBackgroundColor(FCNewLogin[15], -2139062017);
    
TextDrawFont(FCNewLogin[15], 2);
    
TextDrawSetProportional(FCNewLogin[15], 1);
    
TextDrawSetShadow(FCNewLogin[15], 0);
    
TextDrawSetSelectable(FCNewLogin[15], true);
    
FCNewLogin[16] = TextDrawCreate(420.808746313.946594"SAIR");
    
TextDrawLetterSize(FCNewLogin[16], 0.2976001.271466);
    
TextDrawTextSize(FCNewLogin[16], 0.00000068.000000);
    
TextDrawAlignment(FCNewLogin[16], 2);
    
TextDrawColor(FCNewLogin[16], -1);
    
TextDrawUseBox(FCNewLogin[16], 1);
    
TextDrawBoxColor(FCNewLogin[16], -1061109690);
    
TextDrawSetShadow(FCNewLogin[16], 0);
    
TextDrawSetOutline(FCNewLogin[16], 0);
    
TextDrawBackgroundColor(FCNewLogin[16], -2139062017);
    
TextDrawFont(FCNewLogin[16], 2);
    
TextDrawSetProportional(FCNewLogin[16], 1);
    
TextDrawSetShadow(FCNewLogin[16], 0);
    
TextDrawSetSelectable(FCNewLogin[16], true);
    
FCNewLogin[17] = TextDrawCreate(330.799804394.586700"O_OBJETIVO_DESTE_JOGO_E_PROVER_APENAS_DIVERSAO~n~NAO_FAZEMOS_QUALQUER_TIPO_DE_APOLOGIA~n~JOGO_NAO_RECOMENDADO_PARA_MENORES_DE_18_ANOS~n~NAO_NOS_RESPONSABILIZAMOS_POR_SKINS_E_MODS_CRIADOS_POR_TERCEIROS");
    
TextDrawLetterSize(FCNewLogin[17], 0.2631990.927999);
    
TextDrawAlignment(FCNewLogin[17], 2);
    
TextDrawColor(FCNewLogin[17], -1);
    
TextDrawSetShadow(FCNewLogin[17], 0);
    
TextDrawSetOutline(FCNewLogin[17], 0);
    
TextDrawBackgroundColor(FCNewLogin[17], 255);
    
TextDrawFont(FCNewLogin[17], 2);
    
TextDrawSetProportional(FCNewLogin[17], 1);
    
TextDrawSetShadow(FCNewLogin[17], 0);
    
//OnPlayerConnect
    
if(Player[playerid][pLogged] == false)
    {
        
MostrarLogin(playerid);
    }
    
//OnPlayerSpawn
    
if(Player[playerid][pLogged] == true)
    {
        
EsconderLogin(playerid);
    }
//Stocks
stock MostrarLogin(playerid)
{
    
TextDrawShowForPlayer(playeridFCNewLogin[0]);
    
TextDrawShowForPlayer(playeridFCNewLogin[1]);
    
TextDrawShowForPlayer(playeridFCNewLogin[2]);
    
TextDrawShowForPlayer(playeridFCNewLogin[3]);
    
TextDrawShowForPlayer(playeridFCNewLogin[4]);
    
TextDrawShowForPlayer(playeridFCNewLogin[5]);
    
TextDrawShowForPlayer(playeridFCNewLogin[6]);
    
TextDrawShowForPlayer(playeridFCNewLogin[7]);
    
TextDrawShowForPlayer(playeridFCNewLogin[8]);
    
TextDrawShowForPlayer(playeridFCNewLogin[9]);
    
TextDrawShowForPlayer(playeridFCNewLogin[10]);
    
TextDrawShowForPlayer(playeridFCNewLogin[11]);
    
TextDrawShowForPlayer(playeridFCNewLogin[12]);
    
TextDrawShowForPlayer(playeridFCNewLogin[17]);
    
TextDrawShowForPlayer(playeridFCNewLogin[13]);
    
TextDrawShowForPlayer(playeridFCNewLogin[14]);
    
TextDrawShowForPlayer(playeridFCNewLogin[15]);
    
TextDrawShowForPlayer(playeridFCNewLogin[16]);
    
SelectTextDraw(playeridCOR_CV);
}
stock EsconderLogin(playerid)
{
    
TextDrawHideForPlayer(playeridFCNewLogin[0]);
    
TextDrawHideForPlayer(playeridFCNewLogin[1]);
    
TextDrawHideForPlayer(playeridFCNewLogin[2]);
    
TextDrawHideForPlayer(playeridFCNewLogin[3]);
    
TextDrawHideForPlayer(playeridFCNewLogin[4]);
    
TextDrawHideForPlayer(playeridFCNewLogin[5]);
    
TextDrawHideForPlayer(playeridFCNewLogin[6]);
    
TextDrawHideForPlayer(playeridFCNewLogin[7]);
    
TextDrawHideForPlayer(playeridFCNewLogin[8]);
    
TextDrawHideForPlayer(playeridFCNewLogin[9]);
    
TextDrawHideForPlayer(playeridFCNewLogin[10]);
    
TextDrawHideForPlayer(playeridFCNewLogin[11]);
    
TextDrawHideForPlayer(playeridFCNewLogin[12]);
    
TextDrawHideForPlayer(playeridFCNewLogin[13]);
    
TextDrawHideForPlayer(playeridFCNewLogin[14]);
    
TextDrawHideForPlayer(playeridFCNewLogin[15]);
    
TextDrawHideForPlayer(playeridFCNewLogin[16]);
    
TextDrawHideForPlayer(playeridFCNewLogin[17]);
}
public 
OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
_:clickedid != INVALID_TEXT_DRAW)
    {
        if(
clickedid == FCNewLogin[13]) //Logar
        
{
            if(
Player[playerid][Registrado] == false)
            {
                
SendClientMessage(playeridCOR_ERRO"Vocк ainda nгo tem Conta, se registre primeiro.");
                return 
1;
            }
            
            new 
String[256];
            
format(Stringsizeof(String), CONTASgetPName(playerid));
            if(!
DOF2_FileExists(String))
            {
                
SendClientMessage(playeridCOR_ERRO"ERRO: Vocк estб bugado, por favor entre novamente.");
                
Kick(playerid);
                return 
1;
            }
            
            new 
str[256];
            
format(strsizeof(str), "{FFFFFF}Seja bem vindo a {FF0000}Faccoes City - OFICIAL.\n{FF0000}Status: {00FF00}Registrado.\n{FF0000}Nick:{00FF00}%s\n{FFFFFF}Digite uma senha para logar no servidor."getPName(playerid));
            
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"{FF0000}»  {FFFFFF}LOGIN Faccoes City  {FF0000}«"str"Logar"#);
        
}
        if(
clickedid == FCNewLogin[14]) //registrar
        
{
            if(
Player[playerid][Registrado] == true)
            {
                
SendClientMessage(playeridCOR_ERRO"Vocк ja tem uma conta, use o botгo 'Logar'.");
                return 
1;
            }
            
            new 
String[256];
            
format(Stringsizeof(String), CONTASgetPName(playerid));
            if(
DOF2_FileExists(String))
            {
                
SendClientMessage(playeridCOR_ERRO"ERRO: Vocк estб bugado, por favor entre novamente.");
                
Kick(playerid);
                return 
1;
            }
            
            new 
str[512];
            
format(strsizeof(str), "{FFFFFF}Seja bem vindo a {FF0000}Faccoes City - OFICIAL.\n{FFFFFF}Status: {FF0000}Nгo registrado.\n{FF0000}Nick:{00FF00}%s\n{FFFFFF}Digite uma senha para se registrar."getPName(playerid));
            
ShowPlayerDialog(playeridDIALOG_REGISTRODIALOG_STYLE_PASSWORD"Registro"str"Registrar"#);
        
}
        if(
clickedid == FCNewLogin[15]) //Esqueci minha Senha
        
{
            new 
string[256];
            
format(stringsizeof(string), CONTASgetPName(playerid));
            if(
Player[playerid][Registrado] == false)
            {
                
SendClientMessage(playeridCOR_ERRO"Vocк ainda nгo tem Conta, se registre primeiro.");
                return 
1;
            }
            
            if(
DOF2_GetInt(string"TemPergunta") == 0)
            {
                
SendClientMessage(playeridCOR_ERRO"Sua conta nгo tem uma pergunta secreta definida");
                
SendClientMessage(playeridCOR_ERRO"Visite o forum www.equipefc.forumeiros.com e crie um ticket de ajuda");
                
Kick(playerid);
                return 
1;
            }
            
            
format(string128"{FFFFFF}Insira a resposta da pergunta abaixo para recuperar sua senha:\n{ccff00}%s?"DOF2_GetString(string"Pergunta"));
            
ShowPlayerDialog(playeridDIALOG_NEWLOGIN+1DIALOG_STYLE_INPUT"Recuperar Senha"string"Enviar""Voltar");
        }
        if(
clickedid == FCNewLogin[16]) //Sair
        
{
            
Kick(playerid);
        }
    
CancelSelectTextDraw(playerid);
    }
    return 
1;

Ajuda como resolver?
Reply
#2

if(_:clickedid != INVALID_TEXT_DRAW)

Talvez seja isso, faz um teste.

Se nгo for isso, usa um Preview model (com o model 19382) para fazer os botхes de clique.
Usando textos com TextDrawSetSelectable fica MUITO bugado, as vezes vocк clica do lado da textdraw e o SA-MP diz que vocк clicou nela.
Reply
#3

O problema estб em TextDrawTextSize(Text:text, Float: x, Float:y), vocк deve aumentar mais o valor x, ponha 50.00 e vб ajustando.

Код:
TextDrawTextSize(FCNewLogin[13], 50.000000, 61.000000);
Reply
#4

Pelo q eu percebi vc criou e mostrou as TextDraw's, porйm nгo as fez selecionaveis:

Coloque isso em baixo de todas as texts com suas respectivas variaveis e id's...
Quote:

TextDrawSetSelectable(variavel, id);

Reply
#5

F1N4L, ele jб fez isso olha o cуdigo.

A resposta do cicinho estб certa, https://sampwiki.blast.hk/wiki/TextDrawTextSize

Olha esse trecho que tirei de la:
"Esta funзгo define a бrea que pode ser clicado para uso com TextDrawSetSelectable, seja uma caixa ou nгo й mostrado." - Traduzido por ****** Tradutor
Reply
#6

Uma dica: Quando vocк for fazer suas textdraw clicбveis, na hora ative a box e redimensione a box para que seja a area do click, depois vocк desativa a box e quando vocк pegar o cуdigo estarб com o TextDrawSize que vocк quer.
Reply
#7

Coloquei o Botгo na Box como Falou, e esta funcionando.

Mas uma rapida duvida pra fechar.
if(_:clickedid != INVALID_TEXT_DRAW й realmente necessбrio?

Estou usando sem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)