ENTITY/CanProperty

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Documented)
 
 
Line 1: Line 1:
 
{{Hook
 
{{Hook
|Name=CanProperty
 
|Parent=ENTITY
 
 
|Description=Controls if a property can be used on this entity or not.
 
|Description=Controls if a property can be used on this entity or not.
  
 
This hook will only work in Sandbox derived gamemodes that do not have {{HookFunction|SANDBOX|CanProperty}} overridden.
 
This hook will only work in Sandbox derived gamemodes that do not have {{HookFunction|SANDBOX|CanProperty}} overridden.
 +
 +
{{Note|This hook will work on ALL entities, not just the scripted ones (SENTs)}}
 
|Realm=Shared
 
|Realm=Shared
|Predicted=Yes
+
|Predicted=No
 
|File=gamemodes/sandbox/gamemode/shared.lua
 
|File=gamemodes/sandbox/gamemode/shared.lua
 
|Line=239-L241
 
|Line=239-L241
Line 23: Line 23:
 
|type=boolean
 
|type=boolean
 
|desc=Return false to disallow using that property, return true to allow.
 
|desc=Return false to disallow using that property, return true to allow.
 +
 +
You must return a value. Not returning anything can cause unexpected results.
 
}}
 
}}

Latest revision as of 13:49, 10 September 2019

 ENTITY:CanProperty( )

Contents

Description

Controls if a property can be used on this entity or not.

This hook will only work in Sandbox derived gamemodes that do not have SANDBOX:CanProperty overridden.

NOTE

This hook will work on ALL entities, not just the scripted ones (SENTs)

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

Returns

boolean

Return false to disallow using that property, return true to allow.

You must return a value. Not returning anything can cause unexpected results.
Personal tools
Navigation