
Weapon skins for FiveM
Put your own artwork on any model in the library and export it as its own resource, inventory icons cut to match. The first one costs nothing.
FAM-261023-261025-UL4B9this weekendTick it in your cart Halloween Edition36 maps, limited runlimited runShop the drop FREE TOOL · SetRelationshipBetweenGroups
Set who likes and who hates whom across 43 of GTA 5’s own relationship groups, add factions of your own beside them, and copy out the AddRelationshipGroup and SetRelationshipBetweenGroups script. Every cell is one direction, because a relationship in this game is one direction — the Ballas can hate you while you are nothing to them, and that asymmetry is the thing almost every guide leaves out.
The six levels and their numbers come from Cfx.re natives — SET_RELATIONSHIP_BETWEEN_GROUPS. 26 of the group names are taken from the game’s own ped data in DurtyFree/gta-v-data-dumps — peds.json, where every ped model states the relationship group it is born into; the ped counts and example models on each row are counted from that file. The remaining 17 — PLAYER, the GANG_ slots, the MISSION scratch groups, HATES_PLAYER, DEALER, NO_RELATIONSHIP, SPECIAL and AGGRESSIVE_INVESTIGATE — are not any model’s default and so appear in no dump; those are listed from Cfx.re forum — the circulated relationship group table and tagged as such. The hashes are computed here with the same joaat implementation the hash calculator uses.
Pick a level, then click a cell. The row is who is doing the feeling and the column is who it is aimed at.
| feelsabout | PLAYER | COP | CIVMALE | AMBIENT_GANG_BALLAS | AMBIENT_GANG_FAMILY |
|---|---|---|---|---|---|
| PLAYER | |||||
| COP | |||||
| CIVMALE | |||||
| AMBIENT_GANG_BALLAS | |||||
| AMBIENT_GANG_FAMILY |
Every pairing in the matrix reads the same in both directions. That is a choice, not a default — the natives would happily let you set one side and leave the other, and a cell marked ≠ is where that has happened.
Client-side, once per resource start. The stop handler matters: without it a /restart leaves every relationship you set still in place on top of the ones you are about to set again.
local OWN_GROUPS = {
}
local LINKS = {
}
local function applyRelationships()
for i = 1, #OWN_GROUPS do
AddRelationshipGroup(OWN_GROUPS[i])
end
for i = 1, #LINKS do
local level, from, to = LINKS[i][1], LINKS[i][2], LINKS[i][3]
SetRelationshipBetweenGroups(level, GetHashKey(from), GetHashKey(to))
end
end
local function undoRelationships()
for i = 1, #LINKS do
local level, from, to = LINKS[i][1], LINKS[i][2], LINKS[i][3]
ClearRelationshipBetweenGroups(level, GetHashKey(from), GetHashKey(to))
end
for i = 1, #OWN_GROUPS do
RemoveRelationshipGroup(GetHashKey(OWN_GROUPS[i]))
end
end
AddEventHandler('onClientResourceStart', function(resource)
if resource ~= GetCurrentResourceName() then return end
applyRelationships()
end)
AddEventHandler('onClientResourceStop', function(resource)
if resource ~= GetCurrentResourceName() then return end
undoRelationships()
end)Client-side. Without the two SetPedRelationshipGroup calls this ped stays in its model's own group and ignores everything above.
local GROUP = GetHashKey('COP')
local function spawnInGroup(model, coords, heading)
local hash = GetHashKey(model)
RequestModel(hash)
while not HasModelLoaded(hash) do Wait(0) end
local ped = CreatePed(4, hash, coords.x, coords.y, coords.z, heading, false, true)
SetModelAsNoLongerNeeded(hash)
SetPedRelationshipGroupHash(ped, GROUP)
SetPedRelationshipGroupDefaultHash(ped, GROUP)
return ped
end
local guard = spawnInGroup('g_m_m_armboss_01', vector3(1395.9, 1141.7, 114.3), 180.0)
print(('group now: %s'):format(GetPedRelationshipGroupHash(guard)))THE SCALE
The numbers run the opposite way to how people expect. Zero is the warmest setting and five is the most violent, so a bigger number is worse. The two in the middle are the ones worth thinking about: neutral is a real setting you can go back to, and dislike is almost always what somebody wanted when they typed 5.
0CompanionThe strongest friendly setting. Companions behave as one side: they do not target each other, they come along into a fight, and a ped will take cover near a companion rather than near a stranger. This is the setting for a bodyguard and the person it is guarding.
1RespectFriendly, one notch below companion. Peds who respect each other will not pick a fight and will weigh in when one of them is attacked, but they do not move as a unit. The usual setting between two departments on the same side without being the same crew.
2LikeFriendly and passive. They are glad to see each other and will not attack, but liking somebody is not defending them, so do not lean on this level to make a group come to the rescue.
3NeutralNo feeling either way. Neither side starts anything and neither side helps. This is the level to go back to when you want to undo a hostility, and it is where most pairings sit before you touch anything.
4DislikeHostile but not violent on sight. Peds who dislike each other posture, insult, shove and escalate if provoked. On a roleplay server this is the level that buys you atmosphere without a body count, and it is almost always the one people wanted when they reached for hate.
5HateAttack on sight, as far as the ped can perceive. Two groups that hate each other open fire the moment they see one another, across a street, with no player anywhere near. This is the setting behind every "my server turned into a war zone" thread.
255PedestriansThe native reference lists 255 as "Pedestrians" next to the six numbered levels. It is not a seventh degree of friendliness on the same scale, and passing it where you meant 5 gives you no hostility and no error. Keep 0 to 5 in your scripts and only recognise 255 when you are reading a value back.
HOW TO USE IT
A gang war is two calls. Pick the two groups in the matrix above, set both cells to hate, and you get this — the second line is not a copy-paste mistake, it is the other half of the relationship.
Client-side, once. Both groups are the game's own, so there is nothing to add first.
local GROUPS = { 'AMBIENT_GANG_BALLAS', 'AMBIENT_GANG_FAMILY' }
CreateThread(function()
SetRelationshipBetweenGroups(5, GetHashKey(GROUPS[1]), GetHashKey(GROUPS[2]))
SetRelationshipBetweenGroups(5, GetHashKey(GROUPS[2]), GetHashKey(GROUPS[1]))
end)And here is the same thing with one line removed, which is what most copied snippets actually do. The Ballas will shoot you on sight; your own ped has no opinion about them at all, so your character will not auto-aim at them, your bodyguards will not treat them as a threat, and nothing you own will return fire until it is shot at.
Client-side. Legitimate when you mean it — this is how you make an ambush that the player's own entourage does not pre-empt.
CreateThread(function()
SetRelationshipBetweenGroups(5, GetHashKey('AMBIENT_GANG_BALLAS'), GetHashKey('PLAYER'))
end)THE USUAL BUG
This is the one that eats an evening. You add a group, you set it to hate PLAYER, you spawn a ped, and the ped stands there. Nothing is broken: the relationship you set applies to two groups, and your ped is in neither of them. Every ped model in the game declares a default relationship group in its own model data — 1,109 of the 1,109 models in the dump do, and 691 of those say CIVMALE. CreatePed honours that default, not your intention.
So the fix is one line after the spawn, and a second line that stops it being undone: SetPedRelationshipGroupHash puts the ped in your group now, and SetPedRelationshipGroupDefaultHash changes the group it falls back to. The ped snippet in the tool above writes both, filled in with whichever group you added. When a ped still misbehaves, print GetPedRelationshipGroupHash and compare it against the hash column on its row — the mismatch is usually the answer.
The model names CreatePed takes, with pictures and hashes. The group each one defaults to is what this page is about.
Model browserOne search box over every vehicle, ped and weapon in the game, with the spawn code for each.
Hash calculatorGetHashKey as you type. Paste a group hash out of a log and get the name back if it is one we know.
NOT THE SAME THING
Three different mechanisms get mixed up in forum answers, and picking the wrong one is why a fix works on the ped in front of you and on nothing else.
The relationship system is a rule about two groups. It is directional, it persists, and it applies to every ped in those groups including the ones that have not spawned yet. If you want a faction, this is the only one of the three that gives you one.
SetPedAsEnemy is a flag on one ped handle. It marks that single ped hostile and does not touch its relationship group at all — which you can see for yourself by reading the group back afterwards. It is the right tool for one ped in one scene, and the wrong tool for a gang, because the next ped you spawn knows nothing about it.
Client-side. Print the group after the flag and you will see it unchanged — which is the point.
local hash = GetHashKey('g_m_y_ballasout_01')
RequestModel(hash)
while not HasModelLoaded(hash) do Wait(0) end
local ped = CreatePed(4, hash, GetEntityCoords(PlayerPedId()) + vector3(4.0, 0.0, 0.0), 0.0, false, true)
SetModelAsNoLongerNeeded(hash)
SetPedAsEnemy(ped, true)
print(('still in group %s'):format(GetPedRelationshipGroupHash(ped)))SetCanAttackFriendly changes neither the group nor the feeling. The game normally refuses to let a ped aim at somebody it is friendly with, and this native lifts that refusal for one ped. That is why it is the fix for a bodyguard that will not fire on a teammate, and why it does nothing whatsoever for a ped that already hates its target. Watch its third argument: the published note says passing it true alongside the toggle can leave the ped unable to aim even after you set the toggle back.
Native descriptions from SET_PED_AS_ENEMY and SET_CAN_ATTACK_FRIENDLY.
THE NATIVES
Group names are case-insensitive, because GetHashKey lowercases the string before it hashes it. The game’s own ped data is inconsistent about it — it writes civmale in lower case and CIVFEMALE in upper — which matters not at all to the hash. This page prints them in upper case so the matrix reads; copy them in any case you like.
Registers a group name so the game will accept relationships for it. The native writes the new group’s hash into an output parameter, and that hash is the joaat hash of the name you passed — which is why scripts simply call GetHashKey(name) afterwards and get the same number. Calling it again for a name that already exists is harmless.
Sets how groupA feels about groupB. One direction only. The native reference says in as many words that it should be called twice, once for each group, and calling it once is the single most common relationship bug in FiveM.
Removes a relationship you set, and it takes the level as well as the two groups — you are clearing one specific setting, not the pairing. Also one direction at a time. Put it in your resource’s onResourceStop so a restart does not leave the world angry.
Moves one ped into a group. Nothing you set with SetRelationshipBetweenGroups applies to a ped until the ped is in one of the two groups, and a freshly spawned ped is in whatever group its model defaults to — not in yours.
Reads the group a ped is in right now. Print it and compare it against the hash column on this page when a relationship is not behaving: nine times out of ten the ped is still in CIVMALE.
Sets the group the ped falls back to, rather than the group it is in now. Worth knowing because some tasks and script events put a ped back to its default, and if you only set the current group the ped quietly changes sides.
Deletes a group you added. Only use it on your own groups, and only once nothing is left in one — what happens to a live ped whose group is removed is not described in the reference, so we are not going to tell you.
Signatures and the quoted behaviour from the Cfx.re native reference: ADD_RELATIONSHIP_GROUP, SET_RELATIONSHIP_BETWEEN_GROUPS, CLEAR_RELATIONSHIP_BETWEEN_GROUPS and SET_PED_RELATIONSHIP_GROUP_HASH.
QUESTIONS
MORE
Damage, range, clip and components for every weapon, with the GiveWeaponToPed call.
Markers and checkpointsEvery DrawMarker type with the call built from your own scale, colour and flags.
Damage eventsThe weapon and damage event list for working out what actually hit a player.
All the free toolsThe flag calculators, the animation and cutscene lists, every reference table.
ALSO FREE
Picked because they touch the same files, natives or part of the game.
FROM THE SHOP
The free tools and the paid work come out of the same place. These are the lines closest to what this page is about.
Grand opening: 25% off every product with FAM-261023-261025-UL4B9, until 25 October. It is applied at checkout.

Put your own artwork on any model in the library and export it as its own resource, inventory icons cut to match. The first one costs nothing.
Twelve colour palettes across three base map styles, each one a drop-in resource. Add your logo and your district labels in the editor.

A native hud.gfx replacement rather than an NUI overlay, so it costs no frame time. Colours, shape and motion are yours before you pay.