05.06.2012, 16:31
Hey guys, i need help with a timer. Now I have tried, so any help would be much appreciated...
UnderOnPlayerDeath
Under the /makeill command
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
pawn Код:
forward DiseaseTimer(playerid);
pawn Код:
//kill timers
new KillDiseaseTimer[MAX_PLAYERS];
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;
}
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
