21.10.2009, 12:22
pawn Код:
forward HPTimer();//forward goes above OnFilterscriptInit()
SetTimer("HPTimer",10000,1);//interval has to be in milliseconds. and repeating is 1 or true.
public HPTimer()//Timers are run as publics - required to be forwarded
{
for(new i = 0; i <MAX_PLAYERS; i++)//loops through ALL players
{
if(IsPlayerConnected(i))//if they are not connected it will not work for them
{
new Float:HP;//Float for their current HP
GetPlayerHealth(i,HP);//Get their HP and saves it as the HP Float
SetPlayerHP(i,HP - 1.00);//Will minus their HP by 1 every 10 seconds :)
}
}
}