SA-MP Forums Archive
[Ajuda] As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] As funзхes nгo sгo chamadas (Ao Clicar TextDraw) (/showthread.php?tid=467572)



As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - RuanRider - 03.10.2013

No outro post eu tavo com problema em selecionar, mas jб resolvi. Agora estou com outro problema...

Quando clico na textdraw, as funзхes nгo sгo chamadas!

OnPlayerConnect

PHP код:
    tdimgduck CreatePlayerTextDraw(playerid,538.000000409.000000"ooo");
    
PlayerTextDrawBackgroundColor(playerid,tdimgduck255);
    
PlayerTextDrawFont(playerid,tdimgduck1);
    
PlayerTextDrawLetterSize(playerid,tdimgduck0.4499990.899999);
    
PlayerTextDrawColor(playerid,tdimgduck, -1);
    
PlayerTextDrawSetOutline(playerid,tdimgduck0);
    
PlayerTextDrawSetProportional(playerid,tdimgduck1);
    
PlayerTextDrawSetShadow(playerid,tdimgduck1);
    
PlayerTextDrawUseBox(playerid,tdimgduck1);
    
PlayerTextDrawBoxColor(playerid,tdimgduck0);
    
PlayerTextDrawTextSize(playerid,tdimgduck569.00050012.000500);
    
PlayerTextDrawSetSelectable(playerid,tdimgduck1); 
OnPlayerClickTextDraw

PHP код:
    if(clickedid == Text:tdimgduck)
    {
        
SendClientMessage(playerid, -1"oi");
        if (
ButtonWasClicked[playerid] == 0)
        {
            
ButtonWasClicked[playerid] = 1;
            
PlayerTextDrawHide(playeridPlayerText:score);
            return 
1;
        }
        else
        {
            
ButtonWasClicked[playerid] = 0;
            
PlayerTextDrawShow(playeridPlayerText:score);
        }
    } 



Re: As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - zSuYaNw - 04.10.2013

faz debug.

pawn Код:
printf("%d - %d", clickedid,tdimgduck);



Re: As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - RuanRider - 04.10.2013

Quote:
Originally Posted by zSuYaNw
Посмотреть сообщение
faz debug.

pawn Код:
printf("%d - %d", clickedid,tdimgduck);
e onde que eu coloco isso


Re: As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - Juniiro3 - 04.10.2013

Depois de cada funзгo, pra ver onde deu o erro.


Re: As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - RuanRider - 04.10.2013

Код:
C:\Ruan/Desktop/samp-server/testes.pwn(263) : warning 213: tag mismatch
C:\Ruan/Desktop/samp-server/testes.pwn(263) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.



Re: As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - zSuYaNw - 04.10.2013

pawn Код:
printf ( "%d - %d" , _:clickedid,_:tdimgduck);



Respuesta: Re: As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - DanDRT - 04.10.2013

Quote:
Originally Posted by Juniiro3
Посмотреть сообщение
Depois de cada funзгo, pra ver onde deu o erro.
clickedid vai ser sempre somente uma id, nгo vai adiantar й sу por no comeзo da callback e pronto.


Re: As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - RuanRider - 04.10.2013

Colokei isso abaixo de todas as funзхes do OnPlayerClickTextDraw

Minha conclusгo foi: Eu clico na texdraw normalmente, aparece atй a cor destaque, mas nгo chama as funзхes!


Re: As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - RuanRider - 04.10.2013

enquanto eu estava tomando banho, lembrei q eu tinha botado variaves assim:

new tdimgduck[MAX_PLAYERS];
new tdimgduck1[MAX_PLAYERS];
new tdimgduck2[MAX_PLAYERS];
new tdimgduck3[MAX_PLAYERS];

por causa do numero q nao tava dando .. Й CADA COISA BOBA nй

outra coisa tmb, eu estava colocando na callback OnPlayerClickTextDraw, deveria ter colocado na OnPlayerClickPlayerTextDraw...


RESOLVIDO

+rep pra mim


Re: As funзхes nгo sгo chamadas (Ao Clicar TextDraw) - mau.tito - 04.10.2013

Quote:
Originally Posted by RuanRider
Посмотреть сообщение
enquanto eu estava tomando banho, lembrei q eu tinha botado variaves assim:

new tdimgduck[MAX_PLAYERS];
new tdimgduck1[MAX_PLAYERS];
new tdimgduck2[MAX_PLAYERS];
new tdimgduck3[MAX_PLAYERS];

por causa do numero q nao tava dando .. Й CADA COISA BOBA nй

outra coisa tmb, eu estava colocando na callback OnPlayerClickTextDraw, deveria ter colocado na OnPlayerClickPlayerTextDraw...


RESOLVIDO

+rep pra mim
Acho que vocк deveria usar PlayerText: na frente de cada variavel!