Timer only killing for ID 0 on pickup
#1

Heya straight to the point here, my timer doesnt seem to kill unless you are ID 0, can anyone help.

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == cure)
    {
        if(PlayerInfo[playerid][Infected] == 1)
        {
            SendClientMessage(playerid, COLOUR_CYAN, "In a panic, you quickly flip the lid of the vial open and down it's contents, feeling refreshed." );
            KillTimer(KillInfectionTimer[playerid]);
            KillTimer(KillSymptomsTimer[playerid]);
            PlayerInfo[playerid][Carrier] = 0;
            PlayerInfo[playerid][Infected] = 0;
            PlayerInfo[playerid][Bit] = 0;
            SaveUser(playerid);
        }
Reply
#2

Show us the timer.
Reply
#3

pawn Код:
public InfectionTimer(playerid)
{
    {
        new Float: health;
        PlayerInfo[playerid][Infected] = 1;
        GetPlayerHealth(playerid, health);
        SetPlayerHealth(playerid, health - 10);
        SaveUser(playerid);
    }
    return 1;
}
Reply
#4

The SetTimerEx line Please
Reply
#5

pawn Код:
KillInfectionTimer[i] = SetTimerEx( "InfectionTimer", 60000, true, "i", i);
Reply
#6

PHP код:
public InfectionTimer(playerid)
{
        new 
Floathealth;
        
PlayerInfo[playerid][Infected] = 1;
        
GetPlayerHealth(playeridhealth);
        
SetPlayerHealth(playeridhealth 10);
        
SaveUser(playerid);
        return 
1;

dont use loop here

KillInfectionTimer[i] = SetTimerEx( "InfectionTimer", 60000, true, "i", i);
Reply
#7

Sorry i don't follow what you mean :S
Reply
#8

Most likely the i when setting the timer is wrong. Please show the code surrounding this KillInfectionTimer[i] = SetTimerEx( "InfectionTimer", 60000, true, "i", i);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)