SA-MP Forums Archive
Question - 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: Question (/showthread.php?tid=502253)



Question - DarkLored - 23.03.2014

Hello so i made a stock but i cant figure out how to make it work it gives me warnings such as "not matches defenistion"

how can i make my stock decrease health every second like in variables for exsample Time[playerid] --;

how do i do this with stocks?


here is my stock
pawn Код:
stock DecreaseHealth(playerid)
{
   SetPlayerHealth(playerid, GetPlayerHealth(playerid) --);
}



Re: Question - ChandraLouis - 23.03.2014

why don't use timer ?


Re: Question - DarkLored - 23.03.2014

i use variables as timers
the problem is i dont know how to make someones health to decrease within a stock if its even possible
and can i use variables as timers to decrease health every second?


AW: Question - Nero_3D - 23.03.2014

pawn Код:
stock DecreaseHealth(playerid)
{
    new
        Float: health
    ;
    GetPlayerHealth(playerid, health);
    return SetPlayerHealth(playerid, health - 1.0);
}



Re: Question - Dubya - 23.03.2014

@Dark, you've got GetPlayerHealth messed up.

pawn Код:
stock DecreaseHealth(playerid)
{
   new Float:health;
   GetPlayerHealth(playerid, health);
   return SetPlayerHealth(playerid, health-1.0);
}



Re: Question - DarkLored - 23.03.2014

Thanks for the help man it worked +1