Is object in water.
#1

Hi,

It's possible to check is object in water?
Reply
#2

no you can't but you can create zones where is water and check if object is in that zone
Reply
#3

Or just check if the Z coordinate is negative.
E.g:
pawn Код:
CMD:check(playerid, params[])
{
     new Float:x, Float:y, Float:z, maxobjects, string[256], count = 0;
     maxobjects = CreateObject(1234, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0);
     DestroyObject(maxobjects);
     for(new i = 0; i < maxobjects-1; i++)
     {
          GetObjectPos(i, x, y, z);
          if(z < 0.0) count++;
     }
     format(string, sizeof(string), "Underwater Objects: %d.", count);
     SendClientMessage(playerid, -1, string);
     return 1;
}
Reply
#4

Where i can find zones where is water? because i have that system player can throw object, and i want to do when object reach the point, then check is object in water, but not using Z, because Z coordinate will be always the same. I want to do, object can be very high don't care, but if water exist when you look down.
Reply
#5

Quote:
Originally Posted by audriuxxx
Посмотреть сообщение
Where i can find zones where is water? because i have that system player can throw object, and i want to do when object reach the point, then check is object in water, but not using Z, because Z coordinate will be always the same. I want to do, object can be very high don't care, but if water exist when you look down.
What? It makes no sense.

What people are saying above is you can make transparent zones wherever water is and then check if player is in that zone which means he is in water zone according to your wishes. Either way, use Z and it's not always the same.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)