tag mismatch - Zones
#1

-FIXED-
Reply
#2

BUMB
Reply
#3

Show the lines which results these errors please.
Reply
#4

pawn Код:
stock GetVehicleZone(vehicleid)
{
    new
        Float: X,
        Float: Y,
        Float: Z;
       
    for (new i; i < sizeof (gSAZones); ++i)
    {
        GetVehiclePos(vehicleid, X, Y, Z);
        if (gSAZones[i][SAZONE_AREA][0] < X < gSAZones[i][SAZONE_AREA][3] && gSAZones[i][SAZONE_AREA][1] < Y < gSAZones[i][SAZONE_AREA][4] && gSAZones[i][SAZONE_AREA][2] < Z < gSAZones[i][SAZONE_AREA][5]) return i;
    }
    return -1;
}
Example of usage:
pawn Код:
new
    zoneid = GetVehicleZone(vehicleid);

if (zoneid != -1)
{
    // vehicleid is inside a valid zone..
}
Reply
#5

Let me try
Reply
#6

pawn Код:
{"Whetstone"                   {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
};
Reply
#7

Quote:
Originally Posted by Stefand
Посмотреть сообщение
Let me try
Sure. I tested it before posting it and it printed the correct zone. It'd be good if you also check about the vehicle whether or not is valid.

pawn Код:
native IsValidVehicle(vehicleid);
Add it under #define and in the GetVehicleZone function at the top (before declaration) add:
pawn Код:
if (!IsValidVehicle(vehicleid)) return -1;
If the vehicle does not exist, then there isn't a reason to loop and search for a zone.

Quote:
Originally Posted by SwisherSweet
Посмотреть сообщение
pawn Код:
{"Whetstone"                   {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
};
What?
Reply
#8

Thanks Konstantinos, REP+ for ya
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)