Raised This Month: $ Target: $400
 0% 

get_user_info does not work for all vars?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pinatz
Member
Join Date: Dec 2008
Old 02-01-2009 , 15:03   get_user_info does not work for all vars?
Reply With Quote #1

Hey guys,
There's something crazy with the command get_user_info I don't understand.

get_user_info(pid, "name", name, 31) <- works

get_user_info(id, "fps_max", fps, 31) <- does not work

This is the Command to give the info to the client :

Code:
console_print(id,"[Fps-check] %s (%s) hat maximal %s(fps_max) bzw %s(fps_modem)",name,authid,fps,modem)
And actually fps and modem given out as strings are "" nothing and as number they are 0 :/
The name is okay but fps does not work.

So I wrote 2 classes to check fps and modem. But the code is quite 8 times long as the one with get_user_info
Code:
static abfrager
static name[32],iPlayers[32],pid, iNum


 public ausgabe(id){
    abfrager=id
    get_players(iPlayers, iNum, "ch");
    client_print(id,print_chat,"Have a look into the console..")
    console_print(abfrager,"[Fps-check] Intializing...")
    for(new i = 0; i < iNum; i++){
        pid = iPlayers[i]
        query_client_cvar(pid, "fps_max","reesults")
    }
    console_print(abfrager,"[Fps-check] Done...")
    console_print(abfrager,"Thanks to Pinatz the developer of this Plugin")
    console_print(abfrager,"Download it from")
    console_print(abfrager,"http://catchmod.de")
    return PLUGIN_HANDLED
  }

  public reesults(id, cvar_name[], cvar_value[]) {
    get_user_name(id, name, 32)
    get_user_authid ( id, authid[id], 30 ) 
    console_print(abfrager,"[Fps-check] %s (%s) hat  %s = %s",name,authid[id],cvar_name,cvar_value)
  }
  
  
 
 public getfpsmodem(id){
    abfrager=id
    get_players(iPlayers, iNum, "ch");
    client_print(id,print_chat,"Have a look into the console..")
    console_print(abfrager,"[Fps_modem-check] Intializing...")
    for(new i = 0; i < iNum; i++){
        pid = iPlayers[i]
        query_client_cvar(pid, "fps_modem","ergebnisse")
    }
    console_print(abfrager,"[Fps_modem-check] Done...")
    console_print(abfrager,"Download this plugin from")
    console_print(abfrager,"http://catchmod.de")
    return PLUGIN_HANDLED
  }

  public ergebnisse(id, cvar_name[], cvar_value[]) {
    get_user_name(id, name, 32)
    get_user_authid ( id, authid[id], 30 ) 
    console_print(abfrager,"%s (%s) hat  %s = %s",name,authid[id],cvar_name,cvar_value)
  }
And you can not compare modem > fps. Because a fps_modem 336 kills a fps_modem 280 and they can use 336.. hm :/
Pinatz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-01-2009 , 15:09   Re: get_user_info does not work for all vars?
Reply With Quote #2

You have to use query_client_cvar.

Type setinfo in your game console and you will see al avaible setinfos.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Pinatz
Member
Join Date: Dec 2008
Old 02-01-2009 , 15:28   Re: get_user_info does not work for all vars?
Reply With Quote #3

Ah okay.
And how can I compare fps with modem and then return only the higher value into my output? ( I'm going to try it myself)

btw somebody should change this then..

http://www.amxmodx.org/funcwiki.php?go=func&id=18

Quote:
//One more example
new getfps[32]
get_user_info(id, "fps_max", getfps, 31)
Pinatz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-01-2009 , 15:36   Re: get_user_info does not work for all vars?
Reply With Quote #4

Look at this http://forums.alliedmods.net/showthr...hlight=fps_max
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Pinatz
Member
Join Date: Dec 2008
Old 02-01-2009 , 16:24   Re: get_user_info does not work for all vars?
Reply With Quote #5

This would kill any developer 1 but I only want to force fps < 300 because the fps at 336 for example is very high

http://members.chello.at/hawkin/CS/Measured.PNG
Pinatz is offline
Reply


Thread Tools
Display Modes

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 01:38.


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