Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <progress>
- new Bar:vhealth[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
- forward ProgressBar();
- public OnFilterScriptInit()
- {
- SetTimer("ProgressBar", 500, 1);
- return 1;
- }
- public ProgressBar()
- {
- for(new playerid; playerid < MAX_PLAYERS; playerid++)
- {
- new vehicleid;
- if((vehicleid = GetPlayerVehicleID(playerid)) && vhealth[playerid] != INVALID_BAR_ID)
- {
- new Float:health;
- GetVehicleHealth(vehicleid, health);
- SetProgressBarValue(vhealth[playerid], health);
- UpdateProgressBar(vhealth[playerid], playerid);
- }
- }
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(oldstate == PLAYER_STATE_DRIVER)
- {
- DestroyProgressBar(vhealth[playerid]);
- vhealth[playerid] = INVALID_BAR_ID;
- }
- if(newstate == PLAYER_STATE_DRIVER)
- {
- vhealth[playerid] = CreateProgressBar(548.5, 36.0, _, _, 0x00FF00FF, 1000.0);
- ShowProgressBarForPlayer(playerid, vhealth[playerid]);
- }
- return 1;
- }
- // Serios? Multumim Crazy pentru primul Anti-HH, aici dupa cate vezi e doar tehno redactare. In fine, oricum, ai dovedit in fata lui Alex cine e sefu. De acum nu-ti mai spus idea mea. Chiar nu ma asteptam sa am asa putin de modificat. Te-ai gandit la toate. ;)
Advertisement
Add Comment
Please, Sign In to add comment