Jump to content

veigac4tm

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by veigac4tm

  1. Convido vocês a conhecerem o Wasteland Brasil MTA. Servidor DayZ adaptado ao Wasteland (Arma3). Informações extras como ip, etc. Basta curtir a página do facebook do Servidor. https://www.facebook.com/wastelandmta/ Espero que curtam a ideia e apoiem, abraços Soldados!
  2. Independente disso, o que eu puder ajudar só me chamar irmão!
  3. 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)
  4. Hello friends, I've been seeing the mta wiki tried to do more and I could not, could simulate to me how I could make a particular Resource be automatically resetting the X time? Let's say the Resource called "bot" how I could make a script that restarted it every 15 minutes?
  5. Hello, today I made this script to be like a kind of mission for my dayz server. But over time I noticed that starts bugar time. Is there any way to run the X function and only after it has executed count like 15 minutes and disable the function? Like the code below to put this but my code is always crazy after a while, no longer follows the set time. Could review my code and see if I did something wrong? I thank the community for being so helpful! forgiveness for the English, I'm Brazilian! my code: -- MISSAO 1 function m72Go (thePlayer) outputChatBox ( "#FF0000:#FFFFFF Roube os equipamentos! (checkpoint) (#26e30015 Minutos#ffffff)", everybody,255, 255, 255, true) end setTimer(m72Go,300000,0) -- start function function m72Fim (thePlayer) destroyElement(blip72) destroyElement(tent72) destroyElement(marka72) outputChatBox ( "#FF0000:#FFFFFF Missão foi finalizada!", everybody,255, 255, 255, true) end setTimer(m72Fim,420000,0) -- finish function -- [ TENT ] function tentadayzm72(thePlayer) local x, y, z = 61.878128051758,400.298828125,10.41711139679 blip72 = createBlip(61.878128051758,400.298828125,10.41711139679, 5) marka72 = createMarker(61.878128051758,400.298828125,10.41711139679, "checkpoint", 5, 100, 255, 100, 100) tent72 = createObject(964, x, y, z - 1) setObjectScale(tent72, 0.6) tentCol = createColSphere(x + 5, y, z, 4) attachElements(tentCol, tent72, 0, 0, 0) setElementData(tentCol, "parent", tent72) setElementData(tent72, "parent", tentCol) setElementData(tentCol, "tent72", true) setElementData(tentCol, "vehicle", true) setElementData(tentCol, "MAX_Slots", 0) setElementData(tentCol, "PP-19 Mag", 10) setElementData(tentCol, "PP-19", 10) setElementData(tentCol, "UMP-45 Mag", 10) setElementData(tentCol, "UMP-45", 10) setElementData(tentCol, "M9 SD Mag", 10) setElementData(tentCol, "M9 SD", 10) setElementData(tentCol, "Glock Mag", 10) setElementData(tentCol, "Glock", 10) setElementData(tentCol, "Mochila Extra Grande", 10) end setTimer(tentadayzm72,300000,0) -- start with function spawn object with itens..
  6. So friend, I want to do the following: I want to create a chat for those who are in the same group understand? A teamchat only for the members of their respective groups. Most do not know why it does not work!
  7. Run client or server? Thank's for helping!
  8. I tried but did not work. Below is the archive of my group system It helps? Server addEvent("onPlayerCreatedGroup",true) addEvent("onPlayerDeletedGroup",true) addEventHandler("onResourceStart",resourceRoot,function() executeSQLQuery("CREATE TABLE IF NOT EXISTS Groups_x22 (Account,NameGroup,RankPlayer,Owner,Event,Ruel)") executeSQLQuery("CREATE TABLE IF NOT EXISTS GrupsMembers_x22 (Account,NameGroup,RankPlayer,State,Name)") executeSQLQuery("CREATE TABLE IF NOT EXISTS GrupsInvite_x22 (Account,Name,NameGroup)") executeSQLQuery("CREATE TABLE IF NOT EXISTS GroupMoney_x22 (Account,Name,RankPlayer,NameGroup,Amount,Tick)") outputDebugString("Sql Group System , Loaded .",3) exports.scoreboard:addScoreboardColumn("NameGroup") exports.scoreboard:addScoreboardColumn("RankPlayer") for _,plrs in ipairs (getElementsByType("player")) do local acc = getPlayerAccount(plrs) if ( acc ) then if not( isGuestAccount(acc) ) then setElementData(plrs,"AccountName",tostring(getAccountName(acc))) local Row = executeSQLQuery("SELECT * FROM GrupsMembers_x22 WHERE Account=?",tostring(getAccountName(acc))) if ( type(Row) == "table" and #Row == 0 or not Row ) then setElementData(plrs,"NameGroup","N/A") setElementData(plrs,"RankPlayer","N/A") else setElementData(plrs,"NameGroup",tostring(Row[1]["NameGroup"])) setElementData(plrs,"RankPlayer",tostring(Row[1]["RankPlayer"])) local Row_ = executeSQLQuery("SELECT * FROM Groups_x22 WHERE NameGroup=?",tostring(Row[1]["NameGroup"])) if ( type(Row_) == "table" and #Row_ == 0 or not Row_ ) then return false else setElementData(resourceRoot,"Event"..tostring(Row_[1]["NameGroup"]).."",tostring(Row_[1]["Event"])) setElementData(resourceRoot,"Ruel"..tostring(Row_[1]["NameGroup"]).."",tostring(Row_[1]["Ruel"])) setElementData(resourceRoot,"General"..tostring(Row_[1]["NameGroup"]).."",tostring(Row_[1]["General"])) end end else setElementData(plrs,"AccountName","N/A") setElementData(plrs,"NameGroup","N/A") setElementData(plrs,"RankPlayer","N/A") end else setElementData(source,"AccountName","N/A") setElementData(plrs,"NameGroup","N/A") setElementData(plrs,"RankPlayer","N/A") end end end) addEventHandler("onPlayerJoin",root,function() setElementData(source,"AccountName","N/A") setElementData(source,"NameGroup","N/A") setElementData(source,"RankPlayer","N/A") end) addEventHandler("onPlayerLogin",root,function(_,account) setElementData(source,"AccountName",tostring(getAccountName(account))) local Row = executeSQLQuery("SELECT * FROM GrupsMembers_x22 WHERE Account=?",tostring(getAccountName(account))) if ( type(Row) == "table" and #Row == 0 or not Row ) then setElementData(source,"NameGroup","N/A") setElementData(source,"RankPlayer","N/A") else setElementData(source,"NameGroup",tostring(Row[1]["NameGroup"])) setElementData(source,"RankPlayer",tostring(Row[1]["RankPlayer"])) executeSQLQuery("UPDATE GrupsMembers_x22 SET State=? WHERE Account=?",tostring("Online"),tostring(getAccountName(account))) end end) addEventHandler("onPlayerLogout",root,function() local accountName = getElementData(source,"AccountName") local Row = executeSQLQuery("SELECT * FROM GrupsMembers_x22 WHERE Account=?",tostring(accountName)) if ( type(Row) == "table" and #Row == 0 or not Row ) then return false else executeSQLQuery("UPDATE GrupsMembers_x22 SET State=? WHERE Account=?",tostring("Offline"),tostring(accountName)) end setElementData(source,"AccountName","N/A") setElementData(source,"NameGroup","N/A") setElementData(source,"RankPlayer","N/A") triggerClientEvent(source,"DestroyGui",source) end) addEventHandler("onPlayerQuit",root,function() local accountName = getElementData(source,"AccountName") if ( accountName ~= "N/A" ) then local Row = executeSQLQuery("SELECT * FROM GrupsMembers_x22 WHERE Account=?",tostring(accountName)) if ( type(Row) == "table" and #Row == 0 or not Row ) then return false else executeSQLQuery("UPDATE GrupsMembers_x22 SET State=? WHERE Account=?",tostring("Offline"),tostring(accountName)) end end end) addEvent("CreateGroup",true) addEventHandler("CreateGroup",root,function(NameGroup) local accountName = getElementData(source,"AccountName") local CheckNameGroup = executeSQLQuery("SELECT * FROM Groups_x22 WHERE NameGroup=?",tostring(NameGroup)) if ( type(CheckNameGroup) == "table" and #CheckNameGroup == 0 or not CheckNameGroup ) then executeSQLQuery("INSERT INTO Groups_x22 (Account,NameGroup,RankPlayer,Owner,Event,Ruel) VALUES (?,?,?,?,?,?)",tostring(accountName),tostring(NameGroup),tostring("General"),tostring(string.gsub(getPlayerName(source),"#%x%x%x%x%x%x","")),tostring("Nada"),tostring("Nada")) executeSQLQuery("INSERT INTO GrupsMembers_x22 (Account,NameGroup,RankPlayer,State,Name) VALUES (?,?,?,?,?)",tostring(accountName),tostring(NameGroup),tostring("General"),tostring("Online"),tostring(string.gsub(getPlayerName(source),"#%x%x%x%x%x%x",""))) outputChatBox("#FF0000: #FFFFFFUm novo esquadrão foi criado [ Comandante : #00FF00"..getPlayerName(source).." #FFFFFF/ Esquadrão : #00FF00"..tostring(NameGroup).." ]#FFFFFF",everybody,0,255,255,true) triggerEvent("onPlayerCreatedGroup",source,source,NameGroup) setElementData(resourceRoot,"Event"..NameGroup.."","Nenhuma") setElementData(resourceRoot,"Ruel"..NameGroup.."","Nenhuma") setElementData(resourceRoot,"General"..NameGroup.."",tostring(string.gsub(getPlayerName(source),"#%x%x%x%x%x%x",""))) setElementData(source,"NameGroup",tostring(NameGroup)) setElementData(source,"RankPlayer",tostring("General")) for _,plrs in ipairs (getElementsByType("player")) do getAllGroups(plrs) end else outputChatBox("#FF0000:#FFFFFF Você não pode usar esse nome .",source,255,0,0,true) end end) addEvent("UpGroups",true) addEventHandler("UpGroups",root,function() for _,plrs in ipairs (getElementsByType("player")) do getAllGroups(plrs) end setElementData(resourceRoot,"CountGroups",getCountGroups()) setElementData(resourceRoot,"CountMembers",getCountMembers()) end) addEvent("UpMembers",true) addEventHandler("UpMembers",root,function() for _,plrs in ipairs (getElementsByType("player")) do getAllMembers(plrs,getElementData(source,"NameGroup")) end setElementData(source,"OnlineInMyGroup",""..#getPlayersCountOnlineInMyGroup(source,getElementData(source,"NameGroup")).."") setElementData(source,"OfflineInMyGroup",""..#getPlayersCountOfflineInMyGroup(source,getElementData(source,"NameGroup")).."") end) addEvent("UpEvent",true) addEventHandler("UpEvent",root,function(eventText) local NameGroup = getElementData(source,"NameGroup") executeSQLQuery("UPDATE Groups_x22 SET Event=? WHERE NameGroup=?",tostring(eventText),tostring(NameGroup)) setElementData(resourceRoot,"Event"..NameGroup.."",tostring(eventText)) end) addEvent("UpRuel",true) addEventHandler("UpRuel",root,function(ruelText) local NameGroup = getElementData(source,"NameGroup") executeSQLQuery("UPDATE Groups_x22 SET Ruel=? WHERE NameGroup=?",tostring(ruelText),tostring(NameGroup)) setElementData(resourceRoot,"Ruel"..NameGroup.."",tostring(ruelText)) end) addEvent("InvitePlayer",true) addEventHandler("InvitePlayer",root,function(Account) if ( Account and Account ~= false and Account ~= nil and string.len(Account) >= 1 ) then local MyAcc = getElementData(source,"AccountName") if ( Account == MyAcc ) then outputChatBox("#FF0000:#FFFFFF Você não pode convidar você mesmo .",source,255,0,0,true) return end local NameGroup_ = getElementData(source,"NameGroup") local Row = executeSQLQuery("SELECT * FROM GrupsMembers_x22 WHERE Account=?",tostring(Account)) local Row_ = executeSQLQuery("SELECT * FROM GrupsInvite_x22 WHERE Account=?",tostring(Account)) for i,v in ipairs (Row_) do if ( v.NameGroup == NameGroup_ ) then outputChatBox("#FF0000:#FFFFFF Convite enviado, aguarde o jogador aceitar o convite .",source,255,0,0,true) return end end executeSQLQuery("INSERT INTO GrupsInvite_x22 (Account,Name,NameGroup) VALUES (?,?,?)",tostring(Account),tostring(string.gsub(getPlayerName(source),"#%x%x%x%x%x%x","")),tostring(NameGroup_)) outputChatBox("#FFFFFFConvite de Esquadrão enviado .",source,0,255,255,true) else outputChatBox("#FF0000:#FFFFFF Selecione o jogador .",source,255,0,0,true) end end) addEvent("ViewMyInvite",true) addEventHandler("ViewMyInvite",root,function() getAllInvites(source,getElementData(source,"AccountName")) end) addEvent("InviteAgre",true) addEventHandler("InviteAgre",root,function(nameGroup,acc,name) if ( nameGroup and nameGroup ~= false and nameGroup ~= nil and string.len(nameGroup) >= 3 ) then local Row = executeSQLQuery("SELECT * FROM Groups_x22 WHERE NameGroup=?",tostring(nameGroup)) if ( type(Row) == "table" and #Row == 0 or not Row ) then outputChatBox("#FF0000:#FFFFFF Esse esquadrão foi deletado ,( Não Encontrado ) .",source,255,0,0,true) return end if ( Row[1]["NameGroup"] == getElementData(source,"NameGroup") ) then outputChatBox("#FF0000:#FFFFFF Você já está no esquadrão .",source,255,0,0,true) return end local accountName = getElementData(source,"AccountName") executeSQLQuery("INSERT INTO GrupsMembers_x22 (Account,NameGroup,RankPlayer,State,Name) VALUES (?,?,?,?,?)",tostring(accountName),tostring(nameGroup),tostring("Soldado"),tostring("Online"),tostring(string.gsub(getPlayerName(source),"#%x%x%x%x%x%x",""))) executeSQLQuery("DELETE FROM GrupsInvite_x22 WHERE NameGroup =? AND Account=? AND Name=?",tostring(nameGroup),tostring(acc),tostring(name)) setElementData(source,"NameGroup",tostring(nameGroup)) setElementData(source,"RankPlayer",tostring("Soldado")) getAllInvites(source,accountName) end end) addEvent("DeletedMyInvite",true) addEventHandler("DeletedMyInvite",root,function(nameGroup,acc,name) if ( nameGroup and nameGroup ~= false and nameGroup ~= nil and string.len(nameGroup) >= 3 ) then executeSQLQuery("DELETE FROM GrupsInvite_x22 WHERE NameGroup =? AND Account=? AND Name=?",tostring(nameGroup),tostring(acc),tostring(name)) getAllInvites(source,getElementData(source,"AccountName")) end end) addEvent("GiveRank",true) addEventHandler("GiveRank",root,function(acc,GiveRank) if ( acc and acc ~= false and acc ~= nil and type(acc) == "string" and string.len(acc) >= 1 and GiveRank ) then local Row = executeSQLQuery("SELECT * FROM GrupsMembers_x22 WHERE Account=?",tostring(acc)) local MyRank = getElementData(source,"RankPlayer") local MyAcc = getElementData(source,"AccountName") if ( type(Row) == "table" and #Row == 0 or not Row ) then outputChatBox("#FF0000:#FFFFFF Nenhum jogador encontrado no esquadrão .",source,255,0,0,true) else local PlayerToGiveRank = Row[1]["RankPlayer"] if ( acc == MyAcc ) then outputChatBox("#FF0000:#FFFFFF Você não pode promover você mesmo .",source,255,0,0,true) return end if ( MyRank == "Tenente" or MyRank == "Soldado" ) then outputChatBox("#FF0000:#FFFFFF Você não pode promover .",source,255,0,0,true) return end if ( MyRank == "Major" and GiveRank ~= "Tenente" and PlayerToGiveRank ~= "Soldado" ) then outputChatBox("#FF0000:#FFFFFF Você só pode dar membros .",source,255,0,0,true) return end if ( MyRank == "Coronel" and GiveRank == "General" ) then outputChatBox("#FF0000:#FFFFFF Você só pode dar owner .",source,255,0,0,true) return end if ( MyRank == "Coronel" and PlayerToGiveRank == "General" ) then outputChatBox("#FF0000:#FFFFFF Você não pode promover para owner .",source,255,0,0,true) return end executeSQLQuery("UPDATE GrupsMembers_x22 SET RankPlayer=? WHERE Account=?",tostring(GiveRank),tostring(acc)) outputChatBox("#FFFFFFCargo alterado .",source,0,255,255,true) getAllMembers(source,getElementData(source,"NameGroup")) local plr = getPlayerFromAccount(acc) if not( plr ) then return end setElementData(plr,"RankPlayer",tostring(rank)) end else outputChatBox("#FF0000:#FFFFFF bad argument acc&rank .",source,255,0,0,true) end end) addEvent("GetKick",true) addEventHandler("GetKick",root,function(acc) if ( acc and acc ~= false and acc ~= nil and type(acc) == "string" and string.len(acc) >= 1 ) then local Row = executeSQLQuery("SELECT * FROM GrupsMembers_x22 WHERE Account=?",tostring(acc))
  9. Sorry, my idea is as follows. I want to be a squad chat, all players who have the same squad can see the message is to be a kind of teamchat. Its clear?
  10. Hello I need help to create a teamchat for me. I do not know how they could help me? Here the team is defined by getElementData(player,"NameGroup") could guide me?
×
×
  • Create New...