Skip to content

Instantly share code, notes, and snippets.

@eduzappa18
Created February 20, 2026 20:42
Show Gist options
  • Select an option

  • Save eduzappa18/600f413b09d0b2b692e9caaab18eba02 to your computer and use it in GitHub Desktop.

Select an option

Save eduzappa18/600f413b09d0b2b692e9caaab18eba02 to your computer and use it in GitHub Desktop.
openmohaa's new functions (up to February 2026)
// openmohaa's new functions (up to February 2026)
////////////////////
//AttractiveNode()
////////////////////
max_dist( Float max_dist )
// Set the max distance for this node to be attracted, -1 for unlimited distance.
max_dist
// Get the max distance for this node
priority( Integer priority )
// Set the node priority
respawn_time
// Get the how much time will this node re-attract already attracted AIs
respawn_time( Float respawn_time )
// Set the how much time will this node re-attract already attracted AIs. The minimum required value is 1, otherwise AI will get stuck.
setuse( Boolean use )
// Set if AI should use or not
stay_time( Float stay_time )
// Set the maximum stay time AI will stay on this node
stay_time
// Get the max stay time for this node
team( String team )
// Set the attractive node team. 'none' for no team.
team
// Get the attractive node team. 'none' for no team.
////////////////////
// Entity ()
////////////////////
depthhack( Integer bEnable )
// Enable or disable depth hack.
////////////////////
// FSFile ()
////////////////////
close
// Closes the file.
flush
// Flush to disk.
read( Integer length )
// Reads n characters from file.
seek( Integer offset, Integer origin )
// Seeks to the specified offset.
// 0 = From current
// 1 = From end
// 2 = Set
tell
// Returns the specified offset.
write( String buffer, Integer length )
// Writes n characters from file.
////////////////////
// FuncBeam (func_beam)
////////////////////
ignorewalls( [ Boolean bool] )
// Set if the beam can traverse walls
////////////////////
// GravPathNode (info_grav_pathnode)
////////////////////
deactivate
// Deactivate the grav path.
gravpath_create
// Create the grav path.
maxspeed( Float maxspeed )
// Set the max speed of the grav path.
radius( Float radius )
// Set the radius of the grav path.
speed( Float speed )
// Set the speed of the grav path.
activate
// Activate the grav path.
////////////////////
// Hud ()
////////////////////
alignx( String align )
// Sets the horizontal alignment for the HUD. Specified by 'left', 'center', or 'right'
alignx
// Gets the horizontal alignment for the HUD. Specified by 'left', 'center', or 'right'
aligny
// Gets the vertical alignment for the HUD
aligny( String align )
// Sets the vertical alignment for the HUD. Specified by 'top', 'center', or 'bottom'
alpha
// Gets the HUD alpha
alpha( Float alpha )
// Sets the HUD alpha
color( Vector color )
// Sets the HUD colors
color
// Gets the HUD colors
fadeovertime( Float time )
// Sets the HUD to transition in color (or alpha) over time
font( String font )
// Sets the HUD font
font
// Gets the HUD font
getheight
// Gets the HUD height
gettime
// Gets the HUD time
getwidth
// Gets the HUD width
moveovertime( Float time )
// Sets the HUD to move over time
refresh
// Refresh the HUD
resetdimension
// Bring the HUD back to normal dimension (non-3D)
scaleovertime( Float time, Integer width, Integer height )
// Sets the HUD to scale over time
setdimension( Vector vector_or_offset, Boolean always_show, Boolean depth, [ Entity entity] )
// Sets this huddraw element to be a 3D world icon and can specify if this icon is always shown on-screen even if the player isn't looking at.
// It uses xy pos from huddraw_rect.
// If entity is specified, the vector will be an offset relative to the entity.
// depth specify if the icon is shown through walls.
setplayer( Entity entity, [ Boolean clears] )
// Sets to which player this HUD is shown and possibly clears the HUD to the previous player(s) it was shown. A NULL/NIL entity means the HUD will be shown to all players
// Note : you will need to call in HUD functions again as it won't refresh to the player(s)
setshader( String shader, Integer width, Integer height )
// Sets the HUD shader
settext( String text )
// Sets the HUD text
settimer( Float time, [ Float fade_at_time] )
// Sets a timer to count down an optionally fade at the specified time
settimerup( Float time, [ Float fade_at_time] )
// Sets a timer to count up an optionally fade at the specified time
setvirtualsize( Boolean virtual )
// Sets if the HUD should use virtual screen resolution for positioning and size
x
// Gets the HUD horizontal position
x( Integer x )
// Sets the HUD horizontal position
y( Integer y )
// Sets the HUD vertical position
y
// Gets the HUD vertical position
////////////////////
// Listener ()
////////////////////
endon( String name )
// Ends the function when the specified event is triggered.
inheritsfrom( String class )
// Returns 1 if the class inherits from the specified class. 0 otherwise.
isinheritedby( String class )
// Returns 1 if the class is inherited by the specified class. 0 otherwise.
notify( String name )
// Triggers an event. An undefined event will be automatically created by calling waittill or endon.
waittill_any( String name1, [ String ...] )
// Wait until any event of type name
waittill_any_timeout( Float timeout_time, String name1, [ String ...] )
// Wait until any event of type name with a timeout time
waittill_timeout( Float timeout_time, String name )
// Wait until event of type name with a timeout time
////////////////////
// NavMaster ()
////////////////////
nav_build
// Build navigation path
nav_create( [ String type] )
// Create a new node at the player's origin
nav_node_remove
// Delete the selected node
nav_node_set_target( [ String target] )
// Set the selected node target
nav_node_set_targetname( [ String targetname] )
// Set the selected node target name
nav_node_set_type( String type1, [ String type2] , [ String ...] )
// Set the selected node type. Type can be one of the following values:
// - corner_left
// - corner_right
// - duck
// - sniper
// - concealment
// - cover
// - crate
////////////////////
// Player (player)
////////////////////
dive( Float height, [ Float airborne_duration] )
// Makes the player dive into prone position.
freezecontrols( Boolean freeze_state )
// Blocks or unblocks control input from this player.
getlegsstate
// Gets the player's current legs state name
gettorsostate
// Gets the player's current torso state name
hideent( Entity entity )
// Hides the specified entity to the player.
killaxis( Float radius )
// Kills all of the axis that are in the passed radius, or all of them if radius is 0.
killhandler( String label )
// Replace the player's killed event by a new scripted handler. None or an empty string will revert to the default killed event handler.
moveSpeedScale
// Gets the player's speed multiplier.
nationalityprefix
// get the three or five letter prefix that denotes the player's nationality
objective( Integer num_completed, Integer out_of )
//Sets the number of objectives completed and the total number of objectives
setanimspeed( Float speed )
// set the player's animation speed multiplier (default 1.0).
setteam( String team_name )
// sets the player's team without respawning.
// Available team names are 'none', 'spectator', 'freeforall', 'axis' and 'allies'.
showent( Entity entity )
// Shows the specified entity to the player.
state
// Dumps the player's state to the console.
statefile( [ String statefile] )
// Sets the player's current state file (setting NIL, NULL or an empty string will revert to the global statefile).
statefile
// Gets the player's current state file.
stoplocalsound( String soundName, [ Float time] )
// Stops the specified sound.
playlocalsound( String soundName, [ Boolean loop] , [ Float time] )
// Plays a local sound to the player. The sound must be aliased globally. Requires sv_reborn to be set for stereo sounds.
////////////////////
// PlayerStart (info_player_start)
////////////////////
deletespawn
// delete this spawnpoint when spawning from this spawnpoint
keepspawn
// keep this spawnpoint when spawning from this spawnpoint
////////////////////
// ScriptDoor (script_door)
////////////////////
closethread( String closethread )
// Set the thread to run when the door is closed (required).
initthread( String initthread )
// Set the thread to run when the door is initialized (optional).
openthread( String openthread )
// Set the thread to run when the door is opened (required).
////////////////////
// ScriptModel (script_model)
////////////////////
moving_from_anim
// The script model is moving based on an animation
////////////////////
// ScriptThread ()
////////////////////
event_subscribe( String eventname, String script )
//Subscribe to the specified event. The specified script will be executed when the event gets triggered.
event_unsubscribe( String eventname, String script )
// Unsubscribe the script from the specified event.
flag_clear( String name )
// Clears and deletes a flag.
flag_init( String name )
// Initializes a flag so it can be set. Flags MUST be initialized before they can be used for the first time.
flag_set( String name )
// Sets a flag which alerts all flag_wait()'s and changes are reflected in flag() checks thereafter.
flag_wait( String name )
// Pauses execution flow until a flag has been set.
fread( Entity player, Integer index, Integer virtual )
// Reads binary buffer from file
fwrite( Entity player, Integer index, Integer virtual )
// Writes binary buffer to file
fs_open_append( String fileName )
// Opens the specified file for appending. Returns an FSFile object.
fs_open_read( String fileName )
// Opens the specified file for reading. Returns an FSFile object.
fs_open_write( String fileName )
// Opens the specified file for writing. Returns an FSFile object.
fs_read_content( String fileName )
// Reads and returns the whole file content.
fs_write_content( String fileName, [ String content] )
// Write the specified content to a file (replaces the existing file).
getareaentities( Vector origin, Vector mins, Vector maxs )
// Get all entities around the origin
getarraykeys( String array )
// Retrieves a full list containing the name of arrays
getarrayvalues( String array )
// Retrieves the full list of an array that was set-up with name, such as local.array[ "name" ] and return their values
getentarray( String name, String key )
// Gets an array of entities that have the given key, name pair (case sensitive)
huddraw_3d( Integer index, Vector vector_or_offset, Integer always_show, Integer depth, [ Entity entity] )
// Sets this huddraw element to be a 3D world icon and can specify if this icon is always shown on-screen even if the player isn't looking at.
// Uses xy pos from huddraw_rect.
// If entity is specified, the vector will be an offset relative to the entity.
// depth specify if the icon is shown through walls.
ihuddraw_3d( Entity player, Integer index, Vector vector_or_offset, Integer always_show, Integer depth, [ Entity entity] )
// Sets this huddraw element to be a 3D world icon for individual player and can specify if this icon is always shown on-screen even if the player isn't looking at.
// Uses xy pos from huddraw_rect.
// If entity is specified, the vector will be an offset relative to the entity.
// depth specify if the icon is shown through walls.
huddraw_timer( Integer index, Float duration, Float fade_out_time )
// Sets a timer to be displayed and fade within the given time in seconds. Clears the string value and the shader value of huddraw element.
ihuddraw_timer( Entity player, Integer index, Float duration, Float fade_out_time )
// Sets a timer to be displayed and fade within the given time in seconds for given player. Clears the string value and the shader value of huddraw element.
info_valueforkey( String info, String key )
// Retrieves the value of the specified key (from userinfo).
isBot( Entity entity )
// Returns 1 if the client is a bot, 0 otherwise. Will return 0 if the entity is not a client.
isdefined( String object )
// Checks whether this entity/variable is defined
isonground( Entity entity )
// Returns 1 if the entity is on ground. 0 otherwise
isoutofbounds( Entity entity )
// Returns 1 if the entity is out of bounds. 0 otherwise
newhud( [ Entity player] )
// Create a new HUD element. Optionally for a particular client
preg_match( String pattern, String subject )
// Searches subject for a match to the regular expression given in pattern.
registercmd( String name, String label )
// Registers a command.
removearchivedclass( String class, [ Integer except_entity_number] )
// Removes all of the simple archived entities in the specified class.
restoresound( Float time, [ Float max_vol] , [ Entity player] )
// Fades the sound in over the given time, optionally to one single player.
// max_vol being a 0-1 fraction is the maximum volume.
strncpy( Integer bytes, String source )
// Returns the copied string with the specified bytes
team_getscore( String team )
// Get a team's current score.
team_setscore( String team, Integer score, [ Integer bAdd] )
// Change/Add score to a team.
visiongetnaked
// Gets players' global current naked-eye vision.
visionsetnaked( String vision_name, [ Float transition_time] )
// Sets players' naked-eye vision. Optionally give a transition time from the current vision. If vision_name is an empty string, it will be set to the current map's name.
earthquake2( Float duration, Float magnitude, Boolean no_rampup, Boolean no_rampdown, [ Vector location] , [ Float radius] )
// Create a smooth realistic earthquake. Requires sv_reborn to be set.
isarray( String object )
// Checks whether this variable is an array
////////////////////
// Sentient ()
////////////////////
getnewactiveweap
// gets new active weapon
newActiveWeapon
// gets new active weapon
newActiveWeaponHand
// gets the hand of the new active weapon
////////////////////
// UseObject (func_useobject)
////////////////////
move_thread( String label )
// Sets which move thread to use when this UseObject has finshed looping.
reset_thread( String label )
// Sets which thread to call when resetting.
stop_thread( String label )
// Sets which stop thread to use when this UseObject is finished.
////////////////////
// Weapon ()
////////////////////
putaway
// Returns whether or not the given weapon is being put away
doneanimating
// Signals the end of animation
////////////////////
// World (worldspawn)
////////////////////
get_render_terrain
// Get the render terrain switch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment