Advertisement
Guest User

Sistema de Fome

a guest
Sep 18th, 2011
1,769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.43 KB | None | 0 0
  1. #include <a_samp>
  2. #include <progress>
  3. #include <zcmd>
  4.  
  5. #define FomeTempo 5 // em minutos
  6.  
  7. new Bar:FomeB;
  8.            
  9. forward Fome(playerid);
  10.  
  11. public OnFilterScriptInit()
  12. {
  13.     print("Sistema de fome por: Vai_Besta e Leo_Perez carregado com sucesso.");
  14.     FomeB = CreateProgressBar(549.00, 58.00, 55.50, 3.20, -8716033, 100.0);
  15.     SetProgressBarMaxValue(FomeB, 100);
  16.     return 1;
  17. }
  18. public OnFilterScriptExit()
  19. {
  20.     HideProgressBarForAll(FomeB);
  21.     print("Sistema de fome por: Vai_Besta e Leo_Perez descarregado com sucesso.");
  22.     return 1;
  23. }
  24. public OnPlayerConnect(playerid)
  25. {
  26.     SendClientMessage(playerid,-1,"Este servidor usa o sistema de fome feito por Vai_Besta e Leo_Perez.");
  27.     SetPVarInt(playerid,"Fome",0);
  28.     ShowProgressBarForPlayer(playerid, FomeB);
  29.     return 1;
  30. }
  31. public OnPlayerSpawn(playerid)
  32. {
  33.     SetTimerEx("Fome",FomeTempo*60000 , 1, "i", playerid);
  34.     return 1;
  35. }
  36. public OnPlayerDeath(playerid, killerid, reason)
  37. {
  38.     SetProgressBarValue(FomeB,0);
  39.     UpdateProgressBar(FomeB,playerid);
  40.     SetPVarInt(playerid,"Fome",0);
  41.     return 1;
  42. }
  43. public Fome(playerid)
  44. {
  45.     SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+5);
  46.     SetProgressBarValue(FomeB, GetPVarInt(playerid,"Fome"));
  47.     UpdateProgressBar(FomeB,playerid);
  48.     if(GetPVarInt(playerid,"Fome") >= 95)
  49.     {
  50.         new Float:vida;
  51.         GetPlayerHealth(playerid,vida),SetPlayerHealth(playerid,vida-90.0);
  52.         SendClientMessage(playerid,-1,"Vá comer um lanche ou morrá");
  53.     }
  54.     return 1;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement