#define FomeTempo 1 //define o tempo para ficar com fome
forward Fome(playerid);
public OnGameModeInit()
{
FomeB = CreateProgressBar(552.00, 321.00, 55.50, 4.19, -16776961, 100.1);
SetProgressBarMaxValue(FomeB, 100);
return 1;
}
public OnGameModeExit()
{
HideProgressBarForAll(FomeB);
return 1;
}
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid,"Fome", 100);
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",101);
return 1;
}
public Fome(playerid)
{
SetPVarInt(playerid,"Fome", GetPVarInt(playerid, "Fome")-1);
SetProgressBarValue(FomeB, GetPVarInt(playerid, "Fome"));
UpdateProgressBar(FomeB, playerid);
if(GetPVarInt(playerid, "Fome") <= 10)
{
new Float:vida;
GetPlayerHealth(playerid, vida), SetPlayerHealth(playerid, vida-90.0);
SendClientMessage(playerid, BRANCO, "|STATUS| Vocк esta com Fome, coma algum lanche ou vai Morrer de Fome");
PlayerPlaySound(playerid, 1057, 0, 0, 0);
}
return true;
}
#include a_samp
#define FomeTempo 1 //define o tempo para ficar com fome
forward Fome(playerid);
// ****** ATENЗГO Mude "FomeB" para "FomeB[MAX_PLAYERS]"
new FomeB[MAX_PLAYERS];
// **** ATENЗГO MUDE PARA ONPLAYERCONNECT
public OnPlayerConnect(playerid)
{
FomeB[playerid] = CreateProgressBar(552.00, 321.00, 55.50, 4.19, -16776961, 100.1);
SetProgressBarMaxValue(FomeB[playerid], 100);
return 1;
}
public OnGameModeExit()
{
HideProgressBarForAll(FomeB[playerid]);
return 1;
}
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid,"Fome", 100);
ShowProgressBarForPlayer(playerid, FomeB[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetTimerEx("Fome", FomeTempo*60000 , 1, "i", playerid);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SetProgressBarValue(FomeB[playerid],0);
UpdateProgressBar(FomeB[playerid],playerid);
SetPVarInt(playerid,"Fome",101);
return 1;
}
public Fome(playerid)
{
static
tBar
;
tBar = GetPVarInt(playerid, "Fome");
tBar --;
// Simples DEBUG
printf("Barra: %d", tBar);
SetPVarInt(playerid,"Fome", tBar);
SetProgressBarValue(FomeB[playerid], tBar);
UpdateProgressBar(FomeB[playerid], playerid);
if(GetPVarInt(playerid, "Fome") <= 10)
{
new Float:vida;
GetPlayerHealth(playerid, vida), SetPlayerHealth(playerid, vida-90.0);
SendClientMessage(playerid, BRANCO, "|STATUS| Vocк esta com Fome, coma algum lanche ou vai Morrer de Fome");
PlayerPlaySound(playerid, 1057, 0, 0, 0);
}
return true;
}
433 HideProgressBarForAll(FomeB[playerid]);
C:\Users\Fernando\Desktop\PROJETO MVR\gamemodes\MVR.pwn(433) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
FomeB[playerid] = CreateProgressBar(552.00, 321.00, 55.50, 4.19, -16776961, 100.1); SetProgressBarMaxValue(FomeB[playerid], 100);
public OnPlayerConnect(playerid){
FomeB[playerid] = CreateProgressBar(552.00, 321.00, 55.50, 4.19, -16776961, 100.1);
SetProgressBarMaxValue(FomeB[playerid], 100);
SetPVarInt(playerid,"Fome", 100);
SetProgressBarValue(FomeB[playerid], GetPVarInt(playerid,"Fome"));
ShowProgressBarForPlayer(playerid, FomeB[playerid]);
return 1;
}
Subistitui aй
pawn Код:
|