12p Posted October 31, 2010 Share 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) Link to comment
#Paper Posted October 31, 2010 Share Posted October 31, 2010 Is there some way to make this use less CPU? what do you mean? Link to comment
dzek (varez) Posted October 31, 2010 Share Posted October 31, 2010 why -2393.etc instead of X? you can do setElementPosition then setPedFrozen Link to comment
12p Posted October 31, 2010 Author Share Posted October 31, 2010 Because I want the player only moves horizontal. Link to comment
dzek (varez) Posted October 31, 2010 Share Posted October 31, 2010 horizontal? with this you are allowing player to move north-south (if its actually working) and jump. Link to comment
12p Posted October 31, 2010 Author Share 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. Link to comment
dzek (varez) Posted November 1, 2010 Share 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. Link to comment
12p Posted November 1, 2010 Author Share Posted November 1, 2010 It works. I did just wanna know if there is some way to use less CPU and do the same. 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