30.04.2010, 21:29
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:
OnPlayerSpawn
In the bottom of the script
OnPlayerPickUpPickup
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.
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;
pawn Код:
SetTimer("health1",1,false);
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);
}
}
pawn Код:
if(pickupid == Life) SetPlayerHealth(playerid,100);
Thanks in advance.