Gamemode.PlayerSpawnSENT

From GMod Wiki

Revision as of 11:53, 13 October 2010 by Comet1337 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NamePlayerSpawnSENT
SyntaxGM:PlayerSpawnSENT( Player , String classname )
DescriptionCalled when a player wants to spawn a SENT
ReturnsBoolean
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSpawnSENT]Gamemode.PlayerSpawnSENT [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionBlocks the spawning of the bouncy ball sent_ball.
Used onNewerServer.png
Code
function NoBouncyBalls( ply, sent_type )
 
    if sent_type == "sent_ball" then // checks if it's a bouncy ball
 
	ply:PrintMessage(HUD_PRINTCENTER,"You're not allowed to spawn Bouncy Balls!") // Prints it to the player's chat
 
	return false // We return false to block the spawning, it's true by default.
    end
 
end
 
hook.Add( "PlayerSpawnSENT", "Nobouncyballshere", NoBouncyBalls );
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox