gamemode.Call
From GMod Wiki
Revision as of 05:45, 30 January 2010 by Cyber cam34 (Talk | contribs)
Function | |
Syntax |
gamemode.Call( String name, args ) Where is this used? |
Description: | |
Called by the engine to call a hook within the loaded gamemode. | |
Returns: | The result of the hook function. |
Part of Library: | gamemode |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Gamemode.Call]Gamemode.Call [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Call the loadout gamemode hook. |
---|---|
Used on | |
Code | function Loadout(Player) gamemode.Call("PlayerLoadout", Player) end |
Output | N/A |
Additional Notes
- The supplied event 'name' must exist as a GAMEMODE function. Otherwise, every hook created with hook.Add will not be called. IE: gamemode.Call( "PlayerLoadout" ) must have a function GAMEMODE:PlayerLoadout().
- This is similiar to hook.Call( name, game.GetGamemode(), ... ) except hook.Call will call hooks created with hook.Add even if there is no GAMEMODE function with the event name
- This functions returns the result of the hook function.