SSGamers - 12 Anos online por você.

#SSGamers - A Comunidade que mais crescer no brasil!

Participe do fórum, é rápido e fácil

SSGamers - 12 Anos online por você.

#SSGamers - A Comunidade que mais crescer no brasil!

SSGamers - 12 Anos online por você.

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Chegou o novo tema 6.5.5 - SSGamers - Servidores online de qualidade - Aproveite e entre para nossa comunidade, inscreva-se já! - Ouça nossa web radio - Veja nossas novidades - Participe dos nossos setores de jogos online - Parcerias aberta fale já com um administrador.

    [Tutorial] Textdraws Clicáveis

    Weslley_Script
    Weslley_Script
    SS - Fundador
    SS - Fundador


    Steam Steam : WeslleySSGames
    Zello : WeslleySSGames
    Mensagens : 11378
    Moedas : 1031971
    Data de inscrição : 06/10/2011
    Idade : 28
    Localização : Brasil

    [Tutorial] Textdraws Clicáveis Empty [Tutorial] Textdraws Clicáveis

    Mensagem por Weslley_Script Dom 23 Abr 2023 - 20:08

    Textdraws Clicáveis


    Neste tutorial, você vai aprender a fazer textdraws clicáveis ​​com as mais diversas aplicações, sendo somente limitado pela sua imaginação!

    Para realizar o serviço, você precisa de algumas ferramentas. Elas são opções, porém fica bem mais fácil de fazer Textdraws com as ferramentas.


    Criando como textdraws


    No exemplo deste tutorial, eu vou fazer um pequeno sistema de registro por textdraws clicáveis, que você pode verificar (e testá-lo em aзгo) no seguinte servidor: 208.115.224.233:7777. Caso você não saiba como desenhar textdraws no iPLEOMAX's Textdraw Editor, entre no link providenciado acima e veja o vídeo com o tutorial.


    O textdraw deste tutorial (após finalizado) terá o seguinte aspecto:



    As setas e o cone de balгo sгo SPRITES, imagens de textura do GTA original. O Sprite Browser permite que você procure alguns (se não todos) sprites disponíveis para uso.



    Para começar, devemos definir o código das Textdraws e criá-las.
    peão Код:

    Código:
    //Preferencialmente no comeзo de seu GM, iremos definir as variбveis que guardaгo como textdraws...


    new  Text : RegisterOption [ 7 ] ;


    novo  Texto : RegisterClick [ MAX_PLAYERS ] ;


    novo  texto : RegisterText [ MAX_PLAYERS ] [ 5 ] ;


    novo  Texto : RegisterLeft [ MAX_PLAYERS ] [ 5 ] ;


    novo  texto : Registre-se à direita [ MAX_PLAYERS] [ 5 ] ;


    Agora que suas variáveis ​​foram inicializadas, vamos criar as textdraws em OnGameModeInit...
    peão Код:
    Código:
    RegisterOption [ 0 ]  = TextDrawCreate ( 608.000000 , 173.648147 , "usebox" ) ; // Textdraw da caixa preta de fundo;
        TextDrawLetterSize ( RegisterOption [ 0 ] , 0.000000 , 24.295679 ) ;
        TextDrawTextSize ( RegisterOption [ 0 ] , 443.000000 , 0.000000 ) ;
        TextDrawAlignment ( RegisterOption [ 0 ], 1 ) ;
        TextDrawColor ( RegisterOption [ 0 ] , 0 ) ;
        TextDrawUseBox ( RegisterOption [ 0 ] , verdadeiro ) ;
        TextDrawBoxColor ( RegisterOption [ 0 ] , 102 ) ;
        TextDrawSetShadow ( RegisterOption [ 0 ] , 0 ) ;
        TextDrawSetOutline ( RegisterOption [ 0 ], 0 ) ;
        TextDrawFont ( RegisterOption [ 0 ] , 0 ) ;

        RegisterOption [ 1 ]  = TextDrawCreate ( 434.666687 , 156.385192 , "Registro" ) ; //Textdraw Azul escrita Registro...
         TextDrawLetterSize ( RegisterOption [ 1 ] , 0.736666 , 2.325926 ) ;
        TextDrawAlignment ( RegisterOption [ 1] , 1 ) ;
        TextDrawColor ( RegisterOption [ 1 ] , 257552383 ) ;
        TextDrawSetShadow ( RegisterOption [ 1 ] , 0 ) ;
        TextDrawSetOutline ( RegisterOption [ 1 ] , 1 ) ;
        TextDrawBackgroundColor ( RegisterOption [ 1 ] , 51 ) ;
        TextDrawFont ( RegisterOption[ 1 ] , 0 ) ;
        TextDrawSetProportional ( RegisterOption [ 1 ] , 1 ) ;

        RegisterOption [ 2 ]  = TextDrawCreate ( 452.666595 , 194.548156 , "Idade:" ) ; //Resto dos textdraws...
         TextDrawLetterSize ( RegisterOption [ 2 ] , 0.301665 , 1.255702 ) ;
        TextDrawAlignment (RegisterOption [ 2 ] , 1 ) ;
        TextDrawColor ( RegistrarOpção [ 2 ] , - 1 ) ;
        TextDrawSetShadow ( RegisterOption [ 2 ] , 0 ) ;
        TextDrawSetOutline ( RegisterOption [ 2 ] , - 1 ) ;
        TextDrawBackgroundColor ( RegisterOption [ 2 ] , 255 ) ;
        TextDrawFont ( RegisterOption [ 2 ] , 2 ) ;
        TextDrawSetProportional ( RegisterOption [ 2 ] , 1 ) ;

        RegisterOption [ 3 ]  = TextDrawCreate ( 452.666595 , 217.777755 , "Altura:" ) ;
        TextDrawLetterSize ( RegisterOption [ 3 ] , 0.300998 , 1.254999 ) ;
        TextDrawAlignment( RegistrarOpção [ 3 ] , 1 ) ;
        TextDrawColor ( RegistrarOpção [ 3 ] , - 1 ) ;
        TextDrawSetShadow ( RegisterOption [ 3 ] , 0 ) ;
        TextDrawSetOutline ( RegisterOption [ 3 ] , - 1 ) ;
        TextDrawBackgroundColor ( RegisterOption [ 3 ] , 255 );
        TextDrawFont ( RegisterOption [ 3 ] , 2 ) ;
        TextDrawSetProportional ( RegisterOption [ 3 ] , 1 ) ;

        RegisterOption [ 4 ]  = TextDrawCreate ( 452.666595 , 241.007354 , "Peso:" ) ;
        TextDrawLetterSize ( RegisterOption [ 4 ] , 0,300998 , 1,254999 ) ;
        TextDrawAlignment ( RegisterOption [ 4 ] , 1 ) ;
        TextDrawColor ( RegistrarOpção [ 4 ] , - 1 ) ;
        TextDrawSetShadow ( RegisterOption [ 4 ] , 0 ) ;
        TextDrawSetOutline ( RegisterOption [ 4 ] , 1 ) ;
        TextDrawBackgroundColor ( RegisterOption [ 4 ] ,255 ) ;
        TextDrawFont ( RegisterOption [ 4 ] , 2 ) ;
        TextDrawSetProportional ( RegisterOption [ 4 ] , 1 ) ;

        RegisterOption [ 5 ]  = TextDrawCreate ( 452.666595 , 264.236953 , "Skin:" ) ;
        TextDrawLetterSize ( RegisterOption [ 5 ] , 0,300998 , 1,254999 );
        TextDrawAlignment ( RegisterOption [ 5 ] , 1 ) ;
        TextDrawColor ( RegisterOption [ 5 ] , - 1 ) ;
        TextDrawSetShadow ( RegisterOption [ 5 ] , 0 ) ;
        TextDrawSetOutline ( RegisterOption [ 5 ] , 1 ) ;
        TextDrawBackgroundColor ( RegisterOption [ 5 ] ,255 ) ;
        TextDrawFont ( RegisterOption [ 5 ] , 2 ) ;
        TextDrawSetProportional ( RegisterOption [ 5 ] , 1 ) ;

        RegisterOption [ 6 ]  = TextDrawCreate ( 452.666595 , 287.466552 , "Spawn:" ) ;
        TextDrawLetterSize ( RegisterOption [ 6 ] , 0.300998 , 1.254999 );
        TextDrawAlignment ( RegisterOption [ 6 ] , 1 ) ;
        TextDrawColor ( RegisterOption [ 6 ] , - 1 ) ;
        TextDrawSetShadow ( RegisterOption [ 6 ] , 0 ) ;
        TextDrawSetOutline ( RegisterOption [ 6 ] , 1 ) ;
        TextDrawBackgroundColor ( RegisterOption [ 6 ] ,255 ) ;
        TextDrawFont ( RegisterOption [ 6 ] , 2 ) ;
        TextDrawSetProportional ( RegisterOption [ 6 ] , 1 ) ;
    Essas são as textdraws que não são clicáveis. As textdraws acima são globais (não são criados uma por jogador) pois são textos imutáveis ​​e básicos. Agora, vamos proceder a colocar os textdraws por player, que são os textos que o jogador clicará e/ou modificará.

    peão Код:
    Código:
    for ( new i =  0 ; i < MAX_PLAYERS; i ++ )
        {
             RegisterClick [ i ]  = TextDrawCreate ( 509.137298 , 342.131469 , "ld_chat:thumbup" ) ; //Textura do balçozinho.
            TextDrawLetterSize ( RegisterClick [ i ] , 0,000000 , 0,000000 ) ;
            TextDrawTextSize ( RegisterClick [ i ] ,29.019626 , 31.487031 ) ;
            TextDrawAlignment ( RegisterClick [ i ] , 1 ) ;
            TextDrawColor ( RegisterClick [ i ] , - 1 ) ;
            TextDrawSetShadow ( RegisterClick [ i ] , 0 ) ;
            TextDrawSetOutline ( RegisterClick [ i ] , 0 ) ;
            TextDrawFont (RegisterClick [ i ] , 4 ) ;
            TextDrawSetSelectable ( RegisterClick [ i ] , true ) ;
            
            RegisterText [ i ] [ 0 ]  = TextDrawCreate ( 556.331970 , 194.548156 , "18" ) ;
            TextDrawLetterSize ( RegisterText [ i ] [ 0 ] , 0,300998 , 1,254999 ) ;
            TextDrawAlignment ( RegisterText [ i ] [ 0 ] , 2 ) ;
            TextDrawColor ( RegisterText [ i ] [ 0 ] , 257552383 ) ;
            TextDrawSetShadow ( RegisterText [ i ] [ 0 ] , 0 ) ;
            TextDrawSetOutline ( RegisterText [ i ] [ 0 ] , 1) ;
            TextDrawBackgroundColor ( RegisterText [ i ] [ 0 ] , 255 ) ;
            TextDrawFont ( RegistroTexto [ i ] [ 0 ] , 2 ) ;
            TextDrawSetProportional ( RegisterText [ i ] [ 0 ] , 1 ) ;

            RegisterLeft [ i ] [ 0 ]  = TextDrawCreate( 509.000274 , 192.888931 , "ld_beat:left" ) ; //Textura da seta esquerda.
            TextDrawLetterSize ( RegisterLeft [ i ] [ 0 ] , 0,002000 , 0,037333 ) ;
            TextDrawTextSize ( RegisterLeft [ i ] [ 0 ] , 17.006999 , 17.007396 ) ;
            TextDrawAlignment ( RegisterLeft [ i ] [ 0] , 1 ) ;
            TextDrawColor ( RegistrarEsquerda [ i ] [ 0 ] , - 1 ) ;
            TextDrawSetShadow ( RegisterLeft [ i ] [ 0 ] , 0 ) ;
            TextDrawSetOutline ( RegistroEsquerda [ i ] [ 0 ] , 0 ) ;
            TextDrawFont ( RegisterLeft [ i ][ 0 ] , 4 ) ;
            TextDrawSetSelectable ( RegisterLeft [ i ] [ 0 ] , verdadeiro ) ;

            RegisterRight [ i ] [ 0 ]  = TextDrawCreate ( 586.666137 , 192.888931 , "ld_beat:right" ) ; //Textura da seta direita.
            TextDrawLetterSize ( RegisterRight [ i ] [ 0 ] , 0,000000, 0,000000 ) ;
            TextDrawTextSize ( RegisterRight [ i ] [ 0 ] , 17.006999 , 18.666671 ) ;
            TextDrawAlignment ( RegistrarRight [ i ] [ 0 ] , 1 ) ;
            TextDrawColor ( RegistroDireito [ i ] [ 0 ] , - 1 ) ;
            TextDrawSetShadow ( RegisterRight[ i ] [ 0 ] , 0 ) ;
            TextDrawSetOutline ( RegistroDireito [ i ] [ 0 ] , 0 ) ;
            TextDrawFont ( RegistrarRight [ i ] [ 0 ] , 4 ) ;
            TextDrawSetSelectable ( RegisterRight [ i ] [ 0 ] , verdadeiro ) ;
            
            RegisterText [ i] [ 1 ]  = TextDrawCreate ( 556.331970 , 217.777755 , "130cm" ) ;
            TextDrawLetterSize ( RegisterText [ i ] [ 1 ] , 0,300998 , 1,254999 ) ;
            TextDrawAlignment ( RegisterText [ i ] [ 1 ] , 2 ) ;
            TextDrawColor ( RegisterText [ i ] [ 1] , 257552383 ) ;
            TextDrawSetShadow ( RegisterText [ i ] [ 1 ] , 0 ) ;
            TextDrawSetOutline ( RegistroTexto [ i ] [ 1 ] , 1 ) ;
            TextDrawBackgroundColor ( RegisterText [ i ] [ 1 ] , 255 ) ;
            TextDrawFont ( RegisterText [ i ][ 1 ] , 2 ) ;
            TextDrawSetProportional ( RegisterText [ i ] [ 1 ] , 1 ) ;

            RegisterLeft [ i ] [ 1 ]  = TextDrawCreate ( 509.000274 , 216.11853 , "ld_beat:left" ) ;
            TextDrawLetterSize ( RegisterLeft [ i ] [ 1 ] , 0,002000 , 0,037333) ;
            TextDrawTextSize ( RegisterLeft [ i ] [ 1 ] , 17.006999 , 17.007396 ) ;
            TextDrawAlignment ( RegisterLeft [ i ] [ 1 ] , 1 ) ;
            TextDrawColor ( RegistrarEsquerda [ i ] [ 1 ] , - 1 ) ;
            TextDrawSetShadow ( RegisterLeft [ i ][ 1 ] , 0 ) ;
            TextDrawSetOutline ( RegistroEsquerda [ i ] [ 1 ] , 0 ) ;
            TextDrawFont ( RegistrarEsquerda [ i ] [ 1 ] , 4 ) ;
            TextDrawSetSelectable ( RegisterLeft [ i ] [ 1 ] , verdadeiro ) ;

            RegistrarDireita [ i ] [ 1]  = TextDrawCreate ( 586.666137 , 216.11853 , "ld_beat:right" ) ;
            TextDrawLetterSize ( RegistrarRight [ i ] [ 1 ] , 0,000000 , 0,000000 ) ;
            TextDrawTextSize ( RegisterRight [ i ] [ 1 ] , 17.006999 , 18.666671 ) ;
            TextDrawAlignment ( RegisterRight [ i ][ 1 ] , 1 ) ;
            TextDrawColor ( RegistrarDireita [ i ] [ 1 ] , - 1 ) ;
            TextDrawSetShadow ( RegistrarRight [ i ] [ 1 ] , 0 ) ;
            TextDrawSetOutline ( RegistrarRight [ i ] [ 1 ] , 0 ) ;
            TextDrawFont ( RegisterRight [i ] [ 1 ] , 4 ) ;
            TextDrawSetSelectable ( RegisterRight [ i ] [ 1 ] , verdadeiro ) ;  
            
            RegisterText [ i ] [ 2 ]  = TextDrawCreate ( 556.331970 , 241.007354 , "45kg" ) ;
            TextDrawLetterSize ( RegisterText [ i ] [ 2 ] , 0.300998 ,1.254999 ) ;
            TextDrawAlignment ( RegisterText [ i ] [ 2 ] , 2 ) ;
            TextDrawColor ( RegisterText [ i ] [ 2 ] , 257552383 ) ;
            TextDrawSetShadow ( RegisterText [ i ] [ 2 ] , 0 ) ;
            TextDrawSetOutline ( RegisterText [ i ] [ 2] , 1 ) ;
            TextDrawBackgroundColor ( RegisterText [ i ] [ 2 ] , 255 ) ;
            TextDrawFont ( RegistroTexto [ i ] [ 2 ] , 2 ) ;
            TextDrawSetProportional ( RegisterText [ i ] [ 2 ] , 1 ) ;

            RegistrarEsquerda [ i ] [ 2 ] = TextDrawCreate ( 509.000274 , 239.348129 , "ld_beat:left" ) ;
            TextDrawLetterSize ( RegisterLeft [ i ] [ 2 ] , 0,002000 , 0,037333 ) ;
            TextDrawTextSize ( RegisterLeft [ i ] [ 2 ] , 17.006999 , 17.007396 ) ;
            TextDrawAlignment ( RegisterLeft [ i ] [ 2] , 1 ) ;
            TextDrawColor ( RegistrarEsquerda [ i ] [ 2 ] , - 1 ) ;
            TextDrawSetShadow ( RegisterLeft [ i ] [ 2 ] , 0 ) ;
            TextDrawSetOutline ( RegistrarEsquerda [ i ] [ 2 ] , 0 ) ;
            TextDrawFont ( RegisterLeft [ i ][ 2 ] , 4 ) ;
            TextDrawSetSelectable ( RegisterLeft [ i ] [ 2 ] , verdadeiro ) ;

            RegisterRight [ i ] [ 2 ]  = TextDrawCreate ( 586.666137 , 239.348129 , "ld_beat:right" ) ;
            TextDrawLetterSize ( RegisterRight [ i ] [ 2 ] , 0,000000 , 0,000000) ;
            TextDrawTextSize ( RegisterRight [ i ] [ 2 ] , 17.006999 , 18.666671 ) ;
            TextDrawAlignment ( RegistrarRight [ i ] [ 2 ] , 1 ) ;
            TextDrawColor ( RegistrarDireita [ i ] [ 2 ] , - 1 ) ;
            TextDrawSetShadow ( RegisterRight [ i ][ 2 ] , 0 ) ;
            TextDrawSetOutline ( RegistrarRight [ i ] [ 2 ] , 0 ) ;
            TextDrawFont ( RegistrarRight [ i ] [ 2 ] , 4 ) ;
            TextDrawSetSelectable ( RegisterRight [ i ] [ 2 ] , verdadeiro ) ;  
            
            RegisterText [ i ] [ 3]  = TextDrawCreate ( 556.331970 , 264.236953 , "1" ) ;
            TextDrawLetterSize ( RegisterText [ i ] [ 3 ] , 0,300998 , 1,254999 ) ;
            TextDrawAlignment ( RegisterText [ i ] [ 3 ] , 2 ) ;
            TextDrawColor ( RegisterText [ i ] [ 3 ] ,257552383 ) ;
            TextDrawSetShadow ( RegisterText [ i ] [ 3 ] , 0 ) ;
            TextDrawSetOutline ( RegistroTexto [ i ] [ 3 ] , 1 ) ;
            TextDrawBackgroundColor ( RegisterText [ i ] [ 3 ] , 255 ) ;
            TextDrawFont ( RegisterText [ i ] [ 3] , 2 ) ;
            TextDrawSetProportional ( RegisterText [ i ] [ 3 ] , 1 ) ;

            RegisterLeft [ i ] [ 3 ]  = TextDrawCreate ( 509.000274 , 262.577728 , "ld_beat:left" ) ;
            TextDrawLetterSize ( RegisterLeft [ i ] [ 3 ] , 0,002000 , 0,037333 );
            TextDrawTextSize ( RegisterLeft [ i ] [ 3 ] , 17.006999 , 17.007396 ) ;
            TextDrawAlignment ( RegisterLeft [ i ] [ 3 ] , 1 ) ;
            TextDrawColor ( RegistrarEsquerda [ i ] [ 3 ] , - 1 ) ;
            TextDrawSetShadow ( RegisterLeft [ i ] [3 ] , 0 ) ;
            TextDrawSetOutline ( RegistrarEsquerda [ i ] [ 3 ] , 0 ) ;
            TextDrawFont ( RegistrarEsquerda [ i ] [ 3 ] , 4 ) ;
            TextDrawSetSelectable ( RegisterLeft [ i ] [ 3 ] , verdadeiro ) ;

            RegistrarDireita [ i ] [ 3 ] = TextDrawCreate ( 586.666137 , 262.577728 , "ld_beat:right" ) ;
            TextDrawLetterSize ( RegisterRight [ i ] [ 3 ] , 0,000000 , 0,000000 ) ;
            TextDrawTextSize ( RegisterRight [ i ] [ 3 ] , 17.006999 , 18.666671 ) ;
            TextDrawAlignment ( RegisterRight [ i ] [3 ] , 1 ) ;
            TextDrawColor ( RegistrarDireita [ i ] [ 3 ] , - 1 ) ;
            TextDrawSetShadow ( RegistrarRight [ i ] [ 3 ] , 0 ) ;
            TextDrawSetOutline ( RegistrarRight [ i ] [ 3 ] , 0 ) ;
            TextDrawFont ( RegisterRight [ i] [ 3 ] , 4 ) ;
            TextDrawSetSelectable ( RegisterRight [ i ] [ 3 ] , verdadeiro ) ;  

            RegisterText [ i ] [ 4 ]  = TextDrawCreate ( 556.331970 , 287.466552 , "Posto" ) ;
            TextDrawLetterSize ( RegisterText [ i ] [ 4 ] , 0,300998 , 1,254999) ;
            TextDrawAlignment ( RegisterText [ i ] [ 4 ] , 2 ) ;
            TextDrawColor ( RegisterText [ i ] [ 4 ] , 257552383 ) ;
            TextDrawSetShadow ( RegisterText [ i ] [ 4 ] , 0 ) ;
            TextDrawSetOutline ( RegisterText [ i ] [ 4 ], 1 ) ;
            TextDrawBackgroundColor ( RegisterText [ i ] [ 4 ] , 255 ) ;
            TextDrawFont ( RegistroTexto [ i ] [ 4 ] , 2 ) ;
            TextDrawSetProportional ( RegisterText [ i ] [ 4 ] , 1 ) ;

            CadastroLeft [ i ] [ 4 ]  =TextDrawCreate ( 509.000274 , 285.807327 , "ld_beat:left" ) ;
            TextDrawLetterSize ( RegisterLeft [ i ] [ 4 ] , 0,002000 , 0,037333 ) ;
            TextDrawTextSize ( RegisterLeft [ i ] [ 4 ] , 17.006999 , 17.007396 ) ;
            TextDrawAlignment ( RegisterLeft [ i ] [ 4 ], 1 ) ;
            TextDrawColor ( RegistrarEsquerda [ i ] [ 4 ] , - 1 ) ;
            TextDrawSetShadow ( RegisterLeft [ i ] [ 4 ] , 0 ) ;
            TextDrawSetOutline ( RegistroEsquerda [ i ] [ 4 ] , 0 ) ;
            TextDrawFont ( RegisterLeft [ i ] [4 ] , 4 ) ;
            TextDrawSetSelectable ( RegisterLeft [ i ] [ 4 ] , verdadeiro ) ;

            RegisterRight [ i ] [ 4 ]  = TextDrawCreate ( 586.666137 , 285.807327 , "ld_beat:right" ) ;
            TextDrawLetterSize ( RegisterRight [ i ] [ 4 ] , 0,000000 , 0,000000 );
            TextDrawTextSize ( RegisterRight [ i ] [ 4 ] , 17.006999 , 18.666671 ) ;
            TextDrawAlignment ( RegistrarRight [ i ] [ 4 ] , 1 ) ;
            TextDrawColor ( RegistrarDireita [ i ] [ 4 ] , - 1 ) ;
            TextDrawSetShadow ( RegisterRight [ i ] [4 ] , 0 ) ;
            TextDrawSetOutline ( RegistrarRight [ i ] [ 4 ] , 0 ) ;
            TextDrawFont ( RegistrarRight [ i ] [ 4 ] , 4 ) ;
            TextDrawSetSelectable ( RegisterRight [ i ] [ 4 ] , verdadeiro ) ;  
        }
    Para quem não conhece essas funções do textdraw (e por isso está lendo este tutorial), eis um esclarecimento de alguns termos:

    peão Код:
    Código:
    RegisterRight [ i ] [ 4 ]  = TextDrawCreate ( 586.666137 , 285.807327 , "ld_beat:right" ) ;
    A linha acima contém um nome estranho (ld_beat:right). Este nome é justamente a identificação da textura. Usando uma fonte 4 (vide abaixo), você coloca texturas ao invйs de textos. A sintaxe ©: LIVRARIA: NOMEDATEXTURA .
    No caso, fica a livraria de texutras ld_beat, textura right.txd. Ao entrar no Sprite Browser, você pode identificar facilmente a livraria e textura no canto inferior esquerdo do programa.

    peão Код:
    Código:
    TextDrawFont ( RegistrarRight [ i ] [ 4 ] , 4 ) ; //Fonte tipo 4, para texturas.
    peão Код:
    Código:
    TextDrawSetSelectable ( RegisterRight [ i ] [ 4 ] , verdadeiro ) ;
    A linha acima torna a textdraw RegisterRight[i][4] selecionável, ou seja, você pode clicar nela.

    A razão pela qual existem textdraws não clicáveis, porém separado por jogador e com texto, como a textdraw abaixo, tem a ver com o sistema de registro implementado, que será explicado no decorrer deste tutorial.

    peão Код:
    Código:
    RegisterText [ i ] [ 2 ]  = TextDrawCreate ( 556.331970 , 241.007354 , "45kg" ) ; //Linha de texto.
    Essas linhas de texto existem pois a cada vez que o jogador clica numa seta esquerda ou direita, o valor deste texto é alterado para mais ou para menos. Como fazer isso? Usando um retorno de chamada OnPlayerClickTextDraw .

    peão Код:
    Código:
    public OnPlayerClickTextDraw ( playerid, Texto : clickedid )
    {
        if ( _ : clickedid != INVALID_TEXT_DRAW )
        {
            if ( clickedid == RegisterLeft [ playerid ] [ 0 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection0" ) ;
                x -- ;
                SetPVarInt ( id do jogador,"RegistroSeleção0" , x ) ;
                if ( GetPVarInt ( playerid, "RegisterSelection0" )  <  18 ) SetPVarInt ( playerid, "RegisterSelection0" , 100 ) ;
                nova string [ 128 ] ;
                format ( string, 128 , "%i" , GetPVarInt ( playerid, "RegisterSelection0" ) ) ;
                TextDrawHideForPlayer ( ID do jogador, RegisterText [ID do jogador ] [ 0 ] ) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 0 ] , string ) ;
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 0 ] ) ;
            }
            else  if ( clickedid == RegisterRight [ playerid ] [ 0 ] )
            {
                new x = GetPVarInt( playerid, "RegisterSelection0" ) ;
                x ++ ;
                SetPVarInt ( playerid, "RegisterSelection0" , x ) ;
                if ( GetPVarInt ( playerid, "RegisterSelection0" )  >  100 ) SetPVarInt ( playerid, "RegisterSelection0" , 18 ) ;
                nova string [ 128 ] ;
                formato ( string, 128 , "%i" , GetPVarInt( playerid, "RegisterSelection0" ) ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 0 ] ) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 0 ] , string ) ;
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 0 ] ) ;
            }
            else  if ( clickedid ==RegisterLeft [ playerid ] [ 1 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection1" ) ;
                x -- ;
                SetPVarInt ( playerid, "RegisterSelection1" , x ) ;
                if ( GetPVarInt ( playerid, "RegisterSelection1" )  <  130 ) SetPVarInt ( playerid, "RegisterSelection1" , 220 ) ;
                nova string [ 128 ] ;
                format ( string, 128 , "%icm" , GetPVarInt ( playerid, "RegisterSelection1" ) ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 1 ] ) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 1 ] , string ) ;
                TextDrawShowForPlayer (playerid, RegisterText [ playerid ] [ 1 ] ) ;
            }
            else  if ( clickedid == RegisterRight [ playerid ] [ 1 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection1" ) ;
                x ++ ;
                SetPVarInt ( playerid, "RegisterSelection1" , x ) ;
                if ( GetPVarInt ( id do jogador,"RegisterSelection1" )  >  220 ) SetPVarInt ( playerid, "RegisterSelection1" , 130 ) ;
                nova string [ 128 ] ;
                format ( string, 128 , "%icm" , GetPVarInt ( playerid, "RegisterSelection1" ) ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 1 ] ) ;
                TextDrawSetString (RegisterText [ playerid ] [ 1 ] , string ) ;
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 1 ] ) ;
            }
            else  if ( clickedid == RegisterLeft [ playerid ] [ 2 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection2" ) ;
                x -- ;
                SetPVarInt ( playerid, "RegisterSelection2" , x ) ;
                if ( GetPVarInt ( playerid, "RegisterSelection2" )  <  45 ) SetPVarInt ( playerid, "RegisterSelection2" , 220 ) ;
                nova string [ 128 ] ;
                formato ( string, 128 , "%ikg" , GetPVarInt ( playerid, "RegisterSelection2" ) ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 2 ] ) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 2 ] , string ) ;
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 2 ] ) ;
            }
            else  if ( clickedid == RegisterRight [ playerid ] [ 2] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection2" ) ;
                x ++ ;
                SetPVarInt ( playerid, "RegisterSelection2" , x ) ;
                if ( GetPVarInt ( playerid, "RegisterSelection2" )  >  220 ) SetPVarInt ( playerid, "RegisterSelection2" , 45 ) ;
                nova string [ 128 ] ;
                formatar( string, 128 , "%ikg" , GetPVarInt ( playerid, "RegisterSelection2" ) ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 2 ] ) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 2 ] , string ) ;
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 2 ] );
            }
            else  if ( clickedid == RegisterLeft [ playerid ] [ 3 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection3" ) ;
                x -- ;
                SetPVarInt ( playerid, "RegisterSelection3" , x ) ;
                if ( GetPVarInt ( playerid, "RegisterSelection3" )  <  1 ) SetPVarInt (id do jogador, "RegisterSelection3" , 299 ) ;
                nova string [ 128 ] ;
                format ( string, 128 , "%i" , GetPVarInt ( playerid, "RegisterSelection3" ) ) ;
                SetPlayerSkin ( playerid, GetPVarInt ( playerid, "RegisterSelection3" ) ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 3 ] ) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 3 ] , string ) ;
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 3 ] ) ;
            }
            else  if ( clickedid == RegisterRight [ playerid ] [ 3 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection3" ) ;
                x ++ ;
                SetPVarInt ( playerid, "RegisterSelection3" , x ) ;
                if ( GetPVarInt ( playerid, "RegisterSelection3" )  >  299 ) SetPVarInt ( playerid, "RegisterSelection3" , 1 ) ;
                nova string [ 128 ] ;
                formato ( string, 128 , "%i" , GetPVarInt ( playerid, "RegisterSelection3" ) );
                SetPlayerSkin ( playerid, GetPVarInt ( playerid, "RegisterSelection3" ) ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 3 ] ) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 3 ] , string ) ;
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 3 ] ) ;
            }
            else  if ( clickedid == RegisterLeft [ playerid ] [ 4 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection4" ) ;
                x -- ;
                SetPVarInt ( playerid, "RegisterSelection4" , x ) ;
                if ( GetPVarInt ( playerid, "RegisterSelection4" )  <  1 ) SetPVarInt ( playerid,"RegistroSeleção4" , 3 ) ;
                nova string [ 128 ] ;
                switch  ( GetPVarInt ( playerid, "RegisterSelection4" ) )
                {
                    case  1 :  format ( string, 128 , "Posto" , GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                    case  2 :  format ( string, 128 , "Praзa" , GetPVarInt ( playerid,"RegistroSeleção4" ) ) ;
                    caso  3 :  formato ( string, 128 , "Pier" , GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                }
                 TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 4 ] ) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 4 ] , string ) ;
                TextDrawShowForPlayer( playerid, RegisterText [ playerid ] [ 4 ] ) ;
            }
            else  if ( clickedid == RegisterRight [ playerid ] [ 4 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection4" ) ;
                x ++ ;
                SetPVarInt ( playerid, "RegisterSelection4" , x ) ;
                if ( GetPVarInt (playerid, "RegisterSelection4" )  >  3 ) SetPVarInt ( playerid, "RegisterSelection4" , 1 ) ;
                nova string [ 128 ] ;
                switch  ( GetPVarInt ( playerid, "RegisterSelection4" ) )
                {
                    case  1 :  format ( string, 128 , "Posto" , GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                    caso  2 : format ( string, 128 , "Praзa" , GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                    caso  3 :  formato ( string, 128 , "Pier" , GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                }
                 TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 4 ] ) ;
                TextDrawSetString ( RegisterText [ID do jogador ] [ 4 ] , string ) ;
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 4 ] ) ;
            }
            else  if ( clickedid == RegisterClick [ playerid ] )
            {
                 SetPVarInt ( playerid, "Idade" , GetPVarInt ( playerid, "RegisterSelection0" ) ) ;
                SetPVarInt ( id do jogador,"Altura" , GetPVarInt ( playerid, "RegisterSelection1 " ) ;
                SetPVarInt ( playerid, "Peso" , GetPVarInt ( playerid, "RegisterSelection2" ) ) ;
                SetPVarInt ( playerid, "Skin" , GetPVarInt ( playerid, "RegisterSelection3" ) ) ;
                SetPVarInt ( playerid, "Spawn" , GetPVarInt ( playerid, "RegisterSelection4"
                SendSystemMessage ( playerid, "Registro completo com sucesso!" ) ;
                switch ( GetPVarInt ( playerid, "Spawn" ) )
                {
                    case  1 :
                    {
                         SetPVarFloat ( playerid, "PosX" , 116.7447 ) ;
                        SetPVarFloat ( playerid, "PosY" , 1094.8406 ) ;
                        SetPVarFloat ( playerid, "PosZ" , 13.6126 );
                        SetPVarInt ( playerid, "Int" , 0 ) ;
                        SetPVarInt ( playerid, "VW" , 0 ) ;
                    }
                    case  2 :
                    {
                         SetPVarFloat ( playerid, "PosX" , - 146.1487 ) ;
                        SetPVarFloat ( playerid, "PosY" , 1124.4265 ) ;
                        SetPVarFloat ( ID do jogador, "PosZ" ,19.7422 ) ;
                        SetPVarInt ( playerid, "Int" , 0 ) ;
                        SetPVarInt ( playerid, "VW" , 0 ) ;
                    }
                    case  3 :
                    {
                         SetPVarFloat ( playerid, "PosX" , - 396.9557 ) ;
                        SetPVarFloat ( playerid, "PosY" , 911.6937 ) ;
                        SetPVarFloat ( ID do jogador,"PosZ" , 10.9430 ) ;
                        SetPVarInt ( playerid, "Int" , 0 ) ;
                        SetPVarInt ( playerid, "VW" , 0 ) ;
                    }
                }
                 SetPlayerPos ( playerid, GetPVarFloat ( playerid, "PosX" ) , GetPVarFloat ( playerid, "PosY" ) , GetPVarFloat ( playerid, "PosZ" ) ) ;
                SetPlayerInterior (ID do jogador, 0 ) ;
                SetPlayerVirtualWorld ( playerid, 0 ) ;
                SetCameraBehindPlayer ( playerid ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 0 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 1 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 2 ] ) ;
                TextDrawHideForPlayer (ID do jogador, RegisterOption [ 3 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 4 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 5 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 6 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterClick [ playerid ] ) ;
                TextDrawHideForPlayer (playerid, RegisterText [ playerid ] [ 0 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterLeft [ playerid ] [ 0 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterRight [ playerid ] [ 0 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 1 ] ) ;
                TextDrawHideForPlayer (playerid, RegisterLeft [ playerid ] [ 1 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterRight [ playerid ] [ 1 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 2 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterLeft [ playerid ] [ 2 ] ) ;
                TextDrawHideForPlayer (playerid, RegisterRight [ playerid ] [ 2 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 3 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterLeft [ playerid ] [ 3 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterRight [ playerid ] [ 3 ] ) ;
                TextDrawHideForPlayer (playerid, RegisterText [ playerid ] [ 4 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterLeft [ playerid ] [ 4 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterRight [ playerid ] [ 4 ] ) ;
                SetPVarInt ( playerid, "Registrado" , 1 ) ;
                SavePlayerData ( playerid ) ;
                CancelSelectTextDraw ( playerid ) ;
                TogglePlayerControllable ( playerid, true ) ;
                retornar  1 ;
            }
        }
        retorna  1 ;
    }

    Dissecando todo o cуdigo acima...



    peão Код:
    Código:
    if ( _ : clickedid != INVALID_TEXT_DRAW )
        {
            if ( clickedid == RegisterLeft [ playerid ] [ 0 ] )
    Devido a um bug no sistema de Textdraws, caso você use a função CancelSelectTextDraw(playerid) , ela irá chamar um callback de novo, com um id INVALID_TEXT_DRAW, causando um loop. O primeiro IF acima ( if(_:clickedid != INVALID_TEXT_DRAW) ) Cuidado com este bug.

    A seguir, vem uma série de IF's, separando cada textdraw em um caso diferente. A função de todas as textdraws de setas ( RegisterLeft e RegisterRight ) serve, como dito anteriormente, para adicionar ou subtrair um valor que será mostrado em texto, e, portanto, tem funcionalidade semelhante. Mostrei duas abaixo e expliquei-as detalhadamente.

    peão Код:
    Código:
    else  if ( clickedid == RegisterLeft [ playerid ] [ 3 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection3" ) ; //Variável para salvar o valor atual da seleção;
                x -- ; //Ao clicar na seta esquerda, ele diminui o valor...
                 SetPVarInt ( playerid, "RegisterSelection3" , x ) ; //... eo coloca novamente na variável.
                if ( GetPVarInt (playerid, "RegisterSelection3" )  <  1 ) SetPVarInt ( playerid, "RegisterSelection3" , 299 ) ;
    //Na linha acima, caso o valor seja menor que 1, ao clicar na seta esquerda, ele se torna 299. (SKINS);
                nova string [ 128 ] ;
                format ( string, 128 , "%i" , GetPVarInt ( playerid, "RegisterSelection3" ) ) ;
    //formata o texto com a ID da skin;
                SetPlayerSkin ( playerid, GetPVarInt( playerid, "RegisterSelection3" ) ) ;
    //Seta no jogador a skin na qual o valor que é mostrado no texto (e alterado pelas setas);
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 3 ] ) ;
    //Esconde o texto para atualização;
                TextDrawSetString ( RegisterText [ playerid ] [ 3 ] , string ) ;
    //Altera o textdraw que mostra o valor da skin;
                TextDrawShowForPlayer ( id do jogador, RegisterText[ ID do jogador ] [ 3 ] ) ;
    //Mostra novamente o texto;
            }
    Abaixo, a mesma situação é descrita, porém com o acrílico da variável que guarda a pele.

    peão Код:
    Código:
    else  if ( clickedid == RegisterRight [ playerid ] [ 3 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection3" ) ; //Variável que guarda a skin;
                x ++ ; //Adiçã o ao clicar na seta direita;
                SetPVarInt ( playerid, "RegisterSelection3" , x ) ; // Atualização no valor;
                if ( GetPVarInt ( id do jogador, "RegisterSelection3")  >  299 ) SetPVarInt ( playerid, "RegisterSelection3" , 1 ) ;
    //Caso a variável seja 299 e o jogador clicar na seta direita, ela retornará a 1;
                nova string [ 128 ] ;
    //Abaixo a atualização do valor na textdraw;
                format ( string, 128 , "%i" , GetPVarInt ( playerid, "RegisterSelection3" ) ) ;
                SetPlayerSkin ( playerid, GetPVarInt ( playerid, "RegisterSelection3") ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 3 ] ) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 3 ] , string ) ;
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 3 ] ) ;
            }
    Abaixo, temos um texto que é modificado da mesma maneira, porém mostrado com valores diferentes.

    peão Код:
    Código:
    else  if ( clickedid == RegisterLeft [ playerid ] [ 4 ] )
            {
                //Mesmo esquema de antes: Para seta esquerda subtração, para seta direita, adição do valor.
                            novo x = GetPVarInt ( playerid, "RegisterSelection4" ) ;
                x -- ;
                SetPVarInt ( playerid, "RegisterSelection4" , x ) ;
    //Ao chegar em 1 (valor mínimo), ele volta para 3;
                if ( GetPVarInt ( id do jogador,"RegisterSelection4" )  <  1 ) SetPVarInt ( playerid, "RegisterSelection4" , 3 ) ;
                nova string [ 128 ] ;
                //Aqui, eu coloquei um switch para os valores. Cada valor corresponde a um texto diferente, como formatado abaixo;
                            switch  ( GetPVarInt ( playerid, "RegisterSelection4" ) )
                {
                    case  1 :  format ( string, 128 , "Posto" , GetPVarInt ( playerid,"RegistroSeleção4" ) ) ;
                    case  2 :  formato ( string, 128 , "Praca" , GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                    caso  3 :  formato ( string, 128 , "Pier" , GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                }
                 TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 4 ]) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 4 ] , string ) ;
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 4 ] ) ;
            }
    A mesma coisa acontece abaixo, porйm, adicionados os valores;

    peão Код:
    Código:
    else  if ( clickedid == RegisterRight [ playerid ] [ 4 ] )
            {
                new x = GetPVarInt ( playerid, "RegisterSelection4" ) ;
                x ++ ;
                SetPVarInt ( playerid, "RegisterSelection4" , x ) ;
    //Ao chegar no valor máximo (3), ele retorna para o início;
                if ( GetPVarInt ( playerid, "RegisterSelection4" )  >  3 )SetPVarInt ( playerid, "RegisterSelection4" , 1 ) ;
                nova string [ 128 ] ;
                switch  ( GetPVarInt ( playerid, "RegisterSelection4" ) )
                {
                    case  1 :  format ( string, 128 , "Posto" , GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                    case  2 :  format ( string, 128 , "Praca", GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                    caso  3 :  formato ( string, 128 , "Pier" , GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                }
                 TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 4 ] ) ;
                TextDrawSetString ( RegisterText [ playerid ] [ 4 ] , string );
                TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 4 ] ) ;
            }

    Agora, para o último botô, o que confirma suas mudanças.

    peão Код:
    Código:
    else  if ( clickedid == RegisterClick [ playerid ] )
            {
                //Abaixo são somente variáveis ​​que correspondem ao meu sistema de informações;
                            SetPVarInt ( playerid, "Idade" , GetPVarInt ( playerid, "RegisterSelection0" ) ) ;
                SetPVarInt ( playerid, "Altura" , GetPVarInt ( playerid, "RegisterSelection1" ) ) ;
                SetPVarInt ( playerid, "Peso", GetPVarInt ( playerid, "RegisterSelection2" ) ) ;
                SetPVarInt ( playerid, "Skin" , GetPVarInt ( playerid, "RegisterSelection3" ) ) ;
                SetPVarInt ( playerid, "Spawn" , GetPVarInt ( playerid, "RegisterSelection4" ) ) ;
                SendSystemMessage ( playerid, "Registro completo com sucesso!" ) ;
                //Como visto acima, cada spawn tem um nome diferente, portanto esta coleta o spawn selecionado pelo jogador, e o coloca lá;
                            switch ( GetPVarInt ( playerid, "Spawn" ) )
                {
                    case  1 :
                    {
                         SetPVarFloat ( playerid, "PosX" , 116.7447 ) ;
                        SetPVarFloat ( playerid, "PosY" , 1094.8406 ) ;
                        SetPVarFloat ( playerid, "PosZ" , 13.6126 ) ;
                        SetPVarInt ( playerid, "Int" , 0 ) ;
                        SetPVarInt ( playerid, "VW" , 0 ) ;
                    }
                    case  2 :
                    {
                         SetPVarFloat ( playerid, "PosX" , - 146.1487 ) ;
                        SetPVarFloat ( playerid, "PosY" , 1124.4265 ) ;
                        SetPVarFloat ( ID do jogador, "PosZ" ,19.7422 ) ;
                        SetPVarInt ( playerid, "Int" , 0 ) ;
                        SetPVarInt ( playerid, "VW" , 0 ) ;
                    }
                    case  3 :
                    {
                         SetPVarFloat ( playerid, "PosX" , - 396.9557 ) ;
                        SetPVarFloat ( playerid, "PosY" , 911.6937 ) ;
                        SetPVarFloat ( ID do jogador,"PosZ" , 10.9430 ) ;
                        SetPVarInt ( playerid, "Int" , 0 ) ;
                        SetPVarInt ( playerid, "VW" , 0 ) ;
                    }
                }
                            //Abaixo, a posição e câmera do jogador й definida, e as textdraws sгo escondidas da tela do jogador;
                SetPlayerPos ( playerid, GetPVarFloat ( playerid, "PosX" ) , GetPVarFloat ( playerid, "PosY" ) , GetPVarFloat ( playerid,"PosZ" ) ) ;
                SetPlayerInterior ( playerid, 0 ) ;
                SetPlayerVirtualWorld ( playerid, 0 ) ;
                SetCameraBehindPlayer ( playerid ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 0 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 1 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption[ 2 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 3 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 4 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 5 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterOption [ 6 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterClick [ID do jogador ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 0 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterLeft [ playerid ] [ 0 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterRight [ playerid ] [ 0 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ][ 1 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterLeft [ playerid ] [ 1 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterRight [ playerid ] [ 1 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 2 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterLeft [ playerid ][ 2 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterRight [ playerid ] [ 2 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 3 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterLeft [ playerid ] [ 3 ] ) ;
                TextDrawHideForPlayer ( id do jogador, RegisterRight [ id do jogador ][ 3 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterText [ playerid ] [ 4 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterLeft [ playerid ] [ 4 ] ) ;
                TextDrawHideForPlayer ( playerid, RegisterRight [ playerid ] [ 4 ] ) ;
                SetPVarInt ( playerid, "Registrado" , 1 );
                SavePlayerData ( playerid ) ;
    //Em CancelSelectTextDraw, o jogador nгo poderб mais selecionar textdraws;
                CancelSelectTextDraw ( playerid ) ;
                TogglePlayerControllable ( playerid, true ) ;
                retornar  1 ;
            }

    Pronto. A estrutura básica deste sistema foi criada e explicada acima. Portanto, como passo final, necessitamos mostrar ela em algum ponto do gamemode. Isto foi feito com o estoque abaixo:

    peão Код:
    Código:
    stock StartRegister ( playerid )
    {
        //Abaixo, o jogador é colocado em uma sala e travado, para poder editar seu personagem;
            SetPVarFloat ( playerid, "Saúde" , 100 ) ;
        SpawnPlayer ( playerid ) ;
        SetPlayerInterior ( playerid, 14 ) ;
        SetPlayerPos ( playerid, 258.3504 , - 41.5838 , 1002.0234 ) ;
        TogglePlayerControllable ( playerid, false );
        SetPlayerCameraPos ( playerid , 254.1672 , -41.8898 , 1003.2319 ) ;     SetPlayerCameraLookAt ( playerid, 258.3504 , - 41.5838 , 1002.0234 ) ; //Abaixo, os valores padrão de cada um dos textos e variáveis ​​que serão editados pelos textdraws clicáveis ​​são definidos;     SetPVarInt ( playerid, "RegisterSelection0" , 18 ) ;     SetPVarInt ( playerid, "RegisterSelection1" , 130 )

            

    ;
        SetPVarInt ( playerid, "RegisterSelection2" , 45 ) ;
        SetPVarInt ( playerid, "RegisterSelection3" , 1 ) ;
        SetPVarInt ( playerid, "RegisterSelection4" , 1 ) ;
    //Abaixo, todas as textdraws são mostradas abaixo para o jogador;
        TextDrawShowForPlayer ( playerid, RegisterOption [ 0 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterOption [ 1 ] );
        TextDrawShowForPlayer ( playerid, RegisterOption [ 2 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterOption [ 3 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterOption [ 4 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterOption [ 5 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterOption [ 6 ] ) ;
        TextDrawShowForPlayer( playerid, RegisterClick [ playerid ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 0 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterLeft [ playerid ] [ 0 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterRight [ playerid ] [ 0 ] ) ;
        TextDrawShowForPlayer ( ID do jogador, RegisterText [ID do jogador ] [ 1 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterLeft [ playerid ] [ 1 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterRight [ playerid ] [ 1 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 2 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterLeft [ playerid ][ 2 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterRight [ playerid ] [ 2 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 3 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterLeft [ playerid ] [ 3 ] ) ;
        TextDrawShowForPlayer ( id do jogador, RegisterRight [ id do jogador ] [ 3] ) ;
        TextDrawShowForPlayer ( playerid, RegisterText [ playerid ] [ 4 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterLeft [ playerid ] [ 4 ] ) ;
        TextDrawShowForPlayer ( playerid, RegisterRight [ playerid ] [ 4 ] ) ;
    //A linha abaixo faz com que os textdraws que são selecionáveis ​​possam ser selecionados, mostrando o mouse. A função também permite mudar a cor do textdraw selecionado para qualquer uma que você queira, com os mesmos parâmetros de cor da função SendClientMessage;
        SelectTextDraw ( playerid, COLOR_SYSBLUE ) ;
        retornar  1 ;
    }

    E fim!



    Qualquer dъvida e/ou comentбrio, incluindo crнticas, sгo bem vindos.

    Creditos: LeLeTe



    [Tutorial] Textdraws Clicáveis D07Xwqb
    [Tutorial] Textdraws Clicáveis Yjab9HN

      Data/hora atual: Qui 2 maio 2024 - 10:50