well its fixed now, heh, no need to get worried!
heres the code, i gave it to a friend after i looked and couldnt find anything wrong, not sure whats different but im sure you'll know.
if not ULib then Msg( "\n ** UnoLimited v2+ REQUIRES ULib v2.4+ .. Aborting\n\n") return end
Msg( "[ULIB]*** UnoLimited v2.1 Ready! *******\n")
local UNL = { }
-- ---------------------------------------------------------
-- Name: UnoLimited
-- Author: Garry 98.50% - Megiddo .75% - JamminR .75% - A "Team Ulysses idea
-- Desc: Allows defined groups to spawn past the sbox_max limits.
-- v1 release to Ulysses - v1.1 - Fixed sents (evil garry)
-- v2 Added group control - ULib 2.4+ required
-- ---------------------------------------------------------
-- The numbers are a percentage and will be multiplied to the actual sbox limit.
-- Range is 0 (0 percent) to 2 (200 percent). Setting a group to 0 will limit that group to nothing.
-- Example - Server has "sbox_maxprops 400" limit. .5 percent of that is 200 props.
-- Any group = .5 will have a 200 prop limit. However, 1.5 would give them 600
-- NOTE!!! - Any decimals will be rounded DOWN to nearest whole number.
-- If you allow sbox 1 of something...any multiplier below 1 will set that groups limit to 0. Any not 2 will be 1.
-- All groups not specified get 'standard' limit set in your server.cfg.
-- Any group set to -1 becomes unlimited
-- ==================
-- Edit the following table. Add groups as necessary. Add comma at end of previous line if additional added.
UNL.groups = {
superadmin = -1,
admin = -1,
vip = 2,
respected = 1.5
}
-- ------- Please ask for Team Ulysses assistance editing below this line ----------------
local function GetUnoLimit ( ply, str )
local gmulti = UNL.groups[ ply:GetUserGroup() ]
local a
if gmulti then
if gmulti == -1 then return gmulti end
if ( gmulti < 0 || gmulti > 2 ) then
ULib.error( string.format( "* UNoLimited - Group %q multiplier %q out of range(0 to 2)...setting to 1", ply:GetUserGroup(), gmulti ) )
gmulti = 1
end
a = math.floor( ( gmulti * server_settings.Int( "sbox_max"..str, 0 ) ) )
else
a = server_settings.Int( "sbox_max"..str, 0 )
end
return a
end
local function LimitReachedProcess( ply, str )
-- Always allow in single player
if (SinglePlayer()) then return true end
local c = GetUnoLimit ( ply, str )
-- Always allow if multiplier is -1
if c == -1 then return true end
if ( ply:GetCount( str ) < c || c < 0 ) then return true end
ply:LimitHit( str )
return false
end
/*---------------------------------------------------------
Name: gamemode:PlayerSpawnRagdoll( ply, model )
Desc: Return true if it's allowed
---------------------------------------------------------*/
local function PlayerSpawnRagdoll( ply, model )
return LimitReachedProcess( ply, "ragdolls" )
end
hook.Add("PlayerSpawnRagdoll", "UnoLimited", PlayerSpawnRagdoll)
/*---------------------------------------------------------
Name: gamemode:PlayerSpawnProp( ply, model )
Desc: Return true if it's allowed
---------------------------------------------------------*/
local function PlayerSpawnProp( ply, model )
return LimitReachedProcess( ply, "props" )
end
hook.Add("PlayerSpawnProp", "UnoLimited", PlayerSpawnProp)
/*---------------------------------------------------------
Name: gamemode:PlayerSpawnEffect( ply, model )
Desc: Return true if it's allowed
---------------------------------------------------------*/
local function PlayerSpawnEffect( ply, model )
return LimitReachedProcess( ply, "effects" )
end
hook.Add("PlayerSpawnEffect", "UnoLimited", PlayerSpawnEffect)
/*---------------------------------------------------------
Name: gamemode:PlayerSpawnVehicle( ply, model, vname, vtable )
Desc: Return true if it's allowed
---------------------------------------------------------*/
local function PlayerSpawnVehicle( ply, model, vname, vtable )
return LimitReachedProcess( ply, "vehicles" )
end
hook.Add("PlayerSpawnVehicle", "UnoLimited", PlayerSpawnVehicle)
/*---------------------------------------------------------
Name: gamemode:PlayerSpawnNPC( ply, npc_type )
Desc: Return true if player is allowed to spawn the NPC
---------------------------------------------------------*/
local function PlayerSpawnNPC( ply, npc_type, equipment )
return LimitReachedProcess( ply, "npcs" )
end
hook.Add("PlayerSpawnNPC", "UnoLimited", PlayerSpawnNPC)
local meta = FindMetaTable( "Player" )
// Return if there's nothing to add on to
if (!meta) then return end
function meta:CheckLimit( str )
// No limits in single player
if (SinglePlayer()) then return true end
local c = GetUnoLimit ( self, str )
if ( c < 0 ) then return true end
if ( self:GetCount( str ) > c-1 ) then self:LimitHit( str ) return false end
return true
end