Author Topic: Reserved slot to one player only?  (Read 2983 times)

0 Members and 1 Guest are viewing this topic.

Offline roxon101

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Reserved slot to one player only?
« on: September 19, 2008, 01:19:26 AM »
Hey ULX team/people! I host a server and I need to know a way to reserve one slot in the server to only allow me to fill it.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Reserved slot to one player only?
« Reply #1 on: September 19, 2008, 02:20:58 AM »
Only give yourself permission to fill it
Experiencing God's grace one day at a time.

Offline roxon101

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Re: Reserved slot to one player only?
« Reply #2 on: September 19, 2008, 02:29:09 AM »
But I want it so, there's 2 reserved slots, one for admins and another one for me.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Reserved slot to one player only?
« Reply #3 on: September 19, 2008, 02:37:09 AM »
Sorry, can't do that.
Experiencing God's grace one day at a time.

Offline roxon101

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Re: Reserved slot to one player only?
« Reply #4 on: September 19, 2008, 03:21:50 AM »
Would it be easy to make something like that for me please  ???

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Reserved slot to one player only?
« Reply #5 on: September 19, 2008, 09:05:53 PM »
Not really.
Possible, yes.
Easy (for us lua-wise), maybe.
Easy within the time we have within our currently busy lives to do such a request, sorry, no.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Reserved slot to one player only?
« Reply #6 on: September 19, 2008, 09:16:12 PM »
Code: [Select]
local reserve = "steamid here"

function AReserve(ply)
local CurPlys = #player.GetAll()
local SlotsOpen = (maxplayers:GetInt() - Curplys)
if SlotsOpen == 1 then
if table.getn(player.GetAll()) then
for k,v in pairs(player.GetAll()) do
if string.find( k:SteamID(), reserve) then
local reserveSlot = "No"
return
else
local reserveSlot = "Yes"
end
if reserveSlot == "Yes" then
ULib.kick(ply,"Sorry This Slot Is Reserved")
end
end
end
end
end
hook.Add("PlayerInitialSpawn", "AReserve_hook", AReserve )

Not tested, but should only allow the steamid placed there to fill the final slot if it's not already in the server.
« Last Edit: September 19, 2008, 09:25:36 PM by jay209015 »
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Reserved slot to one player only?
« Reply #7 on: September 19, 2008, 09:18:12 PM »
*sigh*
And Jay with more energy than the Team Ulysses 3 to the rescue.
:P
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Reserved slot to one player only?
« Reply #8 on: September 19, 2008, 09:25:58 PM »
I can't help it, it's what I do :P
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly