[Ajuda]TextDraw Mostrando PING + FPS
#1

E ae, To precisando de um sistema de Text Draw do lado do Radar q mostra Ping e FPS.
Antes de falarem q nao usei o search eu usei sim, E achei um monte mas nao entendi nenhum, porque ou ta me ingles ou espanhol, Tbm achei esse: https://sampforum.blast.hk/showthread.php?tid=184926,Mas tbm nao consegui fazer, por isso estou pedindo a vcs, e nao queria FS eu queria um cod pra mim poder entender +/-.
Obrg!!
Reply
#2

Olha Shickcard postou em lanзamentos um sistema de ping e 3dlabel+ip, vai de vocк adapatar
Reply
#3

Quote:
Originally Posted by [NWD]Jim._.Carrey
Посмотреть сообщение
Olha Shickcard postou em lanзamentos um sistema de ping e 3dlabel+ip, vai de vocк adapatar
Tentei adaptalo mas o TextDraw do Ping Mostrava Sу pra mim, Outros Players que entravam no Server nao via.
Reply
#4

Criou global?

new Text:LOL[MAX_PLAYERS]; ?
Reply
#5

Quote:
Originally Posted by [NWD]Jim._.Carrey
Посмотреть сообщение
Criou global?

new Text:LOL[MAX_PLAYERS]; ?
*-*, kkk esqueci desse detalhe, vou la testar.
Reply
#6

tem de definir a 3d text como Text, senгo vocк e ninguem verб.
Reply
#7

como nao consegui com o sistema do shickard, fiz o seguinte.

pawn Код:
new Text:PingT;

public OnGameModeInit()
{
new playerid;
MaxPlayer = GetMaxPlayers();
AtuPing(playerid);
SetTimer("PingPT", 1000, 1);
return 1;
}

forward AtuPing(playerid);
public AtuPing(playerid)
{
    new string[16];
    if(PingT){
        TextDrawDestroy(PingT);
    }
    format(string, sizeof(string), "Ping:%d", GetPlayerPing(playerid));
    PingT = TextDrawCreate(400,25, string);
    return 1;
}

forward PingPT(playerid);
public PingPT(playerid)
{
    AtuPing(playerid);
    TextDrawFont(PingT,3);
    TextDrawUseBox(PingT,0);
    TextDrawSetOutline(PingT,1);
    TextDrawBackgroundColor(PingT,0x32CD32FF);
    TextDrawColor(PingT,0x000000FF);
    TextDrawAlignment(PingT, 1);

    for(new i=0; i<MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
            TextDrawShowForPlayer(i, PingT);
        }
        else{
            TextDrawHideForPlayer(i, PingT);
        }
    }

    return 1;
}
Quando eu e meu colega logou apareceu pra nois dois normal, mas ao invйs dele ver o Ping dele ele via o meu no caso id 0.

Serб q vc conseguem arrumar o cod pra mim?
Reply
#8

Tenta:
PHP код:

forward AtualizarPing
();
new
    
Text:PingT[MAX_PLAYERS];
;
public 
OnGameModeInit()
{
    for( new 
0MAX_PLAYERSi++ )
    {
        
PingT] = TextDrawCreate40025"   " );
        
TextDrawFontPingT], 3);
        
TextDrawUseBoxPingT], 0);
        
TextDrawSetOutlinePingT], 1);
        
TextDrawBackgroundColorPingT], 0x32CD32FF);
        
TextDrawColorPingT], 0x000000FF);
        
TextDrawAlignmentPingT], 1);
    }
    
SetTimer"AtualizarPing"1000);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
TextDrawShowForPlayeriPingT] );
    return 
1;
}
public 
AtualizarPing()
{
     new
        
string16 ]
    ;
    for( new 
0MAX_PLAYERSi++ )
    {
        if( 
IsPlayerConnected) )
        {
            
formatstringsizeof( string ), "Ping: %d"GetPlayerPing(i) );
            
TextDrawSetStringPingT], gstring);
        }
    }
    return 
1;

Reply
#9

Quote:
Originally Posted by [NWD]Jim._.Carrey
Посмотреть сообщение
Tenta:
PHP код:

forward AtualizarPing
();
new 
   
Text:PingT[MAX_PLAYERS];
;
public 
OnGameModeInit()
{
    for( new 
0MAX_PLAYERSi++ )
    {
        
PingT] = TextDrawCreate40025"   " );
        
TextDrawFontPingT], 3);
        
TextDrawUseBoxPingT], 0);
        
TextDrawSetOutlinePingT], 1);
        
TextDrawBackgroundColorPingT], 0x32CD32FF);
        
TextDrawColorPingT], 0x000000FF);
        
TextDrawAlignmentPingT], 1);
    }
    
SetTimer"AtualizarPing"1000);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
TextDrawShowForPlayeriPingT] );
    return 
1;
}
public 
AtualizarPing()
{
     new
        
string16 ]
    ;
    for( new 
0MAX_PLAYERSi++ )
    {
        if( 
IsPlayerConnected) )
        {
            
formatstringsizeof( string ), "Ping: %d"GetPlayerPing(i) );
            
TextDrawSetStringPingT], gstring);
        }
    }
    return 
1;

Vlw deu certim com algumas modificaзхes XD.

pawn Код:
forward AtualizarPing();

new Text:PingT[MAX_PLAYERS];


public OnGameModeInit()
{
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        PingT[ i ] = TextDrawCreate( 400, 25, "   " );
        TextDrawFont( PingT[ i ], 3);
        TextDrawUseBox( PingT[ i ], 0);
        TextDrawSetOutline( PingT[ i ], 1);
        TextDrawBackgroundColor( PingT[ i ], 0x32CD32FF);
        TextDrawColor( PingT[ i ], 0x000000FF);
        TextDrawAlignment( PingT[ i ], 1);
    }
    SetTimer( "AtualizarPing", 1000, 1 );
    return 1;
}

public OnPlayerSpawn(playerid)
{
for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if( IsPlayerConnected( i ) )
        {
    TextDrawShowForPlayer( i, PingT[ i ] );
}
}
    return 1;
}

public AtualizarPing()
{
    new string[ 16 ];
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if( IsPlayerConnected( i ) )
        {
            format( string, sizeof( string ), "Ping: %d", GetPlayerPing(i) );
            TextDrawSetString( PingT[ i ], gstring);
        }
    }
    return 1;
}
Reply
#10

Disponha!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)