def kick(caller,cn): """This allows the caller to kick another player; however, this will not override players with higher permission. Meaning, a master level permission can not kick someone with admin or trusted permission. To prevent the player from rejoining the server, they will also be banned for the default 60 minutes.""" cn=int(cn) UserSessionManager.checkPermissions(caller,UserSessionManager[("ingame",cn)][1]) #check if the other person is more privileged ban(caller,sbserver.playerName(cn),"kicked by %s" % formatCaller(caller)) triggerServerEvent("player_kicked",[caller,cn]) return sbserver.playerKick(cn)
def kick(caller,cn): """Kicks another player; however, this command does not work on players with higher permission. Kicking a player also gives them a 60 minute ban.""" cn=int(cn) try: UserSessionManager.checkPermissions(caller,UserSessionManager[("ingame",cn)][1]) #check if the other person is more privileged except PermissionError: triggerServerEvent("player_kick_failed",[caller,cn]) raise ban(caller,sbserver.playerName(cn),"kicked by %s" % formatCaller(caller)) triggerServerEvent("player_kicked",[caller,cn]) return sbserver.playerKick(cn)