DarkRP.CanChangeRPName
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]
Description | Called when a player attempts to change their RP name. |
---|---|
Syntax |
GAMEMODE:CanChangeRPName(Player ply, string name)
|
Returns | can_change (boolean): whether the player can change their name to the name given. |
Arguments
The player who is trying to change their name
The name
Examples[edit]
Description | Makes 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)
|
Output | people can't name themselves hitler. |