Botгo ESC TextDraw Nгo Funciona - Repost -
matheusdorado - 26.02.2019
Por algum motivo excluнram minha pergunta, entгo vou repostar.
Pessoal preciso de ajuda para poder excluir as TextDraws quando o player pressionar ESC.
Eu jб fiz de varias maneiras diferentes, porem nгo funciona, vou colocar com o DBUG para vocкs verem.
PHP код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(_:playertextid == INVALID_TEXT_DRAW)
{
SendClientMessage(playerid, CINZA, "DBUG: APERTOU ESC");
}
return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == PlayerText:INVALID_TEXT_DRAW)
{
SendClientMessage(playerid, CINZA, "DBUG: APERTOU ESC");
}
return 1;
}
Obs: Vale Lembrar que estou fazendo uso de TXD's para cada Players individualmente e nгo Globais.
Porem a mensagem do DBUG nгo aparece, ou seja, ele nгo esta executando quando aperto ESC.
Alguйm tem alguma ideia de como resolver?
Vlw Forte Abraзo.
Re: Botгo ESC TextDraw Nгo Funciona - Repost -
Felipealves - 27.02.2019
Se apertar 'ESC' sу essa public й chama a do player nгo й.
PHP код:
public OnPlayerClickTextDraw(playerid, Text:clickedid){
if(clickedid == Text:INVALID_TEXT_DRAW){
SendClientMessage(playerid, CINZA, "DBUG: APERTOU ESC");
}
}
Quando tiver duvidas leia a wiki
https://sampwiki.blast.hk/wiki/OnPlayerClickPlayerTextDraw
Re: Botгo ESC TextDraw Nгo Funciona - Repost -
matheusdorado - 27.02.2019
Quote:
Originally Posted by Felipealves
Se apertar 'ESC' sу essa public й chama a do player nгo й.
PHP код:
public OnPlayerClickTextDraw(playerid, Text:clickedid){
if(clickedid == Text:INVALID_TEXT_DRAW){
SendClientMessage(playerid, CINZA, "DBUG: APERTOU ESC");
}
}
Quando tiver duvidas leia a wiki
https://sampwiki.blast.hk/wiki/OnPlayerClickPlayerTextDraw
|
Brother agradeзo, mas ainda nгo resolveu, tudo que eu faзo, a TXD nгo some.
PHP код:
if(clickedid == Text:INVALID_TEXT_DRAW){
FecharTXD(playerid);
}
Se eu coloco desta maneira acima para chamar a funзгo FecharTXD(playerid); ao dar ESC ele nгo chama, sу torna a TXD inclinбvel mas ela continua na tela.
Se eu coloco direto como esta a forma abaixo, obviamente ele se quer compila.
PHP код:
if(clickedid == Text:INVALID_TEXT_DRAW){
PlayerTextDrawHide(playerid, FecharTXD[playerid][0]);
PlayerTextDrawHide(playerid, FecharTXD[playerid][1]);
PlayerTextDrawHide(playerid, FecharTXD[playerid][2]);
}
Ta difнcil, nгo consigo achar uma forma de resolver kk
Vlw Forte Abraзo, caso tenha mais alguma ideia de soluзгo por favor nгo exite em mandar kkk
Re: Botгo ESC TextDraw Nгo Funciona - Repost -
Felipealves - 27.02.2019
Ta, manda as textdraws e as funзгo de FecharTXD, aqui ta funcionando perfeitamente.
Re: Botгo ESC TextDraw Nгo Funciona - Repost -
matheusdorado - 28.02.2019
Consegui Resolver Tudo Men, mas agradeзo pelas dicas que vc deu ai, obrigado.
Mas de qualquer maneira vou explicar kkk
Primeira coisa que descobri й que nгo se pode chamar um public ou uma Stock da maneira que eu fiz aqui:
PHP код:
if(clickedid == Text:INVALID_TEXT_DRAW){
FecharTXD(playerid);
}
A segunda coisa que descobri й que as publics OnPlayerClickTextDraw e OnPlayerClickPlayerTextDraw precisam estar retornando ZERO.
E dentro do if(clickedid == Text:INVALID_TEXT_DRAW) deve estar retornando 1.
Apenas desta maneira vai funcionar, ficando assim no final:
PHP код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Text:INVALID_TEXT_DRAW)
{
for(new i = 0; i < 13; i++) //Esse 13 й o numero de TXD
{
PlayerTextDrawHide(playerid, TXD[playerid][i]);
}
return 1; //O Return que estava Faltando
}
//Restante das Funзхes
return 0;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == ...)
{
//O que vai fazer
}
return 0;
}
Tmj, fica com Deus, abraзo