File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,16 @@ game_library.getRealTickInterval = engine.AbsoluteFrameTime
98
98
-- @return number Ticks
99
99
game_library .getTickCount = engine .TickCount
100
100
101
+ --- Checks if a model exists in the game files
102
+ -- @param string path Filepath in game folder
103
+ -- @return boolean? True if exists, false if not, nil if error
104
+ function game_library .modelExists (path )
105
+ checkluatype (path , TYPE_STRING )
106
+ path = SF .NormalizePath (path )
107
+ if string.find (path , " models/" , 1 , true )~= 1 then return false end
108
+ return file .Exists (path , " GAME" )
109
+ end
110
+
101
111
--- Returns AmmoData for given id
102
112
-- @param number id See https://wiki.facepunch.com/gmod/Default_Ammo_Types
103
113
-- @return table AmmoData, see https://wiki.facepunch.com/gmod/Structures/AmmoData
You can’t perform that action at this time.
0 commit comments