💻
alt:V Athena Docs v3.0.0
  • Info
    • Introduction
    • Patreon & Support
    • Athena Discord
    • FAQ
  • Installation
    • Common Issues
    • Windows
    • Linux (Ubuntu 20.04+)
    • Debugging
    • Updating
  • Info
    • Admin
    • Configuration
    • Console
    • Database
    • Hotkeys
    • Identifier
  • Plugins
    • Load Plugins
    • Create Plugins
    • Mods
    • Clothing
  • Controllers
    • What is a Controller?
    • Blip Controller
    • Interaction Controller
    • Marker Controller
    • Object Controller
    • Ped Controller
    • Text Label Controller
    • World Notification Controller
  • Systems
    • Interiors
    • Inventory & Items
    • Inventory Rules
    • Jobs
    • Time
    • Weather
  • Menus
    • Menu Types
    • Action Menus
    • Input Menu
    • Wheel Menu
  • Player
    • Admin-Commands
    • Animations
    • Attach Objects
    • Credits
    • Currency
    • Commands
    • Error Screen
    • Message
    • Meta
    • Notifications
    • Particle
    • Progress Bar
    • Save
    • Shard
    • Sound
    • Spinners
    • Task Timeline
  • Custom WebViews
    • Introduction
    • Your First Page
    • CSS Framework
  • Misc
    • Custom Sounds
    • Custom Streamers
    • Custom Icons
    • Adding Locale / Translations
    • Adding Vehicle Rules
    • Adding Whitelist
    • Adding Wheel Menus
    • Adding Parking Garages
Powered by GitBook
On this page
  • What Makes a 'Task'
  • Simple Walking to and From Task
  • Preview of the Above Example
Edit on GitHub
  1. Player

Task Timeline

Playing ped natives in a specific order.

Task timelines can be incredibly useful but they are also very limited in functionality. They basically allow you to override a player's inputs and make them do something specific with natives on client-side.

Understanding how they work though is a bit tricky.

What Makes a 'Task'

Tasks are just natives with slightly obscure parameters.

Let's take the native.taskGoToCoordsAnyMeans as an example.

Normal Native

taskGoToCoordAnyMeans(ped: number | alt.Player, x: number, y: number, z: number, speed: number, p5: any, p6: boolean, walkingStyle: number, p8: number);

Task Object

Notice how we do not specify ped in the parameters.

That is inheritely added when we call the task.

Our arguments we are passing just remove the ped entry and we have very similar arguments.

{
    nativeName: 'taskGoToCoordAnyMeans',
    params: [openSpot.pos.x, openSpot.pos.y, openSpot.pos.z, 1, null, false, 786603, 0],
    timeToWaitInMs: 5000,
}

Simple Walking to and From Task

Let's say that when you start a job you want them to walk from Point A to Point B automatically. This can be achieved through a task timeline.

const tasks: Array<Task> = [
    {
        nativeName: 'taskGoToCoordAnyMeans',
        params: [openSpot.pos.x, openSpot.pos.y, openSpot.pos.z, 1, null, false, 786603, 0],
        timeToWaitInMs: 5000,
    },
];

Athena.player.emit.taskTimeline(player, tasks);

openSpot is a pre-defined parameter

Preview of the Above Example

In the above example I never touched my keyboard to perform the walking

PreviousSpinnersNextIntroduction

Last updated 3 years ago