12p Posted October 31, 2010 Posted October 31, 2010 Is there some way to make this use less CPU? addEventHandler ("onClientRender",getRootElement(), function () local x,y,z = getElementPosition(getLocalPlayer()) setElementPosition (getLocalPlayer(), x, -2393.986328125, z, false) end)
#Paper Posted October 31, 2010 Posted October 31, 2010 Is there some way to make this use less CPU? what do you mean?
dzek (varez) Posted October 31, 2010 Posted October 31, 2010 why -2393.etc instead of X? you can do setElementPosition then setPedFrozen
12p Posted October 31, 2010 Author Posted October 31, 2010 Because I want the player only moves horizontal.
dzek (varez) Posted October 31, 2010 Posted October 31, 2010 horizontal? with this you are allowing player to move north-south (if its actually working) and jump.
12p Posted October 31, 2010 Author Posted October 31, 2010 check out my video of "I Wanna be the Guy" in Resources forum. There you will see what I'm doing.
dzek (varez) Posted November 1, 2010 Posted November 1, 2010 checked, now i understand. its better to limit the Y to some values (like 1 unit total) i think. idk how to achieve this anyway, something wrong with this code? if it's fine - leave it. i'm creating a gamemode that is using 4 onClientRender at the same time, doich much things. and my weak cpu is still working as always.
12p Posted November 1, 2010 Author Posted November 1, 2010 It works. I did just wanna know if there is some way to use less CPU and do the same.
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