U3Games

Games | Desarrollo & Soporte => SAMP | Desarrollo de Servidores => San Andreas Multi Player => SAMP | Implementaciones => Mensaje iniciado por: Swarlog en May 12, 2025, 03:19 PM

Título: Sistema de Sangrado
Publicado por: Swarlog en May 12, 2025, 03:19 PM
● Información Adicional:

Básicamente lo que hace es que al utilizar dicho valor, la vida del jugador va decreciendo hasta llegar a cero y mtarlo.

● Código:

public OnGameModeInit()
{
    SetTimer("LifeCheck", 30000, true);
    return 1;
}

public LifeCheck()
{
    for(new i; i < GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            new Float:health;
            GetPlayerHealth(i, health);
            SetPlayerHealth(i, health-1);
        }
    }
    return 1;