Log in

View Full Version : If hp lower than 30% do sth



begginer
04-01-2012, 02:37 PM
Tittle. How can I do that?

Sin
04-01-2012, 03:14 PM
if HPPercent > 30 then

begginer
04-01-2012, 03:28 PM
Not working. Tried like 10 times

Abu
04-01-2012, 03:32 PM
Hmmm, you must be doing something wrong then :confused:

Here's the definition for the function, make sure you're using it correctly:
(*
HPPercent
~~~~~~~~~

.. code-block:: pascal

function HpPercent: Integer;

Returns Hp left as a percentage.
Does not switch tabs if Players[CurrentPlayer].Level[SKILL_HITPOINTS] (HP level) is set.
Returns -1 if failed.

.. note::

by Wizzup?

Example:

.. code-block:: pascal
*)

Imagine
04-01-2012, 03:33 PM
It helps if you have:

Level[SKILL_HITPOINTS] := 99; //Change 99 to your MAX Hitpoints/Constitution level

in your DeclarePlayers.

Er1k
04-01-2012, 03:54 PM
It helps if you have:

Level[SKILL_HITPOINTS] := 99; //Change 99 to your MAX Hitpoints/Constitution level

in your DeclarePlayers.

IIRC HPPercent will try to get your HP level first if you didn't do the above. So hardcoding your HP level in the script actually helps, unless you're really training HP big time.

begginer
04-09-2012, 08:34 AM
Fixed it. Thanks to all helpers