Jump to content

xml no load


kino

Recommended Posts

dear scripters sorry my bad eng

my's script don't load xml files

bad part script

  
function load() 
if  fileExists ( ":mode0/conf/f.xml" ) then 
  local rooti = xmlLoadFile (":mode0/conf/f.xml") 
    local factionroot = xmlFindChild (rooti,"factiones",0) 
  if (not factionroot) then 
    outputDebugString("faction node noload") 
  end 
     
if not rooti then 
   
    outputDebugString("not file load") 
    end 
  
xmlUnloadFile(rooti) 
------ 
outputDebugString ("Factions loaded!") 
else 
outputDebugString ("404") 
end 
end  
  
addEventHandler ( "onResourceStart", resourceRoot, load ) 
  

log:

  
[2011-10-30 01:56:24] Starting resources................. 
[2011-10-30 01:56:26] INFO: not file load 
[2011-10-30 01:56:26] WARNING: [gamemodes]/mode0/loadp.lua:16: Bad argument @ 'xmlNodeFindChild' 
[2011-10-30 01:56:26] INFO: faction node noload 
[2011-10-30 01:56:26] INFO: Factions loaded! 
  
  

meta:

  
<meta> 
    <info author="kino" type="gamemode" name="crm-rdm" /> 
   <script src="loadp.lua" type="server"/> 
   <script src="cligui.lua" type="client"/> 
  
    <file src="conf/f.xml"  /> 
   
  
  
   </meta> 
  

help me :(

Link to comment
function load() 
if  fileExists ( "conf/f.xml" ) then -- If you are loading from the same resource, then no need to put the resource name. 
  local rooti = xmlLoadFile ("conf/f.xml") -- If you are loading from the same resource, then no need to put the resource name. 
  if not rooti then 
        outputDebugString("not file load") 
   end 
   local factionroot = xmlFindChild (rooti,"factiones",0) 
   if (not factionroot) then 
       outputDebugString("faction node noload") 
   end  
outputDebugString ("Factions loaded!") 
else 
    outputDebugString ("404") 
end 
xmlUnloadFile(rooti) 
end 
addEventHandler ( "onResourceStart", resourceRoot, load ) 

Try that.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...