Gamemode.PlayerUse

From GMod Wiki

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