Skip to content

OnPartyInvite

A player wants to invite another; return false to refuse.

Fires from InviteToParty before the toast goes out, after the server’s own checks (the target free, the party not full, no invitation pending). The place for the mode’s rule: leader-only invitations, a level gate, a cooldown. Without the callback every invitation the server admits goes through.

function OnPartyInvite(from, target)
-- ...
end
Parameter Type
from number the inviter
target number the player invited

false refuses the invitation (InviteToParty returns false, "refused"); anything else lets it through

function OnPartyInvite(from, target)
-- leader-only: a member who does not lead may not invite
local party = GetPlayerParty(from)
if party and GetPartyLeader(party) ~= from then return false end
SendClientMessage(target, COLOUR_SERVER, GetPlayerName(from) .. " invites you to a party - /accept or /decline.")
end

InviteToParty · OnPartyInviteResponse · the Parties group of the index