SA-MP Forums Archive
[HELP]Player In 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: [HELP]Player In Water ? (/showthread.php?tid=353397)



[HELP]Player In Water ? - Saw® - 23.06.2012

Hi , all in the Subject , how to check if the player is in the water ?

I don't need includes doing that , if it is possible with SA-MP Package Only , i'm glad to know how to done it , else , you can give me the include ..

Thanks !!


Re: [HELP]Player In Water ? - vyper - 23.06.2012

You can check his animation


Re: [HELP]Player In Water ? - Saw® - 23.06.2012

hmm.. you mean the animation once player jump in the water? do you know its name please?


Re: [HELP]Player In Water ? - MP2 - 23.06.2012

pawn Код:
stock IsPlayerInWater(playerid)
{
    new lib[16], anim[32];
    GetAnimationName(GetPlayerAnimationIndex(playerid), lib, sizeof(lib), anim, sizeof(anim));
    if(!strcmp(lib, "SWIM", true) && !isnull(lib)) return 1;
    return 0;
}
Surprisingly simple. Get isnull in y_utils (part of YSI): https://sampforum.blast.hk/showthread.php?pid=1696956#pid1696956