i want to get location of a specific place like cuban cafe xyz to use in inpoly function can some one tell me how can i get these xyz point so that a specific place is covered in it.....
print( player.Pos );
It has been solved many times
The best example to learn inpoly it helped me alot (http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=405.msg1293#msg1293)
nah we need some poses that should cover an area like if i want to cover cuban cafe then on which positions i have to get player pos so that cuban cafe covered in that poses.....lets take an example of square it has four sides if i want to cover that square then on which positions i have to get playe.Pos and use in inpoly
The image Gudio has in the post linked by Kusanagi explains that perfectly.
Just take the corners' X and Y coordinates, like so:
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FxRD6QZf.jpg%3F1&hash=54b156acfd3e046eb684e72c136762b9eb977de7)
The InPoly would look like InPoly(player.Pos.x, player.Pos.y, x1, y2, x2, y2, x3, y3, x4, y4)
Thankx man it realy healped me a lot......
itx not working i have tried here are its x y poses and my code....
function IsPlayerInArea( player, AreaName )
{
local r1;
if ( AreaName == "cuban" )
{
r1 = InPoly( player.Pos.x, player.Pos.y, -1175.0514, -608.6057, -1171.8179, -633.6555, -1161.2239, -632.0810, -1164.5632, -607.0847 );
if ( r1 ) return true;
else return false;
}
}
function onPlayerMove( player, x1, y1, z1, x2, y2, z2 )
{
if (IsPlayerInArea( player, "cuban" ))
{
Announce( "~y~ \x10 \x10 \x10 \x10 \x10 weapons disabled", player, 3 );
player.CanAttack = false;
}
else player.CanAttack = true;
}
What error do you get? The InPoly worked fine for me with your coordinates.
it didnt disable my weps in cuban cafe
while when i use co-ordinates of bank those work perfectly.....