DarkRP.GetVehicleCost

From Official DarkRP Wiki
Jump to: navigation, search
This page refers to DarkRP 2.4.3. This information may be incorrect as of later versions.
Check here for a up-to-date list of hooks.

Syntax

DescriptionCalled when a player attempts to buy a vehicle. This hook gets the money amount.
Syntax
GAMEMODE:GetVehicleCost(Player ply, Entity ent)
Returnscost (number): The cost of the vehicle.

Arguments

  • ply (Player)
  • The player who is attempting to buy the vehicle.

  • ent (Entity)
  • The Vehicle that is being bought

    Examples

    DescriptionMakes Vehicles free for admins
    Code
    hook.Add( "GetVehicleCost", "FreeAdminVehicles", function( objPl )
    	if objPl:IsAdmin( ) then return 0 end
    end );
    OutputAll admins will get free Vehicles