SA-MP Forums Archive
Affected Zones help - 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)
+--- Thread: Affected Zones help (/showthread.php?tid=343324)



Affected Zones help - Benzke - 17.05.2012

Hello guys, I'm a bit troubled right now as I wanted to know that what's the name of the Fs ( or if its include ) in which if player enters a location then his health starts dropping ( radiation ).

Please find it or tell me how to do it. ( Couldn't find it in search )

Thanks,
Benzke.


Re: Affected Zones help - Flake. - 17.05.2012

you could make this yourself easily just use
pawn Код:
isplayerinrangeofpoint



Re: Affected Zones help - Kitten - 17.05.2012

pawn Код:
new LoseHP[MAX_PLAYERS];

forward NegativeDown(playerid);

public OnPlayerUpdate(playerid) // not recommended but just for the test.
{
    if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z))
    {
        LoseHP[playerid] = SetTimerEx("NegativeDown",1000,1,"i",playerid);
    }
    return 1;
}

public NegativeDown(playerid)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    SetPlayerHealth(playerid, health - 1.5); // Getting the players health and dropping it down by 1.5 hp (float)
    return 1;
}

// Remember to use KillTimer(LoseHP[playerid]); Somewhere to stop losing health