[Pedido] Textdraw de base
#1

To tentando fazer textdraw, mas da sempre erro, vou fazer tipo uma hud com o nome do jogador, nivel entre outras coisas,jб sei pegar a posiзгo a variavel do nome pra colocar, mas n consigo fazer os textdraws rodar sem da erros, alguem me da uma base com sei lб Qualquer_Coisa escrito no meio da tela pra eu editar?
Reply
#2

Posta suas TextDraws . Se tu tiver tentando botar o nome na criaзгo a Textdraw nem vai dar ...
Reply
#3

TopoGmNews
pawn Код:
new ptdname[MAX_PLAYERS];
new ptdlevel[MAX_PLAYERS];
new ptdpoints[MAX_PLAYERS];
new ptdwanted[MAX_PLAYERS];
OnGamemodeInit
pawn Код:
ptdname = TextDrawCreate(500 ,96 , "Pedro_Mvkxlm");
TextDrawFont(ptdname , 3);
TextDrawLetterSize(ptdname , 0.5, 3.5);
TextDrawColor(ptdname , 0xff0000FF);
TextDrawSetOutline(ptdname , false);
TextDrawSetProportional(ptdname , true);
TextDrawSetShadow(ptdname , 1);


ptdlevel = TextDrawCreate(500 ,101 , "level: 100");
TextDrawFont(ptdlevel , 2);
TextDrawLetterSize(ptdlevel , 0.3, 3.5);
TextDrawColor(ptdlevel , 0xff0000FF);
TextDrawSetOutline(ptdlevel , false);
TextDrawSetProportional(ptdlevel , true);
TextDrawSetShadow(ptdlevel , 1);


ptdpoints = TextDrawCreate(500 ,111 , "points: 1000");
TextDrawFont(ptdpoints , 1);
TextDrawLetterSize(ptdpoints , 0.3, 3.5);
TextDrawColor(ptdpoints , 0xFFFFFFFF);
TextDrawSetOutline(ptdpoints , false);
TextDrawSetProportional(ptdpoints , true);
TextDrawSetShadow(ptdpoints , 1);


ptdwanted = TextDrawCreate(490 ,116 , "points: 1000");
TextDrawFont(ptdwanted , 1);
TextDrawLetterSize(ptdwanted , 0.3, 3.5);
TextDrawColor(ptdwanted , 0xFFFFFFFF);
TextDrawSetOutline(ptdwanted , false);
TextDrawSetProportional(ptdwanted , true);
TextDrawSetShadow(ptdwanted , 1);
OnPlayerSpawn
pawn Код:
TextDrawShowForPlayer(playerid, ptdwanted[playerid]);
TextDrawShowForPlayer(playerid, ptdpoints[playerid]);
TextDrawShowForPlayer(playerid, ptdlevel[playerid]);
TextDrawShowForPlayer(playerid, ptdname[playerid]);
Erros
pawn Код:
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(18042) : warning 213: tag mismatch
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(18043) : warning 213: tag mismatch
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(18044) : warning 213: tag mismatch
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(18045) : warning 213: tag mismatch
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24916) : error 033: array must be indexed (variable "ptdname")
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24917) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(2491 : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24919) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24920) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24921) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24922) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24925) : error 033: array must be indexed (variable "ptdlevel")
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24926) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24927) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(2492 : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24929) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24930) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24931) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24934) : error 033: array must be indexed (variable "ptdpoints")
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24935) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24936) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24937) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(2493 : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24939) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24940) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24943) : error 033: array must be indexed (variable "ptdwanted")
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24944) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24945) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24946) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\Administrator\Desktop\RPG\Gamemodes\ULTRA 2.pwn(24947) : error 035: argument type mismatch (argument 1)

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
Reply
#4

Nao entendei muito bem o topico mais acabei fazendo o q entendie ^^




pawn Код:
#include    <   a_samp     >


#if defined MAX_PLAYERS
#undef      MAX_PLAYERS
#define     MAX_PLAYERS 32 // Slosts Seu Servidor ^^
#endif

