HolyLib Wiki

gameevent

gameevent

This library extents gmod's original gameevent library.

Methods

Adds the given player to listen to the given event. Was removed/disabled since it was broken.
gameevent.BlockCreation( string gameevent, boolean blockCreation = false )
Blocks/Unblocks the creation of the specified gameevent.
IGameEvent gameevent.Create( string gameevent, boolean force = false )
Creates the given gameevent and returns it.
Duplicates the given event
Fires the given gameevent only for the specific player
boolean gameevent.FireEvent( IGameEvent event, boolean dontBroadcast = false )
Fires the given gameevent and networks it to all players.
table gameevent.GetClientListeners( Player ply = nil )
Returns a table containing all gameevents the specific client is listening to.
If not given a valid player, it will return a table containing all players as a key and all gameevents their listening to as the value.
number gameevent.GetListeners( string eventName = nil )
Returns the number of Listeners a specific gameevent has.
If not given a eventName, it will return a table containing all events and listener numbers.
gameevent.Listen( string name )
Registers a listener for the given game event, so it can be caught using hook.Add with the event's name.
This function only exists inside HolyLib's separate holylua interface, since that interface doesn't have the normal gamemode hook system set up.
Inside the normal gamemode state, this will be GMod's original gameevent.Listen function.
boolean gameevent.RemoveClientListener( ClientArg(CBaseClient or Player or number) ply, string gameevent = nil )
Removes the player from listening to the given gameevent.
If the given gameevent is nil it will remove the player from all gameevents.
boolean gameevent.RemoveListener( string gameevent = nil )
Removes the Lua gameevent listener from the specific gameevent.