From a229d0b800ec6c8d459adfc4effa14de73d299d8 Mon Sep 17 00:00:00 2001 From: andristum <47616367+andristum@users.noreply.github.com> Date: Fri, 22 Nov 2019 08:40:36 +0100 Subject: [PATCH] 1.7.1 - 3 new emotes, some fixes --- Client/AnimationList.lua | 36 ++++++++++++++++----- Client/Emote.lua | 67 ++++++++++++++++++---------------------- Client/EmoteMenu.lua | 7 ++++- version | 2 +- 4 files changed, 65 insertions(+), 47 deletions(-) diff --git a/Client/AnimationList.lua b/Client/AnimationList.lua index eb9a70e..37aa4e5 100644 --- a/Client/AnimationList.lua +++ b/Client/AnimationList.lua @@ -1776,7 +1776,6 @@ DP.PropEmotes = { PropBone = 18905, PropPlacement = {0.13, 0.05, 0.02, -50.0, 16.0, 60.0}, EmoteMoving = true, - EmoteDuration = 4500 }}, ["burger"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Burger", AnimationOptions = { @@ -1784,7 +1783,6 @@ DP.PropEmotes = { PropBone = 18905, PropPlacement = {0.13, 0.05, 0.02, -50.0, 16.0, 60.0}, EmoteMoving = true, - EmoteDuration = 4500 }}, ["sandwich"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Sandwich", AnimationOptions = { @@ -1792,7 +1790,6 @@ DP.PropEmotes = { PropBone = 18905, PropPlacement = {0.13, 0.05, 0.02, -50.0, 16.0, 60.0}, EmoteMoving = true, - EmoteDuration = 4500 }}, ["soda"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Soda", AnimationOptions = { @@ -1808,7 +1805,6 @@ DP.PropEmotes = { PropBone = 60309, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, EmoteMoving = true, - EmoteDuration = 3500 }}, ["wine"] = {"anim@heists@humane_labs@finale@keycards", "ped_a_enter_loop", "Wine", AnimationOptions = { @@ -1834,21 +1830,21 @@ DP.PropEmotes = { EmoteMoving = true, EmoteLoop = true }}, - ["cigar"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Cigar", AnimationOptions = + ["cigar"] = {"amb@world_human_smoking@male@male_a@enter", "enter", "Cigar", AnimationOptions = { Prop = 'prop_cigar_02', PropBone = 47419, PropPlacement = {0.010, 0.0, 0.0, 50.0, 0.0, -80.0}, EmoteMoving = true, - EmoteDuration = 600 + EmoteDuration = 2600 }}, - ["cigar2"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Cigar 2", AnimationOptions = + ["cigar2"] = {"amb@world_human_smoking@male@male_a@enter", "enter", "Cigar 2", AnimationOptions = { Prop = 'prop_cigar_01', PropBone = 47419, PropPlacement = {0.010, 0.0, 0.0, 50.0, 0.0, -80.0}, EmoteMoving = true, - EmoteDuration = 600 + EmoteDuration = 2600 }}, ["guitar"] = {"amb@world_human_musician@guitar@male@idle_a", "idle_b", "Guitar", AnimationOptions = { @@ -1977,4 +1973,28 @@ DP.PropEmotes = { PtfxInfo = Config.Languages[Config.MenuLanguage]['spraychamp'], PtfxWait = 500, }}, + ["joint"] = {"amb@world_human_smoking@male@male_a@enter", "enter", "Joint", AnimationOptions = + { + Prop = 'p_cs_joint_02', + PropBone = 47419, + PropPlacement = {0.015, -0.009, 0.003, 55.0, 0.0, 110.0}, + EmoteMoving = true, + EmoteDuration = 2600 + }}, + ["cig"] = {"amb@world_human_smoking@male@male_a@enter", "enter", "Cig", AnimationOptions = + { + Prop = 'prop_amb_ciggy_01', + PropBone = 47419, + PropPlacement = {0.015, -0.009, 0.003, 55.0, 0.0, 110.0}, + EmoteMoving = true, + EmoteDuration = 2600 + }}, + ["brief3"] = {"missheistdocksprep1hold_cellphone", "static", "Brief 3", AnimationOptions = + { + Prop = "prop_ld_case_01", + PropBone = 57005, + PropPlacement = {0.10, 0.0, 0.0, 0.0, 280.0, 53.0}, + EmoteLoop = true, + EmoteMoving = true, + }}, } \ No newline at end of file diff --git a/Client/Emote.lua b/Client/Emote.lua index 79e6ca8..569b79b 100644 --- a/Client/Emote.lua +++ b/Client/Emote.lua @@ -20,6 +20,10 @@ local PtfxNoProp = false Citizen.CreateThread(function() while true do + if IsPedShooting(PlayerPedId()) and IsInAnimation then + EmoteCancel() + end + if PtfxPrompt then if not PtfxNotif then SimpleNotify(PtfxInfo) @@ -354,27 +358,10 @@ function OnEmotePlay(EmoteName) if EmoteName.AnimationOptions then if EmoteName.AnimationOptions.EmoteDuration == nil then EmoteName.AnimationOptions.EmoteDuration = -1 + AttachWait = 0 else AnimationDuration = EmoteName.AnimationOptions.EmoteDuration - end - - if EmoteName.AnimationOptions.Prop then - PropName = EmoteName.AnimationOptions.Prop - PropBone = EmoteName.AnimationOptions.PropBone - PropPl1, PropPl2, PropPl3, PropPl4, PropPl5, PropPl6 = table.unpack(EmoteName.AnimationOptions.PropPlacement) - if EmoteName.AnimationOptions.SecondProp then - SecondPropName = EmoteName.AnimationOptions.SecondProp - SecondPropBone = EmoteName.AnimationOptions.SecondPropBone - SecondPropPl1, SecondPropPl2, SecondPropPl3, SecondPropPl4, SecondPropPl5, SecondPropPl6 = table.unpack(EmoteName.AnimationOptions.SecondPropPlacement) - SecondPropEmote = true - else - SecondPropEmote = false - end - - AddPropToPlayer(PropName, PropBone, PropPl1, PropPl2, PropPl3, PropPl4, PropPl5, PropPl6) - if SecondPropEmote then - AddPropToPlayer(SecondPropName, SecondPropBone, SecondPropPl1, SecondPropPl2, SecondPropPl3, SecondPropPl4, SecondPropPl5, SecondPropPl6) - end + AttachWait = EmoteName.AnimationOptions.EmoteDuration end if EmoteName.AnimationOptions.PtfxAsset then @@ -395,27 +382,33 @@ function OnEmotePlay(EmoteName) DebugPrint("Ptfx = none") PtfxPrompt = false end - - else - DebugPrint("AnimationOptions = False") - end - - DebugPrint ("--- Main Animations") - DebugPrint ("ChosenDict = " ..ChosenDict.. "") - DebugPrint ("ChosenAnimation = " ..ChosenAnimation.. "") - DebugPrint ("MovementType = " ..MovementType.. "") - DebugPrint ("AnimationDuration = " ..AnimationDuration.. "") - - if EmoteName.AnimationOptions then - DebugPrint ("--- AnimationOptions") - DebugPrint ("AnimationOption.EmoteLoop = " ..tostring(EmoteName.AnimationOptions.EmoteLoop).. "") - DebugPrint ("AnimationOption.EmoteMoving = " ..tostring(EmoteName.AnimationOptions.EmoteMoving).. "") - DebugPrint ("AnimationOption.EmoteDuration = " ..tostring(EmoteName.AnimationOptions.EmoteDuration).. "") - end - TaskPlayAnim(GetPlayerPed(-1), ChosenDict, ChosenAnimation, 2.0, 2.0, AnimationDuration, MovementType, 0, false, false, false) IsInAnimation = true MostRecentDict = ChosenDict MostRecentAnimation = ChosenAnimation + + if EmoteName.AnimationOptions.Prop then + PropName = EmoteName.AnimationOptions.Prop + PropBone = EmoteName.AnimationOptions.PropBone + PropPl1, PropPl2, PropPl3, PropPl4, PropPl5, PropPl6 = table.unpack(EmoteName.AnimationOptions.PropPlacement) + if EmoteName.AnimationOptions.SecondProp then + SecondPropName = EmoteName.AnimationOptions.SecondProp + SecondPropBone = EmoteName.AnimationOptions.SecondPropBone + SecondPropPl1, SecondPropPl2, SecondPropPl3, SecondPropPl4, SecondPropPl5, SecondPropPl6 = table.unpack(EmoteName.AnimationOptions.SecondPropPlacement) + SecondPropEmote = true + else + SecondPropEmote = false + end + + Wait(AttachWait) + AddPropToPlayer(PropName, PropBone, PropPl1, PropPl2, PropPl3, PropPl4, PropPl5, PropPl6) + if SecondPropEmote then + AddPropToPlayer(SecondPropName, SecondPropBone, SecondPropPl1, SecondPropPl2, SecondPropPl3, SecondPropPl4, SecondPropPl5, SecondPropPl6) + end + end + end + + + return true end \ No newline at end of file diff --git a/Client/EmoteMenu.lua b/Client/EmoteMenu.lua index 00459e6..cd35c81 100644 --- a/Client/EmoteMenu.lua +++ b/Client/EmoteMenu.lua @@ -255,7 +255,7 @@ end function AddInfoMenu(menu) if not UpdateAvailable then - infomenu = _menuPool:AddSubMenu(menu, Config.Languages[lang]['infoupdate'], "(1.7.0)", "", Menuthing, Menuthing) + infomenu = _menuPool:AddSubMenu(menu, Config.Languages[lang]['infoupdate'], "(1.7.1)", "", Menuthing, Menuthing) else infomenu = _menuPool:AddSubMenu(menu, Config.Languages[lang]['infoupdateav'], Config.Languages[lang]['infoupdateavtext'], "", Menuthing, Menuthing) end @@ -304,4 +304,9 @@ AddEventHandler("dp:Update", function(state) UpdateAvailable = state AddInfoMenu(mainMenu) _menuPool:RefreshIndex() +end) + +RegisterNetEvent("dp:RecieveMenu") -- For opening the emote menu from another resource. +AddEventHandler("dp:RecieveMenu", function() + OpenEmoteMenu() end) \ No newline at end of file diff --git a/version b/version index 3968aef..6547e41 100644 --- a/version +++ b/version @@ -1 +1 @@ -170 \ No newline at end of file +171 \ No newline at end of file