Client Limits Menu for ULX 1.1
Description:
A nice menu for administration of Client Limits.
Installation:
1.) Copy the code below into a Lua File (climits.lua).
2.) Copy the Lua File (climits.lua) to your ulx/modules directory.
3.) Enjoy! You can also configure the amounts of the options by changing OPTION_AMOUNTS.
------------------------------------------------
-- Client Limits Menu for ULX 1.1 by andrejkw --
------------------------------------------------
OPTION_AMOUNTS = { "5", "10", "20", "30", "40" }
if ( ULX_VERSION <= 1.0 ) then
_Msg( "WARNING: You must be running ULX v1.1 or better.\n" )
end
function addLimitOptionToMenu( iPlayer, sOption, sCvar )
_spawnmenu.AddItem( iPlayer, "[ULX] Client Limits", "@" .. sOption, "" )
_spawnmenu.AddItem( iPlayer, "[ULX] Client Limits", "+" .. sOption .. " Off", "ulx_rcon " .. sCvar .. " 0" )
for i, v in OPTION_AMOUNTS do
_spawnmenu.AddItem( iPlayer, "[ULX] Client Limits", "+" .. v .. " " .. sOption, "ulx_rcon " .. sCvar .. " ".. v )
end
end
function PlayerSendClientLimitsMenu( iPlayer )
if ( hasAccess( iPlayer, ACCESS_RCON ) == false ) then
return
end
addLimitOptionToMenu( iPlayer, "Balloons", "gm_sv_clientlimit_balloons" )
addLimitOptionToMenu( iPlayer, "Effects", "gm_sv_clientlimit_effects" )
addLimitOptionToMenu( iPlayer, "Emitters", "gm_sv_clientlimit_emitters" )
addLimitOptionToMenu( iPlayer, "Props", "gm_sv_clientlimit_props" )
addLimitOptionToMenu( iPlayer, "Ragdolls", "gm_sv_clientlimit_ragdolls" )
addLimitOptionToMenu( iPlayer, "Sprites", "gm_sv_clientlimit_sprites" )
addLimitOptionToMenu( iPlayer, "Thrusters", "gm_sv_clientlimit_thrusters" )
addLimitOptionToMenu( iPlayer, "Wheels", "gm_sv_clientlimit_wheels" )
addLimitOptionToMenu( iPlayer, "NPCs", "gm_sv_clientlimit_npcs" )
addLimitOptionToMenu( iPlayer, "Vehicles", "gm_sv_clientlimit_vehicles" )
addLimitOptionToMenu( iPlayer, "Dynamites", "gm_sv_clientlimit_dynamite" )
end
HookEvent( "eventPlayerInitialSpawn", PlayerSendClientLimitsMenu )