Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: pwnerz0r on November 2nd, 2014, 12:25 PM

Title: pickups behavior
Post by: pwnerz0r 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?
Title: Re: pickups behavior
Post by: jayant 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 :)
Title: Re: pickups behavior
Post by: soulshaker on November 2nd, 2014, 03:30 PM
This(http://forum.vc-mp.org/?topic=18.0) might help you :)
Title: Re: pickups behavior
Post by: Sebastian on November 2nd, 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 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.
Title: Re: pickups behavior
Post by: ysc3839 on November 15th, 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 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.