14.03.2014, 21:04
Olha vou passar o sistema de Fome por que se nгo fica meio dificil blz
PHP код:
#include <a_samp>
#include <progress>
#include <zcmd>
#define FomeTempo 5 // em minutos
new Bar:FomeB;
forward Fome(playerid);
public OnGameModeInit()
{
FomeB = CreateProgressBar(549.00, 58.00, 55.50, 3.20, -8716033, 100.0);
SetProgressBarMaxValue(FomeB, 100);
return 1;
}
public OnGameModeExit()
{
HideProgressBarForAll(FomeB);
return 1;
}
public OnPlayerConnect(playerid)
{
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;
}