SA-MP Forums Archive
[Ajuda]Textdraw em gz - 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]Textdraw em gz (/showthread.php?tid=294051)



[Ajuda]Textdraw em gz - DrTHE - 30.10.2011

ola gostaria de saber como fazer uma textdraw ser exibida ao player que entrar na gz,e apos ele sair a textdraw desaparecer


Re: [Ajuda]Textdraw em gz - Macintosh - 30.10.2011

https://sampwiki.blast.hk/wiki/Areacheck e https://sampforum.blast.hk/showthread.php?tid=66300


Re: [Ajuda]Textdraw em gz - DrTHE - 30.10.2011

vlw mac '='


Re: [Ajuda]Textdraw em gz - rjjj - 30.10.2011

Bem, vamos supor que vocк tem uma GZ de nome Exemplo e uma funзгo chamada IsPlayerInGZ(playerid), responsбvel pela avaliaзгo da condiзгo do jogador como dentro ou nгo da GZ .



Com tudo isso, basta vocк criar um cуdigo usando SetTimer e um loop para sempre checar se o jogador estб na GZ, se estiver, o TextDraw aparecerб, caso contrбrio o TextDraw desaparecerб .



Aqui, um cуdigo demonstrando tudo isso, com variбveis de nomes iguais aos das citadas por min antes:



pawn Код:
//Coloque no Topo do GM:

new Text:Exemplo;  //Variбvel que cria o TextDraw e que o representa no cуdigo.



//Coloque na public OnGameModeInit:

SetTimer("MostrarTextDrawGZ", 1000, true);  //Um SetTimer para rodar a callback MostrarTextDrawGZ sempre, enquanto o server estiver aberto.




//Coloque no final do GM:

forward MostrarTextDrawGZ();
public MostrarTextDrawGZ()  
{
    for(new x = 0; y = GetMaxPlayers(); x != y; x++)   //Loop
    {
        if(IsPlayerInGZ(x))  //A funзгo IsPlayerInGZ (que checa se o jogador estб na GZ) sendo usada. Se vocк nгo tiver essa funзгo (que pode variar de nome: IsPlayerInMorro, IsPlayerInCassino, etc), crie-a tendo como base a funзгo do IsPlayerInArea, do site Wiki Samp.
        {
            TextDrawShowForPlayer(x, Exemplo); //Mostra o TextDraw.
        }
        else
        {
            TextDrawHideForPlayer(x, Exemplo);  //Esconde o TextDraw.
        }
    }
    return true;
}


Espero ter ajudado .