AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Player FPS Display [0.7.1] (https://forums.alliedmods.net/showthread.php?t=90398)

shine771 04-17-2009 17:55

Player FPS Display [0.7.1]
 
1 Attachment(s)
Player FPS Display
[0.7.1]


- Description -

This plugin shows player FPS(Frames per second) as deaths. Useful for KZ and other mods where player death count is useless.

- Cvars -

Quote:

amx_fps_display < 1 / 0 > < On / Off >
- Screenshots -

[IMG]http://img19.**************/img19/9339/scr1t.th.jpg[/IMG]

- Change log -

Code:

0.7.0
* Initial Release

0.7.1
* Little code optimization


Nextra 04-17-2009 18:01

Re: Player FPS Display
 
Hey, well done (although I'm wondering how accurate this is?).

Things you should/could change:

- Cache is_user_connected
- Why not use cs_set_user_deaths?
- Can't you give the ent a unique name so you can hook it exclusively (skip checks). (read joa's post for this:roll:)

joaquimandrade 04-17-2009 18:01

Re: Player FPS Display
 
Nice

PHP Code:

new Ent engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target")) 

Make it global. Then:

Change

Code:

public PlayerFPSHandlerThink(Ent) {
   
    if(pev_valid(Ent) && pev(Ent,pev_iuser4) == HANDLER_ID) {

to
PHP Code:

public PlayerFPSHandlerThink(ent) {
    
    if(
ent == Ent) { 


Exolent[jNr] 04-17-2009 18:08

Re: Player FPS Display
 
That is not how you retrieve player fps.
That is more of the server's fps.

http://forums.alliedmods.net/showthr...&highlight=fps

joaquimandrade 04-17-2009 18:08

Re: Player FPS Display
 
Quote:

Originally Posted by Exolent[jNr] (Post 807902)
That is not how you retrieve player fps.
That is more of the server's fps.

http://forums.alliedmods.net/showthr...&highlight=fps

I thought about that also. But it would be nice if it worked.

I read that here:

http://forums.alliedmods.net/showpos...0&postcount=28

shine771 04-17-2009 18:24

Re: Player FPS Display [0.7.1]
 
Quote:

cs_set_user_deaths
1. Sucks...
2. This isn't CS only.

Quote:

That is not how you retrieve player fps.
That is more of the server's fps.
If server fps is normal, you should get a normal output too.

Returns 0.0 for me.

PHP Code:

public PlayerFPSHandlerThink(ent) {
    
    if(
ent == Ent) { 

Didn't though about that method, because i have always used pev_iuser4 to detect info_target entities. Updated. Thanks :).

Exolent[jNr] 04-17-2009 19:27

Re: Player FPS Display [0.7.1]
 
Quote:

Originally Posted by shine771 (Post 807916)
Returns 0.0 for me.

Are you referring to the msec values?
If so, did you test both pev_pushmsec and UC_Msec?

Even if those don't work, the PreThink still is wrong.

shine771 04-17-2009 19:58

Re: Player FPS Display [0.7.1]
 
Quote:

Are you referring to the msec values?
If so, did you test both pev_pushmsec and UC_Msec?
Yes.

Quote:

Even if those don't work, the PreThink still is wrong.
Have you got a better idea besides Msec?
As far as i understand, while server fps is larger than 100, it'll show player fps correctly. I can't image a server with <100 fps...

fysiks 04-17-2009 20:01

Re: Player FPS Display [0.7.1]
 
net_graph 3 :)

joaquimandrade 04-17-2009 20:02

Re: Player FPS Display [0.7.1]
 
Quote:

Originally Posted by fysiks (Post 807957)
net_graph 3 :)

All players


All times are GMT -4. The time now is 20:11.

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