[Ajuda] OnPlayerClickTextDraw
#1

Olб, boa noite!

O problema й o seguinte, nгo esta reconhecendo quando clico na TextRG[playerid][37], e quando eu aperto Esc a frase "Teste99" eternamente, como devo proceder ?

pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid){
    if(clickedid == TextRG[playerid][37]){
        HideBoxRG(playerid); CancelSelectTextDraw(playerid);
        SendClientMessage(playerid, -1, "Teste");
    }
    else{
        SendClientMessage(playerid, -1, "Teste99");
        HideBoxRG(playerid); CancelSelectTextDraw(playerid);
    }
    return true;
}
Reply
#2

Quote:

Parameters:
(playerid, Text:clickedid)
playerid The ID of the player that clicked on the textdraw.
clickedid The ID of the clicked textdraw. INVALID_TEXT_DRAW if selection was cancelled.

No seu cуdigo, o jogador recebe a mensagem Teste99 desde que clickedid tenha valor diferente de TextRG[playerid][37]. Quando vocк tecla ESC, a callback й chamada e clickedid tem valor INVALID_TEXT_DRAW, que й diferente de TextRG[playerid][37], por isso vocк recebe a mensagem.
Reply
#3

Obrigado zPain, e sobre o problema de nгo estar identificando o TextRG[playerid][37] ? Sabe o motivo ?

Estou usando assim:

pawn Код:
SelectTextDraw(targetid, 0x9C9C9CAA);
            TextDrawShowForPlayer(targetid, TextRG[playerid][37]);
        }
Reply
#4

Usou TextDrawSetSelectable?

PHP код:
TextDrawSetSelectable(TextRG[playerid][37]);
TextDrawShowForPlayer(targetidTextRG[playerid][37]);
SelectTextDraw(targetid0x9C9C9CAA); 
Reply
#5

Sim:

pawn Код:
TextRG[i][37] = TextDrawCreate(479.000000, 322.000000, "OK");
        TextDrawLetterSize(TextRG[i][37], 0.400000, 1.600000);
        TextDrawTextSize(TextRG[i][37], 0.000000, 21.666669);
        TextDrawAlignment(TextRG[i][37], 2);
        TextDrawColor(TextRG[i][37], 16777215);
        TextDrawUseBox(TextRG[i][37], 1);
        TextDrawBoxColor(TextRG[i][37], 117);
        TextDrawSetShadow(TextRG[i][37], 0);
        TextDrawSetOutline(TextRG[i][37], 1);
        TextDrawBackgroundColor(TextRG[i][37], 255);
        TextDrawFont(TextRG[i][37], 1);
        TextDrawSetProportional(TextRG[i][37], 1);
        TextDrawSetShadow(TextRG[i][37], 0);
        TextDrawSetSelectable(TextRG[i][37], true);
Reply
#6

Use SelectTextDraw apenas apуs exibir o textdraw ao jogador. Nгo sei ao certo se hб diferenзa, mas vale o teste.

PHP код:
TextDrawShowForPlayer(...);
SelectTextDraw(...); 
Reply
#7

Nгo deu, o erro estб aqui:

pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid){
    if(_:clickedid == INVALID_TEXT_DRAW){
        if(NoTuto[playerid] == true)
            return 1;
    }
    else if(clickedid == TextRG[playerid][37]){
        HideBoxRG(playerid); CancelSelectTextDraw(playerid);
    }
    return true;
}
Sу nгo consigo indentificar
Reply
#8

Nгo dб pra clicar porque vocк nгo setou a бrea do click.
PHP код:
TextDrawTextSize(TextRG[i][37], 0.00000021.666669); 
O X nгo pode ser 0.0 senгo me engano.
Reply
#9

Quote:
Originally Posted by NuTShoT
Посмотреть сообщение
Sim:

pawn Код:
TextRG[i][37] = TextDrawCreate(479.000000, 322.000000, "OK");
        TextDrawLetterSize(TextRG[i][37], 0.400000, 1.600000);
        TextDrawTextSize(TextRG[i][37], 0.000000, 21.666669);
        TextDrawAlignment(TextRG[i][37], 2);
        TextDrawColor(TextRG[i][37], 16777215);
        TextDrawUseBox(TextRG[i][37], 1);
        TextDrawBoxColor(TextRG[i][37], 117);
        TextDrawSetShadow(TextRG[i][37], 0);
        TextDrawSetOutline(TextRG[i][37], 1);
        TextDrawBackgroundColor(TextRG[i][37], 255);
        TextDrawFont(TextRG[i][37], 1);
        TextDrawSetProportional(TextRG[i][37], 1);
        TextDrawSetShadow(TextRG[i][37], 0);
        TextDrawSetSelectable(TextRG[i][37], true);
O problema estб aqui:
Код:
TextDrawTextSize(TextRG[i][37], 0.000000, 21.666669);
X nгo pode ser 0.0 , pois assim nгo existe nenhuma бrea no eixo lateral para ser clicбvel.
No caso coloque uns 120 e teste.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)