GM/PlayerSpray

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m
Line 1: Line 1:
 
{{Hook
 
{{Hook
|Name=PlayerSpray
+
|Description=Determines if the player can spray using the "impulse 201" console command.
|Parent=GM
+
|Description=Called whenever a player sprayed his logo to allow or disallow spraying.
+
 
|Realm=Server
 
|Realm=Server
 
|Predicted=No
 
|Predicted=No
 +
|Name=PlayerSpray
 +
|Parent=GM
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 13: Line 13:
 
{{Ret
 
{{Ret
 
|type=boolean
 
|type=boolean
|desc=Return false to allow spraying, return true to prevent the spray.
+
|desc=Return false to allow spraying, return true to prevent spraying.
 
}}
 
}}
 
{{Example
 
{{Example
|Description=Makes so that only Admins can spray
+
|Description=Makes so that only Admins can spray.
 
|Code=hook.Add( "PlayerSpray", "DisablePlayerSpray", function( ply )
 
|Code=hook.Add( "PlayerSpray", "DisablePlayerSpray", function( ply )
 
return !ply:IsAdmin()
 
return !ply:IsAdmin()
 
end )
 
end )
 
}}
 
}}

Revision as of 19:35, 20 February 2016

 GM:PlayerSpray( )

Contents

Description

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

Arguments

Player sprayer

The player who sprayed.

Returns

boolean

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

Examples

Example

Makes so that only Admins can spray.

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


Personal tools
Navigation