KILLTIMER
#1

The function of this code is simple, every 5 minutes it DECREASES one of a wanted level, and if you have not tried level, ie, if 0, it simply calls the KillTimer to stop counting, the problem is that if the player LOG iN SERVER wITH 0 of demand and eventually earn him a star the code does not take the stars, it just takes if I relog, it's because I'm putting it into the public SetTimer OnPlayerConnect (playerid).

HOW TO SOLVE THIS? WOULD THE TAKING OF OnPlayerConnect SetTimer (playerid)? IF SO, WHERE SHOULD I WEAR THE SetTimer?

pawn Код:
forward WantedLevelDown(playerid);
public WantedLevelDown(playerid)
{
    if(WantedPoints[playerid] == 0) return KillTimer(GetPVarInt(playerid, "Timer"));
    {
    if((WantedPoints[playerid] - 1) >= 0)
    {
        static wanSTR[100];
        -- WantedPoints[playerid];
        format(wanSTR, sizeof wanSTR, ">> seu level de procurado abaixou para %02i", WantedPoints[playerid]);

        SendClientMessage(playerid, -1, wanSTR);
        SetPlayerWantedLevel(playerid, WantedPoints[playerid]);
        if(WantedPoints[playerid] == 0) return KillTimer(GetPVarInt(playerid, "Timer"));
    }
    return 0x01;
    }
}
Reply


Messages In This Thread
KILLTIMER - by dansr - 06.04.2013, 04:13
Re: KILLTIMER - by JaKe Elite - 06.04.2013, 04:16
Re: KILLTIMER - by dansr - 06.04.2013, 04:23
Re: KILLTIMER - by Pottus - 06.04.2013, 05:01
Re: KILLTIMER - by dansr - 06.04.2013, 05:10
Re: KILLTIMER - by Pottus - 06.04.2013, 05:13
Re: KILLTIMER - by dansr - 06.04.2013, 05:14
Re: KILLTIMER - by Pottus - 06.04.2013, 05:16
Re: KILLTIMER - by dansr - 06.04.2013, 05:19

Forum Jump:


Users browsing this thread: 1 Guest(s)