Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: pwnerz0r on Nov 02, 2014, 12:25 PM

Title: pickups behavior
Post by: pwnerz0r on Nov 02, 2014, 12:25 PM
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?
Title: Re: pickups behavior
Post by: jayant on Nov 02, 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 :)
Title: Re: pickups behavior
Post by: soulshaker on Nov 02, 2014, 03:30 PM
This (http://forum.vc-mp.org/?topic=18.0) might help you :)
Title: Re: pickups behavior
Post by: Sebastian on Nov 02, 2014, 03:37 PM
CreatePickup( int model, int world, int quantity, Vector * pos, int alpha, bool isAuto )
Title: Re: pickups behavior
Post by: Gudio on Nov 03, 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: CreatePickup( 366, 0, 25, Vector( 0, 0, 0 ), 255, true ); will add 25 HP for player who picked it up.
Title: Re: pickups behavior
Post by: ysc3839 on Nov 15, 2014, 03:20 PM
Try CreatePickupExpanded( 366, 1, 0, -372.4039, -539.5184, 17.2836, 255, true )
Title: Re: pickups behavior
Post by: Stormeus on Nov 15, 2014, 06:19 PM
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.