Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] [GSC] Jug / Weapon script

[Support] [GSC] Jug / Weapon script

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
19 Posts 5 Posters 1.9k Views 1 Watching
  • 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.
  • KillaG4undefined Offline
    KillaG4undefined Offline
    KillaG4
    wrote on last edited by
    #10

    Yea Dont know what i had onplayerspawn multiple times this was the correct way i had it before I believe

    #include maps\mp\_utility;
    #include common_scripts\utility;
    #include maps\mp\zombies\_zm;
    #include maps\mp\zombies\_zm_utility;
    
    
    init()
    {	
        for(;;)
        {
        level thread onPlayerConnect();
        level.perk_purchase_limit = 9;
        }
    }
    
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill("connected", player);
            player thread onPlayerSpawned();
        }
    }
    
    onPlayerSpawned()
    {
        level endon("game_ended");
        self endon("disconnect");
        for(;;)
        {
            self waittill("spawned_player");
    	player thread welcome();
        }
    
    }
    
    welcome()
    {
        self endon("disconnect");
        self waittill("spawned_player");
        self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
        self giveWeapon( "ak74u_upgraded_zm" );
        wait 7;
        self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
    }
    
    1 Reply Last reply
    0
    • KillaG4undefined Offline
      KillaG4undefined Offline
      KillaG4
      wrote on last edited by
      #11

      Now the server is crashing over and over again on startup

      1 Reply Last reply
      0
      • KillaG4undefined Offline
        KillaG4undefined Offline
        KillaG4
        wrote on last edited by
        #12

        This isnt crashing now but nothing happens when the game starts

        #include maps\mp\_utility;
        #include common_scripts\utility;
        #include maps\mp\zombies\_zm;
        #include maps\mp\zombies\_zm_utility;
        
        
        init()
        {	
            level thread onPlayerConnect();
            level.perk_purchase_limit = 9;
        }
        
        onPlayerConnect()
        {
            for(;;)
            {
                level waittill("connected", player);
                player thread onPlayerSpawned();
            }
        }
        
        onPlayerSpawned()
        {
            self endon("disconnect");
            level endon("game_ended");
            for(;;)
            {
            player thread welcome();
        
            }
        }
        
        welcome()
        {
            self endon("disconnect");
            self waittill("spawned_player");
            self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
            self giveWeapon( "ak74u_upgraded_zm" );
            wait 7;
            self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
        }
        
        
        homuraundefined 1 Reply Last reply
        0
        • KillaG4undefined KillaG4

          This isnt crashing now but nothing happens when the game starts

          #include maps\mp\_utility;
          #include common_scripts\utility;
          #include maps\mp\zombies\_zm;
          #include maps\mp\zombies\_zm_utility;
          
          
          init()
          {	
              level thread onPlayerConnect();
              level.perk_purchase_limit = 9;
          }
          
          onPlayerConnect()
          {
              for(;;)
              {
                  level waittill("connected", player);
                  player thread onPlayerSpawned();
              }
          }
          
          onPlayerSpawned()
          {
              self endon("disconnect");
              level endon("game_ended");
              for(;;)
              {
              player thread welcome();
          
              }
          }
          
          welcome()
          {
              self endon("disconnect");
              self waittill("spawned_player");
              self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
              self giveWeapon( "ak74u_upgraded_zm" );
              wait 7;
              self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
          }
          
          
          homuraundefined Offline
          homuraundefined Offline
          homura
          Banned
          wrote on last edited by homura
          #13

          KillaG4 is it because you removed
          self waittill("spawned_player"); from the player spawn loop? I'd say try that and see if that makes a difference.

          1 Reply Last reply
          0
          • KillaG4undefined Offline
            KillaG4undefined Offline
            KillaG4
            wrote on last edited by
            #14

            homura said in Jug / Weapon script:

            #include maps\mp\_utility;
            #include common_scripts\utility;
            #include maps\mp\zombies\_zm;
            #include maps\mp\zombies\_zm_utility;
            
            init()
            {
            	level.clientid = 0;
            	level.perk_purchase_limit = 9;
            	level thread onplayerconnect();
            	player thread onplayerspawned();
            }
            
            onplayerconnect()
            {
            	for ( ;; )
            	{
            		level waittill( "connecting", player );
            		player.clientid = level.clientid;
            		level.clientid++;
            		player thread onplayerspawned();
            	}
            }
            
            onplayerspawned()
            {
            	level endon( "game_ended" );
                    self endon( "disconnect" );
            	
            	for(;;)
            	{
            		self waittill( "spawned_player" );
            		self IPrintLnBold( "^5whatever welcome message you want here" );
            		self welcome();
            	}
            }
            
            welcome()
            {
                self waittill( "spawned_player" );
                self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
                self giveWeapon( "mp5k_upgraded_zm" );
                wait 7;
                self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
            }
            

            It all works with this now, only issue now is the first person who joins the game doesnt get the gun. So once others start to join they all get the item and if the first player kills themselves then then get it

            Drgnundefined 1 Reply Last reply
            0
            • KillaG4undefined KillaG4

              homura said in Jug / Weapon script:

              #include maps\mp\_utility;
              #include common_scripts\utility;
              #include maps\mp\zombies\_zm;
              #include maps\mp\zombies\_zm_utility;
              
              init()
              {
              	level.clientid = 0;
              	level.perk_purchase_limit = 9;
              	level thread onplayerconnect();
              	player thread onplayerspawned();
              }
              
              onplayerconnect()
              {
              	for ( ;; )
              	{
              		level waittill( "connecting", player );
              		player.clientid = level.clientid;
              		level.clientid++;
              		player thread onplayerspawned();
              	}
              }
              
              onplayerspawned()
              {
              	level endon( "game_ended" );
                      self endon( "disconnect" );
              	
              	for(;;)
              	{
              		self waittill( "spawned_player" );
              		self IPrintLnBold( "^5whatever welcome message you want here" );
              		self welcome();
              	}
              }
              
              welcome()
              {
                  self waittill( "spawned_player" );
                  self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
                  self giveWeapon( "mp5k_upgraded_zm" );
                  wait 7;
                  self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
              }
              

              It all works with this now, only issue now is the first person who joins the game doesnt get the gun. So once others start to join they all get the item and if the first player kills themselves then then get it

              Drgnundefined Offline
              Drgnundefined Offline
              Drgn
              Plutonium Staff
              wrote on last edited by
              #15

              KillaG4 Generally you don't want to run the onplayerspawn thread twice like you are doing here in init and on connect.

              1 Reply Last reply
              0
              • KillaG4undefined Offline
                KillaG4undefined Offline
                KillaG4
                wrote on last edited by
                #16

                hmm I keep ending up adding it back I believe it causes issues if i dont keep it in both spots. Ill play around with it again tomorrow.

                1 Reply Last reply
                0
                • KillaG4undefined Offline
                  KillaG4undefined Offline
                  KillaG4
                  wrote on last edited by
                  #17

                  Anyone know how to make it so the first person who joins the server gets the welcome function?? Works for anyone else who joins just not the first person.

                  1 Reply Last reply
                  0
                  • KillaG4undefined Offline
                    KillaG4undefined Offline
                    KillaG4
                    wrote on last edited by KillaG4
                    #18
                    #include maps\mp\_utility;
                    #include common_scripts\utility;
                    #include maps\mp\zombies\_zm;
                    #include maps\mp\zombies\_zm_utility;
                    
                    init()
                    {
                    	level.clientid = 0;
                    	level.perk_purchase_limit = 9;
                    	level thread onplayerconnect();
                    }
                    
                    onplayerconnect()
                    {
                    	for ( ;; )
                    	{
                    		level waittill( "connecting", player );
                    		player.clientid = level.clientid;
                    		player thread onplayerspawned();
                    		level.clientid++;
                    	}
                    }
                    
                    onplayerspawned()
                    {
                    	level endon( "game_ended" );
                            self endon( "disconnect" );
                    	
                    	for(;;)
                    	{
                    		self welcome();
                    	}
                    }
                    
                    welcome()
                    {
                        self IPrintLnBold( "^Killa Server" );
                        self waittill( "spawned_player" );
                        self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
                        self giveWeapon( "mp5k_upgraded_zm" );
                        wait 7;
                        self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
                    }
                    

                    Ok i fixed it, I was calling self waittill( "spawned_player" ); twice which was my issue. So if anyone is interested this will give Jug and a weapon and set perk limit to 9

                    1 Reply Last reply
                    1
                    • KillaG4undefined Offline
                      KillaG4undefined Offline
                      KillaG4
                      wrote on last edited by
                      #19

                      So after using it for a day I find if 2 players join while the game is going and then round ends and they join in it only gives 1 player the items and jug and just ignores the second player who also joined with them.

                      1 Reply Last reply
                      0
                      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
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Donate