A little problem,need help
#1

Hello,
i got a problem,i tried to make something that checks that if your health gets under 25.0 it will create
a pickup that will heal you.anyway here is the code:
pawn Код:
forward health1(playerid);
new Life;
OnPlayerSpawn
pawn Код:
SetTimer("health1",1,false);
In the bottom of the script
pawn Код:
public health1(playerid)
{
    new Float:health;
  GetPlayerHealth(playerid,health);
  if (health < 25.0)
  {
    SendClientMessage(playerid,COLOR_PURPLE,"Wow looks like you're injured badly!take the heart pickup to heal yourself.");
    new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        Life = AddStaticPickup(1240,2,x+2.00,y+2.34,z,0);
  }
}
OnPlayerPickUpPickup
pawn Код:
if(pickupid == Life) SetPlayerHealth(playerid,100);
Well the problem is that if my health goes under 25 nothing happens,i tried to change the repeating to "true" but than it just spammed pickups and messages.
Thanks in advance.
Reply


Messages In This Thread
A little problem,need help - by [XST]O_x - 30.04.2010, 21:29
Re: A little problem,need help - by maij - 30.04.2010, 21:34
Re: A little problem,need help - by GTAguillaume - 30.04.2010, 21:35
Re: A little problem,need help - by [XST]O_x - 30.04.2010, 21:40
Re: A little problem,need help - by maij - 30.04.2010, 21:47
Re: A little problem,need help - by [XST]O_x - 30.04.2010, 21:49
Re: A little problem,need help - by Killa_ - 30.04.2010, 22:06
Re: A little problem,need help - by [XST]O_x - 30.04.2010, 22:11

Forum Jump:


Users browsing this thread: 1 Guest(s)