Swim and walk
#1

Anyway to check whether a player is in water or swimming?

Anyway to toggle player's running/sprinting ability?
Reply
#2

In a word: no.

You could check if the player is at water level, but since there are lower points on map that isnt water, it would be buggy.

Both those things should be added to comming samp versions.
Reply
#3

You can check if a player is swimming by his animation.

Код:
bool:IsPlayerSwimming(playerid)
{
    if(GetPlayerAnimationIndex(playerid))
    {
        new animlib[32];
        new animname[32];
        GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, sizeof(animlib), animname, sizeof(animname));
        if(strcmp(animlib, "SWIM", true) == 0)
            return true;
    }
    return false;
}
Reply
#4

Nice to know!
Reply
#5

There is an include to detect if player's swimming.

Check : https://sampforum.blast.hk/showthread.php?tid=173944

KillerDVX,
Reply
#6

Quote:
Originally Posted by KillerDVX
Посмотреть сообщение
There is an include to detect if player's swimming.

Check : https://sampforum.blast.hk/showthread.php?tid=173944

KillerDVX,
thanks!
Reply
#7

No problem.

KillerDVX,
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)