Skip to content

Commit

Permalink
redm.inc: add GetCvarTypeStr()
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov committed Feb 11, 2024
1 parent 56b2043 commit d5aa4ea
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cstrike/addons/amxmodx/scripting/include/redm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -597,3 +597,19 @@ enum _: ConVar_ExtendedFlags (<<= 1) {
_FCVAR_STRING, /**< Can contain string value */
_FCVAR_FLOAT, /**< Can contain float value */
}

stock GetCvarTypeStr(const /* ConVar_ExtendedFlags: */ flags) {
new buffer[32]
copy(buffer, charsmax(buffer), "number")

if (flags & _FCVAR_BOOLEAN)
copy(buffer, charsmax(buffer), "boolean")

if (flags & _FCVAR_STRING)
copy(buffer, charsmax(buffer), "string")

if (flags & _FCVAR_FLOAT)
copy(buffer, charsmax(buffer), "float")

return buffer
}

0 comments on commit d5aa4ea

Please sign in to comment.