#include <a_samp> #define SLOTS 50 // Change it to your Server Slots new txdstr[25]; new Float:Armour; new Float:Health; new Text:ArmourTXD[SLOTS]; new Text:HealthTXD[SLOTS]; public OnFilterScriptInit() { for (new i=0; i <= SLOTS; i++) { ArmourTXD[i] = TextDrawCreate(600.000000, 43.000000, "Armour: 100"); TextDrawAlignment(ArmourTXD[i], 3); TextDrawBackgroundColor(ArmourTXD[i], 255); TextDrawFont(ArmourTXD[i], 3); TextDrawLetterSize(ArmourTXD[i], 0.359999, 1.300000); TextDrawColor(ArmourTXD[i], -1); TextDrawSetOutline(ArmourTXD[i], 1); TextDrawSetProportional(ArmourTXD[i], 1); HealthTXD[i] = TextDrawCreate(600.000000, 64.000000, "Health: 100"); TextDrawAlignment(HealthTXD[i], 3); TextDrawBackgroundColor(HealthTXD[i], 255); TextDrawFont(HealthTXD[i], 3); TextDrawLetterSize(HealthTXD[i], 0.359999, 1.300000); TextDrawColor(HealthTXD[i], -1); TextDrawSetOutline(HealthTXD[i], 1); TextDrawSetProportional(HealthTXD[i], 1); } return 1; } public OnFilterScriptExit() { for (new i=0; i <= SLOTS; i++) { TextDrawDestroy(ArmourTXD[i]); TextDrawDestroy(HealthTXD[i]); } return 1; } public OnPlayerSpawn(playerid) { TextDrawShowForPlayer(playerid, ArmourTXD[playerid]); TextDrawShowForPlayer(playerid, HealthTXD[playerid]); return 1; } public OnPlayerUpdate(playerid) { GetPlayerArmour(playerid, Armour); if (Armour > 0) { format(txdstr, 25, "%.0f", Armour); TextDrawSetString(ArmourTXD[playerid], txdstr); TextDrawShowForPlayer(playerid, ArmourTXD[playerid]); } else TextDrawHideForPlayer(playerid, ArmourTXD[playerid]); GetPlayerHealth(playerid, Health); format(txdstr, 25, "%.0f", Health); TextDrawSetString(HealthTXD[playerid], txdstr); return 1; } public OnPlayerDeath(playerid, killerid, reason) { TextDrawSetString(HealthTXD[playerid], "0"); return 1; }
WTF? This only show you Armour And Health are 100 lol.
Dude change it to it's amount! |
@topic You can do to this callback OnPlayerTakeDamage, OnPlayerUpdate is too often performed.
|