Piorun Posted July 16, 2011 Posted July 16, 2011 Hi My code function deleteVeh(source) if isPedInVehicle(source) then local veh = getPedOccupiedVehicle(source) local data = getElementData(veh, "datanum") if data then local xmlfile = xmlLoadFile("veh.xml") for i, node in ipairs(xmlNodeGetChildren(xmlfile)) do local datanode = xmlNodeGetAttribute(node, "datanum") if data == datanode then local result = xmlDestroyNode(node) xmlSaveFile(xmlfile) destroyElement(veh) end end end end end addCommandHandler("usunauto", deleteVeh) Is working when i restart resource. In other functions i've got creating a vehicle and saveing few info into xml file. When i create a veh and enter to it this function doesn't work, but when i restart resource and enter again - it's working. Why?
Jaysds1 Posted July 17, 2011 Posted July 17, 2011 is this script suppose to delete a vehicle when a person leaves the vehicle??? My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Piorun Posted July 17, 2011 Author Posted July 17, 2011 Ok doesn't matter .. I fix my code and now is working . Bye.
JR10 Posted July 17, 2011 Posted July 17, 2011 Can you post what you did, so that if someone searches for such topic he finds the answer. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Jaysds1 Posted July 22, 2011 Posted July 22, 2011 Ok doesn't matter .. I fix my code and now is working . Bye. Why are you talking like that, I asked if it's suppose to delete the vehicle, I wanted to know more so I could help you with the script... My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Piorun Posted July 22, 2011 Author Posted July 22, 2011 I do nothing I sell this code to other user, but i can paste code here. Want it?
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