Lil of a problem with my timer.
#4

here you go without y_hooks and y_timers

pawn Код:
#include <a_samp>

main () { }

new
   bool:g_Spawned[MAX_PLAYERS] = false
;

public OnPlayerConnect(playerid)
{
    SetTimerEx("RemoveHealthPoint", 1000, true,"i",playerid); //put this where you want your timer
    return 1;
}

forward RemoveHealthPoint(playerid);
public RemoveHealthPoint(playerid)
{
    if(g_Spawned[playerid])
    {
        new
            Float:fHealth
        ;
        GetPlayerHealth(playerid, fHealth);
        SetPlayerHealth(playerid, fHealth-1);
    }
    return 1;
}

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

public OnPlayerSpawn(playerid)
{
    g_Spawned[playerid] = true;
    return 1;
}
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: 2 Guest(s)