Moderators IIYAMA Posted September 11, 2012 Moderators Posted September 11, 2012 How can I receive fps data of a player? I can't find any functions about the fps. Only " setFPSLimit". Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Anderl Posted September 11, 2012 Posted September 11, 2012 You must make a function to get FPS by yourself. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Kenix Posted September 11, 2012 Posted September 11, 2012 local iFPS = 0 local iFrames = 0 function GetFPS( ) return iFPS end addEventHandler( 'onClientRender', root, function() iFrames = iFrames + 1 end ) setTimer( function() iFPS = iFrames; iFrames = 0 end, 1000, 0 ) Updated So you need just call function GetFPS. Also you should modify this code for yourself. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Moderators IIYAMA Posted September 11, 2012 Author Moderators Posted September 11, 2012 ah this is how it works. Thx Kenix I never thought about client render. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Kenix Posted September 11, 2012 Posted September 11, 2012 No problem. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Fresku Posted September 12, 2012 Posted September 12, 2012 No problem. Instead of using laggy timers, you can also use getTickCount() in the onClientRender function itself. edit: local iFPS = 0 local iFrames = 0 function GetFPS( ) return iFPS end addEventHandler( 'onClientRender', root, function() iFrames = iFrames + 1 if getTickCount () %800 < 15 then iFPS = iFrames; iFrames = 0 end end ) I know you bitches hatin'... I'm in the new Aston; the one Swizz created.
Kenix Posted September 12, 2012 Posted September 12, 2012 local iFPS = 0 local iFrames = 0 local iStartTick = getTickCount() function GetFPS( ) return iFPS end addEventHandler( 'onClientRender', root, function() iFrames = iFrames + 1 if getTickCount() - iStartTick >= 1000 then iFPS = iFrames iFrames = 0 iStartTick = getTickCount() end end ) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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