SA-MP Forums Archive
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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Player in water. (/showthread.php?tid=255950)



Player in water. - Admigo - 18.05.2011

Heey guys,
I want to make a fishing system but how can i know if the players is in water.
because i want to make that you can fish if you are in a boat and when you on land with boat that it says you need to be in the water to fish?
Thanks Admigo


Re: Player in water. - WackoX - 18.05.2011

You can check if the player has the SWIM animation.
Don't have the code here though, you can search it.


Re: Player in water. - Babul - 18.05.2011

Code:
new Float:XPos,Float:YPos,Float:ZPos;
GetVehiclePos(GetPlayerVehicleID(playerid),XPos,YPos,ZPos);
if(ZPos>-1 && Zpos<1)
{
then the vehicle is at water level...
if(ZPos>-1 && Zpos<1) works when the sea is calm, so idk if it works all time (erm.. at each weather)...