03.11.2010, 19:33
I making INC file someting like "new pickup" problem is in this code
And i have one timer in INC
And the problem is, when i create ring >
evrything works fine BUT if i create more then one ring then just one ring changeing them position from timer, that's because of object id mess up :-/ so can someone help me how to fix it
pawn Код:
stock CreateRing(Float:X,Float:Y,Float:Z)
{
obj1 = CreateObject(3438,X,Y,Z+6,0.00000000,90.00000000,300);
obj2 = CreateObject(3438,X,Y,Z-1,0.00000000,90.00000000,300);
return true;
}
pawn Код:
forward MovingTimer();
public MovingTimer()
{
new
Float:X,
Float:Y,
Float:Z;
foreach(Player, i)
{
if(Moving[i] == 0)
{
GetObjectPos(obj1 , X, Y, Z);
MoveObject(obj1 , X, Y, Z-7,5);
GetObjectPos(obj2, X, Y, Z);
MoveObject(obj2, X, Y, Z+7,5);
Moving[i] = 1;
}
else if(Moving[i] == 1)
{
GetObjectPos(obj1 , X, Y, Z);
MoveObject(obj1 , X, Y, Z+7,5);
GetObjectPos(obj2, X, Y, Z);
MoveObject(obj2, X, Y, Z-7,5);
Moving[i] = 0;
}
}
return true;
}
pawn Код:
CreateRing(2121.5203,1923.7277,10.6719);