Water Death
#6

I'm not familiar with the player anim indexes but what yo basically do:
pawn Код:
new Timer[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    Timer[playerid] = SetTimerEx("CheckWater",5000,1,"i",playerid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    KillTimer(Timer[playerid]);
    return 1;
}

#define PLAYER_ANIMATION_SWIMMING (12345) // 12345 - here you need to fill in the ID of the swimming animation, I don't know what it is.
forward CheckWater(playerid);
public CheckWater(playerid)
{
    if(GetPlayerAnimationIndex(playerid) == PLAYER_ANIMATION_SWIMMING)
    {
        SetPlayerHealth(playerid,0.0);
    }
    return 1;
}
Enjoy and learn. :P

you can use the code on https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex , then go swim and check what the player animation swimming index is.
Reply


Messages In This Thread
Water Death - by muhib777 - 05.06.2011, 22:55
Re: Water Death - by Gamer_Z - 05.06.2011, 23:11
Re: Water Death - by muhib777 - 05.06.2011, 23:14
Re: Water Death - by Gamer_Z - 05.06.2011, 23:16
Re: Water Death - by muhib777 - 05.06.2011, 23:30
Re: Water Death - by Gamer_Z - 05.06.2011, 23:46
Re: Water Death - by muhib777 - 05.06.2011, 23:56
Re: Water Death - by Gamer_Z - 06.06.2011, 00:01
Re: Water Death - by muhib777 - 06.06.2011, 07:29
Re: Water Death - by muhib777 - 06.06.2011, 15:02

Forum Jump:


Users browsing this thread: 1 Guest(s)