DarkRP.CanChangeRPName

From DarkRP
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[edit]

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[edit]

    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.