Garry's Mod Wiki

GM:PlayerSpray

  boolean GM:PlayerSpray( Player sprayer )

Description

Determines if the player can spray using the impulse 201 console command.

Arguments

1 Player sprayer
The player.

Returns

1 boolean
Return false to allow spraying, return true to prevent spraying.

Example

Makes so that only Admins can spray.

hook.Add( "PlayerSpray", "DisablePlayerSpray", function( ply ) return not ply:IsAdmin() end )