Squared area (if(IsPlayerInRangeOfPoint) problem
#1

Hi!


When I finally figured out a problem: Didn't got right with coordinates (for gang zones)

I used that for make squared areas... But now finally when I figured out the problem

I get error message when I try to compile it..

If it's even possible to put a squared area to if(IsPlayerInRangeOfPoint or?.

I mean with https://sampwiki.blast.hk/wiki/GangZoneCreate


Error message:


Код:
D:\Davids\Scripting\Farming project\Farming.pwn(95) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
1 Warning.

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, -409.0492, -1747.6949, -432.0255, -1767.7533))
Thanks a lot!..
Reply
#2

Quote:
Originally Posted by davve95
Посмотреть сообщение
Hi!


When I finally figured out a problem: Didn't got right with coordinates (for gang zones)

I used that for make squared areas... But now finally when I figured out the problem

I get error message when I try to compile it..

If it's even possible to put a squared area to if(IsPlayerInRangeOfPoint or?.

I mean with https://sampwiki.blast.hk/wiki/GangZoneCreate


Error message:


Код:
D:\Davids\Scripting\Farming project\Farming.pwn(95) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
1 Warning.

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, -409.0492, -1747.6949, -432.0255, -1767.7533))
Thanks a lot!..
This wrong :
Quote:

if(IsPlayerInRangeOfPoint(playerid, 7.0, -409.0492, -1747.6949, -432.0255, -1767.7533))

Here you go : CLICK ME

I need it will helped
Reply
#3

Quote:

if(IsPlayerInRangeOfPoint(playerid, 7.0, -409.0492, -1747.6949, -432.0255, -1767.7533))

So :
7.0 = range
-409.0492 = x
-1747.6949 = y
-432.0255 = z

what's -1767.7533 ?

just remove it

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#4

IsPlayerInRangeOfPoint does not really check for squared areas... It was made to checks for spheres (Notice the range parameter).
But you can easily create a function like:
pawn Код:
stock IsPlayerInSquaredArea(playerid, Float:minx, Float:miny, Float:maxx, Float:maxy)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(minx <= x <= maxx && miny <= y <= maxy) return true;
    else return false;
}
Usage:
pawn Код:
if(IsPlayerInSquaredArea(playerid, 123.123, 234.234, 123.123, 234.234)
SendClientMessage(playerid, -1, "You are inside the squared area");
Or you can use Incognito's streamer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)