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



OnPlayerPickUpPickup - RollTi - 27.04.2012

Hello i'm creating 4 heart pickup

the 2 heart pickup will spawn at Glenn Park's Hospital
the 2 heart pickup left will spawn at Vinewood's Hospital

i have already create one with pickup types 15 which is pickable and will respawn after death

So here is the question is it possible if player has 100 health he cannot pick the heart pickup anymore?
Like in GTA III?


Re: OnPlayerPickUpPickup - ReneG - 27.04.2012

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    if(pickupid == *yourpickuphere* && health > 100) return 0;
    return 1;
}
Try it


Re: OnPlayerPickUpPickup - RollTi - 27.04.2012

Thanks bud it work