IsObjectInArea...
#1

Hi!
can you help me? ... those who know ...
so:
To OnGameModeInit i put:
Код:
SetTimer("BallOut",100,1);
football=CreateObject(1598,1520.948,-1133.519,135.133,0.0,0.0,0.0);
and I created
Код:
forward BallOut();
public BallOut()
{
if(!IsObjectInArea(football,1562.119, 1501.274, -1109.439, -1156.812))
{
DestroyObject(football);
football=CreateObject(1598,1520.948,-1133.519,135.133,0.0,0.0,0.0);
}
return 1;
}
below i put
Код:
stock IsObjectInArea(objectid, Float:minX, Float:maxX, Float:minY, Float:maxY)
{
	new Float:x,Float:y,Float:z;
	GetObjectPos(objectid, x,y,z);
	if (x > minX && x < maxX && y > minY && y < maxY) return true;
	return false;
}
...Then compile hoping that if that object Will exceed that Area Will put back in the middle
but that object
but the object is always the same place and can not move it ... I try to move from place to other place but object don't move!

You tell me what's wrong and I fix the above?

Thank you very much
Reply
#2

I think you're putting in your area coordinates in wrong. That would make it just keep resetting the ball. Try this check instead.

pawn Код:
if(!IsObjectInArea(football,1501.274,1562.119, -1156.812,-1109.439))
Reply
#3

I do not think...I am very sure the area coordinates are correct...
any help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)