Tphere and tpto

maughanorama

Member
Member
Nov 27, 2014
181
10
18
50
Is there anyway we could get a tphere and tp commands from rust++ to work for moderators... maybe a python mod if possible ?? ;)
also would it be possible to have reserved player slots ? basically so if my server fills up i can still get on ?


Thanks
 
Last edited:

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Is there anyway we could get a tphere and tp commands from rust++ to work for moderators... maybe a python mod if possible ?? ;)
also would it be possible to have reserved player slots ? basically so if my server fills up i can still get on ?


Thanks
You can set the default flags in the rust++.cfg. then you can use the /addadmin command, ehich shouldnt give RCON.

Sent from my Samsung Galaxy S4
 

maughanorama

Member
Member
Nov 27, 2014
181
10
18
50
now that i didnt know thank you very much ...
do you know of a way to reserve player slots ?

thanks
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
now that i didnt know thank you very much ...
do you know of a way to reserve player slots ?

thanks
The required code to make reserved slots is private as you could change the max players to what ever number you want and you're host wouldn't be to happy with that.

Or maybe getting the max players should be unprivate but setting it should be private.

@mikec would know more
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Orrr maybe its not private..
Not sure if these are even call able tho
 
Last edited:

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
I am the host. I have changed my max hosts a few times
I have no idea if this thing will work.

Create the ReservedSlots.py for It.

Python:
import clr

clr.AddReferenceByPartialName("Fougerite")
import Fougerite

ReservedSlots = 10 # <- Set that to the max reserved slots
red = "[color #FF0000]"
class ReservedSlots:

    server = None
    Diff = 0
    Slots = 0

    def On_PluginInit(self):
        self.server = Util.TryFindReturnType("server")
        self.Slots = int(self.server.maxplayers)
        self.Diff = self.Slots - ReservedSlots

    def TrytoGrabID(self, Player):
        try:
            id = Player.SteamID
            return id
        except:
            return None

    def isMod(self, id):
        if DataStore.ContainsKey("Moderators", id):
            return True
        return False

    def On_PlayerConnected(self, Player):
        id = self.TrytoGrabID(Player)
        if id is None:
            try:
                Player.Disconnect()
            except:
                pass
            return
        if Player.Admin or self.isMod(id):
            return
        n = len(Server.Players)
        if n > self.Diff:
            Player.MessageFrom("ReservedSlots", red + "You are using reserved slots!")
            Player.Disconnect()
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
I have no idea if this thing will work.

Create the ReservedSlots.py for It.

Python:
import clr

clr.AddReferenceByPartialName("Fougerite")
import Fougerite

ReservedSlots = 10 # <- Set that to the max reserved slots
red = "[color #FF0000]"
class ReservedSlots:

    server = None
    Diff = 0
    Slots = 0

    def On_PluginInit(self):
        self.server = Util.TryFindReturnType("server")
        self.Slots = int(self.server.maxplayers)
        self.Diff = self.Slots - ReservedSlots

    def TrytoGrabID(self, Player):
        try:
            id = Player.SteamID
            return id
        except:
            return None

    def isMod(self, id):
        if DataStore.ContainsKey("Moderators", id):
            return True
        return False

    def On_PlayerConnected(self, Player):
        id = self.TrytoGrabID(Player)
        if id is None:
            try:
                Player.Disconnect()
            except:
                pass
            return
        if Player.Admin or self.isMod(id):
            return
        n = len(Server.Players)
        if n > self.Diff:
            Player.MessageFrom("ReservedSlots", red + "You are using reserved slots!")
            Player.Disconnect()
Wouldn't that mean on server init you could change the max players?
Python:
class lol:

    server = None

    def On_PluginInit(self):
        self.server = Util.TryFindReturnType("server")
        self.server.maxplayers = 999999
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Wouldn't that mean on server init you could change the max players?
Python:
class lol:

    server = None

    def On_PluginInit(self):
        self.server = Util.TryFindReturnType("server")
        self.server.maxplayers = 999999
Well the code that I posted doesn't do It, but yes.

Anyone can do this sadly, even on Oxide, and on RustEssentials. It would be hard for anyone to bypass this. The host can do this by simply getting the current slots of the server, and checking if it equals with the slots that the person paid for.
 

maughanorama

Member
Member
Nov 27, 2014
181
10
18
50
what would happen? I mean if I set my server to 30 playeyers would it take reserved slots from the pool of 30 or would it add another 2 slots that only admins and mods can connect to ? Would therver just fill up to 30 then kick 2 people ?

Thanks
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
what would happen? I mean if I set my server to 30 playeyers would it take reserved slots from the pool of 30 or would it add another 2 slots that only admins and mods can connect to ? Would therver just fill up to 30 then kick 2 people ?

Thanks
If you set the reserved slots to 2, and you have 30 slots, 28 players will be able to join.

Sent from my Samsung Galaxy S4
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com