31.08.2015, 20:32
Quote:
|
poderia so me explicar se e possivel colocar pra atualizar nisso ?
PHP код:
PHP код:
PHP код:
|
PHP код:
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||BY:IgorLuiz||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <a_samp>
// Definir a Player TextDraw HUDS
new PlayerText:HUD7[MAX_PLAYERS],
PlayerText:HUD8[MAX_PLAYERS],
PlayerText:HUD9[MAX_PLAYERS]
;
new Tempo[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
// Criar PlayerTextDraw
HUD7[playerid] = CreatePlayerTextDraw(playerid, 511.485900, 61.176670, "_");
PlayerTextDrawLetterSize(playerid, HUD7[playerid], 0.235199, 1.144533);
PlayerTextDrawAlignment(playerid, HUD7[playerid], 1);
PlayerTextDrawColor(playerid, HUD7[playerid], -1);
PlayerTextDrawSetShadow(playerid, HUD7[playerid], 0);
PlayerTextDrawSetOutline(playerid, HUD7[playerid], 0);
PlayerTextDrawBackgroundColor(playerid, HUD7[playerid], 255);
PlayerTextDrawFont(playerid, HUD7[playerid], 2);
PlayerTextDrawSetProportional(playerid, HUD7[playerid], 1);
PlayerTextDrawSetShadow(playerid, HUD7[playerid], 0);
HUD8[playerid] = CreatePlayerTextDraw(playerid, 527.853027, 73.310012, "_");
PlayerTextDrawLetterSize(playerid, HUD8[playerid], 0.235199, 1.144533);
PlayerTextDrawAlignment(playerid, HUD8[playerid], 1);
PlayerTextDrawColor(playerid, HUD8[playerid], -1);
PlayerTextDrawSetShadow(playerid, HUD8[playerid], 0);
PlayerTextDrawSetOutline(playerid, HUD8[playerid], 0);
PlayerTextDrawBackgroundColor(playerid, HUD8[playerid], 255);
PlayerTextDrawFont(playerid, HUD8[playerid], 2);
PlayerTextDrawSetProportional(playerid, HUD8[playerid], 1);
PlayerTextDrawSetShadow(playerid, HUD8[playerid], 0);
HUD9[playerid] = CreatePlayerTextDraw(playerid, 508.126434, 85.256683, "_");
PlayerTextDrawLetterSize(playerid, HUD9[playerid], 0.235199, 1.144533);
PlayerTextDrawAlignment(playerid, HUD9[playerid], 1);
PlayerTextDrawColor(playerid, HUD9[playerid], -1);
PlayerTextDrawSetShadow(playerid, HUD9[playerid], 0);
PlayerTextDrawSetOutline(playerid, HUD9[playerid], 0);
PlayerTextDrawBackgroundColor(playerid, HUD9[playerid], 255);
PlayerTextDrawFont(playerid, HUD9[playerid], 2);
PlayerTextDrawSetProportional(playerid, HUD9[playerid], 1);
PlayerTextDrawSetShadow(playerid, HUD9[playerid], 0);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetTimer("Status", 1000, 1); // Chamar a public status
PlayerTextDrawShow(playerid, HUD7[playerid]); // Mostrar todos os HUDS quando da spawn
PlayerTextDrawShow(playerid, HUD8[playerid]); // Mostrar todos os HUDS quando da spawn
PlayerTextDrawShow(playerid, HUD9[playerid]); // Mostrar todos os HUDS quando da spawn
Tempo[playerid] = 0; // Setar o tempo para 0 novamente
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerTextDrawHide(playerid, HUD7[playerid]); // esconder os HUDS quando morrer
PlayerTextDrawHide(playerid, HUD8[playerid]); // esconder os HUDS quando morrer
PlayerTextDrawHide(playerid, HUD9[playerid]); // esconder os HUDS quando morrer
KillTimer(Status(playerid)); // Parar de chamar a public "Status"
Tempo[playerid] = 0; // setar o tempo para 0 novamente
return 1;
}
// public onde ira atualizar todos os status
forward Status(playerid);
public Status(playerid)
{
new String[128], Float:Health;
GetPlayerHealth(playerid, Health);
//
format(String, sizeof(String), "alive_time: ~w~%d", Tempo[playerid]);
PlayerTextDrawSetString(playerid, HUD7[playerid], String);
//
format(String, sizeof(String), "blood: ~w~%f",Health);
PlayerTextDrawSetString(playerid, HUD8[playerid], String);
//
format(String, sizeof(String), "name:_~w~%s",Tempo[playerid], Health, Nome(playerid));
PlayerTextDrawSetString(playerid, HUD9[playerid], String);
//
Tempo[playerid]++;
return 1;
}
// Stock para pegar o nome do jogador
stock Nome(playerid)
{
new nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome));
return nome;
}
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||BY:IgorLuiz||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


