Is here water.
#1

Hi,

It's possible to know is here a water? for ex, i have X and Y koordinates, and with them i can check is in this area is water? i know Z koordinate if lower than 0, then there is water, but i do something else, and i need to know, with X and Y koordinates. Thank you.
Reply
#2

If you have the cords you can do it with
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Also if you want to check it easier , you can check if the player using swim animation.
Reply
#3

No... I don't talk about player. I have just coordinates and i need to know is it in water zone.
Reply
#4

Ok, then just use this function , also you can set if the player on water zone something happen to him.
pawn Код:
IsPlayerInRageOfPoint
Reply
#5

You mean IsPlayerOnWater? If you do I found this function created by someone, I hope this helps you

pawn Код:
stock IsPlayerInWater(playerid)
{
        new Float:Z;
        GetPlayerPos(playerid,Z,Z,Z);
        if(Z < 0.7) switch(GetPlayerAnimationIndex(playerid)) { case 1543,1538,1539: return 1; }
        if(GetPlayerDistanceFromPoint(playerid,-965,2438,42) <= 700 && Z < 45)return 1;
        new Float:water_places[][] =
        {
                {25.0,  2313.0, -1417.0,        23.0},
                {15.0,  1280.0, -773.0,         1082.0},
                {15.0,  1279.0, -804.0,         86.0},
                {20.0,  1094.0, -674.0,         111.0},
                {26.0,  194.0,  -1232.0,        76.0},
                {25.0,  2583.0, 2385.0,         15.0},
                {25.0,  225.0,  -1187.0,        73.0},
                {50.0,  1973.0, -1198.0,        17.0}
        };
        for(new t=0; t < sizeof water_places; t++)
                if(GetPlayerDistanceFromPoint(playerid,water_places[t][1],water_places[t][2],water_places[t][3]) <= water_places[t][0]) return 1;
        return 0;
}
Reply
#6

I don't talk about specif player that is on water...

I have that coordintes:

Код:
-1575.50,720.000
Here is X and Y coordinates.

And how to check is this coordinates in water?


Reply
#7

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Find the Float:z also..

Example
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 20.0, -1575.50,720.000, z))
---
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, range, Float: x,Float: y, Float: z))
playerid The ID of the player.
Float:range The furthest distance the player can be from the point to be in range.
Float: x The X coordinate of the point to check the range to.
Float: y The Y coordinate of the point to check the range to.
Float: z The Z coordinate of the point to check the range to.
Reply
#8

But i need to make without playerid...
Reply
#9

Why ? , i think the only way to check if the player on that point or not is that function only.
otherwise can you tell us what you want to script clearly ?
Reply
#10

I do fishing system. And i need to know, is that point where is 10.0metres front from him is there a water, and then player can fishing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)