'LinKin Posted July 10, 2014 Posted July 10, 2014 Hello, I'm trying to modify a child into a xml file that stores some teams. How could I for example; find and change an attribute? I got this: <team name="Street Warriors" tag="|SW|" color="#00FFFF" aclGroup="GMC" required="both"></team> <team name="Team 1" tag="|T1|" color="#990000" aclGroup="-" required="tag"></team> <team name="Team 2" tag="|T2|" color="#009900" aclGroup="-" required="tag"></team> <team name="Team 3" tag="|T3|" color="#000099" aclGroup="-" required="tag"></team> So if I wanted to change 'Team 2' color to #FF00FF so that it becomes like this: <team name="Street Warriors" tag="|SW|" color="#00FFFF" aclGroup="GMC" required="both"></team> <team name="Team 1" tag="|T1|" color="#990000" aclGroup="-" required="tag"></team> <team name="Team 2" tag="|T2|" color="#FF00FF" aclGroup="-" required="tag"></team> <team name="Team 3" tag="|T3|" color="#000099" aclGroup="-" required="tag"></team> how could I do it? I want to make the search based on the 'name' attribute. Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
Max+ Posted July 10, 2014 Posted July 10, 2014 xmlNodeGetAttributes xmlNodeSetAttribute - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
MTA Team botder Posted July 10, 2014 MTA Team Posted July 10, 2014 function saveTeamColor(file, team, color) local rootnode = xmlLoadFile(file) if (not rootnode) then return end local index, node = 0, false repeat node = xmlFindChild(rootnode, "team", index) if (node) then local name = xmlNodeGetAttribute(node, "name") if (name and name == team) then xmlNodeSetAttribute(node, "name", tostring(color)) xmlUnloadFile(rootnode) break end index = index + 1 end until (node) xmlUnloadFile(rootnode) end GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
'LinKin Posted July 10, 2014 Author Posted July 10, 2014 Thanks Necktrox, I'll try it. Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
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