Skip to content

Commit bb6048f

Browse files
legokidlogansarahsturgeon
authored andcommitted
Turn propify's default model into a list
1 parent bc0a841 commit bb6048f

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

lua/ulx/modules/sh/cfc_propify.lua

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ CFCUlxCommands.propify = CFCUlxCommands.propify or {}
22
local cmd = CFCUlxCommands.propify
33

44
local CATEGORY_NAME = "Fun"
5-
local PROP_DEFAULT_MODEL = "models/props_c17/oildrum001.mdl"
65
local PROP_MAX_SIZE = CreateConVar( "cfc_ulx_propify_max_size", 150, FCVAR_NONE, "The max radius allowed for propify models (default 150)", 0, 50000 )
76
local HOP_STRENGTH = CreateConVar( "cfc_ulx_propify_hop_strength", 400, FCVAR_NONE, "The strength of propify hops (default 400)", 0, 50000 )
87
local HOP_COOLDOWN = CreateConVar( "cfc_ulx_propify_hop_cooldown", 2, FCVAR_NONE, "The cooldown between propify hops in seconds (default 2)", 0, 50000 )
@@ -13,6 +12,17 @@ local STRUGGLE_SAFETY = CreateConVar( "cfc_ulx_propify_struggle_safety", 10, FCV
1312
local STRUGGLE_STRENGTH = CreateConVar( "cfc_ulx_propify_struggle_strength", 500, FCVAR_NONE, "The strength that a propified player launches at when escaping a grab (default 500)", 0, 50000 )
1413
local STRUGGLE_FLEE_RANDOM = CreateConVar( "cfc_ulx_propify_struggle_flee_random", 45, FCVAR_NONE, "How many degrees in any direction that a propified player will randomly launch towards when escaping a grab (default 45)", 0, 180 )
1514
local PICKUP_DENY_COOLDOWN = CreateConVar( "cfc_ulx_propify_pickup_deny_cooldown", 1, FCVAR_NONE, "The cooldown on how frequently players can be told they are unable to pick up a recently-escaped propified player (default 1)", 0, 50000 )
15+
local PROP_DEFAULT_MODELS = {
16+
"models/props_c17/oildrum001.mdl",
17+
"models/props_c17/FurnitureSink001a.mdl",
18+
"models/props_borealis/bluebarrel001.mdl",
19+
"models/props_c17/gravestone003a.mdl",
20+
"models/props_lab/filecabinet02.mdl",
21+
"models/props_lab/monitor01a.mdl",
22+
"models/props_junk/TrashBin01a.mdl",
23+
"models/props_c17/suitcase001a.mdl"
24+
}
25+
local PROP_DEFAULT_MODEL_COUNT = #PROP_DEFAULT_MODELS
1626

1727
local jumpVector = Vector( 0, 0, 1 )
1828
cmd.relativeDirFuncs = {
@@ -29,6 +39,11 @@ local function propifyPlayer( caller, ply, modelPath, overrideHopPress, override
2939
local canPropify = hook.Run( "CFC_ULX_PropifyPlayer", caller, ply, false ) ~= false
3040
if not IsValid( ply ) then return "Invalid player!" end
3141
if not canPropify then return ply:GetNick() .. " cannot be propified!" end
42+
43+
if modelPath == "random" then
44+
modelPath = PROP_DEFAULT_MODELS[math.random( 1, PROP_DEFAULT_MODEL_COUNT )]
45+
end
46+
3247
if not util.IsValidModel( modelPath ) then return "Invalid model!" end
3348

3449
if ply:InVehicle() then
@@ -158,7 +173,7 @@ end
158173

159174
local propifyCommand = ulx.command( CATEGORY_NAME, "ulx propify", cmd.propifyTargets, "!propify" )
160175
propifyCommand:addParam{ type = ULib.cmds.PlayersArg }
161-
propifyCommand:addParam{ type = ULib.cmds.StringArg, default = PROP_DEFAULT_MODEL, ULib.cmds.optional }
176+
propifyCommand:addParam{ type = ULib.cmds.StringArg, default = "random", ULib.cmds.optional }
162177
propifyCommand:addParam{ type = ULib.cmds.BoolArg, invisible = true }
163178
propifyCommand:defaultAccess( ULib.ACCESS_ADMIN )
164179
propifyCommand:help( "Turns the target(s) into a prop with the given model." )

0 commit comments

Comments
 (0)