Add ped parts/props sync event (unfinished)
This commit is contained in:
@@ -107,6 +107,8 @@ function addAllNetworkHandlers() {
|
|||||||
addNetworkEventHandler("vrr.holdObject", makePedHoldObject);
|
addNetworkEventHandler("vrr.holdObject", makePedHoldObject);
|
||||||
|
|
||||||
addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer);
|
addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer);
|
||||||
|
|
||||||
|
addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -259,18 +261,6 @@ function setElementCollisionsEnabled(elementId, state) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setLocalPlayerPedPartsAndProps(parts, props) {
|
|
||||||
for(let i in parts) {
|
|
||||||
localPlayer.changeBodyPart(parts[0], parts[1], parts[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(let i in props) {
|
|
||||||
localPlayer.changeBodyProp(props[0], props[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setLocalPlayerArmour(armour) {
|
function setLocalPlayerArmour(armour) {
|
||||||
if(typeof localPlayer.armour != "undefined") {
|
if(typeof localPlayer.armour != "undefined") {
|
||||||
localPlayer.armour = armour;
|
localPlayer.armour = armour;
|
||||||
|
|||||||
Reference in New Issue
Block a user