[Ajuda]TextDraw Mostrando PING + FPS
#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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)