new Text: Textdraw0 [ MAX_PLAYERS ];
new Text: Textdraw1 [ MAX_PLAYERS ];
new Text: Textdraw2 [ MAX_PLAYERS ];
new Text: Textdraw3 [ MAX_PLAYERS ];
new Text: Textdraw4 [ MAX_PLAYERS ];
new Text: Textdraw5 [ MAX_PLAYERS ];

forward Actualizando ( playerid ) ;

public OnGameModeInit( )
{

    SetTimer ( "Actualizando", 100, 1 ) ;

    for( new i = 0; i < MAX_PLAYERS; ++i )
    {
   
        Textdraw0[ i ] = TextDrawCreate(503.000000, 364.000000, "~g~Nome Jogador: ~w~Cantiliano"); //Troca pela Sua
        TextDrawBackgroundColor(Textdraw0[ i ], 255);
        TextDrawFont(Textdraw0[ i ], 1);
        TextDrawLetterSize(Textdraw0[ i ], 0.220000, 1.300000);
        TextDrawColor(Textdraw0[ i ], -1);
        TextDrawSetOutline(Textdraw0[ i ], 1);
        TextDrawSetProportional(Textdraw0[ i ], 1);
        TextDrawSetSelectable(Textdraw0[ i ], 0);

        Textdraw1[ i ] = TextDrawCreate(503.000000, 381.000000, "~r~Level: ~w~1000"); //Troca pela Sua
        TextDrawBackgroundColor(Textdraw1[ i ], 255);
        TextDrawFont(Textdraw1[ i ], 1);
        TextDrawLetterSize(Textdraw1[ i ], 0.220000, 1.300000);
        TextDrawColor(Textdraw1[ i ], -1);
        TextDrawSetOutline(Textdraw1[ i ], 1);
        TextDrawSetProportional(Textdraw1[ i ], 1);
        TextDrawSetSelectable(Textdraw1[ i ], 0);

        Textdraw2[ i ] = TextDrawCreate(503.000000, 398.000000, "~p~Nao sei: ~w~10"); //Troca pela Sua
        TextDrawBackgroundColor(Textdraw2[ i ], 255);
        TextDrawFont(Textdraw2[ i ], 1);
        TextDrawLetterSize(Textdraw2[ i ], 0.220000, 1.300000);
        TextDrawColor(Textdraw2[ i ], -1);
        TextDrawSetOutline(Textdraw2[ i ], 1);
        TextDrawSetProportional(Textdraw2[ i ], 1);
        TextDrawSetSelectable(Textdraw2[ i ], 0);

        Textdraw3[ i ] = TextDrawCreate(503.000000, 413.000000, "~y~Chupa: ~w~30"); //Troca pela Sua
        TextDrawBackgroundColor(Textdraw3[ i ], 255);
        TextDrawFont(Textdraw3[ i ], 1);
        TextDrawLetterSize(Textdraw3[ i ], 0.220000, 1.300000);
        TextDrawColor(Textdraw3[ i ], -1);
        TextDrawSetOutline(Textdraw3[ i ], 1);
        TextDrawSetProportional(Textdraw3[ i ], 1);
        TextDrawSetSelectable(Textdraw3[ i ], 0);

        Textdraw4[ i ] = TextDrawCreate(547.000000, 434.000000, "~p~Status"); //Troca pela Sua
        TextDrawBackgroundColor(Textdraw4[ i ], 255);
        TextDrawFont(Textdraw4[ i ], 1);
        TextDrawLetterSize(Textdraw4[ i ], 0.220000, 1.300000);
        TextDrawColor(Textdraw4[ i ], -1);
        TextDrawSetOutline(Textdraw4[ i ], 1);
        TextDrawSetProportional(Textdraw4[ i ], 1);
        TextDrawSetSelectable(Textdraw4[ i ], 0);

        Textdraw5[ i ] = TextDrawCreate(529.000000, 434.000000, "[]         []"); //Troca pela Sua
        TextDrawBackgroundColor(Textdraw5[ i ], 255);
        TextDrawFont(Textdraw5[ i ], 2);
        TextDrawLetterSize(Textdraw5[ i ], 0.220000, 1.300000);
        TextDrawColor(Textdraw5[ i ], -65281);
        TextDrawSetOutline(Textdraw5[ i ], 1);
        TextDrawSetProportional(Textdraw5[ i ], 1);
        TextDrawSetSelectable(Textdraw5[ i ], 0);
    }
    return 1;
}

