How to lose hp every 10 seconds? how to make that?
#2

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 :)
}
}
}
Reply


Messages In This Thread
How to lose hp every 10 seconds? how to make that? - by dirkblok - 21.10.2009, 12:13
Re: How to lose hp every 10 seconds? how to make that? - by pagie1111 - 21.10.2009, 12:22
Re: How to lose hp every 10 seconds? how to make that? - by Rzzr - 21.10.2009, 12:23
Re: How to lose hp every 10 seconds? how to make that? - by saiberfun - 21.10.2009, 12:50
Re: How to lose hp every 10 seconds? how to make that? - by dirkblok - 21.10.2009, 12:51

Forum Jump:


Users browsing this thread: 3 Guest(s)