checking position
#1

what is the best way to check for IsPlayerInRangeOfPoint if you have many coordinates?

I tried with

Код:
new Float:Tests[0][2] = //x,y,z,World
{
	{-540.75262, -122.25552, 71.17383,0},
	{-521.55115, -130.04494, 71.17383,1},
}
And then using

Код:
if(IsPlayerInRangeOfPoint(playerid,2.0,Tests[0][0],Tests[0][1],Tests[0][2]))
but it says tag missmatch. the 4th one is for this
Код:
if(IsPlayerInRangeOfPoint(playerid,2.0,Tests[0][0],Tests[0][1],Tests[0][2]) && GetPlayerVirtualWorld(Tests[0][3]))
but me gets
Код:
warning 213: tag mismatch
Reply
#2

use 0.0/1.0 in the array for virtual world and then do floatround(Texts[0][3])
Reply
#3

can edit my code and show me please, i am bad at pawno
Reply
#4

First:
Код:
new Float:Tests[0][2] = //x,y,z,World
{
	{-540.75262, -122.25552, 71.17383,0},
	{-521.55115, -130.04494, 71.17383,1},
}
No good, your first dimension is "2" and second is the amount of data inside those curly braces, which is clearly 4, therefore the second dimension is "4".
For the tag mismatch part:
Код:
if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z) && GetPlayerVirtualWorld(Tests[0][3]))
Always check the wiki for documentation, there you are missing the "playerid" parameter! Also, you must make a separate array if you want to check for virtual worlds, or use floatround if you wish to use it like that!
Reply
#5

ah shit u right i fcked up
Reply
#6

ty sir
Reply
#7

GetPlayerVirtualWorld(playerid)== Tests[0][3]

is what you probably want.. if your going to use one array, then u need floatround
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)