Skip to content

Commit 5459cee

Browse files
committed
feat(scripting/utils): CCSGameRules
1 parent 2c21dac commit 5459cee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plugin_files/bin/scripting/utils.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,10 @@ string.split = function(str, split)
122122
end
123123
return splitted
124124
end
125+
126+
function CCSGameRules()
127+
local entities = FindEntitiesByClassname("cs_gamerules")
128+
if #entities <= 0 then return nil end
129+
local rulesProxy = entities[1]
130+
return CCSGameRulesProxy(rulesProxy:ToPtr()).GameRules
131+
end

0 commit comments

Comments
 (0)