• 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(playeridxyz);



? ? 
// Will not work near the dam

? ? if(0.0 && FISH_THRESHOLD)

? ? {

? ? ? ? for(new 
04i)

? ? ? ? {

? ? ? ? ? ? 
cx x  (WATER_CHECK_RADIUS floatsin(-angledegrees));

? ? ? ? ? ? 
cy y  (WATER_CHECK_RADIUS floatcos(-angledegrees));

? ? ? ? ? ? 
angle 90.0;



? ? ? ? ? ? 
MapAndreas_FindZ_For2DCoord(cxcycz);



? ? ? ? ? ? 
// 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

Forum Jump: