[Ajuda] Problema TextDrawHideForPlayer
#1

Boas Tardes pessoal estou com dificuldade em esconder estas textdraws, visto que estгo num sistema de casas no qual so consigo usar a variбvel (i) e nгo consigo usar o playerid, o problema esta quando tento usar OnPlayerClickTextDraw para usar o botгo de "cancelar" ele nгo me deixa usar a variavel (i) logo ele nгo funciona quando tento fechar. Alguma sugestгo para solucionar o problema?

PHP код:
public PickupGametexts()
{
    new 
string[500];
    for(new 
i = 0; i < MAX_PLAYERS; i++)
    {
        if(
gPlayerLogged[i])
        {
            
//=============================================[BUILDING GAMETEXTS]==========================================
        
            //=========================================================================================================
            //======================================[HOUSE GAMETEXTS]===================================================
            
for(new n = 0; n < sizeof(Houses); n++)
            {
                if (
PlayerToPoint(1.0, i,Houses[n][EnterX], Houses[n][EnterY], Houses[n][EnterZ]))
                {
                    if(
Houses[n][HousePrice] != 0) //Only show the house if price is set
                    
{
                        if(
Houses[n][Owned] == 0)
                        {
                       new 
casaaid[60];
                        new 
caguistos[60];
                        
                        new 
estadocasa[70];
                            new 
houselocation[MAX_ZONE_NAME];
                            
GetCoords2DZone(Houses[n][EnterX],Houses[n][EnterY], houselocation, MAX_ZONE_NAME);
                        
/*    format(string, sizeof(string), "~g~Esta casa esta para venda!~n~~w~Morada: ~y~ %d %s~n~~w~Descricao: ~y~%s ~n~~w~Preco: ~y~%d euros~n~",n,houselocation,Houses[n][Description],Houses[n][HousePrice]); */
format(casaaid,sizeof(casaaid),"%d", n);
format(caguistos,sizeof(caguistos),"%d", Houses[n][HousePrice]);
format(estadocasa,sizeof(estadocasa),"Para Venda");
                            
GameTextForPlayer(i, string, 3500, 3);
                            
            
TextDrawShowForPlayer(i, Cbox1);
TextDrawShowForPlayer(i, Cbox2);
TextDrawShowForPlayer(i, Cbox3);
TextDrawShowForPlayer(i, Cbox4);
TextDrawShowForPlayer(i, Cbox5);
TextDrawShowForPlayer(i, Cacomprar);
TextDrawShowForPlayer(i, Cacancelar);
TextDrawShowForPlayer(i, Cadescritivo);
TextDrawShowForPlayer(i, Cacomprar);
TextDrawShowForPlayer(i, Capreco);
TextDrawShowForPlayer(i, Caid);
TextDrawShowForPlayer(i, Camorada);
TextDrawShowForPlayer(i, Cainfos);
TextDrawShowForPlayer(i, Caboxmeio);
TextDrawShowForPlayer(i, Calocalidade);
TextDrawShowForPlayer(i, Caparavenda);
TextDrawShowForPlayer(i, Caestado);
TextDrawShowForPlayer(i, Canumid);
TextDrawShowForPlayer(i, Cadin);
TextDrawShowForPlayer(i, Cadescritivo);
TextDrawShowForPlayer(i, Cadescricao);
SelectTextDraw(i, 0x00FF00FF);
TextDrawSetString(Canumid, casaaid);
TextDrawSetString(Caestado, estadocasa);
TextDrawSetString(Calocalidade, houselocation);
TextDrawSetString(Cadescricao, Houses[n][Description]);
TextDrawSetString(Cadin, caguistos);
TextDrawSetSelectable(Cacomprar, true);
TextDrawSetSelectable(Cacancelar, true);
                                
                        } 
Reply
#2

sobre essa questгo da variбvel [i] ela significa playerid, pois vc esta usando ela lo loop
for(new i = 0; i < MAX_PLAYERS; i++)

Na OnPlayerClickTextDraw nгo ira ter interferкncia usando playerid!

Sobre seu problema verifique se a text draw de cancelar esta selecionбvel, utilizando

pawn Код:
TextDrawSetSelectable(Cacancelar, true); //true й selecionavel, false nгo selecionavel
Reply
#3

Sim pois era isso que pensava a questгo a questгo e que eu tenho a TextDrawSetSelectable(Cacancelar, true);
esse nгo e o problema. A ъnica possibilidade e eu estar a fazer mal a OnPlayerClickTextDraw


PHP код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(
clickedid == Cacancelar)
    {
 
SendClientMessage(playerid, 0xFFFFFFAA, "teste");
 
SendClientMessage(playerid, 0xFFFFFFAA, "teste");
TextDrawHideForPlayer(playerid, Cbox2);
TextDrawHideForPlayer(playerid, Cbox3);
TextDrawHideForPlayer(playerid, Cbox4);
TextDrawHideForPlayer(playerid, Cbox5);
TextDrawHideForPlayer(playerid, Cacomprar);
TextDrawHideForPlayer(playerid, Cacancelar);
TextDrawHideForPlayer(playerid, Cadescritivo);
TextDrawHideForPlayer(playerid, Cacomprar);
TextDrawHideForPlayer(playerid, Capreco);
TextDrawHideForPlayer(playerid, Caid);
TextDrawHideForPlayer(playerid, Camorada);
TextDrawHideForPlayer(playerid, Cainfos);
TextDrawHideForPlayer(playerid, Caboxmeio);
TextDrawHideForPlayer(playerid, Calocalidade);
TextDrawHideForPlayer(playerid, Caparavenda);
TextDrawHideForPlayer(playerid, Caestado);
TextDrawHideForPlayer(playerid, Canumid);
TextDrawHideForPlayer(playerid, Cadin);
TextDrawHideForPlayer(playerid, Cadescritivo);
TextDrawHideForPlayer(playerid, Cadescricao);
CancelSelectTextDraw(playerid);
        return 
1;
    } 
Reply
#4

Problema resolvido, tinha de adicionar uma box na textdraw obrigado pela ajuda Cleyson
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)