Garry's Mod Wiki

Garry's Mod Wiki

  boolean GM:CanProperty( Player ply, string property, Entity ent )
This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.

Description

Controls if a property can be used or not.

Arguments

1 Player ply
Player, that tried to use the property
2 string property
Class of the property that is tried to use, for example - bonemanipulate
This is not guaranteed to be the internal property name used in properties.Add!
3 Entity ent
The entity, on which property is tried to be used on

Returns

1 boolean
Return false to disallow using that property

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 )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...