26.02.2011, 19:39
pawn Код:
new Stats = 0;
forward CheckBall();
SetTimer("CheckBall", 1000, 1);
public OnPlayerCommandText(playerid, cmdtext[]) {
if(strcmp(cmd, "/CreateBall", true) == 0)
{
Stats = 1;
new Float:X, Float:Y, Float:Z;
DestroyObject(Ball);
GetXYZInFrontOfPlayer_ROT(playerid, X, Y, Z, 0.5, 0.0, 0);
Ball = CreateObject(OBJECTBALL, X, Y, Z -0.5, 359.0, 93.0, 10.0);
return 1;
}
}
public CheckBall()
{
if(Stats == 1)
{
if(IsObjectInArea(Ball, 2540.7649,-1514.6029, 2500.8064,-1546.1082))
{
SendClientMessageToAll(COLOR_GREEN, "Ball in Area! ");
}
if(!IsObjectInArea(Ball, 2540.7649,-1514.6029, 2500.8064,-1546.1082))
{
SendClientMessageToAll(COLOR_RED, "Ball not in Area! ");
}
}
}
****** you mean this?