30.08.2010, 12:09
into the functions . . .
pawn Код:
//-------------------------------COUNTDOWN PUBLICS------------------------------------------------------//
public OnPlayerScreenFade(playerid, color, speed)
{
return 1;
}
forward SendMSG();
public SendMSG()
{
new randMSG = random(sizeof(RandomMSG));
SendClientMessageToAll(COLOR_ORANGE, RandomMSG[randMSG]);
}
forward NeedToEat(playerid);
public NeedToEat(playerid)
{
new Float:health;
GetPlayerHealth(playerid, health);
if(CurHealth[playerid] >= health)
{
SendClientMessage(playerid,COLOR_YELLOW2,"-| Il tuo stomaco ha fame, vai a mangiare qualcosa! |-");
SetPlayerHealth(playerid,health-5);
CurHealth[playerid] = health;
}
else
{
CurHealth[playerid] = health;
}
}
public OnPlayerScreenColorFade(playerid, color, speed)
{
return 1;
}
public OnPlayerFadeFlashed(playerid, color, speed)
{
return 1;
}
public CD()
{
new string[8];
if(CountDown == 1)
{
KillTimer(CDTimer);
GameTextForAll("~g~VIA!",3000,3);
UCD = 0;
return 1;
}
CountDown--;
format(string,sizeof(string),"~w~%d",CountDown);
GameTextForAll(string,1000,3);
return 1;
}
public CheckHealth(playerid)
{
if(gPlayerLogged[playerid] == 1)
{
if(Svenuto[playerid] == 1){return 1;}
new name[MAX_PLAYER_NAME];
new string[64];
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 15)
{
GetPlayerName(playerid, name, sizeof(name));
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid,"SWAT","gnstwall_injurd",4.1,1,1,1,1,20000);
format(string, sizeof(string), "* %s si sente male e cade per terra.", name);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_LIGHTRED, "* I medici hanno un minuto per soccorerti, altrimenti morirai...");
Svenuto[playerid] = 1;
SetTimerEx("TempoSvenuto", 60000, false, "i", playerid);
}
}
return 1;
}
public TempoSvenuto(playerid)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health > 15)
{
Svenuto[playerid] = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Sei ritornato in forma grazie alle cure!");
return 1;
}
else
{
SetPlayerHealth(playerid, 0.0);
Svenuto[playerid] = 0;
}
return 1;
}
public UnfreezeTimer(playerid)
{
TogglePlayerControllable(playerid, true);
return 1;
}
public LottoSystem()
{
new rand = random(80);
if(rand < 77) { rand += 3; }
Lotto(rand);
}