samp.directory
← Scripts et bibliothèques

r4sheed/pawn-plus-tasks

Lightweight SA-MP library for scheduling global and player-specific tasks.

Bibliothèque★ 7mis à jour sept. 2025Pas de licencePawnsampctl
Ouvrir sur GitHub

Ce dépôt n’a pas de fichier de licence. Il est public en lecture, mais cela ne donne pas à lui seul le droit de le réutiliser.

Installer avec sampctl

sampctl package install r4sheed/pawn-plus-tasks

Lance ceci dans le dossier de ton projet. sampctl télécharge le paquet et ce dont il dépend.

L’essayer dans le compilateur Pawn →

Ajoute ses fichiers include, avec les bibliothèques dont il dépend, au compilateur Pawn de ton navigateur, prêts à être inclus dans un script.

README.md

pawn-plus-tasks

Installation

Simply install to your project:

sampctl package install r4sheed/pawn-plus-tasks

Include in your code and begin using the library:

#include <pp-tasks>

Usage

Tasks

Use the task macro to define functions that run automatically at a set interval.

#include <pp-tasks>

task TaskName[interval]() 
{
    // This task executes every <interval> milliseconds.
}

[!WARNING] Tasks can only take playerid for ptask. Adding any other parameters will cause compiler errors because the system runs them automatically and cannot handle extra arguments.

Player Tasks

Use the ptask macro to define player-specific tasks. These run at the specified interval for each connected player.

#include <pp-tasks>

ptask PlayerTaskName[interval](playerid)
{
    // This task executes for each connected player every <interval> milliseconds.
}

[!NOTE] Player tasks do not run for NPCs.

Example


#include <pp-tasks>

ptask HealPlayer[5_000](playerid)
{
    new Float:health;
    GetPlayerHealth(playerid, health);

    new Float:bonus = 5.0;
    if ((health + bonus) <= 100.0)
        SetPlayerHealth(playerid, (health + bonus));
}

Thanks to

open-mppawnpawn-packagesa-mp

Cette page est construite à partir de ce que GitHub publie sur le dépôt. samp.directory n’héberge pas le code. Signaler un problème avec cette fiche

r4sheed/pawn-plus-tasks : Bibliothèque SA-MP | samp.directory