SA-MP Forums Archive
Not working - IsPlayerInRangePoint - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Not working - IsPlayerInRangePoint (/showthread.php?tid=647356)



Not working - IsPlayerInRangePoint - DavidGravelli - 04.01.2018

So guys i made a /fishing command.
but how i can make in 2 rangepoints ? beacuse this code is not working
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 3, FishingAreaPos[0], FishingAreaPos[1], FishingAreaPos[2] || FishingAreaPos2[0], FishingAreaPos2[1], FishingAreaPos2[2]))
        return SCM(playerid, COLOR_WHITE, " {777777}You are not near fishing area.");



Re: Not working - IsPlayerInRangePoint - Logic_ - 04.01.2018

Instead of this, make it that players can fish whenever they are near water :P You're using InPlayerInRangeOfPoint in wrong way here dude:

PHP код:
!IsPlayerInRangeOfPoint(playerid3FishingAreaPos[0], FishingAreaPos[1], FishingAreaPos[2] || FishingAreaPos2[0], FishingAreaPos2[1], FishingAreaPos2[2]) 
should be two different IsPlayerInRangeOfPoint statements!

PHP код:
!IsPlayerInRangeOfPoint(playerid3.0FishingAreaPos[0], FishingAreaPos[1], FishingAreaPos[2])
!
IsPlayerInRangeOfPoint(playerid3.0FishingAreaPos2[0], FishingAreaPos2[1], FishingAreaPos2[2]) 
And please for the sake of optimization, don't type integer in place of floats, you just need to put a .0 after your number!!


Re: Not working - IsPlayerInRangePoint - Ritzy2K - 04.01.2018

But if you plan on having more fishing points in the future I suggest making an array and then looping through it instead of having lots of functions.


Re: Not working - IsPlayerInRangePoint - DavidGravelli - 04.01.2018

not working also i tried this

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 3, FishingAreaPos[0], FishingAreaPos[1], FishingAreaPos[2]) ||
    IsPlayerInRangeOfPoint(playerid, 3, 2121.92, -75.6603, 1.3575))
        return SendClientMessage(playerid, COLRED, "[Error] {AAAAAA}You must be near the fishing area.");



Re: Not working - IsPlayerInRangePoint - DavidGravelli - 04.01.2018

Fixed.
forget to put !