SA-MP Forums Archive
/donut - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /donut (/showthread.php?tid=251131)



/donut - captainjohn - 25.04.2011

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.


Re: /donut - Markx - 25.04.2011

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"));
}



Re: /donut - captainjohn - 25.04.2011

Thank you.