pwnerz0r

  • New Member
  • Posts: 1
pickups behavior
« on November 2nd, 2014, 12:25 PM »
How am I supposed to use the function CreatePickup?

Here's my code:

Code: [Select]

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


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

jayant

  • Full Member
  • #MOMO-CS
  • Posts: 163
Re: pickups behavior
« Reply #1, on November 2nd, 2014, 02:43 PM »
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

  • Full Member
  • RIP
  • Posts: 134

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 1,146
Re: pickups behavior
« Reply #3, on November 2nd, 2014, 03:37 PM »
CreatePickup( int model, int world, int quantity, Vector * pos, int alpha, bool isAuto )

Gudio

  • Full Member
  • Gudio.eu
  • Posts: 125
Re: pickups behavior
« Reply #4, on November 3rd, 2014, 12:09 AM »
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:
Code: [Select]
CreatePickup( 366, 0, 25, Vector( 0, 0, 0 ), 255, true );
will add 25 HP for player who picked it up.

ysc3839

  • VC:MP Beta Tester
  • Posts: 622
Re: pickups behavior
« Reply #5, on November 15th, 2014, 03:20 PM »
Try CreatePickupExpanded( 366, 1, 0, -372.4039, -539.5184, 17.2836, 255, true )

Stormeus

  • VC:MP Developer
  • oh god how did i get here im not good w computer
  • Posts: 1,127
Re: pickups behavior
« Reply #6, on November 15th, 2014, 06:19 PM »
Quote from ysc3839 on November 15th, 2014, 03:20 PM
Try 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.