SA-MP Forums Archive
Water - 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: Water (/showthread.php?tid=388200)



Water - Blackazur - 27.10.2012

How can i make that when somebody is in the water, he die automatic?


Re: Water - Catalyst- - 27.10.2012

edit - What thefatshizms said ^^


Re: Water - thefatshizms - 27.10.2012

Or you could just do this:

pawn Код:
stock IsPlayerInWater(playerid)
{
        new anim = GetPlayerAnimationIndex(playerid);
        if (((anim >=  1538) && (anim <= 1542)) || (anim == 1544) || (anim == 1250) || (anim == 1062)) return 1;
        return 0;
}

public OnPlayerUpdate(playerid)
{
       if(IsPlayerInWater(playerid)
       {
            SetPlayerHealth(playerid, 0);
       }
       return 1;
}



AW: Water - Blackazur - 27.10.2012

then i have 1 error: error 001: expected token: ")", but found "{"

Quote:

if(IsPlayerInWater(playerid)
{

on the {


Re: Water - thefatshizms - 27.10.2012

Sorry that's my fault use this:
if(IsPlayerInWater(playerid))
{


AW: Water - Blackazur - 27.10.2012

Works, thx. ^^