Garry's Mod Wiki

Revision Difference

GM:CanExitVehicle#553118

<function name="CanExitVehicle" parent="GM" type="hook"> <ishook>yes</ishook>⤶ <description>Determines if the player can exit the vehicle.</description> <realm>Server</realm> <predicted>No</predicted>⤶ <args> <arg name="veh" type="Vehicle">The vehicle entity</arg> <arg name="ply" type="Player">The player</arg> </args> <rets> <ret name="" type="boolean">True if the player can exit the vehicle.</ret> </rets> </function> <example> <description>Only lets player exit vehicle if it is not in motion.</description> <code> hook.Add( "CanExitVehicle", "PlayerMotion", function( veh, ply ) return ( veh:GetVelocity() == Vector( 0, 0, 0 ) ) end ) </code> </example>