31.07.2019, 16:33
How to check if X, Y, Z in water?
if(Z < 0.0) return SendClientMessage(playerid, -1, "You are in water.");
stock IsPlayerInWater(playerid)
{
if(IsPlayerInAnyVehicle(playerid)) return 0;
new animlib[32], animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, sizeof(animlib), animname, sizeof(animname));
return (strfind(animname, "swim", true) != -1 || strfind(animname, "water", true) != -1) ? 1 : 0;
}
new Float:x, Float:y, Float:z;
RandomPosInArea(Float: minx, Float: miny, Float: maxx, Float: maxy, x, y);
MapAndreas_FindZ_For2DCoord(x, y, z);
MakeArmourPickup(x, y, z);