veigac4tm Posted July 31, 2016 Share Posted July 31, 2016 Hello, I apologize if you do not understand. I'm using an online translator! Next, I have a group system. But it did not come with a way to communicate only with members of the group. Could help me to make this appeal to all who are in the same group can communicate via chat, where only group members can see and talk? Below is the group system I'm using! client.lua local SpamOnClick = false -------------------------- -- Function Center Window -------------------------- function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end ---------------- -- Window Main ---------------- Window = guiCreateWindow(308, 142, 376, 464, "Sistema de Esquadrão", false) guiWindowSetSizable(Window, false) guiSetVisible(Window,false) centerWindow(Window) guiSetAlpha(Window, 1.00) guiSetProperty(Window, "CaptionColour", "FFF89F05") CreateGroup = guiCreateButton(252, 23, 114, 34, "Criar", false, Window) EditCreateGroup = guiCreateEdit(59, 23, 178, 34, "", false, Window) guiEditSetMaxLength(EditCreateGroup,15) LabelNameGroup = guiCreateLabel(10, 67, 305, 16, "Esquadrão :", false, Window) ButtonViewAllGroups = guiCreateButton(10, 133, 160, 34, "Todos Esquadrões", false, Window) Label1 = guiCreateLabel(0, 108, 370, 15, "_____________________________________________________", false, Window) LabelNameCreatedGroups = guiCreateLabel(10, 92, 305, 16, "Líder Esquadrão :", false, Window) ButtonViewMyGroupMembers = guiCreateButton(10, 183, 160, 34, " Membros do Esquadrão", false, Window) ButtonViewAdminPanel = guiCreateButton(10, 376, 160, 34, "Ver Painel Líder", false, Window) --ButtonViewMyGroupStats = guiCreateButton(10, 231, 160, 34, "View My Group Stats -- Soon", false, Window) ButtonViewMyInviteGroups = guiCreateButton(10, 279, 160, 34, " Ver Convites de Esquadrão", false, Window) ButtonViewEditMyGroupRulesInfo = guiCreateButton(10, 328, 160, 34, "Ver/Editar Info/Regras Esquadrão", false, Window) Label2 = guiCreateLabel(10, 405, 370, 15, "_____________________________________________________", false, Window) ButtonInvitePlayerToGroup = guiCreateButton(10, 423, 160, 31, "Convidar p/ Esquadrão", false, Window) ButtonLeaveOfGroup = guiCreateButton(192, 424, 160, 30, "Deixar Esquadrão", false, Window) ButtonAddEditNewEventGroup = guiCreateButton(200, 133, 160, 34, "Add/Edit Missão Esquadrão", false, Window) MemoEvents = guiCreateMemo(202, 188, 159, 227, "", false, Window) Label3 = guiCreateLabel(237, 167, 98, 16, "Missão Esquadrão :", false, Window) guiMemoSetReadOnly(MemoEvents, true) -------------------------- -- Window View All Groups -------------------------- WindowViewAllGroups = guiCreateWindow(309, 171, 530, 430, "Lista de Esquadrão", false) guiWindowSetSizable(WindowViewAllGroups, false) guiSetVisible(WindowViewAllGroups,false) guiSetAlpha(WindowViewAllGroups, 1.00) centerWindow(WindowViewAllGroups) ListGroups = guiCreateGridList(19, 21, 270, 357, false, WindowViewAllGroups) guiGridListAddColumn(ListGroups,"Nome Esquadrão: ",0.40) guiGridListAddColumn(ListGroups,"Líder Esquadrão: ",0.40) guiGridListSetSelectionMode(ListGroups,1) ListViewMembersGroup = guiCreateGridList(300, 21, 220, 357, false, WindowViewAllGroups) guiGridListAddColumn(ListViewMembersGroup,"Nome dos Membros : ",0.50) guiGridListSetSelectionMode(ListViewMembersGroup,1) CloseGroupsList = guiCreateButton(160, 380, 106, 20, "Fechar", false, WindowViewAllGroups) ViewMembersSelectGroup = guiCreateButton(160, 400, 106, 20, "Ver Membros", false, WindowViewAllGroups) L_1 = guiCreateLabel(300, 385, 156, 20, "Para ver os membros do Esquadrão ,", false, WindowViewAllGroups) L_2 = guiCreateLabel(300, 400, 250, 20, "Selecione o Esquadrão e clique ver membros ,", false, WindowViewAllGroups) CountGroupsLabel = guiCreateLabel(6, 385, 156, 20, "", false, WindowViewAllGroups) CountMembersLabel = guiCreateLabel(6, 400, 156, 20, "", false, WindowViewAllGroups) --------------------- -- Window New Event --------------------- WindowEvent = guiCreateWindow(266, 189, 350, 198, "Add/Editar - Nova Missão", false) guiWindowSetSizable(WindowEvent, false) guiSetVisible(WindowEvent,false) guiSetAlpha(WindowEvent, 1.00) centerWindow(WindowEvent) MeomEventNew = guiCreateMemo(16, 23, 318, 139, "", false, WindowEvent) SaveEvent = guiCreateButton(112, 166, 127, 22, "Salvar", false, WindowEvent) --------------------- -- Window Ruels/Info --------------------- WindowRules = guiCreateWindow(245, 115, 450, 491, "Regras/Info do Esquadrão , ", false) guiWindowSetSizable(WindowRules, false) centerWindow(WindowRules) guiSetVisible(WindowRules,false) guiSetAlpha(WindowRules, 1.00) MeomRulesInfo1 = guiCreateMemo(15, 58, 425, 247, "", false, WindowRules) guiMemoSetReadOnly(MeomRulesInfo1, true) LabeR404 = guiCreateLabel(15, 31, 352, 22, "Regras/Info do Esquadrão :", false, WindowRules) guiSetFont(LabeR404, "default-bold-small") guiLabelSetColor(LabeR404, 28, 130, 226) LabelR405 = guiCreateLabel(15, 322, 425, 18, "Adicionar Regras/info (Somente Líder/SubLíder):", false, WindowRules) guiSetFont(LabelR405, "default-bold-small") guiLabelSetColor(LabelR405, 28, 130, 226) MeomRulesInfo = guiCreateMemo(17, 350, 413, 106, "", false, WindowRules) SaveRules = guiCreateButton(152, 466, 133, 15, "Salvar Edição", false, WindowRules) -------------------------- -- Window View All Members -------------------------- WindowMembers = guiCreateWindow(124, 174, 679, 370, "Membros [ Para fechar pressione F7 ] ", false) guiWindowSetSizable(WindowMembers, false) centerWindow(WindowMembers) guiSetVisible(WindowMembers,false) guiSetAlpha(WindowMembers, 1.00) ListMembers = guiCreateGridList(14, 30, 655, 310, false, WindowMembers) guiGridListAddColumn(ListMembers,"Nome: ",0.30) guiGridListAddColumn(ListMembers,"Cargo: ",0.25) guiGridListAddColumn(ListMembers,"Estado: ",0.25) guiGridListAddColumn(ListMembers,"Conta: ",0.25) guiGridListSetSelectionMode(ListMembers,1) ---------------------- -- Window Admin Panel ---------------------- WindowAdmin = guiCreateWindow(190, 150, 667, 400, "Painel do Líder", false) guiWindowSetSizable(WindowAdmin, false) centerWindow(WindowAdmin) guiSetVisible(WindowAdmin,false) guiSetAlpha(WindowAdmin, 1.00) ListAdmin = guiCreateGridList(10, 25, 516, 355, false, WindowAdmin) guiGridListAddColumn(ListAdmin,"Nome: ",0.30) guiGridListAddColumn(ListAdmin,"Cargo: ",0.25) guiGridListAddColumn(ListAdmin,"Estado: ",0.25) guiGridListAddColumn(ListAdmin,"Conta: ",0.25) guiGridListSetSelectionMode(ListAdmin,1) CloseAdmin = guiCreateButton(534, 360, 157, 17, "Fechar", false, WindowAdmin) GiveOwner = guiCreateButton(534, 25, 123, 24, "Dar General", false, WindowAdmin) GiveAdmin = guiCreateButton(534, 59, 123, 24, "Dar Coronel", false, WindowAdmin) GiveKick = guiCreateButton(534, 195, 123, 24, "Dar Kick", false, WindowAdmin) GiveMember = guiCreateButton(534, 161, 123, 24, "Dar Soldado", false, WindowAdmin) GiveModerator = guiCreateButton(534, 127, 123, 24, "Dar Tenente", false, WindowAdmin) GiveSuperModerator = guiCreateButton(534, 93, 123, 24, "Dar Major", false, WindowAdmin) --MoneySystem = guiCreateButton(534, 229, 123, 24, "Money System", false, WindowAdmin) LabelOnlineInGroup = guiCreateLabel(534, 260, 123, 24, "Conectado : [ - ]", false, WindowAdmin) guiLabelSetColor(LabelOnlineInGroup,0,255,0) LabelOfflineInGroup = guiCreateLabel(534, 289, 123, 24, "Desconectado : [ - ]", false, WindowAdmin) guiLabelSetColor(LabelOfflineInGroup,255,0,0) ---------------------------------- -- Window Invite Player To Group ---------------------------------- WindowPlayers = guiCreateWindow(274, 128, 272, 468, "Convidar Jogador ,", false) guiWindowSetSizable(WindowPlayers, false) guiSetVisible(WindowPlayers,false) guiSetAlpha(WindowPlayers, 1.00) centerWindow(WindowPlayers) ListPlayers = guiCreateGridList(11, 27, 251, 347, false, WindowPlayers) guiGridListAddColumn(ListPlayers,"Jogadores : ",0.70) guiGridListAddColumn(ListPlayers,"Conta : ",0.20) ButtonInvite = guiCreateButton(69, 384, 136, 33, "Convidar", false, WindowPlayers) CloseInvite = guiCreateButton(69, 427, 136, 33, "Fechar", false, WindowPlayers) ---------------------------------- -- Window Invite Groups , ---------------------------------- WindowInvite = guiCreateWindow(274, 128, 272, 500, "Convite de Clans ,", false) guiWindowSetSizable(WindowInvite, false) guiSetVisible(WindowInvite,false) guiSetAlpha(WindowInvite, 1.00) centerWindow(WindowInvite) ListInvite = guiCreateGridList(11, 27, 251, 347, false, WindowInvite) guiGridListAddColumn(ListInvite,"Clan Player : ",0.50) guiGridListAddColumn(ListInvite,"Nome Player : ",0.50) guiGridListAddColumn(ListInvite,"Conta Player : ",0.50) ButtonAgre = guiCreateButton(69, 384, 136, 33, "Aceitar", false, WindowInvite) DeletedInvite = guiCreateButton(69, 420, 136, 33, "Recusar", false, WindowInvite) CloseWInvite = guiCreateButton(69, 457, 136, 33, "Fechar", false, WindowInvite) ----------------------------- -- Money System For Group, ----------------------------- WindowMoney = guiCreateWindow(330, 143, 373, 438, "Money System For My Group", false) guiWindowSetSizable(WindowMoney, false) guiSetAlpha(WindowMoney, 1.00) guiSetVisible(WindowMoney,false) ButtonAddMoney = guiCreateButton(169, 67, 127, 29, "Add Money", false, WindowMoney) EditAddMoney = guiCreateEdit(70, 71, 89, 25, "", false, WindowMoney) L_5 = guiCreateLabel(15, 78, 51, 18, "Amount : :", false, WindowMoney) L_3 = guiCreateLabel(19, 34, 237, 17, "* For Add Money Need To Be 1000 or up .", false, WindowMoney) L_7 = guiCreateLabel(106, 311, 171, 18, "For Use Any amount Select it .", false, WindowMoney) GivwMySelf = guiCreateButton(130, 339, 136, 26, "Give My Self", false, WindowMoney) GiveAllOnline = guiCreateButton(130, 370, 136, 26, "Give All Online In Group", false, WindowMoney) CloseWindowMoneySystem = guiCreateButton(150, 405, 50, 20, "Close", false, WindowMoney) ListMoney = guiCreateGridList(19, 118, 345, 178, false, WindowMoney) guiGridListAddColumn(ListMoney, "#Name : ", 0.7) guiGridListAddColumn(ListMoney, "#Amount : ", 0.2) guiGridListAddColumn(ListMoney, "#Account : ", 0.2) guiGridListAddColumn(ListMoney, "#Rank : ", 0.2) guiGridListAddColumn(ListMoney, "#Tick : ", 0.2) -- guiMemoSetReadOnly(MeomRulesInfo1, true) for _,v in ipairs (getElementsByType("gui-label",resourceRoot)) do guiSetFont(v,"default-bold-small") end for _,v in ipairs (getElementsByType("gui-button",resourceRoot)) do guiSetFont(v,"default-bold-small") end ---------------------- -- Functions - Events ---------------------- addEventHandler("onClientGUIClick",guiRoot,function() if ( SpamOnClick == false ) then if ( source == CreateGroup ) then local GGTCC = guiGetText(EditCreateGroup) if ( GGTCC == "" or GGTCC == " " or GGTCC == " " or GGTCC == " " or GGTCC == nil ) then outputChatBox("#FF0000:#FFFFFF Coloque um nome para criar um Esquadrão",255,0,0,true) else if ( string.len(GGTCC) >= 3 ) then if ( getElementData(getLocalPlayer(),"AccountName") ~= "N/A" ) then if ( getElementData(getLocalPlayer(),"NameGroup") == "N/A" ) then triggerServerEvent("CreateGroup",getLocalPlayer(),GGTCC) else outputChatBox("#FF0000:#FFFFFF Você já tem Esquadrão, siga instruções abaixo : ",255,0,0,true) outputChatBox("#FFFFFF* Deixar Esquadrão ,",255,0,0,true) outputChatBox("#FFFFFF* Excluir Esquadrão .",255,0,0,true) end else outputChatBox("#FF0000:#FFFFFF Você não tem conta, não pode criar um Esquadrão .",255,0,0,true) end else outputChatBox("#FF0000:#FFFFFF Nome do Esquadrão não pode ter caractéres ilegais .",255,0,0,true) end end elseif ( source == ButtonViewAllGroups ) then falseAllWindow() guiSetVisible(WindowViewAllGroups,true) showCursor(true) guiSetInputEnabled(true) guiGridListClear(ListViewMembersGroup) triggerServerEvent("UpGroups",getLocalPlayer()) elseif ( source == CloseGroupsList ) then falseAllWindow() elseif ( source == ButtonAddEditNewEventGroup ) then local rank = getElementData(getLocalPlayer(),"RankPlayer") if ( getElementData(getLocalPlayer(),"AccountName") ~= "N/A" ) then if ( getElementData(getLocalPlayer(),"NameGroup") ~= "N/A" ) then if ( rank == "General" or rank == "Coronel" or rank == "Major" ) then falseAllWindow() guiSetVisible(WindowEvent,true) showCursor(true) guiSetInputEnabled(true) else outputChatBox("#FF0000:#FFFFFF Somente Liderança pode usar essa função .",255,0,0,true) end else outputChatBox("#FF0000:#FFFFFF Você não tem Esquadrão, não pode usar essa função .",255,0,0,true) end else outputChatBox("#FF0000:#FFFFFF Você não tem conta, não pode criar um Esquadrão .",255,0,0,true) end elseif ( source == SaveEvent ) then triggerServerEvent("UpEvent",getLocalPlayer(),guiGetText(MeomEventNew)) --outputChatBox("#FF0000:#FFFFFF missão add .",255,0,0,true) falseAllWindow() elseif ( source == ButtonViewEditMyGroupRulesInfo ) then local rank = getElementData(getLocalPlayer(),"RankPlayer") if ( getElementData(getLocalPlayer(),"AccountName") ~= "N/A" ) then if ( getElementData(getLocalPlayer(),"NameGroup") ~= "N/A" ) then falseAllWindow() guiSetVisible(WindowRules,true) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now