Jump to content

Bad argument


Beluga

Recommended Posts

Posted
addEvent("registerPlayer",true) 
addEventHandler("registerPlayer",getRootElement(), 
function(username,password) 
    local xmlFile = xmlLoadFile("players.xml") 
    local playerNode = xmlFindChild(xmlFile,"players",0) 
    if (playerNode) then 
        xmlCreateChild(playerNode,tostring(username)) 
    else 
        xmlCreateChild(xmlFile,"players") 
    end 
end) 

This code gives two WARNING: Bad argument errors:

Bad argument @ 'xmlNodeFindChild' - line: 5

Bad argument @ 'xmlCreateChild' - line: 9

Someone can help me with this?

Posted

something is wrong with loading xml

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

make it a folder else you won't be able to edit the data from players.xml.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

wut Solid?

why?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

if i'm right you can't edit data if the resource is in a zip file, at least never worked like that for me.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

oh, you are right.

thought you are telling to make a folder inside resource and put there that xml file..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

lol, that doesn't make any difference.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

that's why i asked

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

post your meta,

post your xml file.

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Meta file:

<meta> 
    <info author="Cornelis" type="script"/> 
     
    <file src="players.xml"/> 
    <script src="gui_s.lua" type="server"/> 
    <script src="gui.lua" type="client"/> 
</meta> 

Players xml

<players> 
</players> 

//EDIT: It don't show any errors anymore but It don't make a subnode in players.xml

Posted

afair - XML for server side should be loaded in other way than

yup, i am right:

https://wiki.multitheftauto.com/wiki/Meta.xml

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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...