17.07.2016, 18:32
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.
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", 1000, true);
SetTimer("AtualizarMorte", 1000, true);
SetTimer("AtualizarScore", 1000, true);
new x = 0;
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);
new k = 0;
Kill[k] = TextDrawCreate(52.0000, 286.0000, "");
TextDrawBackgroundColor(Kill[k], 255);
TextDrawFont(Kill[k], 1);
TextDrawLetterSize(Kill[k], 0.5199, 1.6000);
TextDrawColor(Kill[k], -1);
TextDrawSetOutline(Kill[k], 1);
new m = 0;
morte[m] = TextDrawCreate(52.0000, 301.0000, "");
TextDrawBackgroundColor(morte[m], 255);
TextDrawFont(morte[m], 1);
TextDrawLetterSize(morte[m], 0.5199, 1.6000);
TextDrawColor(morte[m], -1);
TextDrawSetOutline(morte[m], 1);
return 1;
}
forward AtualizarScore();
public AtualizarScore()
{
for(new x = 0, y = GetMaxPlayers(); x != y; x++)
{
if(!IsPlayerConnected(x)) continue;
new STR[26];
format(STR, 26, "~r~Level:~w~%d", GetPlayerScore(x));
TextDrawShowForPlayer(x, ScoreTextDraw[x]);
TextDrawSetString(ScoreTextDraw[x], STR);
}
return true;
}
forward AtualizarKill(playerid);
public AtualizarKill(playerid)
{
for(new k = 0, l = GetMaxPlayers(); k != l; k++)
{
new nome[30];
new arq[30];
format(arq,sizeof arq,"CONTAS/%s.ini",nome[playerid]);
if(!IsPlayerConnected(k)) continue;
new Killl[31];
format(Killl, 31, "~r~Matou:~w~%d", dini_Int(arq,"Kill"));
TextDrawShowForPlayer(k, Kill[k]);
TextDrawSetString(Kill[k], Killl);
}
return true;
}
forward AtualizarMorte(playerid);
public AtualizarMorte(playerid)
{
for(new m = 0, e = GetMaxPlayers(); m != e; m++)
{
new nome[30];
new arq[30];
format(arq,sizeof arq,"CONTAS/%s.ini",nome[playerid]);
if(!IsPlayerConnected(m)) continue;
new mortee[30];
format(mortee, 30, "~r~Morreu:~w~%d", dini_Int(arq,"Morte"));
TextDrawShowForPlayer(m,morte[m]);
TextDrawSetString(morte[m], mortee);
}
return true;
}