Vice City: Multiplayer
Server Development => Scripting and Server Management => Topic started by: pwnerz0r on November 2nd, 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?
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 :)
This(http://forum.vc-mp.org/?topic=18.0) might help you :)
CreatePickup( int model, int world, int quantity, Vector * pos, int alpha, bool isAuto )
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:
will add 25 HP for player who picked it up.
CreatePickup( 366, 0, 25, Vector( 0, 0, 0 ), 255, true );
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.