SetTimer Error :S
#1

Код:
public heal(playerid) // line 614
{
    new Float:health;
    GetPlayerHealth(playerid,health);
    if (health < 1.0)
    {
        SetPlayerHealth(playerid, 2.0);
        SetTimer("heal", 4000, false); // Set a timer of 1000 miliseconds (1 second)
    }
    return 1;
}
Error
Код:
D:\Don't touCh\Sampi\roleplay windows\filterscripts\spitali.pwn(614) : error 025: function heading differs from prototype
Please Help me :S
Reply
#2

You set 2 timers; one with SetTimer and the other one with SetTimerEx.

You cannot have it like that:

pawn Код:
forward heal();
public heal()
And
pawn Код:
forward heal(playerid);
public heal(playerid)
at the same time.

Rename one of them to something else.

By the way, just to inform you that using

pawn Код:
forward heal(playerid);
public heal(playerid)
will need to be:
pawn Код:
SetTimerEx("heal", interval_here, false_OR_true_here, "i", playerid);
// in order to pass the playerid to that public.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)