AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_user_info does not work for all vars? (https://forums.alliedmods.net/showthread.php?t=84833)

Pinatz 02-01-2009 15:03

get_user_info does not work for all vars?
 
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 :/

ConnorMcLeod 02-01-2009 15:09

Re: get_user_info does not work for all vars?
 
You have to use query_client_cvar.

Type setinfo in your game console and you will see al avaible setinfos.

Pinatz 02-01-2009 15:28

Re: get_user_info does not work for all vars?
 
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)


ConnorMcLeod 02-01-2009 15:36

Re: get_user_info does not work for all vars?
 
Look at this http://forums.alliedmods.net/showthr...hlight=fps_max

Pinatz 02-01-2009 16:24

Re: get_user_info does not work for all vars?
 
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


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

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