Garry's Mod Wiki

Garry's Mod Wiki

  boolean GM:PreventScreenClicks()

Description

This will prevent in_attack from sending to server when player tries to shoot from C menu.

Returns

1 boolean
Return true to prevent screen clicks.

Example

Disables usage of the World Clicker feature, where a player can hold c to shoot at their cursor instead of their crosshair.

hook.Add( "PreventScreenClicks", "DisableWorldClicker", function() local pnl = vgui.GetHoveredPanel() if ( IsValid( pnl ) ) then if ( pnl:IsWorldClicker() ) then return true end while ( IsValid( pnl:GetParent() ) ) do pnl = pnl:GetParent() if ( pnl:IsWorldClicker() ) then return true end end else -- For when the cursor is outside of the game's window, there can be potential edge cases here return true 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 twice a day. Edits and history are not available.

Last Parsed: Loading...