SA-MP Forums Archive
[Ajuda] Oque tem de errado? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Oque tem de errado? (/showthread.php?tid=582170)



Oque tem de errado? - LuisFerreira - 18.07.2015

Em ongamemonit:

PHP код:
SetTimer("AtualizarScore", 1000, true);
    
TextDraw = CreatePlayerTextDraw(playerid, 383.000000, 2.000000, "");
    
PlayerTextDrawAlignment(playerid, TextDraw, 2);
    
PlayerTextDrawBackgroundColor(playerid, TextDraw, 255);
    
PlayerTextDrawFont(playerid, TextDraw, 2);
    
PlayerTextDrawLetterSize(playerid, TextDraw, 0.210000, 1.299999);
    
PlayerTextDrawColor(playerid, TextDraw, -1);
    
PlayerTextDrawSetOutline(playerid, TextDraw, 1);
    
PlayerTextDrawSetProportional(playerid, TextDraw, 1);
    
PlayerTextDrawSetSelectable(playerid, TextDraw, 0); 
Abaixo:

PHP код:
forward AtualizarScore();
public 
AtualizarScore()
{
    for(new 
playerid; playerid < GetMaxPlayers(); playerid++) {
    if(!
IsPlayerConnected(playerid)) continue;
    new 
STR[200];
    
format(STR, 200, "~w~scores: ~g~%d ~w~- ping: ~b~%d ~w~- fps: ~y~%d ~w~- %d/%d", GetPlayerScore(playerid), GetPlayerPing(playerid), pFPS[playerid], ContarJogadores(), GetMaxPlayers());
    
PlayerTextDrawSetString(playerid, TextDraw, STR);
    }
    return 
true;
} 
Topo:

PHP код:
new PlayerText:TextDraw; 
Onplayerspawn:

PHP код:
PlayerTextDrawShow(playerid, TextDraw); 
o code nгo esta funcionando...Oq pode ser?


Re: Oque tem de errado? - s4kuL - 18.07.2015

nгo funciona mas oque acontece?


Re: Oque tem de errado? - LuisFerreira - 18.07.2015

Ela nгo aparece, e tbm buga o settimer do relуgio...e o relуgio fica parado..


Re: Oque tem de errado? - Kimossab - 18.07.2015

Porque estбs a criar um PlayerTextdraw apenas para 1?
https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw

tens que fazer um array de textdraws...

Quote:

Player-textdraws are automatically destroyed when a player disconnects.

Nunca trabalhei com PlayerTextDraws, mas se eu fosse a ti seguia o exemplo do wiki. Cria as texts no OnPlayerConnect e usa um array, porque assim estбs a usar 1 text para todos os players. Nao sei atй que ponto tudo isto pode bugar, mas o mais certo й ser uma destas coisas que disse...


Re: Oque tem de errado? - FallweN - 18.07.2015

PlayerTextDraw em OnGameModeInit ?