2021-04-19, 02:26 AM
(This post was last modified: 2021-04-19, 02:28 AM by PutuSuhartawan.)
(2021-04-18, 11:17 PM)arber Wrote:PHP Code:#define? ? ? ? FISH_THRESHOLD? ? ? ? ? ? 3.0 #define? ? ? ? WATER_CHECK_RADIUS? ? ? ? 5.0 IsPlayerNearWater(playerid) { ? ? new Float:x, Float:y, Float:z, Float:cx, Float:cy, Float:cz, Float:angle; ? ? GetPlayerPos(playerid, x, y, z); ? ? // Will not work near the dam ? ? if(z > 0.0 && z < FISH_THRESHOLD) ? ? { ? ? ? ? for(new i = 0; i < 4; i) ? ? ? ? { ? ? ? ? ? ? cx = x (WATER_CHECK_RADIUS * floatsin(-angle, degrees)); ? ? ? ? ? ? cy = y (WATER_CHECK_RADIUS * floatcos(-angle, degrees)); ? ? ? ? ? ? angle = 90.0; ? ? ? ? ? ? MapAndreas_FindZ_For2DCoord(cx, cy, cz); ? ? ? ? ? ? // Doesn't work under bridges ? ? ? ? ? ? if(cz == 0.0) return 1; ? ? ? ? } ? ? } ? ? return 0; }
PHP Code:if (IsPlayerNearWater(playerid)) ? ? { ? ? ? ? SendClientMessage(playerid,-1,"You have to near water to start fishing."); ? ? }
Update your include sir, has changed new one to?CA_FindZ_For2DCoord
https://github.com/Pottus/ColAndreas/blo...ndreas.inc
