Gamemode.PlayerUse

From GMod Wiki

Revision as of 15:20, 17 February 2011 by BlackVoid (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NamePlayerUse
SyntaxGM:PlayerUse( Player ply, Entity Entity )
DescriptionTriggered when a player uses something.
ReturnsReturn false to stop people from using the object.
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerUse]Gamemode.PlayerUse [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrint information about the event to the console.
Used onNewerServer.png
Code
function PrintUseInformation( ply, entity )
	Msg( "Player " .. ply:Nick() .. " used " .. entity:GetClass() .. 
" at " ..  tostring( entity:GetPos() ) .. "\n" );
end
 
hook.Add( "PlayerUse", "PrintUseInformation", PrintUseInformation )
OutputPlayer Merlzoth used prop_vehicle_airboat at 1275.8926 -307.7738 -140.5134


Additional Notes


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox