Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local animacionesCaer = {
- [1] = {"ped", "ko_shot_stom", -1, true, true, false, true},
- [2] = {"crack", "ko_shot_face"},
- [3] = {"crack", "ko_spin_r"},
- [4] = {"crack", "ko_skid_front"},
- }
- function gestionarAnimacion(source, group, animacion, time, loop, updatePosition, interruptable, freezeLastFrame)
- local varDataSource = exports["MR1_Inicio"]:getValueOne(source)
- if varDataSource.Estado["Taseado"] == true then
- return
- end
- iprint(source, group, animacion, time, loop, updatePosition, interruptable, freezeLastFrame)
- time = time or -1 -- Duración de la animación (por defecto infinito)
- if loop == nil then loop = true end -- Repetir animación (por defecto true)
- updatePosition = updatePosition or false -- Mover el jugador con la animación (por defecto false)
- interruptable = interruptable or false -- Hacer la animación no interrumpible (por defecto false)
- if freezeLastFrame == nil then freezeLastFrame = true end -- Congelar el último frame (por defecto true)
- if not animacionesJugadores[source] then
- -- Iniciar la animación
- animacionesJugadores[source] = {group, animacion}
- iprint(source, group, animacion, time, loop, updatePosition, interruptable, freezeLastFrame)
- setPedAnimation(source, group, animacion, time, loop, updatePosition, interruptable, freezeLastFrame)
- triggerClientEvent(source, "syncAnimacion", source, group, animacion)
- else
- -- Detener la animación
- animacionesJugadores[source] = nil
- setPedAnimation(source, false)
- triggerClientEvent(source, "syncAnimacion", source, false)
- end
- end
- function Caer(source, command, id)
- local idAnim = tonumber(id)
- local cantidadAnimaciones = #animacionesCaer
- if idAnim and animacionesCaer[idAnim] then
- local group, animacion, time, loop, updatePosition, interruptable, freezeLastFrame = unpack(animacionesCaer[idAnim])
- gestionarAnimacion(source, group, animacion, time, loop, updatePosition, interruptable, freezeLastFrame)
- else
- gestionarAnimacion(source, nil, nil)
- outputChatBox("#FF0000Uso incorrecto. Usa: /caer [1-"..cantidadAnimaciones.."]", source, 255, 255, 255, true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement