Timer isn't going according to plan.
#1

Hey guys, i need help with a timer. Now I have tried, so any help would be much appreciated...

pawn Код:
forward DiseaseTimer(playerid);
pawn Код:
//kill timers
new KillDiseaseTimer[MAX_PLAYERS];
UnderOnPlayerDeath

pawn Код:
KillTimer(KillDiseaseTimer[playerid]);
pawn Код:
public DiseaseTimer(playerid)
{
    for(new i, Float: health; i != MAX_PLAYERS; ++i) {
        PlayerInfo[playerid][Disease] = 1;
        GetPlayerHealth(i, health);
        SetPlayerHealth(i, health - 10);
        SendClientMessage(playerid, COLOUR_RED, "[WARNING] Health dropping." );
    }
    return 1;
}
Under the /makeill command
pawn Код:
KillDiseaseTimer[playerid] = SetTimerEx( "DiseaseTimer", 1000, true, "i", illperson);

Now the problem is that I do /makeill and instead of deducting health from the person who has got the disease, health is taken away from every player on the server. Also The '[WARNING] Health dropping' message doesn't display. Finally the timer doesn't kill so everyone just keeps dieing in a constant loop. Please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)