megaman54 Posted April 10, 2014 Posted April 10, 2014 I need these two stats but from my testing i have noticed that they do not work like in single player. Advice would be appreciated on how i can make them work.
MIKI785 Posted April 11, 2014 Posted April 11, 2014 I think the only way is to actually script them. They dont work like that on their own. Lua Scripter Owner of mshost.cz MTA portal.
megaman54 Posted April 11, 2014 Author Posted April 11, 2014 How should i begin to script them? Like how can i calculate the traveled distance on foot?
Ali_Digitali Posted April 11, 2014 Posted April 11, 2014 Try something like this: g_distance = 0 function addDistance() if x then local xNew,yNew,zNew = getElementPosition(localPlayer) local addedDistance = getDistanceBetweenPoints3D(xNew,yNew,zNew,x,y,z) g_distance = g_distance+addedDistance end x,y,z = xNew,yNew,zNew end addEventHandler ("onClientRender", root, addDistance) It checks the distance you traveled between two frames and adds it to a global counter. You can add aditional checks to see if the player is on foot or not and depending on that add the traveled distance to a different counter. I aint got no time to think of a witty signature
megaman54 Posted April 11, 2014 Author Posted April 11, 2014 Try something like this: g_distance = 0 function addDistance() if x then local xNew,yNew,zNew = getElementPosition(localPlayer) local addedDistance = getDistanceBetweenPoints3D(xNew,yNew,zNew,x,y,z) g_distance = g_distance+addedDistance end x,y,z = xNew,yNew,zNew end addEventHandler ("onClientRender", root, addDistance) It checks the distance you traveled between two frames and adds it to a global counter. You can add aditional checks to see if the player is on foot or not and depending on that add the traveled distance to a different counter. Thanks! This should get me started
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