how to set all players health using a timer ? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to set all players health using a timer ? (
/showthread.php?tid=427198)
how to set all players health using a timer ? -
dash5487 - 31.03.2013
hey
hi i have
and in
hungrytimer
Код HTML:
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)
{
getplayerhealth(i,phealth)
setplayerhealth(i,phealth-5)
so my problem is
if two players at the same time had ishungry[playerid]=1;
the timer will count from id 0 when id 0 dies then it goes to low health id 1
(like timer will first low health id 0 then goto 1 and 2 and 3 )
but i want the timer low the both ids health at the same time
not count from 0 to 10 players !
even if id 1 had ishungy=1 and the timer is already lowing his health
then if id 0 got ishungry=1 then it will stop low id1's health and it will low health id0 when id0 dies it go back to id 1 and starts lowing health id 1 from last health he got
Re: how to set all players health using a timer ? -
Harti - 31.03.2013
Show us the whole code, please. That will make it easier.
You should also use
PVars.