07.07.2016, 15:07
Try with MapAndreas plugin:
Directly from my server code Lost Springs Roleplay (ITA)
pawn Код:
stock IsWaterInFrontOfPlayer(playerid, Float: range = 1.0)
{
new Float:fPX, Float:fPY, Float:fPZ,
Float:fVX, Float:fVY, Float:fVZ,
Float:object_x, Float:object_y, Float:object_z;
GetPlayerCameraPos(playerid, fPX, fPY, fPZ);
GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ);
object_x = fPX + floatmul(fVX, range);
object_y = fPY + floatmul(fVY, range);
MapAndreas_FindZ_For2DCoord(object_x, object_y, object_z);
if(object_z <= 0.0) return true;
return false;
}