🈁Create Task

The basics of how to create a new task.


  1. Create

    In this example, I'm creating a client event to later send the information of the new task.

RegisterNetEvent('--:client:CreateTask')
AddEventHandler('--:client:CreateTask', function()
    local TaskTitle = 'Task Title'
    local taskDescription = 'Task Description'
    local taskIcon = 'fas fa-check'
    local taskStatusComplete = false
TriggerServerEvent('--:server:AddGroupTask', GroupID, TaskTitle, taskDescription, taskIcon, taskStatusComplete)
end)
  1. Show

    Simple, this is how we display the task (remember to organize it well).

TriggerServerEvent('--:server:ShowTaskGroup', GroupID) 
  1. Change Status

    This way, we change the status of the task to completed or not.

TriggerServerEvent('--:server:UpdateTaskStatus', GroupID, TaskTitle, true)

true = completed

false = not completed

When the task is completed, it is automatically removed from the .json file and taken off the screen.

Last updated