14.12.2013, 12:59
Yo,Releasing some little script.it will show car health in progress bar.
Код:
#include <a_samp> #include <progress> new Bar:health[MAX_PLAYERS] = {INVALID_BAR_ID, ...}; public OnFilterScriptInit() { SetTimer("Car", 1000, 1); return 1; } forward Car(); public Car() { for(new playerid; playerid < MAX_PLAYERS; playerid++) foreach(Player, playerid) { new vehicleid; if((vehicleid = GetPlayerVehicleID(playerid)) && health[playerid] != INVALID_BAR_ID) { new Float:health; GetVehicleHealth(vehicleid, health); SetProgressBarValue(health[playerid], health); UpdateProgressBar(health[playerid], playerid); } } } public OnPlayerStateChange(playerid, newstate, oldstate) { if(oldstate == PLAYER_STATE_DRIVER) { DestroyProgressBar(health[playerid]); health[playerid] = INVALID_BAR_ID; } if(newstate == PLAYER_STATE_DRIVER) { health[playerid] = CreateProgressBar(600.5, 100.0, _, _, 0x00FF00FF, 1000.0); ShowProgressBarForPlayer(playerid, health[playerid]); } return 1; }