Lil of a problem with my timer.
#2

This could be used as an include if you wanted to. If not, take the code from the hook statements and put it into the correct callbacks.

pawn Код:
#include <a_samp>
#include <YSI\y_timers>
#include <YSI\y_hooks>

new
   g_Spawned[MAX_PLAYERS] = false
;

ptask removeHealthPoint[1000](playerid)
{
    if(g_Spawned[playerid])
    {
        new
            Float:fHealth
        ;
       
        GetPlayerHealth(playerid, fHealth);
        SetPlayerHealth(playerid, fHealth-1);
    }
    return 1;
}

hook OnPlayerDeath(playerid, reason)
{
    g_Spawned[playerid] = false;
    return 1;
}

hook OnPlayerSpawn(playerid)
{
    g_Spawned[playerid] = true;
    return 1;
}
You'll need y_timers for this to work.
Reply


Messages In This Thread
Lil of a problem with my timer. - by JamesS - 23.03.2013, 15:47
Re: Lil of a problem with my timer. - by Scenario - 23.03.2013, 15:51
Re: Lil of a problem with my timer. - by JamesS - 23.03.2013, 15:55
Re: Lil of a problem with my timer. - by Patrick - 23.03.2013, 16:02
Re: Lil of a problem with my timer. - by Scenario - 23.03.2013, 16:17
Re: Lil of a problem with my timer. - by JamesS - 23.03.2013, 16:20
Re: Lil of a problem with my timer. - by Scenario - 23.03.2013, 16:24
Re: Lil of a problem with my timer. - by JamesS - 23.03.2013, 18:56

Forum Jump:


Users browsing this thread: 3 Guest(s)