Big Smoker Posted July 31, 2021 Share Posted July 31, 2021 Bom dia, preciso de ajuda com um sistema que eu fiz, finalizei ele agora estou mexendo no banco de dados XML dele. Coloquei um função que detecta a conta do player dentro do XML e seta quando é reiniciado ou logado. Porem ele esta dando um conflito setando os dois. EX: Ele tem que setar o Status "Pedente" como tem no XML: <config> <Group Name="dsad" Founder="UDD2X04CD65D4A0D4D6DZ1X2D566D4Z1" JoinedGroup="31/07/2021" Recrutando="enable" MembersSlot="1"> <Members> <Member Account="UDD2X04CD65D4A0D4D6DZ1X2D566D4Z1" Nickname="Felx" Rank="Founder" Joined="11:14 - 31/07/2021" Status="Confirmado"></Member> <Member Account="P41D1X0S14F46A85X85G4D5GB2SD4C5D" Nickname="MADRUGA" Rank="Member" Joined="11:52 - 31/07/2021" Status="Pendente"></Member> </Members> <Ranks> <Rank Name="Member" A01="0" A02="0" A03="0" A04="0" A05="0" A06="0"></Rank> <Rank Name="SubLeader" A01="1" A02="1" A03="1" A04="0" A05="1" A06="0"></Rank> </Ranks> </Group> </config> So que ele acaba setando tanto o status "Confirmado" quanto o status "Pendente" function startGroupSv() local xml = xmlLoadFile("Groups.xml") for i,player in pairs(getElementsByType("player"))do for i,groupp in pairs(xmlNodeGetChildren(xml)) do -- if tostring(xmlNodeGetAttribute(groupp,"Name")) == tostring(getElementData(player,"Group")) then for i,member in pairs(xmlNodeGetChildren(xmlFindChild(groupp,"Members",0)))do if xmlNodeGetAttribute(member,"Account") == getAccountName(getPlayerAccount(player)) then local Status = xmlNodeGetAttribute(member,"Status") if Status == "Pendente" then outputChatBox("teste") setElementData(player,tostring(xmlNodeGetAttribute(member,"Name")).."_Status","Pendente") elseif Status == "Confirmado" then outputChatBox("teste 2") setElementData(player,"Group",xmlNodeGetAttribute(groupp,"Name")) setElementData(player,"GroupRank",xmlNodeGetAttribute(member,"Rank")) setElementData(player,"GroupJoined",xmlNodeGetAttribute(member,"Joined")) setElementData(player,tostring(xmlNodeGetAttribute(member,"Name")).."_Status","Confirmado") end end end -- end end end xmlUnloadFile(xml) end startGroupSv() QUERO QUE ELE APAREÇA APENAS 1 DE CADA DE ACORDO COM O STATUS QUE MOSTRA EM SUA CONTA. OBRIGADO DESDE JÁ 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