DarkRP.PlayerBoughtVehicle

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 has bought a vehicle
Syntax
GAMEMODE:PlayerBoughtVehicle(Player ply, Entity ent, number amount)
Returnsnil

Arguments

  • ply (Player)
  • The player who bought it

  • ent (Entity)
  • The vehicle that was bought

  • amount (number)
  • The cost of the vehicle

    Examples

    Descriptionlogs purchases
    Code
    hook.Add( "PlayerBoughtVehicle", "example", function(ply, ent, cost)
    	ply:ChatPrint(ply:Nick() .. " bought a " .. ent:GetClass() .. " $" .. cost)
    end)
    OutputA print message