AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Example code how to do it ? (https://forums.alliedmods.net/showthread.php?t=273290)

Awesome_man 10-17-2015 06:00

Example code how to do it ?
 
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 ?

Depresie 10-17-2015 06:11

Re: Example code how to do it ?
 
you cannot retrieve player's client settings AFAIK

Arkshine 10-17-2015 06:23

Re: Example code how to do it ?
 
http://www.amxmodx.org/api/cvars/query_client_cvar

Awesome_man 10-17-2015 06:46

Re: Example code how to do it ?
 
Quote:

Originally Posted by Arkshine (Post 2353884)

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 ?

Arkshine 10-17-2015 06:59

Re: Example code how to do it ?
 
get_players
console_print

fysiks 10-17-2015 13:08

Re: Example code how to do it ?
 
Quote:

Originally Posted by Awesome_man (Post 2353890)
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.

Depresie 10-17-2015 14:08

Re: Example code how to do it ?
 
so, you can get player's volume value ? :O

Bugsy 10-17-2015 15:10

Re: Example code how to do it ?
 
Quote:

Originally Posted by Depresie (Post 2354016)
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 );




All times are GMT -4. The time now is 22:08.

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