Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <progress>
- #include <zcmd>
- #define FomeTempo 5 // em minutos
- new Bar:FomeB;
- forward Fome(playerid);
- public OnFilterScriptInit()
- {
- print("Sistema de fome por: Vai_Besta e Leo_Perez carregado com sucesso.");
- FomeB = CreateProgressBar(549.00, 58.00, 55.50, 3.20, -8716033, 100.0);
- SetProgressBarMaxValue(FomeB, 100);
- return 1;
- }
- public OnFilterScriptExit()
- {
- HideProgressBarForAll(FomeB);
- print("Sistema de fome por: Vai_Besta e Leo_Perez descarregado com sucesso.");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid,-1,"Este servidor usa o sistema de fome feito por Vai_Besta e Leo_Perez.");
- SetPVarInt(playerid,"Fome",0);
- ShowProgressBarForPlayer(playerid, FomeB);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetTimerEx("Fome",FomeTempo*60000 , 1, "i", playerid);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SetProgressBarValue(FomeB,0);
- UpdateProgressBar(FomeB,playerid);
- SetPVarInt(playerid,"Fome",0);
- return 1;
- }
- public Fome(playerid)
- {
- SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+5);
- SetProgressBarValue(FomeB, GetPVarInt(playerid,"Fome"));
- UpdateProgressBar(FomeB,playerid);
- if(GetPVarInt(playerid,"Fome") >= 95)
- {
- new Float:vida;
- GetPlayerHealth(playerid,vida),SetPlayerHealth(playerid,vida-90.0);
- SendClientMessage(playerid,-1,"Vá comer um lanche ou morrá");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement