Vice City: Multiplayer

VC:MP Discussion => Support => Topic started by: . on Nov 14, 2014, 03:01 PM

Title: [QUESTION] Some information regarding Player and Vehicle update callbacks
Post by: . on Nov 14, 2014, 03:01 PM
I find my self working with the Player and Vehicle update callbacks from the SDK and I notice I have no information about them other than the one I could find in the Squirrel plugin.

First of all. On what kind of updates are these functions called. Just a few like: Position, Health, Armour, Weapon etc. Or they're called on all kinds of updates.

Does the updated type id mean anything?

I've noticed the following:

When the player is out of a vehicle is always 0. When the player is in a vehicle is always 2.
When the vehicle doesn't have a driver is always 1. When the vehicle has a driver is always 0.


I'm a bit lost and if someone could provide some inside information I'd be grateful. Thank you :)
Title: Re: [QUESTION] Some information regarding Player and Vehicle update callbacks
Post by: Stormeus on Nov 15, 2014, 06:28 PM
The type IDs for OnPlayerUpdate are as follows.

Normal/On Foot: 0
Aiming/Firing Weapon: 1
Driver: 2
Passenger: 3

The type IDs for OnVehicleUpdate are as follows.

Driver: 0
Other (driverless sync): 1
Position: 2
Health: 4
Colour: 5
Rotation: 6

The events will always (or almost always) fire when something has changed. Player updates may fire even while idle when receiving sync packets from them. Vehicle updates will never fire if a vehicle is streamed to no one on the server.
Title: Re: [QUESTION] Some information regarding Player and Vehicle update callbacks
Post by: . on Nov 15, 2014, 06:57 PM
Thank you :)
Title: Re: [QUESTION] Some information regarding Player and Vehicle update callbacks
Post by: ysc3839 on Dec 13, 2014, 03:24 PM
See the wiki! http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Constants#Update_Type :)
Title: Re: [QUESTION] Some information regarding Player and Vehicle update callbacks
Post by: Sk on Dec 13, 2014, 06:17 PM
ty ysc :)
Title: Re: [QUESTION] Some information regarding Player and Vehicle update callbacks
Post by: . on Dec 13, 2014, 08:58 PM
Quote from: ysc3839 on Dec 13, 2014, 03:24 PMSee the wiki! http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Constants#Update_Type :)

That's 20% of the answer and the full answer was already in the second post.