TheIceman1 Posted April 9, 2013 Posted April 9, 2013 (edited) Why this dont upload "clans.xml"? Server side: function createclan() local clan = getElementData ( source, "clan" ) setAccountData ( getPlayerAccount(source), "Clan", getElementData ( source, "clan" ) ) local root = xmlLoadFile ("clans.xml") local clanroot = xmlFindChild (root,"clans",0) if (clanroot) then xmlNodeSetAttribute (clanroot,"clan", clan) end end addEvent ( "createclan", true ) addEventHandler ( "createclan", root, createclan ) clans.xml: Edited April 9, 2013 by Guest Need paid scripter just pm me i will accept every job!
TheIceman1 Posted April 9, 2013 Author Posted April 9, 2013 EDITED Nothing happens. Need paid scripter just pm me i will accept every job!
TheIceman1 Posted April 9, 2013 Author Posted April 9, 2013 Post what you do . I edit code,look at first post. Need paid scripter just pm me i will accept every job!
iPrestege Posted April 9, 2013 Posted April 9, 2013 function createclan() local clan = getElementData ( source, "clan" ) setAccountData ( getPlayerAccount(source), "Clan", getElementData ( source, "clan" ) ) local root = xmlLoadFile ("clans.xml") local clanroot = xmlFindChild (root,"clans",0) if (clanroot) then xmlNodeSetAttribute (clanroot,"clan", clan) end xmlSaveFile( clanroot ) xmlUnloadFile ( clanroot ) end addEvent ( "createclan", true ) addEventHandler ( "createclan", root, createclan )
TheIceman1 Posted April 9, 2013 Author Posted April 9, 2013 function createclan() local clan = getElementData ( source, "clan" ) setAccountData ( getPlayerAccount(source), "Clan", getElementData ( source, "clan" ) ) local root = xmlLoadFile ("clans.xml") local clanroot = xmlFindChild (root,"clans",0) if (clanroot) then xmlNodeSetAttribute (clanroot,"clan", clan) end xmlSaveFile( clanroot ) xmlUnloadFile ( clanroot ) end addEvent ( "createclan", true ) addEventHandler ( "createclan", root, createclan ) Nothing happens Need paid scripter just pm me i will accept every job!
TheIceman1 Posted April 9, 2013 Author Posted April 9, 2013 No,and edit "clanroot" to "root" in function xmlSaveFile, and xmlUnloadFile. But dont work. Need paid scripter just pm me i will accept every job!
PaiN^ Posted April 9, 2013 Posted April 9, 2013 Show how you trigger the event + where you set the data .. " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
TheIceman1 Posted April 9, 2013 Author Posted April 9, 2013 Client side: function createclan() if ( source == GUIEditor_Button[2] ) then local clan = guiGetText ( GUIEditor_Edit[1] ) setElementData ( localPlayer, "clan", clan) triggerServerEvent ( "createclan",localPlayer) end end addEventHandler ( "onClientGUIClick", root, createclan ) Need paid scripter just pm me i will accept every job!
iPrestege Posted April 9, 2013 Posted April 9, 2013 Sorry forget something try this now : function createclan() local clan = getElementData ( source, "clan" ) if not isGuestAccount ( getPlayerAccount(source) ) then setAccountData ( getPlayerAccount(source), "Clan", getElementData ( source, "clan" ) ) end local root = xmlLoadFile ("clans.xml") local clanroot = xmlFindChild (root,"clans",0) if (clanroot) then xmlNodeSetAttribute (clanroot,"clan", clan) else clanroot = xmlCreateChild(root, "clans") xmlNodeSetAttribute (clanroot,"clan", clan) end xmlSaveFile( clanroot ) xmlUnloadFile ( clanroot ) end addEvent ( "createclan", true ) addEventHandler ( "createclan", root, createclan )
TheIceman1 Posted April 9, 2013 Author Posted April 9, 2013 Sorry forget something try this now : function createclan() local clan = getElementData ( source, "clan" ) if not isGuestAccount ( getPlayerAccount(source) ) then setAccountData ( getPlayerAccount(source), "Clan", getElementData ( source, "clan" ) ) end local root = xmlLoadFile ("clans.xml") local clanroot = xmlFindChild (root,"clans",0) if (clanroot) then xmlNodeSetAttribute (clanroot,"clan", clan) else clanroot = xmlCreateChild(root, "clans") xmlNodeSetAttribute (clanroot,"clan", clan) end xmlSaveFile( clanroot ) xmlUnloadFile ( clanroot ) end addEvent ( "createclan", true ) addEventHandler ( "createclan", root, createclan ) Nothing happens. Need paid scripter just pm me i will accept every job!
TheIceman1 Posted April 9, 2013 Author Posted April 9, 2013 No errors. Need paid scripter just pm me i will accept every job!
TheIceman1 Posted April 9, 2013 Author Posted April 9, 2013 Fixed. Need paid scripter just pm me i will accept every job!
MR.S3D Posted April 9, 2013 Posted April 9, 2013 function createclan() local xml = xmlLoadFile ("clans.xml") local clan = getElementData ( source, "clan" ) if not isGuestAccount ( getPlayerAccount(source) ) then setAccountData ( getPlayerAccount(source), "Clan", getElementData ( source, "clan" ) ) end local clanroot if (not xml) then xmlFile = xmlCreateFile(xml, "settings") clanroot = xmlCreateChild(xml, "clans") xmlNodeSetAttribute (clanroot,"clan", clan) else clanroot = xmlFindChild (xml,"clans",0) if clanroot then xmlNodeSetAttribute (clanroot,"clan", clan) else clanroot = xmlCreateChild(xml, "clans") xmlNodeSetAttribute (clanroot,"clan", clan) end end xmlSaveFile( xml ) xmlUnloadFile ( xml ) end addEvent ( "createclan", true ) addEventHandler ( "createclan", root, createclan ) Welcom to my server Q.5 Current game type in my server Drift my Email : [email protected] Programming level: 90%
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