IsPlayerInZone doesn't work at all!
#1

pawn Код:
public IsPlayerInZone(playerid, Float:XMin, Float:YMin, Float:XMax, Float:YMax)
{
    new RetValue = 0;
    new Float: PosX, Float: PosY, Float: PosZ;
    GetPlayerPos( playerid, PosX, PosY, PosZ );

    if( PosX >= XMin && PosY >= YMin && PosX < XMax && PosY < YMax )
    {
      RetValue = 1;
    }
    return RetValue;
}
And

pawn Код:
if(IsPlayerInZone(playerid, 2977.858, 817.4513, 2989.536, 467.115)) // Las Venturas
{
I get those coords from Vehicle Plotter and selected whole Las Venturas, whoever if some player is in the middle of Las Venturas, IsPlayerInZone returns 0

Why?

I tried to do the same with San Fierro and Los Santos but they all don't work!
I also tried many other IsPlayerInZone and IsPlayerInArea's but they all never work!
Reply
#2

pawn Код:
if(IsPlayerInZone(playerid, 2989.536, 467.115, 2977.858, 817.4513)) // Las Venturas
Try that.
Reply
#3

Yeah it would seem you got your mins and max's confused. The post above contains a solution which should work
Reply
#4

How do i know what is the right way to do it? because Vehicle Plotter gave me these coordinates.
Reply
#5

What are coordinates for Los Santos?
Reply
#6

That vehicle plotter put them like 10 metres in the wrong direction for me. Didn't work at all.
Reply
#7

Quote:
Originally Posted by Seif_ [adream-rp.com
]
Use my SeifArea to get square zones coordinates. You just need to read the thread's first post to make sure you know how to do it.
Thx Seif for great plug
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)