Jump to content

[AJUDA] Remove invites


Recommended Posts

Oi galera

Estou precisando de ajuda com o script Group System, Eu quero quando o player aceitar o invite ele se auto excluir.

Ou quando o jogador ser kicka ou expulso do grupo o convite se auto excluir

 

Aceitar / Invite

 

function refreshPlayerInvite ()
	invited,gangName,inviter = isPlayerGangInvited(source)
	if invited then
		if not getElementData(source,"gang") == "None" then return end
		local gangmember = #getGangMembers(gangName)
		local gangvip = getGangSlots (gangName)
		triggerClientEvent(source,"updatePlayerInvites",source,gangName,getPlayerName(inviter),gangmember,gangvip)
	end
end
addEvent("refreshPlayerInvite",true)
addEventHandler("refreshPlayerInvite",getRootElement(),refreshPlayerInvite)

--Gui Triggers
function acceptGroupInvite ()
	invited,gangName,inviter = isPlayerGangInvited(source)
	if invited then
		if #getGangMembers(getElementData(inviter,"gang"))+1 > getGangSlots(getElementData(inviter,"gang")) then outputChatBox(getPlayerName(source)..", #22ff22Este grupo está cheio!",source,22,255,22,true) return end
		addGangMember(gangName,getAccountName(getPlayerAccount(source)),"O líder")
		outputChatBox(getPlayerName(source).." #22ff22Juntou-se ao grupo "..gangName.."!",getRootElement(),22,255,22,true)
	end
end
addEvent("acceptGroupInvite",true)
addEventHandler("acceptGroupInvite",getRootElement(),acceptGroupInvite)

 

Expulso / Saiu

 

function leaveGroup ()
	if getElementData(source,"gang") == "None" then return end
	local groupleader = getGangLeader(getElementData(source,"gang"))
	if getAccountName(getPlayerAccount(source)) == groupleader then outputChatBox(getPlayerName(source)..",#22ff22Você não pode deixar seu próprio grupo.!",source,22,255,22,true) return end
	outputChatBox(getPlayerName(source).." #22ff22Deixou o grupo: "..getElementData(source,"gang").."!" ,getRootElement(),22,255,22,true)
	removeGangMember(getAccountGang(getAccountName(getPlayerAccount(source))),getAccountName(getPlayerAccount(source)))
end
addEvent("leaveGroup",true)
addEventHandler("leaveGroup",getRootElement(),leaveGroup)

function kickGroupMember (playerName)
	if getElementData(source,"gang") == "None" then return end
	if string.find(playerName,"(O líder)") then return end
	--if getPlayerName(source) == playerName then return end
	local groupleader = getGangLeader(getElementData(source,"gang"))
	if getAccountName(getPlayerAccount(source)) == groupleader or isGangSubLeader(getElementData(source,"gang"),getAccountName(getPlayerAccount(source))) then
		outputChatBox(playerName.." #22ff22Banido de "..getElementData(source,"gang").."!",getRootElement(),22,255,22,true)
		removeGangMember(getElementData(source,"gang"),playerName,getPlayerName(source))
	else
		outputChatBox(getPlayerName(source)..",#22ff22Você não pode expulsar os sobreviventes!",source,22,255,22,true)
	end
end
addEvent("kickGroupMember",true)
addEventHandler("kickGroupMember",getRootElement(),kickGroupMember)

 

Me ajudem pfv.

 

Estou tentando colocar isso faz tempo e não consigo

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...