forward UpdateTimer();
public UpdateTimer()
{
for(new x; x<MAX_PLAYERS; x++) // Loop for all players
{
new TDstring[128], Score = GetPlayerScore(x), Money = GetPlayerMoney(x), Ping = GetPlayerPing(x);
if(!IsPlayerConnected(x))
{
format(TDstring, sizeof(TDstring), "SCORE %d, DINHEIRO %d, KILLS %d, DEATHS %d, FPS %d, PING %d", Score, Money,PlayerInfo[id][Kills],PlayerInfo[id][Deaths],Ping);
TextDrawSetString(Textdraw[0][x], TDstring);
}
}
return 1;
}
ґSetTimer("UpdateTimer", 1000, true);
for(new i=0; i<GetMaxPlayers(); i++)
{
Textdraw[0][i] = TextDrawCreate(641.375000, 429.666687, "usebox");
TextDrawLetterSize(Textdraw[0][i], 0.000000, 1.822222);
TextDrawTextSize(Textdraw[0][i], -2.000000, 0.000000);
TextDrawAlignment(Textdraw[0][i], 1);
TextDrawColor(Textdraw[0][i], 0);
TextDrawUseBox(Textdraw[0][i], true);
TextDrawBoxColor(Textdraw[0][i], 102);
TextDrawSetShadow(Textdraw[0][i], 0);
TextDrawSetOutline(Textdraw[0][i], 0);
TextDrawFont(Textdraw[0][i], 0);
Textdraw[1][i] = TextDrawCreate(4.375000, 429.916687, "SCORE: 0");
TextDrawLetterSize(Textdraw[1][i], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[1][i], 1);
TextDrawColor(Textdraw[1][i], -2139062017);
TextDrawSetShadow(Textdraw[1][i], 0);
TextDrawSetOutline(Textdraw[1][i], 1);
TextDrawBackgroundColor(Textdraw[1][i], 51);
TextDrawFont(Textdraw[1][i], 3);
TextDrawSetProportional(Textdraw[1][i], 1);
Textdraw[2][i] = TextDrawCreate(110.000000, 430.500030, "DINHEIRO: 0");
TextDrawLetterSize(Textdraw[2][i], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[2][i], 1);
TextDrawColor(Textdraw[2][i], -2139062017);
TextDrawSetShadow(Textdraw[2][i], 0);
TextDrawSetOutline(Textdraw[2][i], 1);
TextDrawBackgroundColor(Textdraw[2][i], 51);
TextDrawFont(Textdraw[2][i], 3);
TextDrawSetProportional(Textdraw[2][i], 1);
Textdraw[3][i] = TextDrawCreate(225.625000, 430.499969, "KILLS: 0");
TextDrawLetterSize(Textdraw[3][i], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[3][i], 1);
TextDrawColor(Textdraw[3][i], -2139062017);
TextDrawSetShadow(Textdraw[3][i], 0);
TextDrawSetOutline(Textdraw[3][i], 1);
TextDrawBackgroundColor(Textdraw[3][i], 51);
TextDrawFont(Textdraw[3][i], 3);
TextDrawSetProportional(Textdraw[3][i], 1);
Textdraw[4][i] = TextDrawCreate(314.375000, 430.500152, "DEATHS: 0");
TextDrawLetterSize(Textdraw[4][i], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[4][i], 1);
TextDrawColor(Textdraw[4][i], -2139062017);
TextDrawSetShadow(Textdraw[4][i], 0);
TextDrawSetOutline(Textdraw[4][i], 1);
TextDrawBackgroundColor(Textdraw[4][i], 51);
TextDrawFont(Textdraw[4][i], 3);
TextDrawSetProportional(Textdraw[4][i], 1);
Textdraw[5][i] = TextDrawCreate(415.625000, 429.916564, "FPS: 0");
TextDrawLetterSize(Textdraw[5][i], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[5][i], 1);
TextDrawColor(Textdraw[5][i], -2139062017);
TextDrawSetShadow(Textdraw[5][i], 0);
TextDrawSetOutline(Textdraw[5][i], 1);
TextDrawBackgroundColor(Textdraw[5][i], 51);
TextDrawFont(Textdraw[5][i], 3);
TextDrawSetProportional(Textdraw[5][i], 1);
Textdraw[6][i] = TextDrawCreate(488.125000, 429.333312, "PING:0");
TextDrawLetterSize(Textdraw[6][i], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[6][i], 1);
TextDrawColor(Textdraw[6][i], -2139062017);
TextDrawSetShadow(Textdraw[6][i], 0);
TextDrawSetOutline(Textdraw[6][i], 1);
TextDrawBackgroundColor(Textdraw[6][i], 51);
TextDrawFont(Textdraw[6][i], 3);
TextDrawSetProportional(Textdraw[6][i], 1);
}
ґSetTimer("UpdateTimer", 1000, true);
Textdraw[6][i] = TextDrawCreate(488.125000, 429.333312, " ");
TextDrawLetterSize(Textdraw[6][i], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[6][i], 1);
TextDrawColor(Textdraw[6][i], -2139062017);
TextDrawSetShadow(Textdraw[6][i], 0);
TextDrawSetOutline(Textdraw[6][i], 1);
TextDrawBackgroundColor(Textdraw[6][i], 51);
TextDrawFont(Textdraw[6][i], 3);
TextDrawSetProportional(Textdraw[6][i], 1);
}
forward AtualizarScore();
public AtualizarScore()
{
for(new x; x < MAX_PLAYERS; x ++)
{
if(!IsPlayerConnected(x)) continue;
new STR[9000];
format(STR, 9000, "~w~scores: ~g~%d ~w~- ping: ~b~%d ~w~- fps: ~y~%d ~w~- %d/%d", GetPlayerScore(x), GetPlayerPing(x), pFPS[x], ContarJogadores(), GetMaxPlayers());
TextDrawSetString(StatusTextDrawxD[x], STR);
}
return true;
}
for(new xhgj = 0; xhgj < MAX_PLAYERS; xhgj++)
{
StatusTextDrawxD[xhgj] = TextDrawCreate(383.000000, 2.000000, "");
TextDrawAlignment(StatusTextDrawxD[xhgj], 2);
TextDrawBackgroundColor(StatusTextDrawxD[xhgj], 255);
TextDrawFont(StatusTextDrawxD[xhgj], 2);
TextDrawLetterSize(StatusTextDrawxD[xhgj], 0.210000, 1.299999);
TextDrawColor(StatusTextDrawxD[xhgj], -1);
TextDrawSetOutline(StatusTextDrawxD[xhgj], 1);
TextDrawSetProportional(StatusTextDrawxD[xhgj], 1);
TextDrawSetSelectable(StatusTextDrawxD[xhgj], 0);
}
pawn Код:
|
forward UpdateTimer();
public UpdateTimer()
{
new TDstring[128], Score, Money, Ping;
for(new x; x<MAX_PLAYERS; x++) // Loop for all players
{
if(IsPlayerConnected(x))
{
Score = GetPlayerScore(x);
Money = GetPlayerMoney(x);
Ping = GetPlayerPing(x);
format(TDstring, sizeof(TDstring), "SCORE %d, DINHEIRO %d, KILLS %d, DEATHS %d, FPS %d, PING %d", Score, Money, PlayerInfo[id][Kills], PlayerInfo[id][Deaths], Ping);
TextDrawSetString(Textdraw[x][0], TDstring);
}
}
return 1;
}
PT, nгo pedi sua opiniгo, este й meu jeito de fazer postei aqui para o cara e nгo para vocк criticar
![]() |
Fala bobagem nao sff.
- Cara para comecar voce esta a usar o tipo de textdraw errado tem de ser player textdraw. depois na hora de formatar faz algo tipo isto: PHP код:
|
Se nгo sabes fazer direito nгo ensines errado!
Nгo fazes a mнnima ideia da quantidade de slots de Textdraw que gastas ali com aquele Loop sem ser necessбrio. Para isso existe player Textdraw, nгo adianta tentares debater comigo quando estas totalmente errado. Nгo estou a dar a minha opiniгo mas sim a tentar ajudar o criador do tуpico a nгo fazer os mesmos erros que tu fazes |
Hum se acha porque tem quase 6000 post's kk' abraзos, mais como eu disse vo tentar usar dessa forma ver se й melhor.
|