05.06.2011, 23:46
I'm not familiar with the player anim indexes but what yo basically do:
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.
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;
}
you can use the code on https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex , then go swim and check what the player animation swimming index is.