zaticsergiu Posted February 21, 2014 Posted February 21, 2014 function addPickup ( playerSource ) local playerX, playerY, playerZ = getElementPosition( playerSource ) local playerR = getPedRotation ( playerSource ) local locationID = #taxiLocations + 1 local XMLTaxiLocations = xmlLoadFile ( "XML\\taxi_locations.xml" ) local addNode = xmlCreateChild(XMLTaxiLocations, "location") xmlSaveFile(XMLTaxiLocations) xmlNodeSetAttribute(addNode, "id", locationID) xmlNodeSetAttribute(addNode, "posX", playerX) xmlNodeSetAttribute(addNode, "posY", playerY) xmlNodeSetAttribute(addNode, "posZ", playerZ) xmlNodeSetAttribute(addNode, "rot", playerR) xmlSaveFile(XMLTaxiLocations) xmlUnloadFile ( XMLTaxiLocations ) taxiLocations[locationID] = {} taxiLocations[locationID]["x"] = playerX taxiLocations[locationID]["y"] = playerY taxiLocations[locationID]["z"] = playerZ taxiLocations[locationID]["r"] = playerR outputChatBox ( "Taxi location saved.", playerSource ); end addCommandHandler ("addPickup", addPickup, true)
zaticsergiu Posted February 21, 2014 Author Posted February 21, 2014 when i write /addPickup nothing happens ps. sorry for my bad english
Bonsai Posted February 21, 2014 Posted February 21, 2014 use /debugscript 3 and then try again. It will show you exactly whats wrong. If you still don't know how to fix, post the error message here.
zaticsergiu Posted February 21, 2014 Author Posted February 21, 2014 no error message from resource rrtaxi
Bonsai Posted February 21, 2014 Posted February 21, 2014 Try to add some outputChatBox to see how far it gets. But first make sure you have access to the command, since u made it restricted. https://wiki.multitheftauto.com/wiki/AddCommandHandler addCommandHandler ("addPickup", addPickup, true) Try addCommandHandler ("addPickup", addPickup) instead.
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