Funkcje


Animation:RequestDict

Odpowiada za wygodne ładowanie biblioteki animacji.

Syntax
--- animDict: string
local dict = Animation:RequestDict(animDict)
--- dict: AnimDict
Example
local dict = Animation:RequestDict('move_m@drunk@verydrunk_idles@')
Animation:PlayAnim(playerPed, {
        dictionary = dict.name,
        name = 'fidget_03',
        flag = 51,
})

dict.NoLongerNeeded()
Types
AnimDict = {
    name: string,
    NoLongerNeeded(): function
}

Animation:RequestAnimSet

Rozpoczyna ładowanie określonego zestawu animacji. Zestaw animacji zapewnia animacje ruchu dla peda.

Syntax
--- animDict: string
local dict = Animation:RequestAnimSet(animDict)
--- dict: AnimDict
Example
local animClipSet = Animation:RequestAnimSet(animDictName)

ClearFacialClipsetOverride(playerPed)
SetFacialClipsetOverride(playerPed, animName)
PlayFacialAnim(playerPed, animName, animDictName)

animClipSet.NoLongerNeeded()
Types
AnimDict = {
    name: string,
    NoLongerNeeded(): function
}

Animation:RequestClipSet

Odpowiada za wygodne ładowanie Clip Setu.

Syntax
--- animDict: string
local dict = Animation:RequestClipSet(animDict)
--- dict: AnimDict
Example
local dict = Animation:RequestClipSet(clipSet)

dict.NoLongerNeeded()
Types
AnimDict = {
    name: string,
    NoLongerNeeded(): function
}

Animation:PlayAnim

Odtwarza animację dla entity.

Syntax
--- entity: number
--- anim: AnimTaskData
local animTask = Animation:PlayAnim(entity, anim)
--- animTask: AnimTask
Example
local dict = Animation:RequestDict('move_m@drunk@verydrunk_idles@')
local animTask = Animation:PlayAnim(playerPed, {
        dictionary = dict.name,
        name = 'fidget_03',
        blendInSpeed = 4.0,
        blendOutSpeed = 8.0,
        flag = 51,
})

animTask.onEnd:next(function()
    dict.NoLongerNeeded()
end)
Types
AnimTaskData = {
    dictionary: string,
    name: string,
    blendInSpeed?: number<float>,
    blendOutSpeed?: number<float>,
    duration?: number,
    flag?: number,
    playbackRate?: number,
    lockX?: boolean,
    lockY?: boolean,
    lockZ?: boolean,
}

AnimTask = {
    Stop(),
    onEnd: promise
}

Animation:PlayAnimAdvanced

Odtwarza zaawansowaną animację dla entity.

Syntax
--- entity: number
--- anim: AnimAdvancedTaskData
local animTask = Animation:PlayAnimAdvanced(entity, anim)
--- animTask: AnimTask
Example
local dict = Animation:RequestDict('move_m@drunk@verydrunk_idles@')
local animTask = Animation:PlayAnimAdvanced(playerPed, {
        dictionary = dict.name,
        name = 'fidget_03',
        position = GetOffsetFromEntityInWorldCoords(ped, 2.0, 5.0, 0.0),
        rotation = GetEntityRotation(ped) + vec3(0.0, 0.0, 90.0),
        blendInSpeed = 4.0,
        blendOutSpeed = 8.0,
        flag = 41,
})

animTask.onEnd:next(function()
    dict.NoLongerNeeded()
end)
Types
AnimAdvancedTaskData = {
    dictionary: string,
    name: string,
    position: vector3,
    rotation: vector3,
    blendInSpeed?: number<float>,
    blendOutSpeed?: number<float>,
    duration?: number,
    flag?: number,
    playbackRate?: number,
    lockX?: boolean,
    lockY?: boolean,
    lockZ?: boolean,
}

AnimTask = {
    Stop(),
    onEnd: promise
}

Animation:PreparePlayerToAnimation

Wymusza na graczu ustawienie się w podanej pozycji.

Syntax
--- coords: vector4
--- breakDistance: float
--- canCancel?: boolean
local taskAchievePosition = Animation:PreparePlayerToAnimation(coords, breakDistance, canCancel)
--- taskAchievePosition: promise
Example
local taskAchievePosition = Animation:PreparePlayerToAnimation(vec4(position, heading), 1.0, true)
taskAchievePosition:next(function()
    -- Segment wywoływany kiedy uda się osiągnąć podną pozycje
end, function()
    -- Segment wywoływany kiedy nie uda się osiągnąć podanej pozycji
end)

Animation:SetMovementClipset

Odpowiada za ustawianie stylu chodzenia gracza.

Syntax
--- entity: number
--- moveAnimSet: string
--- transitionSpeed?: float
--- moveStrafeAnimSet?: string
local retval = Animation:SetMovementClipset(entity, moveAnimSet, transitionSpeed, moveStrafeAnimSet)
--- retval: ClipsetTask
Example
local animTask = Animation:SetMovementClipset(playerPed, 'move_m@drunk@moderatedrunk')

animTask.Stop()
Types
ClipsetTask = {
    Stop: function()
}

Animation:SetWeaponMovementClipset

Odpowiada za ustawianie stylu chodzenia podczas posiadania broni.

Syntax
--- entity: number
--- moveAnimSet: string
local retval = Animation:SetWeaponMovementClipset(entity, moveAnimSet)
--- retval: ClipsetTask
Example
local animTask = Animation:SetWeaponMovementClipset(entity, moveAnimSet)

animTask.Stop()
Types
ClipsetTask = {
    Stop: function()
}