# CitizenData

## SaveCitizenData

Add this to your script where either the Citizen are created  or maybe the Citizen gets his ID-Card.. (Server sided)

```lua
--just an example
local _source = source

local my_player_id = "char1:sdgtEt4teew412"
local my_firstname= "Daburner"
local my_lastname = "Germany"
local my_alias= "DaBurnerGermany"
local my_sex = "m" -- only m for male and f for female are valid
local my_phone = "1113335544"
local my_size = "195"
local my_birth = "2026-12-31" --format YYYY-MM-DD, otherwise wont be saved
local my_eyecolor = "green"
local my_haircolor = "brown"
local my_weight = "80"

exports["myMDT_core"]:SaveCitizenData(_source, {
    player_id = my_player_id,
    firstname= my_firstname,
    lastname = my_lastname,
    alias = my_alias,
    sex = my_sex ,
    phone = my_phone ,
    size = my_size ,
    birth = my_birth ,
    eyecolor = my_eyecolor ,
    haircolor = my_haircolor ,
    weight = my_weight ,
})
```

{% hint style="info" %}
you can also leave away some data, they will be filled by default-values if not given.\
Mandatory Data:

* player\_id
* either firstname or lastname (at least one of them)

*If player\_id is given again the existing data will be overwritten*
{% endhint %}

<br>
