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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. question on making a simple gsc code for "reserved slots"

question on making a simple gsc code for "reserved slots"

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
8 Posts 5 Posters 863 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.
  • mikzy Offline
    mikzy Offline
    mikzy
    Banned
    wrote on last edited by
    #1

    I could easily make one i think and i have a basic idea but tried and it didnt work. Does anyone else have a idea on this?
    Example: 17 players (max but you can still join) and when you join, it finds you have VIP status and after that, it kicks a random player that doesnt have VIP status

    TheHiddenHour 1 Reply Last reply
    0
    • mikzy mikzy

      I could easily make one i think and i have a basic idea but tried and it didnt work. Does anyone else have a idea on this?
      Example: 17 players (max but you can still join) and when you join, it finds you have VIP status and after that, it kicks a random player that doesnt have VIP status

      TheHiddenHour Offline
      TheHiddenHour Offline
      TheHiddenHour
      Contributor
      wrote on last edited by TheHiddenHour
      #2

      mikzy Untested, but I left some comments that should make it easy to figure out.

      hasVipStatus() {
      	/*
      		Conduct your VIP status check here 
      	*/
      	
      	return status;
      }
      
      /*
      	Returns bool on whether room was made for the VIP player
      	
      	vip_slots - The amount of VIP slots on the server 
      */
      makeVipRoom(vip_slots) {
      	room_made = false;
      	
      	if(level.players.size >= vip_slots) { // If there's as many or more players as there are vip slots, we need to kick someone who isn't vip 
      		for(i = 0; i < level.players.size; i++) { // Iterate over each player in the server 
      			player = level.players[i];
      			if(!player isHost() && !player hasVipStatus()) { // If the player isn't host and isn't vip 
      				// The iterator index should be the same as the entity number in this case (I think) 
      				kick(i); // Kick the non-vip player 
      				room_made = true;
      				break;
      			}
      		}
      	}
      	
      	return room_made;
      }
      

      makeVipRoom() returns a boolean on whether room was made or not. Maybe you could use it to send an error or something to the player that there's no room available.

      1 Reply Last reply
      0
      • mikzy Offline
        mikzy Offline
        mikzy
        Banned
        wrote on last edited by
        #3

        So, for example, the server is full and has 18 players in. Lets say we have it so if you VIP status is found on player joining, it does kick a random player and lets you join. Is that how it would work?

        Ayresia 1 Reply Last reply
        0
        • mikzy mikzy

          So, for example, the server is full and has 18 players in. Lets say we have it so if you VIP status is found on player joining, it does kick a random player and lets you join. Is that how it would work?

          Ayresia Offline
          Ayresia Offline
          Ayresia
          wrote on last edited by
          #4

          mikzy I don't think it's actually possible to-do that cause onPlayerConnect works when the player is actually connecting and it doesn't react when the server is full i believe.

          1 Reply Last reply
          0
          • Cahz Offline
            Cahz Offline
            Cahz
            VIP
            wrote on last edited by
            #5

            I do believe that this could be made in GSC. Depends on how you want to approach it.

            I feel like it'd be easy to create one "reserved slot" but it would require you to have one less player available in order to allow players to attempt to connect.

            mikzy 1 Reply Last reply
            0
            • Cahz Cahz

              I do believe that this could be made in GSC. Depends on how you want to approach it.

              I feel like it'd be easy to create one "reserved slot" but it would require you to have one less player available in order to allow players to attempt to connect.

              mikzy Offline
              mikzy Offline
              mikzy
              Banned
              wrote on last edited by
              #6

              Cahz thats what i was thinking

              1 Reply Last reply
              0
              • Fry Offline
                Fry Offline
                Fry
                Plutonium Staff
                wrote on last edited by
                #7

                What's wrong with IW4MAdmin? It has reserve slots.

                1 Reply Last reply
                0
                • mikzy Offline
                  mikzy Offline
                  mikzy
                  Banned
                  wrote on last edited by
                  #8

                  not really but okay and besides i think i found a fix for the way imma do it now

                  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
                  • Donate