03.03.2014, 06:00
(
Последний раз редактировалось Threshold; 03.03.2014 в 09:54.
Причина: Small edit to add ternary operators, in order to shorten code.
)
pawn Код:
stock IsObjectInArea(objectid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float: X, Float: Y, Float: Z;
GetObjectPos(objectid, X, Y, Z);
new Float:valmaxx, Float:valminx = (minx > maxx) ? (maxx, valmaxx = minx) : (minx, valmaxx = maxx);
new Float:valmaxy, Float:valminy = (miny > maxy) ? (maxy, valmaxy = miny) : (miny, valmaxy = maxy);
//Small debug, just in case they happen to enter the wrong value.
if(X >= valminx && X <= valmaxx && Y >= valminy && Y <= valmaxy) return 1;
return 0;
}