# identix\_pl\_name\_set

`identix_pl_name_set(`[**ᵖˡᵃʸᵉʳ**](https://wiki.facepunch.com/gmod/player) targ, [**ᵗᵉˣᵗ**](https://wiki.facepunch.com/gmod/string) fname, [**ᵗᵉˣᵗ**](https://wiki.facepunch.com/gmod/string) lname`)`

## ▸ Parameters

&#x20;   ***`ply`***       *`targ`*\
&#x20;                      player object

&#x20;   ***`str`***       *`fname`*\
&#x20;                      first name for player

&#x20;   ***`str`***       *`lname`*\
&#x20;                      last name for player

## ▸ Description

&#x20;      Sets new name for player

## ▸ Notes

&#x20;      Runs in the following order:\
&#x20;            **🢖** Updates database\
&#x20;            **🢖** **DarkRP.storeRPName**\
&#x20;            **🢖** pmeta **setalias**\
&#x20;            **🢖** **set\_firstname,** **set\_lastname**\
&#x20;            **🢖** **base:broadcast( )**

## ▸ Example

{% tabs %}
{% tab title="Example 1" %}

```lua
local function your_hook( pl, fname, lname )

    // your custom hook function here

end
hook.Add( 'identix_pl_name_set', 'your_hook_id', your_hook )
```

{% endtab %}

{% tab title="Example 2" %}

```lua
hook.Add( 'identix_pl_name_set', 'your_hook_id', function( pl. fname, lname )

    // your custom hook function here

end )
```

{% endtab %}

{% tab title="Example 3" %}

```lua
local function your_hook( pl, fname, lname )

    // your custom hook function here

end
rhook.new.rlib( 'identix_pl_name_set', 'your_hook_id', your_hook )
```

{% endtab %}
{% endtabs %}
