<!-- fivemad.com, Markdown source of https://fivemad.com/docs/tools/relationship-editor -->
> Source: https://fivemad.com/docs/tools/relationship-editor
> Section: Tools
> Tags: relationships, relationships.dat, peds, gangs, state bags, SetRelationshipBetweenGroups, AddRelationshipGroup
> Tool: https://fivemad.com/tools/relationship-editor
> Last updated: 2026-09-25
> Site map for assistants: https://fivemad.com/llms.txt

# Ped Relationship Editor

Set how every group of peds in GTA V feels about every other one on a matrix, then download a FiveM resource that applies it on every client and keeps it in sync.

The Ped Relationship Editor is a matrix of every relationship group the game defines. You set who likes and who hates whom, add your own groups, and take away a resource that applies the whole set on every client. Everything runs in your browser.

## Quick start

1. Pick a value under **Click a cell to set**. Hate is picked for you, because that is what most people came for.
2. Click cells in the matrix. A row is how that group feels about the column.
3. Use the filter box to cut the matrix down to the groups you care about, for example `GANG` or `COP`.
4. Open **Resource** at the bottom and press **Download resource**.
5. Unzip it into your resources folder, add `ensure fivemad_relationships` to your server.cfg and restart.

<kbd>Ctrl</kbd> + <kbd>Z</kbd> undoes, <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Z</kbd> redoes. **Share** copies a link that carries the whole set, so you can send it to someone or keep it in a note.

## Reading the matrix

The cell at row `COP`, column `CREW` is how cops feel about your crew. The cell at row `CREW`, column `COP` is a different cell and can hold a different value.

> [!IMPORTANT]
> A relationship only goes one way. Setting `A hates B` does not make `B hate A`. That is a second cell, and in code a second call.

None is drawn as nothing at all, so the only coloured cells are the ones where somebody feels something. Green is friendly, amber and orange are wary, red is hostile. A cell you changed gets a white outline, so you can always tell your work from the game's.

Right click a cell to put the game's own value back.

**Set both directions at once** in the side panel is an editing convenience: with it on, clicking a cell fills the mirror cell too. Turn it off when you want a one sided relationship, like an animal that attacks the player while the player has no opinion about it.

## The acquaintance values

| Value | Name | What it does | In relationships.dat |
| --- | --- | --- | --- |
| 0 | Respect | The friendliest value. Reads as an ally they will not turn on. | `Respect` |
| 1 | Like | Friendly. The value the game's own scripts reach for most. | `Like` |
| 2 | Ignore | No reaction either way, set on purpose rather than left blank. | No keyword. Runtime only. |
| 3 | Dislike | Wary. Reacts badly without attacking on sight. | `Dislike` |
| 4 | Wanted | Treated as someone to go after. Not in the picker. | No keyword. |
| 5 | Hate | Attacks on sight. | `Hate` |
| 6 | Dead | Treated as already dead. Not in the picker. | No keyword. |
| 255 | None | No relationship set. This is what every pair starts as. | The default, written by leaving the line out. |

> [!IMPORTANT]
> The value list on docs.fivem.net and NativeDB is wrong, so do not check this table against it.
> That list (0 Companion, 1 Respect, 2 Like, 3 Neutral, 4 Dislike, 5 Hate, 255 Pedestrians) is a
> community comment, credited to "Inco" on the `CLEAR_RELATIONSHIP_BETWEEN_GROUPS` copy, and it is
> shifted one place against the engine. Only Hate = 5 agrees. The table above is Rockstar's own
> `RELATIONSHIP_TYPE`, whose header says it "must match the eAcquaintanceType enumerated type in
> PedType.h in the games Peds directory". GTA5.exe backs it up: right after the hardcoded
> `common:/DATA/Relationships.DAT` string it carries exactly four keyword strings, `Hate`,
> `Dislike`, `Like` and `Respect`, and the words Companion, Neutral and Pedestrians, which are the
> three names unique to the FiveM list, do not appear anywhere in the executable.

The picker offers Respect, Like, Ignore, Dislike, Hate and None. Wanted (4) and Dead (6) exist in the enum but are left out of it: across 4,141 relationship calls in the game's own scripts, 4 is set only four times and 6 is never set at all. If you need one, write the number yourself in the runtime code.

The "what it does" column is our own reading of the name. Nobody can start GTA V in a browser, so the names and the numbers are sourced and that column is not.

## Focusing a group

Click any group name, in the matrix header or in the changes list, to focus it. The side panel then shows:

- Its hash, both as hex and as the signed integer, ready to copy.
- **Set this group's view of every other group**, which fills the whole row in one click.
- **Set every other group's view of this one**, which fills the whole column.
- Everything it feels, and everything that feels about it, as two short lists.

Those two row and column buttons only touch the groups the filter is currently showing. Filter to `AMBIENT_GANG` first and "set every other group to Hate" means every ambient gang, not the whole game.