public OnGameModeExit()
{
    for( new i = 0; i < MAX_PLAYERS; ++i )
    {
        TextDrawHideForPlayer( i, Textdraw0[ i ] );
        TextDrawDestroy( Textdraw0[ i ] );

        TextDrawHideForPlayer( i, Textdraw1[ i ] );
        TextDrawDestroy( Textdraw1[ i ] );

        TextDrawHideForPlayer( i, Textdraw2[ i ] );
        TextDrawDestroy( Textdraw2[ i ] );

        TextDrawHideForPlayer( i, Textdraw3[ i ] );
        TextDrawDestroy( Textdraw3[ i ] );

        TextDrawHideForPlayer( i, Textdraw4[ i ] );
        TextDrawDestroy( Textdraw4[ i ] );
       
        TextDrawHideForPlayer( i, Textdraw5[ i ] );
        TextDrawDestroy( Textdraw5[ i ] );
    }
    return 1;
}

public OnPlayerConnect( playerid )
{
    TextDrawShowForPlayer( playerid, Textdraw0 [ playerid ] ) ;
    TextDrawShowForPlayer( playerid, Textdraw1 [ playerid ] ) ;
    TextDrawShowForPlayer( playerid, Textdraw2 [ playerid ] ) ;
    TextDrawShowForPlayer( playerid, Textdraw3 [ playerid ] ) ;
    TextDrawShowForPlayer( playerid, Textdraw4 [ playerid ] ) ;
    TextDrawShowForPlayer( playerid, Textdraw5 [ playerid ] ) ;
    return 1;
}

public Actualizando ( playerid )
{
    for ( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if ( IsPlayerConnected ( i ) )
        {
            new string [ 128 ] ;
           
            format ( string, sizeof ( string ),"~g~Nome Jogador: ~w~%s: ", GetPlayerNameEx ( playerid ) ) ; //Troca pela Sua
            TextDrawSetString ( Textdraw0[ i ] , string ) ;

            format ( string, sizeof(string),"~r~Level: ~w~ " /*Sua Funзao */ ); //Troca pela Sua
            TextDrawSetString ( Textdraw1[ i ] , string ) ;

            format ( string, sizeof(string),"~p~Nao sei: ~w~ " /*Sua Funзao */ ); //Troca pela Sua
            TextDrawSetString ( Textdraw2[ i ] , string ) ;

            format ( string, sizeof(string),"~y~Chupa: ~w~ " /*Sua Funзao */ ); //Troca pela Sua
            TextDrawSetString ( Textdraw3[ i ] , string ) ;
        }
    }
    return 1;
}


stock GetPlayerNameEx ( playerid )
{
    new PlayerNameLevel [ MAX_PLAYER_NAME ] ;
   
    GetPlayerName ( playerid, PlayerNameLevel, MAX_PLAYER_NAME ) ;
    return PlayerNameLevel ;
}
@EDit so o nome ta pegando nao sei se as outras Funзoes voce Enclementa ^^
de acordo com seu GM/FS ^^
Reply
#5

Parece que bugou meu textdraw de baixo da tela, tudo apareceu assim q eu entrei, dps q eu loguei tudo sumiu, tentei botar tudo em player connect,spawn, mas nada, sу ficava aprecendo o estrelinha status os de cima sumiam, ai por bugar meu antigo eu tive q tirar e n ta aparecendo =\

Queria fazer algo tipo esse aqui:

sу que sem exp, fome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)