Wisin Posted September 28, 2010 Share Posted September 28, 2010 hi, i got a big bug, i've made a game mode and works like this, you click on a city from a grid list then a team then select the skin and when click "Accept" button will setElementData of city team and skin and then i use onPlayerSpawn to spawn him but dunno why some times it spawns everyone as CJ and falling down at cords 0,0,1000. also outputs this errors, bad argument @ 'xmlNodeGetAttributes' - Line: 32 attempt to index global 'playerAttributes' (a boolean value) line 32 = playerAttributes = xmlNodeGetAttributes(player) function playerSpawn() local playerTeam = getElementData(source, "team") local playerSkin = getElementData(source, "skin") check(source) local xmlFile = xmlLoadFile("Spawns.xml") player = xmlFindChild(xmlFile, "skin", playerSkin-1) playerAttributes = xmlNodeGetAttributes(player) local positionX = playerAttributes.x local positionY = playerAttributes.y local positionZ = playerAttributes.z setElementModel(source, playerAttributes.id) setElementPosition(source, positionX, positionY, positionZ) I = 0 while (xmlFindChild(player, "weapon", I)) do local weapon = xmlFindChild(player, "weapon", I) local weaponAttributes = xmlNodeGetAttributes(weapon) giveWeapon(source, weaponAttributes.name, weaponAttributes.amount) I = I + 1 end end addEventHandler("onPlayerSpawn", getRootElement(), playerSpawn) Link to comment
Wisin Posted September 29, 2010 Author Share Posted September 29, 2010 does someone have idea about what is failing Link to comment
dzek (varez) Posted September 29, 2010 Share Posted September 29, 2010 do not bump your post. give us more than freaking 2 hours to reply error says all: player = xmlFindChild(xmlFile, "skin", playerSkin-1) this is returning false Link to comment
Wisin Posted September 29, 2010 Author Share Posted September 29, 2010 do not bump your post. give us more than freaking 2 hours to reply error says all: player = xmlFindChild(xmlFile, "skin", playerSkin-1) this is returning false yeah but why if some times works fine? Link to comment
dzek (varez) Posted September 29, 2010 Share Posted September 29, 2010 https://wiki.multitheftauto.com/wiki/Debugging Link to comment
Wisin Posted September 29, 2010 Author Share Posted September 29, 2010 https://wiki.multitheftauto.com/wiki/Debugging this error never happend at my test server but it happends at public server some times so i don't even know how it starts. Link to comment
50p Posted September 29, 2010 Share Posted September 29, 2010 Debug it on the public server then. Your xml file may be missing some data. Link to comment
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