Weser Posted November 22, 2016 Share Posted November 22, 2016 Hello im trying to do auto save with event but it doesnt work im trying to use this function getPosition(player) local x,y,z = getElementPosition(player) local rx,ry,rz = getElementRotation(player) outputChatBox(x..","..y..","..z..","..rx..","..ry..","..rz,player,155,155,155) end but it doesnt work but when i do with this it works but i dont need with command i need with auto save which saves automaticly maybe someone can help ? function getPosition(player) local x,y,z = getElementPosition(player) local rx,ry,rz = getElementRotation(player) outputChatBox(x..","..y..","..z..","..rx..","..ry..","..rz,player,155,155,155) end addCommandHandler("pos", getPosition) Link to comment
ViRuZGamiing Posted November 22, 2016 Share Posted November 22, 2016 The function needs to be called (started by some sort of action) a command calls it, there are also events which do, such as: onPlayerLogin. Or you could make your own event (addEvent & addEventHandler) to call the function with a timer. Link to comment
Dazee Posted November 23, 2016 Share Posted November 23, 2016 17 hours ago, Weser said: Hello im trying to do auto save with event but it doesnt work im trying to use this function getPosition(player) local x,y,z = getElementPosition(player) local rx,ry,rz = getElementRotation(player) outputChatBox(x..","..y..","..z..","..rx..","..ry..","..rz,player,155,155,155) end but it doesnt work but when i do with this it works but i dont need with command i need with auto save which saves automaticly maybe someone can help ? function getPosition(player) local x,y,z = getElementPosition(player) local rx,ry,rz = getElementRotation(player) outputChatBox(x..","..y..","..z..","..rx..","..ry..","..rz,player,155,155,155) end addCommandHandler("pos", getPosition) To save the position you have to use setAccountData and getAccountData or SQL queries, or if you meant to text file you can do XML. All the information on how to do this is available on wiki.multitheftauto.com. 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