13.03.2013, 21:20
(
Последний раз редактировалось P3DRO; 14.03.2013 в 18:47.
)
I'm a rookie to Pawno, currently I'm scripting an AAD GM and I will be releasing some code that I will use in the AAD GM. For my debut as a scripter I decided to release a simple yet useful filterscript that shows your Armour and Health as a number in your Armour and Health bars.
Print - http://gyazo.com/cc308266b7674d19b79a0927b5dd6f76
In case you detect some bug or any mistake I did please let me know so I can improve. Thank you and I hope you enjoy
Print - http://gyazo.com/cc308266b7674d19b79a0927b5dd6f76
In case you detect some bug or any mistake I did please let me know so I can improve. Thank you and I hope you enjoy
Код:
#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; }