17.04.2014, 19:15
Hello people,
I just want to discuss about this here...i am using ondynamicobjectmoved to move an object from point A to B and in return. As you can see it will go on like that forever so i thought to use it as a timer
//somewhere else
you probably think something like WTF! ..WHY !??
i just dont want to use much timers in a gamemode so i was wondering if this could work out...i mean without weird crashes bugs or what so ever.
I just want to discuss about this here...i am using ondynamicobjectmoved to move an object from point A to B and in return. As you can see it will go on like that forever so i thought to use it as a timer
pawn Код:
//in gamemodeinit
MoveDynamicObject(MoveIt,2013.3398,-204.6888,0.4186, MoveSpeed);
//-
public OnDynamicObjectMoved(objectid)
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(IsObjectInRangeOfPoint(MoveIt,1.0,2013.3398,-204.6888,0.4186))//water
{
MoveDynamicObject(MoveIt,2073.1604,-346.9006,68.8107,MoveSpeed); //to tree
Somefunction(playerid);
}
if(IsObjectInRangeOfPoint(MoveIt,1.0,2073.1604,-346.9006,68.8107))//tree
{
MoveDynamicObject(MoveIt,2013.3398,-204.6888,0.4186,MoveSpeed);//to water
Somefunction(playerid);
}
}
return 1;
}
pawn Код:
forward Somefunction(playerid);
public Somefunction(playerid)
{
//stuff that you would want in a timer here
return 1;
}
i just dont want to use much timers in a gamemode so i was wondering if this could work out...i mean without weird crashes bugs or what so ever.