Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=========================== [ Includes ] =====================================
- #include <a_samp>
- #define ATUALIZAR_VIDA 1 //1000 é um segundo e 10000 é 10 segundos assim vai....
- #define COR_TEXTDRAW -1 //aqui você vai colocar a cor do textdraw em hexadecimal o padrão aqui é branco....
- //========================== [ News ] ==========================================
- new PlayerText:vida[MAX_PLAYERS];
- new stringV[10];
- new Float:vida2;
- forward updatevida();
- public OnFilterScriptInit()
- {
- SetTimer("updatevida",ATUALIZAR_VIDA,true);
- print("FilterScript feito por Marllun");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- vida[playerid] = CreatePlayerTextDraw(playerid,562.000000, 67.000000, " ");
- PlayerTextDrawBackgroundColor(playerid,vida[playerid], 255);
- PlayerTextDrawFont(playerid,vida[playerid], 1);
- PlayerTextDrawLetterSize(playerid,vida[playerid], 0.290000, 0.899999);
- PlayerTextDrawColor(playerid,vida[playerid], COR_TEXTDRAW);
- PlayerTextDrawSetOutline(playerid,vida[playerid], 0);
- PlayerTextDrawSetProportional(playerid,vida[playerid], 1);
- PlayerTextDrawSetShadow(playerid,vida[playerid], 1);
- PlayerTextDrawSetString(playerid,vida[playerid],stringV);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PlayerTextDrawHide(playerid,vida[playerid]);
- return 1;
- }
- public updatevida()
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- GetPlayerHealth(i,vida2);
- format(stringV, sizeof(stringV), "%0.1f",vida2);
- if(IsPlayerConnected(i))
- {
- PlayerTextDrawSetString(i,vida[i],stringV);
- }
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- PlayerTextDrawShow(playerid,vida[playerid]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement