[AJUDA] Foreach
#1

Pessoal , criei uma textdraw aqui usando Foreach , para o contador de FPS, problema й que nгo estou conseguindo mudar a posiзгo dela mesmo mudando as cordenadas , queria saber se isto й possivel de alguma forma.
Reply
#2

Quote:
Originally Posted by .FuneraL.
View Post
Pessoal , criei uma textdraw aqui usando Foreach , para o contador de FPS, problema й que nгo estou conseguindo mudar a posiзгo dela mesmo mudando as cordenadas , queria saber se isto й possivel de alguma forma.
Verifique tudo que se relaciona com a TextDraw e posta aqui .
Reply
#3

pawn Code:
#include <foreach>

    foreach(Player, p)
    {
        FPS[p] = TextDrawCreate(300, 410, "FPS:");
        TextDrawBackgroundColor(FPS[p], 255);
        TextDrawFont(FPS[p], 1);
        TextDrawLetterSize(FPS[p], 0.440000, 1.500000);
        TextDrawColor(FPS[p], -1);
        TextDrawSetOutline(FPS[p], 0);
        TextDrawSetProportional(FPS[p], 1);
        TextDrawSetShadow(FPS[p], 1);
    }

//OnPlayerConnect

TextDrawShowForPlayer(playerid, FPS[playerid]);
Me corrija se algo estiver errado.
Reply
#4

Quote:
Originally Posted by .FuneraL.
View Post
pawn Code:
#include <foreach>

    foreach(Player, p)
    {
        FPS[p] = TextDrawCreate(300, 410, "FPS:");
        TextDrawBackgroundColor(FPS[p], 255);
        TextDrawFont(FPS[p], 1);
        TextDrawLetterSize(FPS[p], 0.440000, 1.500000);
        TextDrawColor(FPS[p], -1);
        TextDrawSetOutline(FPS[p], 0);
        TextDrawSetProportional(FPS[p], 1);
        TextDrawSetShadow(FPS[p], 1);
    }

//OnPlayerConnect

TextDrawShowForPlayer(playerid, FPS[playerid]);
Me corrija se algo estiver errado.
Nгo necessita deste loop '-'
Reply
#5

pawn Code:
//OnPlayerConnect

FPS[playerid] = TextDrawCreate(300, 410, "FPS:");
TextDrawBackgroundColor(FPS[playerid], 255);
TextDrawFont(FPS[playerid], 1);
TextDrawLetterSize(FPS[playerid], 0.440000, 1.500000);
TextDrawColor(FPS[playerid], -1);
TextDrawSetOutline(FPS[playerid], 0);
TextDrawSetProportional(FPS[playerid], 1);
TextDrawSetShadow(FPS[playerid], 1);
TextDrawShowForPlayer(playerid, FPS[playerid]);

//OnPlayerDisconnect

TextDrawHideForAll(FPS[playerid]);
TextDrawDestroy(FPS[playerid]);
Reply
#6

Quote:
Originally Posted by paulor
View Post
pawn Code:
//OnPlayerConnect

FPS[playerid] = TextDrawCreate(300, 410, "FPS:");
TextDrawBackgroundColor(FPS[playerid], 255);
TextDrawFont(FPS[playerid], 1);
TextDrawLetterSize(FPS[playerid], 0.440000, 1.500000);
TextDrawColor(FPS[playerid], -1);
TextDrawSetOutline(FPS[playerid], 0);
TextDrawSetProportional(FPS[playerid], 1);
TextDrawSetShadow(FPS[playerid], 1);
TextDrawShowForPlayer(playerid, FPS[playerid]);

//OnPlayerDisconnect

TextDrawHideForAll(FPS[playerid]);
TextDrawDestroy(FPS[playerid]);
Funcionou Certinho , Vlw Paulo , +Rep.
Reply
#7

Nгo seria mais fбcil utilizar as novas funзхes do 0.3e para essas textdraws individuais?
Reply
#8

Quote:
Originally Posted by Los
View Post
Nгo seria mais fбcil utilizar as novas funзхes do 0.3e para essas textdraws individuais?
Tanto faz!

@Topic

Nds...
Reply
#9

pawn Code:
new PlayerText:T_FPS[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    T_FPS[playerid] = CreatePlayerTextDraw(playerid, 300, 410, "FPS:");
    PlayerTextDrawBackgroundColor(playerid, T_FPS[playerid], 255);
    PlayerTextDrawFont(playerid, T_FPS[playerid], 1);
    PlayerTextDrawLetterSize(playerid, T_FPS[playerid], 0.440000, 1.500000);
    PlayerTextDrawColor(playerid, T_FPS[playerid], -1);
    PlayerTextDrawSetOutline(playerid, T_FPS[playerid], 0);
    PlayerTextDrawSetProportional(playerid, T_FPS[playerid], 1);
    PlayerTextDrawSetShadow(playerid, T_FPS[playerid], 1);
    PlayerTextDrawShow(playerid, T_FPS[playerid]);
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    PlayerTextDrawHide(playerid, T_FPS[playerid]);
    PlayerTextDrawDestroy(playerid, T_FPS[playerid]);
    return 1;
}
Reply
#10

Quote:
Originally Posted by Los
View Post
Tanto faz?

pawn Code:
new PlayerText:T_FPS;

public OnPlayerConnect(playerid)
{
    T_FPS = CreatePlayerTextDraw(playerid, 300, 410, "FPS:");
    PlayerTextDrawBackgroundColor(playerid, T_FPS, 255);
    PlayerTextDrawFont(playerid, T_FPS, 1);
    PlayerTextDrawLetterSize(playerid, T_FPS, 0.440000, 1.500000);
    PlayerTextDrawColor(playerid, T_FPS, -1);
    PlayerTextDrawSetOutline(playerid, T_FPS, 0);
    PlayerTextDrawSetProportional(playerid, T_FPS, 1);
    PlayerTextDrawSetShadow(playerid, T_FPS, 1);
    PlayerTextDrawShow(playerid, T_FPS);
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    PlayerTextDrawHide(playerid, T_FPS);
    PlayerTextDrawDestroy(playerid, T_FPS);
    return 1;
}
O seu tambйm vai destruir a textdraw de todos assim que um jogador sair do servidor.
O seu soh vai funfar pra um player. e o meu nгo vai esconder o de todos pois criou um textdraw em cada celula!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)