Only freeze player that anim is for
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
function makePedPlayAnimation(pedId, animGroup, animId, animType, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition, freezePlayer) {
|
function makePedPlayAnimation(pedId, animGroup, animId, animType, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition, freezePlayer) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Animation] Playing animation ${animGroup}/${animId} for ped ${pedId}`);
|
logToConsole(LOG_DEBUG, `[VRR.Animation] Playing animation ${animGroup}/${animId} for ped ${pedId}`);
|
||||||
if(getGame() < VRR_GAME_GTA_IV) {
|
if(getGame() < VRR_GAME_GTA_IV) {
|
||||||
if(animType == VRR_ANIMTYPE_NORMAL) {
|
if(animType == VRR_ANIMTYPE_NORMAL || animType == VRR_ANIMTYPE_SURRENDER) {
|
||||||
if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
|
if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
|
||||||
getElementFromId(pedId).clearAnimations();
|
getElementFromId(pedId).clearAnimations();
|
||||||
} else {
|
} else {
|
||||||
@@ -26,9 +26,6 @@ function makePedPlayAnimation(pedId, animGroup, animId, animType, animSpeed, loo
|
|||||||
} else if(animType == VRR_ANIMTYPE_BLEND) {
|
} else if(animType == VRR_ANIMTYPE_BLEND) {
|
||||||
getElementFromId(pedId).position = getElementFromId(pedId).position;
|
getElementFromId(pedId).position = getElementFromId(pedId).position;
|
||||||
getElementFromId(pedId).blendAnimation(animGroup, animId, animSpeed);
|
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 {
|
} else {
|
||||||
natives.requestAnims(animGroup);
|
natives.requestAnims(animGroup);
|
||||||
@@ -41,14 +38,15 @@ function makePedPlayAnimation(pedId, animGroup, animId, animType, animSpeed, loo
|
|||||||
function forcePedAnimation(pedId, animGroup, animId, animType, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition) {
|
function forcePedAnimation(pedId, animGroup, animId, animType, animSpeed, loop, loopNoControl, freezeLastFrame, returnToOriginalPosition) {
|
||||||
if(getGame() < VRR_GAME_GTA_IV) {
|
if(getGame() < VRR_GAME_GTA_IV) {
|
||||||
forcedAnimation = [animGroup, animId];
|
forcedAnimation = [animGroup, animId];
|
||||||
setLocalPlayerControlState(false, false);
|
|
||||||
getElementFromId(pedId).position = getElementFromId(pedId).position;
|
getElementFromId(pedId).position = getElementFromId(pedId).position;
|
||||||
getElementFromId(pedId).addAnimation(animGroup, animId);
|
getElementFromId(pedId).addAnimation(animGroup, animId);
|
||||||
|
|
||||||
|
if(getElementFromId(pedId) == localPlayer) {
|
||||||
inAnimation = true;
|
inAnimation = true;
|
||||||
setLocalPlayerControlState(false, false);
|
setLocalPlayerControlState(false, false);
|
||||||
localPlayer.collisionsEnabled = false;
|
localPlayer.collisionsEnabled = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user