[FilterScript] Mostra a vida em nъmero
#1

Olб galera do fуrum sa-mp, vim trazer um FS, simples mas ъtil para server de dm

Nova versгo 2.0

Print:




Config:
Код:
#define COR_TEXTDRAW00 0xE6E6FAFF   //aqui vocк vai colocar a cor do textdraw em hexadecimal.
#define COR_TEXTDRAW01 0xE6E6FAFF //aqui vocк vai colocar a cor do textdraw em hexadecimal.
Cуdigo:
Код:
//=========================== [ Includes ] =====================================
#include <a_samp>

#define COR_TEXTDRAW00 0xE6E6FAFF   //aqui vocк vai colocar a cor do textdraw em hexadecimal.
#define COR_TEXTDRAW01 0xE6E6FAFF //aqui vocк vai colocar a cor do textdraw em hexadecimal.

//========================== [ News ] ==========================================
new PlayerText:vida[MAX_PLAYERS];
new PlayerText:colete[MAX_PLAYERS];
new Total[6];
new Total2[6];


public OnFilterScriptInit()
{
print("FilterScript de mostra vida/colete em nъmeros 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_TEXTDRAW00);
PlayerTextDrawSetOutline(playerid,vida[playerid], 0);
PlayerTextDrawSetProportional(playerid,vida[playerid], 1);
PlayerTextDrawSetShadow(playerid,vida[playerid], 1);
PlayerTextDrawSetString(playerid,vida[playerid],Total);

colete[playerid] = CreatePlayerTextDraw(playerid,562.000000, 44.000000, " ");
PlayerTextDrawBackgroundColor(playerid,colete[playerid], 255);
PlayerTextDrawFont(playerid,colete[playerid], 1);
PlayerTextDrawLetterSize(playerid,colete[playerid], 0.290000, 0.899999);
PlayerTextDrawColor(playerid,colete[playerid], COR_TEXTDRAW01);
PlayerTextDrawSetOutline(playerid,colete[playerid], 0);
PlayerTextDrawSetProportional(playerid,colete[playerid], 1);
PlayerTextDrawSetShadow(playerid,colete[playerid], 1);
PlayerTextDrawSetString(playerid,colete[playerid],Total2);
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
PlayerTextDrawHide(playerid,vida[playerid]);
PlayerTextDrawHide(playerid,colete[playerid]);
return 1;
}

public OnPlayerSpawn(playerid)
{
PlayerTextDrawShow(playerid,vida[playerid]);
PlayerTextDrawShow(playerid,colete[playerid]);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerTextDrawHide(playerid,vida[playerid]);
PlayerTextDrawHide(playerid,colete[playerid]);
return 1;
}

public OnPlayerUpdate(playerid)
{
new Float:vida2;
new Float:colete2;
for(new i; i < MAX_PLAYERS; i++)
{
GetPlayerArmour(i,colete2);
if(colete2 < 1) PlayerTextDrawHide(playerid,colete[playerid]);
if(colete2 > 0) PlayerTextDrawShow(playerid,colete[playerid]);
GetPlayerHealth(i,vida2);
format(Total, sizeof(Total), "%0.1f",vida2);
GetPlayerArmour(i,colete2);
format(Total2, sizeof(Total2), "%0.1f",colete2);
//Textdrawstrings
PlayerTextDrawSetString(i,vida[i],Total);
PlayerTextDrawSetString(i,colete[i],Total2);
return 1;
}
return 1;
}
Aceito sugestхes para melhorar o script.

download
caso queira outro lugar para pegar o cуdigo:

pastebin:http://pastebin.com/rvHjq8Cs

mediafire:http://www.mediafire.com/file/c60emy...a+e+colete.rar
Reply
#2

Parabens, procure sempre melhorar, espero atualizaзхes.
Reply
#3

Obrigado GiromB, vai ter atualizaзхes embreve.
Reply
#4

Quote:
Originally Posted by Marllun
Посмотреть сообщение
Obrigado GiromB, vai ter atualizaзхes embreve.
Sу uma dica, vocк poderia fazer com o colete.
Reply
#5

Vou fazer
Reply
#6

Muito bom cara, й assim com pequenos algoritmos que descobrimos grandes programadores
Reply
#7

Obrigado MBJ.
Reply
#8

Simples, porйm bem ъtil para novatos. Boa
Reply
#9

obrigado NobiZinhoBR
Reply
#10

Olha, achei MUITO simples e a identaзгo do cуdigo estб ruim.
Deveria ter postado em Cуdigos Ъteis.
Ou melhor, se quisesse ajudar novatos, criasse um tutorial completo de como fazer isso com vida e colete.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)