Would it hurt if i do this ?
#1

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
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;
}
//somewhere else
pawn Код:
forward Somefunction(playerid);
public Somefunction(playerid)
{
     //stuff that you would want in a timer here
     return 1;
}
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.
Reply
#2

Timers are good, the more timers, the faster your script runs. It prevents trying to do too much in one function, which causes a lot of lag.
Reply
#3

what ? no i always learned too much timers cause lag
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)