14.04.2012, 22:26
pawn Код:
new checkhealth;
forward WhenUsingDrugs(playerid);
public WhenUsingDrugs(playerid)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 100)
{
SetPlayerHealth(playerid, health++);
}
else
{
KillTimer(checkhealth);
SendClientMessage(playerid, -1, "You have now full health.");
}
return 1;
}
CMD:usedrugs(playerid, params[])
{
new Float:health;
GetPlayerHealth(playerid, health);
if(health == 100)
{
SendClientMessage(playerid, -1, "You have full health, what is a need of drug then?");
}
else
{
SendClientMessage(playerid, -1, "You are now using drugs, your health will increase per second.");
checkhealth = SetTimer("WhenUsingDrugs", 1000, true); // Set a timer of 1000 miliseconds (1 second)
}
}

-FalconX