Bribe Pickup
#8

Top
pawn Код:
#define MAX_PICKUPS_IN_ENUM     2

enum pickups
{
    pModel,
    Float:pX,
    Float:pY,
    Float:pZ,
    pWorld
};
new PickupIDS[MAX_PICKUPS_IN_ENUM][pickups] =
{
    {pickup_model, X, Y, Z, VirtualWorld},
    // {...}, next
    {pickup_model, X, Y, Z, VirtualWorld}
};

new PickupID[2];

@RespawnPickup(pickupid,picked);
@RespawnPickup(pickupid,picked)
{
    DestroyPickup(pickupid);
    CreatePickup(PickupIDS[picked][pModel], 1, PickupIDS[picked][pX], PickupIDS[picked][pY], PickupIDS[picked][pZ], PickupIDS[picked][pWorld]);
    return 1;
}
OnGameModeInit
pawn Код:
for(new i=0; i != MAX_PICKUPS_IN_ENUM; i++)
    PickupID[!!i] = CreatePickup(PickupIDS[i][pModel], 1, PickupIDS[i][pX], PickupIDS[i][pY], PickupIDS[i][pZ], PickupIDS[i][pWorld]);
Somewhere
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(PickupID[0] <= pickupid <= PickupID[1])
    {
        DestroyPickup(pickupid);
        new Pick = pickupid - PickupID[0];
        CreatePickup(PickupIDS[Pick][pModel], 1, PickupIDS[Pick][pX], PickupIDS[Pick][pY], PickupIDS[Pick][pZ], 1000);
        SetTimerEx("@RespawnPickup", 20000, false, "ii", pickupid, Pick);
        return 1;
    }
    return 0;
}
If you don't need virtualworld just remove that array
Reply


Messages In This Thread
Bribe Pickup - by AnonScripter - 26.10.2013, 08:56
Re: Bribe Pickup - by SilentSoul - 26.10.2013, 09:02
Re: Bribe Pickup - by AnonScripter - 26.10.2013, 09:07
Re: Bribe Pickup - by SilentSoul - 26.10.2013, 09:08
Re: Bribe Pickup - by AnonScripter - 28.10.2013, 01:25
Re: Bribe Pickup - by erminpr0 - 28.10.2013, 09:18
Re: Bribe Pickup - by AnonScripter - 28.10.2013, 20:18
Re: Bribe Pickup - by Jefff - 28.10.2013, 20:37
Re: Bribe Pickup - by AnonScripter - 28.10.2013, 20:58
Re: Bribe Pickup - by Jefff - 28.10.2013, 22:24

Forum Jump:


Users browsing this thread: 2 Guest(s)