samp.directory
← Scripts e bibliotecas

r4sheed/pawn-plus-tasks

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

Biblioteca★ 7atualizado set. de 2025Sem licençaPawnsampctl
Abrir no GitHub

Este repositório não tem arquivo de licença. Ele é público para leitura, mas isso sozinho não dá permissão para reutilizar.

Instalar com o sampctl

sampctl package install r4sheed/pawn-plus-tasks

Execute na pasta do seu projeto. O sampctl baixa o pacote e as dependências dele.

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

Esta página é montada com o que o GitHub publica sobre o repositório. O samp.directory não hospeda o código. Avisar de um problema com esta página

r4sheed/pawn-plus-tasks: Biblioteca de SA-MP | samp.directory