/donut
#1

pawn Код:
dcmd_donut(playerid,params[])
{
    #pragma unused params
    SetPVarInt(playerid, "donuthealth", SetTimerEx("donuthealth", 500, true, "i", playerid));
}
forward donuthealth(playerid);

public donuthealth(playerid)
{
    new Flot: health;
    GetPlayerHealth(playerid,health);
    if (health < 100)
    SetPlayerHealth(playerid, health+10);
    return KillTimer(GetPVarInt(playerid, "donuthealth"));
}
Whats wrong with this?
I want the donut to refill the players health by 10 each time.

I get these errors:

Код:
C:\Users\MarioG\Desktop\SASP\gamemodes\SASP.pwn(932) : warning 213: tag mismatch
C:\Users\MarioG\Desktop\SASP\gamemodes\SASP.pwn(933) : warning 213: tag mismatch
C:\Users\MarioG\Desktop\SASP\gamemodes\SASP.pwn(934) : warning 213: tag mismatch
Line 932
pawn Код:
GetPlayerHealth(playerid,health);
Line 933
pawn Код:
if (health < 100)
Line 934
pawn Код:
SetPlayerHealth(playerid, health+10);
Thanks.
Reply
#2

pawn Код:
dcmd_donut(playerid,params[])
{
    #pragma unused params
    SetPVarInt(playerid, "donuthealth", SetTimerEx("donuthealth", 500, true, "i", playerid));
}
forward donuthealth(playerid);

public donuthealth(playerid)
{
    new Float: health;
    GetPlayerHealth(playerid,health);
    if (health < 100)
    SetPlayerHealth(playerid, health+10);
    return KillTimer(GetPVarInt(playerid, "donuthealth"));
}
Reply
#3

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)