freudo Posted May 14, 2015 Posted May 14, 2015 hi I Want change all clan points set to 0 with command Exp: /cpremove "Number One" tag="~¨~" r="102" g="102" b="102" color="#666666" Points="4" "SR" tag="[sR]" r="102" g="102" b="102" color="#666666" Points="5" WOC-DD Destruction Derby -Level system -Clan system -Topwins -Event system for EXP -Podium with animation And more
darhal Posted May 14, 2015 Posted May 14, 2015 function cpremoveCmd(plr, cmd, clan) xml = xmlLoadFile ("clans.xml") for index, childNode in pairs ( xmlNodeGetChildren (xml) ) do local name = xmlNodeGetAttribute (childNode, "isim" ) if name == clan then mlNodeSetAttribute(childNode, "Points", 0) break; end end xmlUnloadFile(xml) end addCommandHandler("cpremove", cpremoveCmd) #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
freudo Posted May 14, 2015 Author Posted May 14, 2015 Not working WOC-DD Destruction Derby -Level system -Clan system -Topwins -Event system for EXP -Podium with animation And more
darhal Posted May 14, 2015 Posted May 14, 2015 post all the code please #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
freudo Posted May 15, 2015 Author Posted May 15, 2015 İ want set 0 value for all clans WOC-DD Destruction Derby -Level system -Clan system -Topwins -Event system for EXP -Podium with animation And more
Walid Posted May 15, 2015 Posted May 15, 2015 İ want set 0 value for all clans try this one function cpremoveCmd(plr, cmd) xml = xmlLoadFile ("clans.xml") for index, childNode in pairs ( xmlNodeGetChildren (xml) ) do xmlNodeSetAttribute(childNode, "Points", 0) outputChatBox("Done",plr,0,255,0) break; end xmlUnloadFile(xml) end addCommandHandler("cpremove", cpremoveCmd) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
darhal Posted May 15, 2015 Posted May 15, 2015 (edited) İ want set 0 value for all clans try this one function cpremoveCmd(plr, cmd) xml = xmlLoadFile ("clans.xml") for index, childNode in pairs ( xmlNodeGetChildren (xml) ) do xmlNodeSetAttribute(childNode, "Points", 0) outputChatBox("Done",plr,0,255,0) break; end xmlSaveFile(xml) xmlUnloadFile(xml) end addCommandHandler("cpremove", cpremoveCmd) OMG puting the break here wil exsit the loop and only the first one will be done so @Barikat try this code function cpremoveCmd(plr, cmd) xml = xmlLoadFile ("clans.xml") for index, childNode in pairs ( xmlNodeGetChildren (xml) ) do xmlNodeSetAttribute(childNode, "Points", 0) end xmlSaveFile(xml) xmlUnloadFile(xml) end addCommandHandler("cpremove", cpremoveCmd) Edited May 15, 2015 by Guest #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
darhal Posted May 15, 2015 Posted May 15, 2015 i forget that i always forget to save anyway thx alwa7sh function cpremoveCmd(plr, cmd) xml = xmlLoadFile ("clans.xml") for index, childNode in pairs ( xmlNodeGetChildren (xml) ) do xmlNodeSetAttribute(childNode, "Points", 0) end xmlSaveFile(xml) xmlUnloadFile(xml) end addCommandHandler("cpremove", cpremoveCmd) #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
freudo Posted May 15, 2015 Author Posted May 15, 2015 Thx. İts working WOC-DD Destruction Derby -Level system -Clan system -Topwins -Event system for EXP -Podium with animation And more
darhal Posted May 15, 2015 Posted May 15, 2015 Thx. İts working Nope you are welcome #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
freudo Posted May 15, 2015 Author Posted May 15, 2015 I have one more question How to I change my clan color change? Client: function renkDegstr(btn) if btn == "left" then local color = guiGetText(renkedit) local r,g,b = getColorFromString(color) triggerServerEvent("updateColor",localPlayer,{renk=color,r=r,g=g,b=b}) end end Sever: Dont work addEvent("updateColor",true) addEventHandler("updateColor",root, function(color) local myClan = getAccountData(getPlayerAccount(source),"clan") if myClan then local xml = xmlLoadFile("clans.xml") if xml then for k,v in ipairs(xmlNodeGetChildren(xml)) do if xmlNodeGetAttribute(v, "tag") == myClan then xmlNodeSetAttribute(v,"r",color.r) xmlNodeSetAttribute(v,"g",color.g) xmlNodeSetAttribute(v,"b",color.b) xmlNodeSetAttribute(v,"color",color.renk) break end end end end end ) WOC-DD Destruction Derby -Level system -Clan system -Topwins -Event system for EXP -Podium with animation And more
ALw7sH Posted May 15, 2015 Posted May 15, 2015 addEvent("updateColor",true) addEventHandler("updateColor",root, function(color) local myClan = getAccountData(getPlayerAccount(source),"clan") if myClan then local xml = xmlLoadFile("clans.xml") if xml then for k,v in ipairs(xmlNodeGetChildren(xml)) do if xmlNodeGetAttribute(v, "tag") == myClan then xmlNodeSetAttribute(v,"r",color.r) xmlNodeSetAttribute(v,"g",color.g) xmlNodeSetAttribute(v,"b",color.b) xmlNodeSetAttribute(v,"color",color.renk) break end end xmlSaveFile(xml) xmlUnloadFile(xml) end end end )
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