From Official DarkRP Wiki
Jump to navigation Jump to search
Hook name playerBuyVehicle(Player ply, Entity ent)
When a player purchases a vehicle.
Returns: boolean allowed, string reason, boolean surpress
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=Hooks/Server/playerBuyVehicle]playerBuyVehicle hook[/url][/b]


  1. ply (Player)
  2. The player who is to buy the vehicle.

  3. ent (Entity)
  4. The vehicle.

Return values

  1. allowed (boolean)
  2. Whether the player is allowed to buy the vehicle.

  3. reason (string)
  4. The reason why a player is not allowed to buy the vehicle, if applicable.

  5. surpress (boolean)
  6. Whether to show the reason in a notification to the player, return true here to surpress the message.