Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Props radio stuck in the hand #63

Open
GladesH opened this issue Sep 24, 2024 · 0 comments
Open

Props radio stuck in the hand #63

GladesH opened this issue Sep 24, 2024 · 0 comments

Comments

@GladesH
Copy link

GladesH commented Sep 24, 2024

Search in client > functions.lua line 172
and change function : function Radio:toggleRadioAnimation(pState)
to

function Radio:toggleRadioAnimation(pState)
    lib.requestAnimDict('cellphone@')
    if pState then
        -- Si l'objet radio existe déjà, on le supprime d'abord avant d'en créer un nouveau
        if self.radioProp and DoesEntityExist(self.radioProp) then
            DeleteObject(self.radioProp)
            self.radioProp = nil
        end

        -- Attacher la radio et jouer l'animation
        TriggerEvent("attachItemRadio", "radio")
        TaskPlayAnim(cache.ped, "cellphone@", "cellphone_text_read_base", 2.0, 3.0, -1, 49, 0, false, false, false)
        self.radioProp = CreateObject(`prop_cs_hand_radio`, 1.0, 1.0, 1.0, true, true, false)
        AttachEntityToEntity(self.radioProp, cache.ped, GetPedBoneIndex(cache.ped, 57005), 0.14, 0.01, -0.02, 110.0, 120.0, -15.0, true, false, false, false, 2, true)
    else
        -- Arrêter l'animation et supprimer l'objet radio s'il existe
        StopAnimTask(cache.ped, "cellphone@", "cellphone_text_read_base", 1.0)
        ClearPedTasks(cache.ped)
        if self.radioProp and DoesEntityExist(self.radioProp) then
            DeleteObject(self.radioProp)
            self.radioProp = nil
        end
    end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant