DarkRP.GetDoorCost

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 door. This hook gets the money amount.
Syntax
GAMEMODE:GetDoorCost(Player ply, Entity ent)
Returnscost (number): The cost of the door.

Arguments

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

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

    Examples

    DescriptionMakes doors free for admins
    Code
    hook.Add( "GetDoorCost", "FreeAdminDoors", function( objPl )
    	return objPl:IsAdmin( ) and 0 or GetConVarNumber( "doorcost" );
    end );
    OutputAll admins will get free doors