07.01.2013, 08:26
(
Последний раз редактировалось gurmani11; 12.09.2014 в 18:47.
)
.....................
new KillTimer[MAX_PLAYERS];
command:kill(playerid)
{
KillTimer[playerid] = SetTimerEx("TakeAwayPlayersHealth", 1000, true, "i", playerid);
return 1;
}
fowrward TakeAwayPlayersHealth(playerid);
public TakeAwayPlayersHealth(playerid)
{
new Float:pHP;GetPlayerHealth(playerid,pHP);
if(pHP >=80) SetPlayerHealth(playerid, 80);
else if(pHP >=60&& pHP <80) SetPlayerHealth(playerid, 60);
else if(pHP >=40&& pHP <60) SetPlayerHealth(playerid, 40);
else if(pHP >=20&& pHP <40) SetPlayerHealth(playerid, 20);
else if(pHP >=0&& pHP <20){SetPlayerHealth(playerid, 0);KillTimer(KillTimer[playerid]);}
return 1;
}
forward TakeAwayPlayersHealth(playerid);
public TakeAwayPlayersHealth(playerid)
{
new Float:pHP;GetPlayerHealth(playerid,pHP);
if(pHP >=80) SetPlayerHealth(playerid, 80);
else if(pHP >=60 && pHP <= 80) SetPlayerHealth(playerid, 60);
else if(pHP >=40 && pHP <= 60) SetPlayerHealth(playerid, 40);
else if(pHP >=20 && pHP <= 40) SetPlayerHealth(playerid, 20);
else if(pHP >=0 && pHP <= 20)
{
SetPlayerHealth(playerid, 0);
KillTimer(KillTimer[playerid]);
}
return 1;
}
SetTimerEx("TakeAwayPlayersHealth", 1000, false, "i", playerid);