This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[Orpheu] Hook GetStatsString


Post New Thread Reply   
 
Thread Tools Display Modes
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 05-14-2015 , 05:53   Re: [Orpheu] Hook GetStatsString
Reply With Quote #11

So, how to correctly call GetStatsString function with orpheu?
FromTheFuture is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-14-2015 , 06:47   Re: [Orpheu] Hook GetStatsString
Reply With Quote #12

I don't know why with Orpheu it doesn't work properly, but if you want to the same value as the one from "stats" command, it does just 1.0 / host_frametime. Frame time can be likely retrieved with glb_frametime (using global_get).
__________________
Arkshine is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 05-14-2015 , 07:10   Re: [Orpheu] Hook GetStatsString
Reply With Quote #13

Quote:
Originally Posted by Arkshine View Post
I don't know why with Orpheu it doesn't work properly, but if you want to the same value as the one from "stats" command, it does just 1.0 / host_frametime. Frame time can be likely retrieved with glb_frametime (using global_get).
But I do this call right?
FromTheFuture is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-14-2015 , 07:27   Re: [Orpheu] Hook GetStatsString
Reply With Quote #14

You don't have to use Orpheu.

Code:
new Float:frametime; global_get(glb_frametime, frametime); new Float:FPS = 1.0 / frametime; server_print("FPS = %.2f", FPS);
__________________

Last edited by Arkshine; 05-14-2015 at 07:28.
Arkshine is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 05-14-2015 , 08:10   Re: [Orpheu] Hook GetStatsString
Reply With Quote #15

Quote:
Originally Posted by Arkshine View Post
You don't have to use Orpheu.

Code:
new Float:frametime; global_get(glb_frametime, frametime); new Float:FPS = 1.0 / frametime; server_print("FPS = %.2f", FPS);
Why? And how I can get cpu usage without orpheu? In previous page im show my version with Con_Printf
FromTheFuture is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-14-2015 , 08:38   Re: [Orpheu] Hook GetStatsString
Reply With Quote #16

Sorry, looks like I've confused CPU and FPS.

Did you try if it works better using Okapi?
__________________
Arkshine is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 05-14-2015 , 08:49   Re: [Orpheu] Hook GetStatsString
Reply With Quote #17

Quote:
Originally Posted by Arkshine View Post
Sorry, looks like I've confused CPU and FPS.

Did you try if it works better using Okapi?
Yes, I have Okapi version, but interested how must call GetStatsString via orpheu.
FromTheFuture is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-14-2015 , 08:53   Re: [Orpheu] Hook GetStatsString
Reply With Quote #18

Does it work with Okapi?
__________________
Arkshine is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 05-14-2015 , 08:57   Re: [Orpheu] Hook GetStatsString
Reply With Quote #19

Quote:
Originally Posted by Arkshine View Post
Does it work with Okapi?
Yes, one guy help me.
PHP Code:
public ConCmd_GetStats()
{
        new 
szResult[BUFFER_SIZE];
       
        
okapi_call(g_iFuncGetStatsStringg_ptrAllocedStringBUFFER_SIZE);
        
okapi_get_ptr_string(g_ptrAllocedStringszResultBUFFER_SIZE 1);
       
        
server_print("CPU   In    Out   Uptime  Users   FPS    Players\n%s"szResult);

FromTheFuture is offline
Old 05-14-2015, 09:31
Arkshine
This message has been deleted by Arkshine. Reason: nvm
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-14-2015 , 09:33   Re: [Orpheu] Hook GetStatsString
Reply With Quote #20

What is g_ptrAllocedString? Well if you can use Okapi, not sure why you want to use Orpheu.
__________________
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode