Lots of changes
* Add optional offset for some anims (like sitting) * Fix int/vw chat check not working * Disable ambience utils for now * Add ped stop anim util * Fix enter veh messages * Fix radio stream not stopping when exiting vehicle * Fix job items bugging out * Don't save job equipment items * Switch to inactive item slot when going on/off duty * Fix gotospawn not working with int/vw * Added anims for offset use * Added element ID & syncer utils * Fixed wrong job name being shown when setting job vehicle rank * Added anim move type constants * Added element collision net events * Added is any GUI active util * Fixed showing player list when a GUI is active
This commit is contained in:
@@ -79,12 +79,15 @@ function addAllNetworkHandlers() {
|
||||
addNetworkHandler("vrr.veh.repair", repairVehicle);
|
||||
|
||||
addNetworkHandler("vrr.pedAnim", makePedPlayAnimation);
|
||||
addNetworkHandler("vrr.pedStopAnim", makePedStopAnimation);
|
||||
addNetworkHandler("vrr.hideAllGUI", hideAllGUI);
|
||||
addNetworkHandler("vrr.gameScript", setGameScriptState);
|
||||
addNetworkHandler("vrr.clientInfo", serverRequestedClientInfo);
|
||||
addNetworkHandler("vrr.interiorLights", updateInteriorLightsState);
|
||||
|
||||
addNetworkHandler("vrr.syncElement", forceSyncElementProperties);
|
||||
addNetworkHandler("vrr.elementPosition", setElementPosition);
|
||||
addNetworkHandler("vrr.elementCollisions", setElementCollisionsEnabled);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -221,11 +224,24 @@ function setEnterPropertyKey(key) {
|
||||
function makePedPlayAnimation(pedId, animGroup, animId, animType, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition) {
|
||||
if(getGame() < VRR_GAME_GTA_IV) {
|
||||
if(animType == VRR_ANIMTYPE_ADD) {
|
||||
getElementFromId(pedId).position = getElementFromId(pedId).position;
|
||||
if(getGame() == GAME_GTA_VC || getGame() == GAME_GTA_SA) {
|
||||
getElementFromId(pedId).clearAnimations();
|
||||
} else {
|
||||
getElementFromId(pedId).clearObjective();
|
||||
}
|
||||
getElementFromId(pedId).addAnimation(animGroup, animId);
|
||||
|
||||
if(getElementFromId(pedId) == localPlayer) {
|
||||
inAnimation = true;
|
||||
setLocalPlayerControlState(false, false);
|
||||
localPlayer.collisionsEnabled = false;
|
||||
}
|
||||
} else if(animType == VRR_ANIMTYPE_BLEND) {
|
||||
getElementFromId(pedId).position = getElementFromId(pedId).position;
|
||||
getElementFromId(pedId).blendAnimation(animGroup, animId, animSpeed);
|
||||
} else if(animType == VRR_ANIMTYPE_MOVEADD) {
|
||||
getElementFromId(pedId).position = getElementFromId(pedId).position;
|
||||
getElementFromId(pedId).blendAnimation(animGroup, animId, animSpeed);
|
||||
}
|
||||
} else {
|
||||
natives.requestAnims(animGroup);
|
||||
@@ -281,4 +297,31 @@ function forceSyncElementProperties(elementId) {
|
||||
syncElementProperties(getElementFromId(elementId));
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setElementPosition(elementId, position) {
|
||||
getElementFromId(elementId).position = position;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setElementCollisionsEnabled(elementId, state) {
|
||||
getElementFromId(elementId).collisionsEnabled = state;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function makePedStopAnimation(pedId) {
|
||||
if(getGame() == GAME_GTA_VC || getGame() == GAME_GTA_SA) {
|
||||
getElementFromId(pedId).clearAnimations();
|
||||
} else {
|
||||
getElementFromId(pedId).clearObjective();
|
||||
}
|
||||
|
||||
if(getElementFromId(pedId) == localPlayer) {
|
||||
localPlayer.collisionsEnabled = true;
|
||||
setLocalPlayerControlState(true, false);
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user