SANDBOX:CanDrive

From Garry's Mod
Jump to: navigation, search
 SANDBOX:CanDrive( )

Contents

Description

Called when a player attempts to drive a prop via Prop Drive

NOTE This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.

Arguments

Player ply

The player who attempted to use Prop Drive.

Arguments

Entity ent

The entity the player is attempting to drive

Returns

boolean

Return true to allow driving, false to disallow

Examples

Example

Stops nonadmins from using Prop Drive

function GM:CanDrive( ply, ent )
	if !ply:IsAdmin() then return false end
end


Personal tools
Navigation