Hooks/Shared/addLaw

From DarkRP
Hook
Hook name addLaw(number index, string law, Player player)
Description:
Called when a law is added.
Returns: nil
Realm:
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=Hooks/Shared/addLaw]addLaw hook[/url][/b]

Parameters[edit]

  1. index (number)
  2. Index of the law

  3. law (string)
  4. Law string

  5. player (Player)
  6. The player who added the law

Return values[edit]

This hook does not accept return values. You can still return a value to override the default implementation of this hook.

Example Code[edit]

______________________________

hook.Add("addLaw", "headdalaw", function(index, law, player)
	print(player .. " " .. "added a law! \n" .. law)
end)

______________________________

Result: Quang added a law! RDM is not allowed.