SA-MP Forums Archive
Swim and walk - 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: Swim and walk (/showthread.php?tid=578791)



Swim and walk - Bani Raheja - 22.06.2015

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

Anyway to toggle player's running/sprinting ability?


Re: Swim and walk - Hessu - 22.06.2015

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.


Re: Swim and walk - Larceny - 22.06.2015

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;
}



Re: Swim and walk - Hessu - 22.06.2015

Nice to know!


Re : Swim and walk - KillerDVX - 22.06.2015

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

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

KillerDVX,



Re: Re : Swim and walk - Bani Raheja - 22.06.2015

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!


Re : Swim and walk - KillerDVX - 22.06.2015

No problem.

KillerDVX,