• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [SOLVED] How users can fishing anywhere as long as there is water everywhere.
#8
(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
  Reply


Messages In This Thread
RE: Help! How The way users can fishing anywhere as long as there is water ? - by PutuSuhartawan - 2021-04-19, 02:26 AM