pickups behavior

Started by pwnerz0r, Nov 02, 2014, 12:25 PM

Previous topic - Next topic

pwnerz0r

How am I supposed to use the function CreatePickup?

Here's my code:


CreatePickup( 366, Vector( -372.4039,-539.5184,17.2836));


the pickup spawns but can't be picked up. How do I solve this?

jayant

I dont know much but you can do this -

function onPickupPickedUp( player, pickup )
{
// Some pickup models
}

I think we can't pick up the pick ups without coding...Try or wait for other replies :)

soulshaker


Sebastian

CreatePickup( int model, int world, int quantity, Vector * pos, int alpha, bool isAuto )

Gudio

You have a callback called onPickupClaimPicked which has the same parameters like onPickupPickedUp, but must return 0 or 1. Server will execute second callback once when first callback returned 1/true.

To create health or weapon pickups, you don't need to script anything. You can use quantity parameter which gets an integer value.
For example a health pickup: CreatePickup( 366, 0, 25, Vector( 0, 0, 0 ), 255, true ); will add 25 HP for player who picked it up.

ysc3839

Try CreatePickupExpanded( 366, 1, 0, -372.4039, -539.5184, 17.2836, 255, true )

Stormeus

Quote from: ysc3839 on Nov 15, 2014, 03:20 PMTry CreatePickupExpanded( 366, 1, 0, -372.4039, -539.5184, 17.2836, 255, true )

This isn't the actual function name, it's just CreatePickup with a different parameter list. Check the raw function names in FunctionHandler.cpp with the real names in Functions.cpp.