SA-MP Forums Archive
[Ajuda] Como crio TexDraw no inicio do server? - 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] Como crio TexDraw no inicio do server? (/showthread.php?tid=403666)



Como crio TexDraw no inicio do server? - yuran - 31.12.2012

Como crio TexDraw no inicio do server tipo na tela de login aparece o nome do server?


Re: Como crio TexDraw no inicio do server? - mau.tito - 31.12.2012

Exemplo!
pawn Код:
#include <a_samp>

new Text:Textdraw0;
new Text:Textdraw1;

public OnFilterScriptInit()
{
    // Create the textdraws:
    Textdraw0 = TextDrawCreate(523.000000, 414.000000, "SiLLenTz");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 1);
    TextDrawLetterSize(Textdraw0, 0.559999, 1.800000);
    TextDrawColor(Textdraw0, 65535);
    TextDrawSetOutline(Textdraw0, 1);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetSelectable(Textdraw0, 0);

    Textdraw1 = TextDrawCreate(572.000000, 425.000000, "KillerS");
    TextDrawBackgroundColor(Textdraw1, 255);
    TextDrawFont(Textdraw1, 1);
    TextDrawLetterSize(Textdraw1, 0.559999, 1.800000);
    TextDrawColor(Textdraw1, -16776961);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawSetProportional(Textdraw1, 1);
    TextDrawSetSelectable(Textdraw1, 0);

    for(new i; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            TextDrawShowForPlayer(i, Textdraw0);
            TextDrawShowForPlayer(i, Textdraw1);
        }
    }
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    return 1;
}

// Resposta do dialog de login/registro

/*  TextDrawHideForAll(Textdraw0);
    TextDrawDestroy(Textdraw0);
    TextDrawHideForAll(Textdraw1);
    TextDrawDestroy(Textdraw1);*/



Re: Como crio TexDraw no inicio do server? - Kuddy - 31.12.2012

Quote:
Originally Posted by mau.tito
Посмотреть сообщение
Exemplo!
pawn Код:
#include <a_samp>

new Text:Textdraw0;
new Text:Textdraw1;

public OnFilterScriptInit()
{
    // Create the textdraws:
    Textdraw0 = TextDrawCreate(523.000000, 414.000000, "SiLLenTz");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 1);
    TextDrawLetterSize(Textdraw0, 0.559999, 1.800000);
    TextDrawColor(Textdraw0, 65535);
    TextDrawSetOutline(Textdraw0, 1);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetSelectable(Textdraw0, 0);

    Textdraw1 = TextDrawCreate(572.000000, 425.000000, "KillerS");
    TextDrawBackgroundColor(Textdraw1, 255);
    TextDrawFont(Textdraw1, 1);
    TextDrawLetterSize(Textdraw1, 0.559999, 1.800000);
    TextDrawColor(Textdraw1, -16776961);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawSetProportional(Textdraw1, 1);
    TextDrawSetSelectable(Textdraw1, 0);

    for(new i; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            TextDrawShowForPlayer(i, Textdraw0);
            TextDrawShowForPlayer(i, Textdraw1);
        }
    }
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    return 1;
}

// Resposta do dialog de login/registro

/*  TextDrawHideForAll(Textdraw0);
    TextDrawDestroy(Textdraw0);
    TextDrawHideForAll(Textdraw1);
    TextDrawDestroy(Textdraw1);*/
Seu code nгo й funcional, vocк estб motrando a TD para 1 e deletando para todos WTF


Re: Como crio TexDraw no inicio do server? - leigorm - 01.01.2013

Acho que entendi, usa GameText, tipo assim

pawn Код:
GameTextForPlayer(playerid, "~y~Bem vindo ~g~ ao nosso ~p~servidor", 5000, 1);
No caso vocк quer que ele conecte.
entгo coloca em
pawn Код:
public OnPlayerConnect(playerid)
Explicando o cуdigo
pawn Код:
GameTextForPlayer(playerid, "~y~Bem vindo ~g~ ao nosso ~p~servidor", 5000, 1);
~y~.~g~ ~p~ sгo as cores
Que vocк pode ver as cores aqui ( https://sampwiki.blast.hk/wiki/GameTextStyle )

5000
и o tempo que o texto vai ficar na tela pro player

1
и o estilo do texto, existe alguns, veja aqui ( https://sampwiki.blast.hk/wiki/GameTextStyle )
E altere do jeito que vocк quer

Espero ter ajudado.

OBS: и um jeito simples, que eu consegui fazer lendo tutoriais


Re: Como crio TexDraw no inicio do server? - Galhardo - 01.01.2013

Primeiro crie uma new para o TextDraw:
pawn Код:
new Text: NomeServerInicio;
Depois coloque as configuraзхes dessa TextDraw (cor da letra, tamanho, sombra, etc..) no OnGameModeInit:
pawn Код:
NomeServerInicio = TextDrawCreate(316.5, 200.5, "NOME DO SEU SERVIDOR"); // Coloque aqui o nome do seu servidor
TextDrawFont(NomeServerInicio, 1);
TextDrawColor(NomeServerInicio, 0xFFFFFFFF);
TextDrawLetterSize(NomeServerInicio, 1.0, 4.0);
TextDrawSetOutline(NomeServerInicio, 1);
TextDrawSetProportional(NomeServerInicio, 1);
TextDrawAlignment(NomeServerInicio, 2);
TextDrawBackgroundColor(NomeServerInicio, 0x000000FF);
TextDrawSetShadow(NomeServerInicio, 1);
Obs.: nesse aн aparece um texto grande

Agora escolha onde o texto vai aparecer, que, no seu caso, irб aparecer no inicio, quando conecta no servidor, atй quando ele spawnar (por exemplo, vocк pode escolher).
Entгo coloque no OnPlayerConnect:
pawn Код:
TextDrawShowForPlayer(playerid, NomeServerInicio); // Irб aparecer o TextDraw quando o player conectar
E, quando vocк quizer que o texto saia, por exemplo, quando ele spawnar, coloque no OnPlayerSpawn:
pawn Код:
TextDrawHideForPlayer(playerid, NomeServerInicio); // Irб desaparecer o TextDraw quando o player spawnar
Qualquer dъvida me fale, abraзos!