ULX

Author Topic: Uppl -- Ulysses Per Prop Limit. Restrict specified props to a certain number!  (Read 83688 times)

0 Members and 1 Guest are viewing this topic.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
The example you posted doesn't have quotes. I almost answered no
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
The short answer is yes. I didn't want to get technical. :P

You can do it without quotes if there's no spaces in the name, but just to be safe we should probably tell people yes. :)
Experiencing God's grace one day at a time.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Hi, I have trouble adding a log message in uppl:

Code: [Select]
local function cc_upplAdd( ply, command, argv )
if ply:IsValid() and not (ply:IsAdmin() or ply:IsSuperAdmin()) then
ULib.tsay( ply, "You are not an admin!" )
return
end

local err -- Check for errors
if #argv < 2 then
err = "You need at least two arguments for this command."
elseif not file.Exists( "../" .. argv[ 1 ] ) then
err = "That model (" .. argv[ 1 ] .. ") does not exist."
elseif not tonumber( argv[ 2 ] ) or tonumber( argv[ 2 ] ) < 0 then
err = "Invalid number for model " .. argv[ 1 ] .. " " .. argv[ 2 ]
end

if err then
if ply:IsValid() then
ULib.tsay( ply, err )
else
Msg( err .. "\n" )
end
return
end

-- Now we should be error free!

--I've just added this message:
ulx.logServAct( ply, "#A limited model '" .. argv[ 1 ] .. "' to " .. argv[ 2 ] .. " units per player." )

LimitModel( argv[ 1 ], tonumber( argv[ 2 ] ) )
end
concommand.Add( "uppl_add", cc_upplAdd )

But this silently crash the script. I've also tried a simple message ulx.logServAct( ply, "hello" )

What i do wrong ?

Cornflake

  • Guest
Hi all,

I'd like to use this to limit people from spawning more than one certain SENT (specifically, the Stargate DHD) and I typed in two paths to .mdl (one with the addons path and one without). For some reason, though, it doesn't seem to take effect. Does this only work for props or does it work for SENTS too?

I typed this in:
Code: [Select]
uppl_add "models/dhd/dhd.mdl" 1and
Code: [Select]
uppl_add "addons/stargate/models/dhd/dhd.mdl" 1
But neither of them worked. If this does not work for SENTs, can you point me towards an addon that does? Thanks.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
It does not work for sents and I do not know of any that does.
Experiencing God's grace one day at a time.

Cornflake

  • Guest
Oh that's too bad  :(

Since aVoN introduced the shield in his Stargate SVN pack, people have been hooking like 10 DHDs up to it because they generate so much power. I looked in his config but saw now limiting variable for the DHDs.

I searched Facepunch but came up with nothing - and they're usually less than helpful in my question threads.

-Thanks, Cornflake

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
I made something like that (it's mostly uppl but modified for sents). I never released it because it's exploitable by the duplicator and i can't find a fix  All the rest seems to work as it should. If i find a fix i'll release it.

Offline blacksythe

  • Newbie
  • *
  • Posts: 38
  • Karma: -1
Any way i can make this limit on a group basis for example i want my respected players and above to be able to use it. OR would it require messing around with my groups file.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
do you mean, you want it to ignore certain groups and not restrict them to a limit?

Offline blacksythe

  • Newbie
  • *
  • Posts: 38
  • Karma: -1
yes i would like certain groups restricted and higher groups not restricted

Also since my last post this apperars not to work on my setup

restricts are entered into the ulx/cfg/server.ini

uppl is in addons should it be in modules?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Blacksythe, test and make sure you aren't running into this problem posted by me on our bugtracker.
It's not actually a direct ULX bug, but a limitation of the (Source/Gmod lua?) engine we hope to work around.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline blacksythe

  • Newbie
  • *
  • Posts: 38
  • Karma: -1
.ini is 3.68k well within limit not using your cvar add add-on because  know all the cvars ive tried putting it into a gamemode config see if there is any difference Thanks.

quick edit before i post no difference ill post a copy of the relevant section of the .ini however after reviewing it i dont think its wrong. it may be in not working properly with one of my other mods.

lol it was that problem oops idiot me just checked it again however will moving it to sandbox.ini and spacebuild.ini fix this?


also cleaned up .ini file to get rid of all your lovely comments well under 8k now will restart to see if its fixed

« Last Edit: December 18, 2007, 07:50:41 AM by blacksythe »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Removing the comments won't do anything because they're already removed by ULib before they're executed. Spreading it out across multiple files also won't do anything.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Spreading it out across multiple files also won't do anything.

Oh! No? I've not tinkered with it, but thought that would. Is there a workaround then?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Oh! No? I've not tinkered with it, but thought that would. Is there a workaround then?

The best workaround would be to stick 'em in the main server.cfg file.
Experiencing God's grace one day at a time.