SANDBOX:CanProperty

From Garry's Mod
Jump to: navigation, search
 SANDBOX:CanProperty( )

Contents

Description

Controls if a property can be used or not.

NOTE This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.

Arguments

Player ply

Player, that tried to use the property

Arguments

string property

Class of the property that is tried to use, for example - bonemanipulate

Arguments

Entity ent

The entity, on which property is tried to be used on

Returns

boolean

Return false to disallow using that property

Examples

Example

Stops non-admins from using the remover property.

hook.Add( "CanProperty", "block_remover_property", function( ply, property, ent )
	if ( !ply:IsAdmin() && property == "remover" ) then return false end
end )


Personal tools
Navigation