Raised This Month: $ Target: $400
 0% 

Client info changed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
butthead
Member
Join Date: May 2007
Location: Nitra, Slovakia
Old 12-22-2008 , 07:35   Client info changed
Reply With Quote #1

Help me plz,

this problem:

PHP Code:
public client_infochanged(id) {
    
    if (!
is_user_connected(id))
        return 
PLUGIN_CONTINUE;
    
    
query_client_cvar(id"cl_sidespeed""ClientCvarResult")
   
    return 
PLUGIN_CONTINUE;
}

public 
ClientCvarResult(id, const cvar[], const value[]) {

    new 
name[32]
    
    
get_user_name(idname31)

    if(
value[id] > 400// < --- line 153
        
log_amx("Check sidespeed change : Nick %s /// change to value: %s"namevalue)
    return 
PLUGIN_CONTINUE;

Error:
PHP Code:
L 12/22/2008 13:33:01: [AMXXRun time error 5memory access 
L 12
/22/2008 13:33:01: [AMXX]    [0plugin.sma::ClientCvarResult (line 153
Thx
__________________

Last edited by butthead; 12-22-2008 at 07:37.
butthead is offline
L//
Senior Member
Join Date: Aug 2008
Location: Not found
Old 12-22-2008 , 08:40   Re: Client info changed
Reply With Quote #2

change this...

Code:
if(value[id] > 400)
for this...

Code:
if(str_to_num(value) > 400)
and compile
L// is offline
Send a message via MSN to L//
butthead
Member
Join Date: May 2007
Location: Nitra, Slovakia
Old 12-22-2008 , 17:37   Re: Client info changed
Reply With Quote #3

Thanks very much, otherwise "client_infochanged" is not a good idea, and i have problem with "FM_PlayerPreThink", poorly written in the logs, roughly 20 lines the same. What is "FM_CVarGetString" ? Or where is problem?
__________________
butthead is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-22-2008 , 17:41   Re: Client info changed
Reply With Quote #4

I doubt client_infochanged is called when a client changes cvars.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
butthead
Member
Join Date: May 2007
Location: Nitra, Slovakia
Old 12-22-2008 , 17:52   Re: Client info changed
Reply With Quote #5

Responds as if I change the nick...
__________________
butthead is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 12-22-2008 , 20:34   Re: Client info changed
Reply With Quote #6

Hi butthead ...
client_infochanged is called, when a client changes something in 'info' structure (see 'setinfo' console command) that is not purely client-side.
__________________
alien is offline
Send a message via ICQ to alien
butthead
Member
Join Date: May 2007
Location: Nitra, Slovakia
Old 12-23-2008 , 05:27   Re: Client info changed
Reply With Quote #7

Hi alien, thx I understand ... but I need to fix client cheats (cl_sidespeed, developer, fps_max), just for these cvars responds only to change 'info' structure...

Trying another way.. It may be as follows?
PHP Code:
public client_putinserver(id) {

    new 
param[1];param[0] = id
   
    set_task
(3.0"checkCvars"idparam1"b")

public 
checkCvars(param[]) {

    new 
id param[0]
    
    if(!
is_user_alive(id)) {
        return
    }    
    
    
query_client_cvar(id"cl_sidespeed""ClientCvarResult")
    
query_client_cvar(id"developer""ClientCvarResult")
    
query_client_cvar(id"fps_max""ClientCvarResult")    

}

public 
ClientCvarResult(id, const cvar[], const value[]) {

    new 
name[32], auth[32]
    
    
get_user_name(idname31)
    
get_user_authid(idauth31)
    
    if(
equal(cvar"cl_sidespeed") && str_to_num(value) != 400) {
        
        
log_amx("Check sidespeed change >>>> Nick: %s / steam id: %s /// change to value: %s"nameauthvalue)
        
client_cmd(id,"cl_sidespeed 400")

    }
    if(
equal(cvar"developer") && str_to_num(value) != 0) {
        
        
log_amx("Check developer change >>>> Nick: %s / steam id: %s /// change to value: %s"nameauthvalue)
        
client_cmd(id,"developer 0")

    }
    if(
equal(cvar"fps_max") && str_to_num(value) != 101) {
        
        
log_amx("Check fps_max change >>>> Nick: %s / steam id: %s /// change to fps_max: %s"nameauthvalue)
        
client_cmd(id,"fps_max 101")

    }

    return 
PLUGIN_CONTINUE
}

__________________

Last edited by butthead; 12-23-2008 at 05:45.
butthead is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 12-26-2008 , 22:30   Re: Client info changed
Reply With Quote #8

I'm not really into query_client_cvar.
First, it's resource expensive and slow method.
Second, it's asynchronous ... what's not that bad really.
Third and most important reason is that you need to call it really frequently to make it efficient for what you're doing. If you want to protect your KZ server from people using edge bugs with ease @ 20 fps, 3 sec is not enough. You can bind "fps_max 20" to a mouse key, use it just before hitting the edge and plugin will turn it off after 3 secs what's more than enough time to exploit. Calling it with 1 sec interval wouldn't be enough.

The most effective method I've came across is using aliases to block certain client cvars in combination with query_client_cvar, which is called once though. Only downfall is that for aliases to wear off, users need to restart the game.
__________________
alien is offline
Send a message via ICQ to alien
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 09:16.


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