crsandu

Untitled

Oct 22nd, 2013
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2. #include <progress>
  3.  
  4. new Bar:vhealth[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
  5. forward ProgressBar();
  6.  
  7. public OnFilterScriptInit()
  8. {
  9. SetTimer("ProgressBar", 500, 1);
  10. return 1;
  11. }
  12.  
  13. public ProgressBar()
  14. {
  15. for(new playerid; playerid < MAX_PLAYERS; playerid++)
  16. {
  17. new vehicleid;
  18. if((vehicleid = GetPlayerVehicleID(playerid)) && vhealth[playerid] != INVALID_BAR_ID)
  19. {
  20. new Float:health;
  21. GetVehicleHealth(vehicleid, health);
  22. SetProgressBarValue(vhealth[playerid], health);
  23. UpdateProgressBar(vhealth[playerid], playerid);
  24. }
  25. }
  26. }
  27.  
  28. public OnPlayerStateChange(playerid, newstate, oldstate)
  29. {
  30. if(oldstate == PLAYER_STATE_DRIVER)
  31. {
  32. DestroyProgressBar(vhealth[playerid]);
  33. vhealth[playerid] = INVALID_BAR_ID;
  34. }
  35. if(newstate == PLAYER_STATE_DRIVER)
  36. {
  37. vhealth[playerid] = CreateProgressBar(548.5, 36.0, _, _, 0x00FF00FF, 1000.0);
  38. ShowProgressBarForPlayer(playerid, vhealth[playerid]);
  39. }
  40. return 1;
  41. }
  42. // 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