DarkRP.CanChangeRPName

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 change their RP name.
Syntax
GAMEMODE:CanChangeRPName(Player ply, string name)
Returnscan_change (boolean): whether the player can change their name to the name given.

Arguments

  • ply (Player)
  • The player who is trying to change their name

  • name (string)
  • The name

    Examples

    DescriptionMakes sure no one calls themselves Hitler.
    Code
    hook.Add( "CanChangeRPName", "nonazis", function(ply, name)
    	if string.find(name:lower(), "hitler") then return false end
    end)
    Outputpeople can't name themselves hitler.