Auto-translated
Tell me what the task is. I won't be able to explain it in general terms. However, I can tell you about the function that affects the task: SetObjectiveState(); - i.e., to assign a state to the task. In parentheses, you write the name of the task (assigned in the map's property tree) and the state.
Possible states:
OBJECTIVE_ACTIVE - activate the task;
OBJECTIVE_COMPLETED - complete the task successfully;
OBJECTIVE_FAILED - complete the task negatively.
P.S.: If you want something to happen when the task is completed, write that too. Be sure to write the completion condition for the task.