how to get inpoly...

Started by Spice, Aug 02, 2015, 04:08 PM

Previous topic - Next topic

Spice

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.....

Thijn


MacTavish


Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Spice

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

Thijn

The image Gudio has in the post linked by Kusanagi explains that perfectly.
Just take the corners' X and Y coordinates, like so:


The InPoly would look like InPoly(player.Pos.x, player.Pos.y, x1, y2, x2, y2, x3, y3, x4, y4)

Spice

Thankx man it realy healped me a lot......

Spice

#6
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;
}



Thijn

What error do you get? The InPoly worked fine for me with your coordinates.

Spice

it didnt disable my weps in cuban cafe
while when i use co-ordinates of bank those work perfectly.....