SA-MP Forums Archive
How to do a one-time pickup ?? - 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: How to do a one-time pickup ?? (/showthread.php?tid=552006)



How to do a one-time pickup ?? - _Application_ - 22.12.2014

How to do a one-time pickup , and when i collect it with impact??

In short,

One-time pickup

With effect

How to do it?


sory my bad english


Re: How to do a one-time pickup ?? - Threshold - 22.12.2014

Example:
pawn Код:
new MyPickup;

public OnGameModeInit()
{
    MyPickup = CreatePickup(1550, 1, 100.0, 200.0, 300.0);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == MyPickup)
    {
        //Do something here..
        DestroyPickup(MyPickup);
        MyPickup = -1;
    }
    return 1;
}
Create a pickup with 'type' 1, which allows for all scripted actions only. Refer to this: https://sampwiki.blast.hk/wiki/PickupTypes

Then, you can just destroy it once it is picked up.