Raised This Month: $ Target: $400
 0% 

Example code how to do it ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 10-17-2015 , 06:00   Example code how to do it ?
Reply With Quote #1

I want to get cl_cmdrate value of all players of my server in console by a command in dis way

Player1 = cl_cmdrate ""
player2 = cl_cmrate ""

and so on

how to do it ?
Awesome_man is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 10-17-2015 , 06:11   Re: Example code how to do it ?
Reply With Quote #2

you cannot retrieve player's client settings AFAIK
Depresie is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-17-2015 , 06:23   Re: Example code how to do it ?
Reply With Quote #3

http://www.amxmodx.org/api/cvars/query_client_cvar
__________________
Arkshine is offline
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 10-17-2015 , 06:46   Re: Example code how to do it ?
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
Actually i don't need it i just want an example of this type of plugin..
Say i want to get all players name in console by a console command how can i do that ?
Awesome_man is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-17-2015 , 13:08   Re: Example code how to do it ?
Reply With Quote #5

Quote:
Originally Posted by Awesome_man View Post
Actually i don't need it i just want an example of this type of plugin..
Say i want to get all players name in console by a console command how can i do that ?
If you want to get help, you need to ask for what you actually want and not "an example" because too often peoples' examples aren't representative.
__________________
fysiks is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-17-2015 , 06:59   Re: Example code how to do it ?
Reply With Quote #6

get_players
console_print
__________________
Arkshine is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 10-17-2015 , 14:08   Re: Example code how to do it ?
Reply With Quote #7

so, you can get player's volume value ? :O
Depresie is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-17-2015 , 15:10   Re: Example code how to do it ?
Reply With Quote #8

Quote:
Originally Posted by Depresie View Post
so, you can get player's volume value ? :O
Replace "volume" with what you want to get.
PHP Code:
#include <amxmodx>

public plugin_init() 
{
    
register_concmd"getvol" "GetVolumeVal" );
}

public 
GetVolumeVal()
{
    new 
iPlayers32 ] , iNum szName32 ] , iPlayer;
    
    
get_playersiPlayers iNum "ch" );
    
    for ( new 
iNum i++ )
    {
        
iPlayer iPlayers];
        
        
get_user_nameiPlayer szName charsmaxszName ) );
    
        
query_client_cvariPlayer "volume" "CvarValCB" sizeofszName ) , szName );
    }
    
    return 
PLUGIN_HANDLED;
}

public 
CvarValCBid , const cvar[] , const value[] , const param[] )
{
    
server_print"Player id [%d] - %s - %s value is %s" id param cvar value );

__________________

Last edited by Bugsy; 10-17-2015 at 15:11.
Bugsy 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 22:08.


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