From 8ecb91e71fe34efe1dc7eb9cd09bc1b6d9737183 Mon Sep 17 00:00:00 2001 From: RockySouthpaw <55056068+RockySouthpaw@users.noreply.github.com> Date: Mon, 1 Mar 2021 17:05:05 -0500 Subject: [PATCH] Fix: Animation being triggered if the phone isn't open. --- resources/client/functions.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/client/functions.ts b/resources/client/functions.ts index 55e740d..c4024e9 100644 --- a/resources/client/functions.ts +++ b/resources/client/functions.ts @@ -174,9 +174,11 @@ const handleCallStartNormalAnim = async (playerPed: number): Promise => { const handleCallEndNormalAnim = async (playerPed: number): Promise => { const DICT = 'cellphone@'; const ANIM = 'cellphone_call_to_text'; - - await loadAnimDict(DICT); - TaskPlayAnim(playerPed, DICT, ANIM, 2.5, 8.0, -1, 50, 0, false, false, false); + + if (IsEntityPlayingAnim(playerPed, 'cellphone@', 'cellphone_call_listen_base', 49)) { + await loadAnimDict(DICT); + TaskPlayAnim(playerPed, DICT, ANIM, 2.5, 8.0, -1, 50, 0, false, false, false); + } }; export async function phoneOpenAnim(): Promise {