25.08.2010, 08:34
Okay so I got this from a gang zone creater:
And I got this:
The problem is, that the ball always respawns, and it always says that the bell went away, even though it never happened..
IsObjectInArea:
So, how to fix?
pawn Код:
GangZoneCreate(2563.775634,539.454345,2645.808349,397.840759);
pawn Код:
public IsInArea()
{
if(IsObjectInArea(Football, 2563.775634,539.454345,2645.808349,397.840759))
{
return 1;
}
else
{
DestroyObject(Football);
Football = CreateObject(1303,2606.47167969,468.07437134,1.00000000,0.00000000,0.00000000,0.00000000);
print("The ball went away!");
//SendClientMessageToAll(COLOR_RED, "== The football went out of the zone and has been respawned!");
}
return 1;
}
IsObjectInArea:
pawn Код:
stock IsObjectInArea(objectid, Float:min_x, Float:min_y, Float:max_x, Float:max_y)
{
new Float:X,Float:Y,Float:Z;
GetObjectPos(objectid, X, Y, Z);
if((X <= max_x && X >= min_x) && (Y <= max_y && Y >= min_y)) return 1;
return 0;
}