Sign in to follow this  
DampflokTV

Ampeln ordentlich Synchronisiert

Recommended Posts

mp.world.trafficLights.locked = true;
mp.world.trafficLights.state = 0;
setLights();

function setLights()
{
    mp.world.trafficLights.state = 39;
    setTimeout(function(){
        mp.world.trafficLights.state = 88;
        setTimeout(function(){
            mp.world.trafficLights.state = 49;
            setTimeout(function(){
                mp.world.trafficLights.state = 88;
                setTimeout(function(){
                    mp.world.trafficLights.state = 39;
                    setTimeout(function(){
                        mp.world.trafficLights.state = 0;
                        setTimeout(function(){
                            setLights();
                        }, 25000); // Grünphase West -> Ost
                    }, 2000);  // Grün werden West -> Ost
                }, 4000); // Gelbphase Nord -> Süd
            }, 15000); // Grünphase Nord -> Süd
        }, 2000); // Grün werden Nord -> Süd
    }, 4000); // Gelbphase West -> Ost
}

Diese Serverseitige Funktion wird beim Serverstart ausgeführt und startet sich danach immer wieder selbst.

Die Zeiten (4000, 2000, 15000 und 25000) könnt ihr nach belieben anpassen.

  • Like 4

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.