[Ajuda] Problema com TextDraw.
#1

Gente pelo amor de deus me ajuda nisso.
Eu entro no servidor e fica tudo perfeito, sу que quando entra outro player ele se mistura com a hora jб fiz de tudo pra tentar arrumar e nгo consigo.


PHP код:
#include <a_samp>
#include <dini>
new Text:ScoreTextDraw[MAX_PLAYERS],Text:Kill[MAX_PLAYERS],Text:morte[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
SetTimer("AtualizarKill"1000true);
SetTimer("AtualizarMorte"1000true);
SetTimer("AtualizarScore"1000true);
new 
0;
ScoreTextDraw[x] = TextDrawCreate(52.0000316.0000"Level:");
TextDrawBackgroundColor(ScoreTextDraw[x], 255);
TextDrawFont(ScoreTextDraw[x], 1);
TextDrawLetterSize(ScoreTextDraw[x], 0.51991.6000);
TextDrawColor(ScoreTextDraw[x], -1);
TextDrawSetOutline(ScoreTextDraw[x], 1);
new 
0;
Kill[k] = TextDrawCreate(52.0000286.0000"");
TextDrawBackgroundColor(Kill[k], 255);
TextDrawFont(Kill[k], 1);
TextDrawLetterSize(Kill[k], 0.51991.6000);
TextDrawColor(Kill[k], -1);
TextDrawSetOutline(Kill[k], 1);
new 
0;
morte[m] = TextDrawCreate(52.0000301.0000"");
TextDrawBackgroundColor(morte[m], 255);
TextDrawFont(morte[m], 1);
TextDrawLetterSize(morte[m], 0.51991.6000);
TextDrawColor(morte[m], -1);
TextDrawSetOutline(morte[m], 1);
return 
1;
}
forward AtualizarScore();
public 
AtualizarScore()
{
for(new 
0GetMaxPlayers(); != yx++)
{
if(!
IsPlayerConnected(x)) continue;
new 
STR[26];
format(STR26"~r~Level:~w~%d"GetPlayerScore(x));
TextDrawShowForPlayer(xScoreTextDraw[x]);
TextDrawSetString(ScoreTextDraw[x], STR);
}
return 
true;
}
forward AtualizarKill(playerid);
public 
AtualizarKill(playerid)
{
for(new 
0GetMaxPlayers(); != lk++)
{
new 
nome[30];
new 
arq[30];
format(arq,sizeof arq,"CONTAS/%s.ini",nome[playerid]);
if(!
IsPlayerConnected(k)) continue;
new 
Killl[31];
format(Killl31"~r~Matou:~w~%d"dini_Int(arq,"Kill"));
TextDrawShowForPlayer(kKill[k]);
TextDrawSetString(Kill[k], Killl);
}
return 
true;
}
forward AtualizarMorte(playerid);
public 
AtualizarMorte(playerid)
{
for(new 
0GetMaxPlayers(); != em++)
{
new 
nome[30];
new 
arq[30];
format(arq,sizeof arq,"CONTAS/%s.ini",nome[playerid]);
if(!
IsPlayerConnected(m)) continue;
new 
mortee[30];
format(mortee30"~r~Morreu:~w~%d"dini_Int(arq,"Morte"));
TextDrawShowForPlayer(m,morte[m]);
TextDrawSetString(morte[m], mortee);
}
return 
true;

Reply
#2

Tem que criar PlayerTextDraw e usar SetTimerEx
Reply
#3

altere o "Text:" para "PlayerText:" e troque as configuraзхes da textdraws pra esses:

PHP код:
PlayerTextDrawDestroyDestroy a player-textdraw.
PlayerTextDrawColorSet the color of the text in a player-textdraw.
PlayerTextDrawBoxColorSet the color of a player-textdraw's box.
PlayerTextDrawBackgroundColor: Set the background color of a player-textdraw.
PlayerTextDrawAlignment: Set the alignment of a player-textdraw.
PlayerTextDrawFont: Set the font of a player-textdraw.
PlayerTextDrawLetterSize: Set the letter size of the text in a player-textdraw.
PlayerTextDrawTextSize: Set the size of a player-textdraw box (or clickable area for PlayerTextDrawSetSelectable).
PlayerTextDrawSetOutline: Toggle the outline on a player-textdraw.
PlayerTextDrawSetShadow: Set the shadow on a player-textdraw.
PlayerTextDrawSetProportional: Scale the text spacing in a player-textdraw to a proportional ratio.
PlayerTextDrawUseBox: Toggle the box on a player-textdraw.
PlayerTextDrawSetString: Set the text of a player-textdraw. 
creio que irб resolver
Reply
#4

new x = 0; vocк estб a criar sempre a textdraw para o id 0 .. utilize

public OnPlayerConnect(playerid)
{
SetTimer("AtualizarKill", 1000, true);
SetTimer("AtualizarMorte", 1000, true);
SetTimer("AtualizarScore", 1000, true);
new x = playerid;
ScoreTextDraw[x] = TextDrawCreate(52.0000, 316.0000, "Level:");
TextDrawBackgroundColor(ScoreTextDraw[x], 255);
TextDrawFont(ScoreTextDraw[x], 1);
TextDrawLetterSize(ScoreTextDraw[x], 0.5199, 1.6000);
TextDrawColor(ScoreTextDraw[x], -1);
TextDrawSetOutline(ScoreTextDraw[x], 1);

Kill[x] = TextDrawCreate(52.0000, 286.0000, "");
TextDrawBackgroundColor(Kill[x], 255);
TextDrawFont(Kill[x], 1);
TextDrawLetterSize(Kill[k], 0.5199, 1.6000);
TextDrawColor(Kill[x], -1);
TextDrawSetOutline(Kill[x], 1);

morte[x] = TextDrawCreate(52.0000, 301.0000, "");
TextDrawBackgroundColor(morte[x], 255);
TextDrawFont(morte[x], 1);
TextDrawLetterSize(morte[x], 0.5199, 1.6000);
TextDrawColor(morte[x], -1);
TextDrawSetOutline(morte[x], 1);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)