Garry's Mod Wiki

GM:OnPhysgunFreeze

boolean GM:OnPhysgunFreeze( Entity weapon, PhysObj physobj, Entity ent, Player ply )

Description

Called when a player freezes an entity with the physgun.

This is not called for players or NPCs being held with the physgun.

Issue Tracker: 723

Arguments

1 Entity weapon
The weapon that was used to freeze the entity.
2 PhysObj physobj
Physics object of the entity.
3 Entity ent
The target entity.
4 Player ply
The player who tried to freeze the entity.

Returns

1 boolean
Allows you to override whether the player can freeze the entity

Example

Only allows admins to freeze things.

hook.Add( "OnPhysgunFreeze", "PhysFreeze", function( weapon, phys, ent, ply ) if not ply:IsAdmin() then return false end end )

Page Links


Special Pages


Wikis

?

Render Time: 95ms

DB GetPage 52
Generate Html 17
SaveChanges (1) 16
Render Body 0
Render Sidebar 7