PlayerToPoint Help
#1

pawn Код:
if (PlayerToPoint(5.0,playerid,PoliceDutyPosition[X],PoliceDutyPosition[Y],PoliceDutyPosition[Z]) || PlayerToPoint(5.0,playerid,959.30,1940.24,9.00))
I want someone to be able to go on police duty in two different locations. One is a dynamic location, and the other, I added, is the normal XYZ. It doesn't work. Please fix.
Reply
#2

bump
Reply
#3

bump
Reply
#4

which is in the variable value, you might have forgotten to put Float: prefix

BAD:

Код:
enum Info
{
x,
y,
z
};

new PoliceDutyPosition[Info];
GOOD:

Код:
enum Info
{
Float:x,
Float:y,
Float:z
};

new PoliceDutyPosition[Info];
Reply
#5

Quote:
Originally Posted by © ŦĥЗ ǺĽẽẌṖŎịŚỘń
which is in the variable value, you might have forgotten to put Float: prefix
No, the dynamic part is NOT bugged. The other part is. Scroll over.
Reply
#6

What is the value stored in PoliceDutyPosition?
Reply
#7

There's now a SA:MP native in 0.3 for this, why don't you use it (IsPlayerInRangeOfPoint)?

pawn Код:
if( IsPlayerInRangeOfPoint( playerid, 5.0, PoliceDutyPosition[X], PoliceDutyPosition[Y], PoliceDutyPosition[Z] ) || IsPlayerInRangeOfPoint(playerid, 5.0, 959.30, 1940.24, 9.00) )
{
//do
}
Reply
#8

Quote:
Originally Posted by © ŦĥЗ ǺĽẽẌṖŎịŚỘń
What is the value stored in PoliceDutyPosition?
That is unnecessary. And, again, that is not what's bugged. The bug starts at "||" in the code.

Quote:
Originally Posted by FreddoX [BINMAN
]
There's now a SA:MP native in 0.3 for this, why don't you use it (IsPlayerInRangeOfPoint)?

pawn Код:
if( IsPlayerInRangeOfPoint( playerid, 5.0, PoliceDutyPosition[X], PoliceDutyPosition[Y], PoliceDutyPosition[Z] ) || IsPlayerInRangeOfPoint(playerid, 5.0, 959.30, 1940.24, 9.00) )
{
//do
}
Did you fix the bug?
Reply
#9

Quote:
Originally Posted by NiiRV4N4
Quote:
Originally Posted by © ŦĥЗ ǺĽẽẌṖŎịŚỘń
What is the value stored in PoliceDutyPosition?
That is unnecessary. And, again, that is not what's bugged. The bug starts at "||" in the code.

Quote:
Originally Posted by FreddoX [BINMAN
]
There's now a SA:MP native in 0.3 for this, why don't you use it (IsPlayerInRangeOfPoint)?

pawn Код:
if( IsPlayerInRangeOfPoint( playerid, 5.0, PoliceDutyPosition[X], PoliceDutyPosition[Y], PoliceDutyPosition[Z] ) || IsPlayerInRangeOfPoint(playerid, 5.0, 959.30, 1940.24, 9.00) )
{
//do
}
Did you fix the bug?
Try it and see. If it doesn't work, the coordinates you specified don't work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)