Garry's Mod Wiki

SANDBOX:CanDrive

boolean SANDBOX:CanDrive( Player ply, Entity ent )
This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.

Description

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

Arguments

1 Player ply
The player who attempted to use Prop Drive.
2 Entity ent
The entity the player is attempting to drive

Returns

1 boolean
Return true to allow driving, false to disallow

Example

Stops nonadmins from using Prop Drive

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

Page Links


Special Pages


Wikis

?

Render Time: 40ms

DB GetPage 4
Generate Html 11
SaveChanges (1) 10
Render Body 0
Render Sidebar 11