Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Possible to make this script only for the host?

Possible to make this script only for the host?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
3 Posts 2 Posters 294 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Dragon115undefined Offline
    Dragon115undefined Offline
    Dragon115
    wrote on last edited by Dragon115
    #1

    I created this script to change the bus speed but on coop its not synced between players. I don't know if it causes any conflicts when other players use it but I want to avoid that causing problems.

    change_bus_speed()
    {
    	print = 0;
    	option = 0;
    	if (getDvar ("ui_zm_mapstartlocation") == "transit")
    	{	
    		flag_wait( "initial_blackscreen_passed" );
    		self iprintln("Press and Hold [{+actionslot 4}] to adjust Bus Speed");
    		wait 0.50;
    	        self iprintln("Speed options increase after power is turned on");
    	}
    	if(level.scr_zm_map_start_location == "transit")
    	{
    	        for(;;)
    		{
    			if ( self actionslotfourbuttonpressed() )
    			{	
    				wait 0.10;
    				print += 1;
    				option += 1;
    				if ( !flag( "power_on" ) )
    				{
    					if(print == 2)
    					{
    						print = 0;
    					}
    					if(option == 2)
    					{
    						option = 0;
    					}
    					if(print == 0)
    					{
    						self iprintln("Bus Speed: Default");
    					}
    				}
    				else
    				{
    				
    				}
    				if(print == 1)
    				{
    					self iprintln("Bus Speed: Slow");
    				}
    				else if(print == 2)
    				{
    					self iprintln("Bus Speed: Fast");
    				}
    				else if(print == 3)
    				{
    					self iprintln("Bus Speed: Super Fast");
    				}
    				else if(print == 4)
    				{
    					self iprintln("Bus Speed: Default");
    					print = 0;
    				}
    				
    			}
    			if(option == 0)
    			{
    				
    			}
    			else if(option == 1)
    			{	
    				foreach(d in level.the_bus.destinations)
    				{
    					d.busspeedleaving = 2500;
    				}
    				level.the_bus setvehmaxspeed(100);
    				level.the_bus setspeed(2500, 1);
    				level.the_bus.targetspeed = 2500;
    			}
    			else if(option == 2)
    			{		
    				foreach(d in level.the_bus.destinations)
    				{
    					d.busspeedleaving = 2500;
    				}
    				level.the_bus setvehmaxspeed(2500);
    				level.the_bus setspeed(2500, 2);
    				level.the_bus.targetspeed = 2500;
    			}
    			else if(option == 3)
    			{	
    				foreach(d in level.the_bus.destinations)
    				{
    					d.busspeedleaving = 2500;
    				}
    				level.the_bus setvehmaxspeed(2500);
    				level.the_bus setspeed(2500, 3);
    				level.the_bus.targetspeed = 2500;
    			}
    			else if(option == 4)
    			{
    				option = 0;
    			}
    			wait 0.05;
    		}
    	}	
    
    }
    
    JezuzLizardundefined 1 Reply Last reply
    0
    • Dragon115undefined Dragon115

      I created this script to change the bus speed but on coop its not synced between players. I don't know if it causes any conflicts when other players use it but I want to avoid that causing problems.

      change_bus_speed()
      {
      	print = 0;
      	option = 0;
      	if (getDvar ("ui_zm_mapstartlocation") == "transit")
      	{	
      		flag_wait( "initial_blackscreen_passed" );
      		self iprintln("Press and Hold [{+actionslot 4}] to adjust Bus Speed");
      		wait 0.50;
      	        self iprintln("Speed options increase after power is turned on");
      	}
      	if(level.scr_zm_map_start_location == "transit")
      	{
      	        for(;;)
      		{
      			if ( self actionslotfourbuttonpressed() )
      			{	
      				wait 0.10;
      				print += 1;
      				option += 1;
      				if ( !flag( "power_on" ) )
      				{
      					if(print == 2)
      					{
      						print = 0;
      					}
      					if(option == 2)
      					{
      						option = 0;
      					}
      					if(print == 0)
      					{
      						self iprintln("Bus Speed: Default");
      					}
      				}
      				else
      				{
      				
      				}
      				if(print == 1)
      				{
      					self iprintln("Bus Speed: Slow");
      				}
      				else if(print == 2)
      				{
      					self iprintln("Bus Speed: Fast");
      				}
      				else if(print == 3)
      				{
      					self iprintln("Bus Speed: Super Fast");
      				}
      				else if(print == 4)
      				{
      					self iprintln("Bus Speed: Default");
      					print = 0;
      				}
      				
      			}
      			if(option == 0)
      			{
      				
      			}
      			else if(option == 1)
      			{	
      				foreach(d in level.the_bus.destinations)
      				{
      					d.busspeedleaving = 2500;
      				}
      				level.the_bus setvehmaxspeed(100);
      				level.the_bus setspeed(2500, 1);
      				level.the_bus.targetspeed = 2500;
      			}
      			else if(option == 2)
      			{		
      				foreach(d in level.the_bus.destinations)
      				{
      					d.busspeedleaving = 2500;
      				}
      				level.the_bus setvehmaxspeed(2500);
      				level.the_bus setspeed(2500, 2);
      				level.the_bus.targetspeed = 2500;
      			}
      			else if(option == 3)
      			{	
      				foreach(d in level.the_bus.destinations)
      				{
      					d.busspeedleaving = 2500;
      				}
      				level.the_bus setvehmaxspeed(2500);
      				level.the_bus setspeed(2500, 3);
      				level.the_bus.targetspeed = 2500;
      			}
      			else if(option == 4)
      			{
      				option = 0;
      			}
      			wait 0.05;
      		}
      	}	
      
      }
      
      JezuzLizardundefined Offline
      JezuzLizardundefined Offline
      JezuzLizard
      Plutonium Staff
      wrote on last edited by
      #2

      Dragon115 You can use the method isHost() to check if a player is the host.

      Dragon115undefined 1 Reply Last reply
      1
      • JezuzLizardundefined JezuzLizard

        Dragon115 You can use the method isHost() to check if a player is the host.

        Dragon115undefined Offline
        Dragon115undefined Offline
        Dragon115
        wrote on last edited by
        #3

        JezuzLizard Awesome thanks

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Unread 0
        • Recent
        • Tags
        • Popular
        • Users
        • Groups