Garry's Mod Wiki

Revision Difference

SANDBOX:CanDrive#512819

<function name="CanDrive" parent="SANDBOX" type="hook">⤶ <ishook>yes</ishook>⤶ <description>Called when a player attempts to drive a prop via Prop Drive</description>⤶ <realm>Shared</realm>⤶ <predicted>Yes</predicted>⤶ <args>⤶ <arg name="ply" type="Player">The player who attempted to use Prop Drive.</arg>⤶ <arg name="ent" type="Entity">The entity the player is attempting to drive</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="boolean">Return true to allow driving, false to disallow</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Stops nonadmins from using Prop Drive</description>⤶ <code>⤶ function GM:CanDrive( ply, ent )⤶ if !ply:IsAdmin() then return false end⤶ end⤶ </code>⤶ ⤶ </example>