Skip to content

Props radio stuck in the hand  #63

@GladesH

Description

@GladesH

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions