Don't permasync non-looped anims
This commit is contained in:
@@ -44,8 +44,10 @@ function playPlayerAnimationCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasPlayerSeenActionTip(client, "AnimationStop")) {
|
if (getAnimationData(animationSlot).loop == true) {
|
||||||
messagePlayerTip(client, getGroupedLocaleString(client, "ActionTips", "AnimationStop", "{ALTCOLOUR}/stopanim{MAINCOLOUR}"));
|
if (hasPlayerSeenActionTip(client, "AnimationStop")) {
|
||||||
|
messagePlayerTip(client, getGroupedLocaleString(client, "ActionTips", "AnimationStop", "{ALTCOLOUR}/stopanim{MAINCOLOUR}"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
makePlayerPlayAnimation(client, animationSlot, animationPositionOffset);
|
makePlayerPlayAnimation(client, animationSlot, animationPositionOffset);
|
||||||
}
|
}
|
||||||
@@ -95,11 +97,13 @@ function isPlayerInForcedAnimation(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
||||||
getPlayerData(client).currentAnimation = animationSlot;
|
if (getAnimationData(animationSlot).loop == true) {
|
||||||
getPlayerData(client).currentAnimationPositionOffset = offsetPosition;
|
getPlayerData(client).currentAnimation = animationSlot;
|
||||||
getPlayerData(client).currentAnimationPositionReturnTo = getPlayerPosition(client);
|
getPlayerData(client).currentAnimationPositionOffset = offsetPosition;
|
||||||
getPlayerData(client).animationStart = getCurrentUnixTimestamp();
|
getPlayerData(client).currentAnimationPositionReturnTo = getPlayerPosition(client);
|
||||||
getPlayerData(client).animationForced = false;
|
getPlayerData(client).animationStart = getCurrentUnixTimestamp();
|
||||||
|
getPlayerData(client).animationForced = false;
|
||||||
|
}
|
||||||
|
|
||||||
makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition);
|
makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition);
|
||||||
//setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true);
|
//setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true);
|
||||||
@@ -113,11 +117,13 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function forcePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
function forcePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
||||||
getPlayerData(client).currentAnimation = animationSlot;
|
if (getAnimationData(animationSlot).loop == true) {
|
||||||
getPlayerData(client).currentAnimationPositionOffset = offsetPosition;
|
getPlayerData(client).currentAnimation = animationSlot;
|
||||||
getPlayerData(client).currentAnimationPositionReturnTo = getPlayerPosition(client);
|
getPlayerData(client).currentAnimationPositionOffset = offsetPosition;
|
||||||
getPlayerData(client).animationStart = getCurrentUnixTimestamp();
|
getPlayerData(client).currentAnimationPositionReturnTo = getPlayerPosition(client);
|
||||||
getPlayerData(client).animationForced = true;
|
getPlayerData(client).animationStart = getCurrentUnixTimestamp();
|
||||||
|
getPlayerData(client).animationForced = true;
|
||||||
|
}
|
||||||
|
|
||||||
setPlayerControlState(client, false);
|
setPlayerControlState(client, false);
|
||||||
forcePedAnimation(getPlayerPed(client), animationSlot, offsetPosition);
|
forcePedAnimation(getPlayerPed(client), animationSlot, offsetPosition);
|
||||||
|
|||||||
@@ -1012,7 +1012,9 @@ function sendPlayerEnterPropertyKey(client, key) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function makePedPlayAnimation(ped, animationSlot, positionOffset) {
|
function makePedPlayAnimation(ped, animationSlot, positionOffset) {
|
||||||
setEntityData(ped, "agrp.anim", animationSlot, true);
|
if (getAnimationData(animationSlot).loop == true) {
|
||||||
|
setEntityData(ped, "agrp.anim", animationSlot, true);
|
||||||
|
}
|
||||||
sendNetworkEventToPlayer("agrp.anim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset);
|
sendNetworkEventToPlayer("agrp.anim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ class AnimationData {
|
|||||||
this.animType = (typeof data.animType != "undefined") ? data.animType : AGRP_ANIMTYPE_NORMAL;
|
this.animType = (typeof data.animType != "undefined") ? data.animType : AGRP_ANIMTYPE_NORMAL;
|
||||||
this.animSpeed = (typeof data.animSpeed != "undefined") ? data.animSpeed : 0.0;
|
this.animSpeed = (typeof data.animSpeed != "undefined") ? data.animSpeed : 0.0;
|
||||||
this.moveType = (typeof data.moveType != "undefined") ? data.moveType : AGRP_ANIMMOVE_NONE;
|
this.moveType = (typeof data.moveType != "undefined") ? data.moveType : AGRP_ANIMMOVE_NONE;
|
||||||
this.duration = -1;
|
this.loop = (typeof data.moveType != "undefined") ? data.moveType : false;
|
||||||
this.loop = true;
|
this.duration = (typeof data.duration != "undefined") ? data.duration : -1;
|
||||||
|
|
||||||
// GTA IV
|
// GTA IV
|
||||||
this.infiniteLoop = (typeof data.infiniteLoop != "undefined") ? data.infiniteLoop : false;
|
this.infiniteLoop = (typeof data.infiniteLoop != "undefined") ? data.infiniteLoop : false;
|
||||||
|
|||||||
Reference in New Issue
Block a user