Short-lived teams of up to four survivors with map blips, a party HUD, and shared XP and loot for members nearby.
en-party lets survivors team up for a session. A party holds up to 4 players. Invite someone by looking at them (hold Alt, "Invite to party") or with /party invite <id>, or ask to join their party. An offer card pops up and they press Y to accept or X to decline.
Party members see each other as coloured map blips, even when far away and not streamed in, with a marker over their heads and a party HUD showing health, armour, downed and in-vehicle state. Members within 100 m of whoever earns a reward share XP and loot; en-zombies, for example, deals corpse finds out between nearby members. Parties are not saved: they end when broken up or when the server restarts. F6 opens the Survivors menu, with your party and your persistent en-core group side by side. Group invites use the same offer card.
Offers. Invites and join requests last Config.offerTimeout seconds, need the players within Config.offerDistance, and one player can only send an offer every Config.offerCooldown seconds.
Leadership. The creator leads. With Config.leaderInvitesOnly, only the leader can invite. Kicking and promoting are done from the menu.
Breaking up. With Config.disbandWhenAlone, a party ends when only one member remains.
Positions. Member positions are sent every Config.positionInterval ms for blips and the HUD.
Sharing XP.ShareXP gives XP to the earner and every member within Config.shareRadius. In 'split' mode the pot grows by bonusPerMember for each extra member and is divided: 4 members sharing 100 XP split 130, so 33 each (rounded, minimum 1). In 'full' mode everyone nearby gets the whole amount.
Without en-party. Every encore.party.* call behaves like a party of one, and XP goes straight to en-core's AddXP. Resources can call it without checking whether en-party is running.
en-party uses en-core's AddXP and GetCharacterName, and en-core's group callbacks and events for the Group tab. See Skills and party interface.
Reward a finished scavenging job to the whole team:
lua
-- server
RegisterNetEvent('my-scav:complete', function()
local src = source
encore.party.shareXP(src, 50, 'Cleared a pharmacy')
for _, member in ipairs(encore.party.getNearbyMembers(src)) do
encore.inventory.addItem(member, 'bandage', 1)
end
end)
Stop friendly fire from counting in your own PvP script:
lua
-- server
AddEventHandler('my-pvp:server:playerKilled', function(killer, victim)
if encore.party.inSameParty(killer, victim) then return end
-- ... award the kill ...
end)