Wisin Posted September 28, 2010 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)
Wisin Posted September 29, 2010 Author Posted September 29, 2010 does someone have idea about what is failing
dzek (varez) Posted September 29, 2010 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 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)!
Wisin Posted September 29, 2010 Author 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?
dzek (varez) Posted September 29, 2010 Posted September 29, 2010 https://wiki.multitheftauto.com/wiki/Debugging 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)!
Wisin Posted September 29, 2010 Author 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.
50p Posted September 29, 2010 Posted September 29, 2010 Debug it on the public server then. Your xml file may be missing some data. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
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