Skip to content
  • 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 244 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mikzyundefined Offline
    mikzyundefined 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

    TheHiddenHourundefined 1 Reply Last reply
    0
    • TheHiddenHourundefined Offline
      TheHiddenHourundefined Offline
      TheHiddenHour Contributor
      replied to mikzy 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
      • mikzyundefined Offline
        mikzyundefined 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?

        Ayresiaundefined 1 Reply Last reply
        0
        • Ayresiaundefined Offline
          Ayresiaundefined Offline
          Ayresia
          replied to mikzy 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
          • Cahzundefined Offline
            Cahzundefined 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.

            mikzyundefined 1 Reply Last reply
            0
            • mikzyundefined Offline
              mikzyundefined Offline
              mikzy Banned
              replied to Cahz on last edited by
              #6

              Cahz thats what i was thinking

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

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

                1 Reply Last reply
                0
                • mikzyundefined Offline
                  mikzyundefined 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

                  • Login

                  • Don't have an account? Register

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