# Faction

```lua
Wosa.Character.Faction.Add(
    user, --[[ int ]]
    job, --[[ string ]]
    rank, --[[ string ]]
    subRank --[[ string ]]
)

--[[

Parameters:
-> user: The PlayerID of the user.
-> job: The "job" label so to say, for pd it is "Law Enforcement" etc.
-> rank: The current "rank" in the faction.
-> subRank: Can leave it as anything, can be used for anything "extra" such as callsign etc.

Description:
Add a player to a faction manually. This just straight accesses the database and uses a
"insert" method to add it manually to the database. As this is not synced with the server or
client at all the player will most likley have to restart their game for the rank to be active.

]]
```

```lua
Wosa.Character.Faction.Remove(
    license, --[[ string ]]
    characterTable, --[[ string ]]
    job --[[ string ]]
)

--[[

Parameters:
-> license: The r* license of the user.
-> characterTable: Which "character table" for the user.
-> job: The "job" entry you want to remove.

Description:
This function can be used to remove a player from a faction, As this function utilizes
license + character table means that you can remove players from a faction when they are
offline as well.

]]
```

```lua
Wosa.Character.Faction.Update(
    license, --[[ string ]]
    characterTable, --[[ string ]]
    job, --[[ string ]]
    rank, --[[ string ]]
    subRank --[[ string ]]
)

--[[

Parameters:
-> license: The r* license of the user.
-> characterTable: Which "character table" that you want to update.
-> job: The "job" entry you want to update.
-> rank: The rank you want to update.
-> subRank: The "subRank" section you want to update to.

Description:
Used if you want to update a specific row in the database for a faction, You can
update users rows when they are offline as well.

]]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wosa.gitbook.io/working-with-wosa/functions/server/character/faction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
