Skip to content

Commit e6ffcd5

Browse files
authored
Merge pull request #34 from swiftly-solution/rewrite
feat(scripting/utils): CCSGameRules
2 parents 2826016 + 5459cee commit e6ffcd5

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)