## Your own groups

Type a name and press **Add**. Names are forced to the shape the game uses: capitals, digits and underscores. The hash is joaat of the lower case name, the same rule the game uses for its own, which is why `GetHashKey('MY_GANG')` and `AddRelationshipGroup('MY_GANG')` agree.

Removing a group also removes every relationship that touched it.

**Put the player ped here** sets which group the player's own ped joins. The generated resource re-applies it after a respawn, because a new ped handle comes back in its default group.

## Presets

| Preset | What it does |
| --- | --- |
| Peaceful city | Everything that hates or dislikes the player goes back to None. |
| Everything hates you | Every group the game ships attacks the player on sight. |
| Gang war | Every ambient gang hates every other ambient gang and still likes its own. |
| Your own crew | Adds a `CREW` group that respects the player, hates the cops and is hated back, and puts the player ped in `PLAYER`. |

A preset is a starting point, not a reset. It adds to what you already have. **Reset** clears everything.

## The outputs

### Resource

`fivemad_relationships` is the one to use on a server. It holds five files:

```text
fivemad_relationships/
  fxmanifest.lua
  config.lua
  server.lua
  client.lua
  README.md
```

The server publishes the set once to global state. Every client reads it and applies it, including a player who joins an hour later. Change it from another resource and every client swaps over:

```lua title="somewhere else on your server"
exports['fivemad_relationships']:setRelationships({
  groups = { 'MY_GANG' },
  player = '',
  rel = { { 5, 'MY_GANG', 'COP', 255 } },
})
```

Every row is `{ acquaintance, from group, to group, what the game shipped }`. That fourth number is what makes a change reversible: when the set changes or the resource stops, each client puts the game's own value back instead of leaving your old one behind. 255 means the game shipped nothing for that pair, so undoing it is a `ClearRelationshipBetweenGroups` rather than a set.

The client script creates your own groups with `AddRelationshipGroup`, which returns `ok, groupHash`, and uses the hash it hands back. `GetHashKey` on the same name gives the same number, because both are joaat of the lower case name, but the returned hash is the one the game itself is using and it is only the fallback here.

> [!NOTE]
> Relationship groups live in the game for the rest of the session. Nothing takes one back on its own, which is why deleting a line from a script and restarting it does not undo anything until the player reconnects. The generated client script undoes its own work on `onResourceStop`.

With **Per ped groups from a state bag** on, the client also watches each ped's `relgroup` entity state, so any server script can put one ped in a group:

```lua title="server"
Entity(ped).state:set('relgroup', 'MY_GANG', true)
```

### Runtime code

The natives on their own, for pasting into a resource you already have. Switch between Lua, JavaScript, TypeScript and C# on the block. This is client side code: the relationship matrix is client side game state and the game never networks it, so every client has to set it for itself.

Which group a ped is *in* is a different thing, and that one is networked, so `SetPedRelationshipGroupHash` on the owner of a ped carries to everyone else. Only the matrix itself has to be applied per client.

There is a second block that undoes the first one. Keep it. It is the part people forget.

### relationships.dat

The game file, in the format the game ships, with your changes folded into the game's own set.

> [!WARNING]
> FiveM cannot load this out of a resource. There is no `data_file` type for ped relationships in the FiveM data files list, and a `stream/` folder takes streamed game assets, not a loose .dat. Use the resource on a server. This file is for a single player install, where it replaces `common.rpf/data/relationships.dat`.

The format has a keyword for Respect, Like, Dislike and Hate only. Ignore (2), Wanted (4) and Dead (6) have no keyword and cannot be written at all, and None (255) is written by leaving the line out, so a None you set on a pair the game had an opinion about cannot be expressed. The tab lists every relationship it had to skip. They are all in the resource and in the runtime code.

## Troubleshooting

| Problem | Why |
| --- | --- |
| Nothing changed in game | The set is applied client side. Check the client console for the resource, and check that the server printed the "published" line on start. |
| It worked, then a restart left the old behaviour | Only if the resource was stopped in a way that skipped `onResourceStop`. Reconnect and it is gone. |
| A gang still ignores me | Peds already spawned keep the group they were given. New peds get the new relationships. |
| My group name does nothing | Check the spelling against the hash shown in the side panel. The game hashes the lower case name, so `MY_GANG` and `my_gang` are the same group. |
| A group I know from a script is not listed | Mission scripts create groups at runtime and their names are compiled to hashes, so they are not recoverable from the game files. Add the name yourself. |
| An old share link opens an empty matrix | Links made before the acquaintance values were corrected carry the old numbers, and there is no way to tell an old `2` (Like on the old list) from a new one (Ignore). The tool refuses them instead of quietly meaning something else. Rebuild the set and share the new link. |

## Privacy

Everything runs in your browser. The matrix, the resource zip and the .dat are all built on your own machine and nothing is uploaded. The only thing the page fetches is the list of the game's own groups.
