AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_user_name (https://forums.alliedmods.net/showthread.php?t=222646)

Bladell 08-05-2013 03:52

get_user_name
 
I don't uderstand something...how know the plugin what name, ip or id to get?
For example here:
Code:

        new name[ 32 ], name2[ 32 ], ip2[ 16 ];
        get_user_name( id, name, charsmax( name ) );
        get_user_name( player, name2, charsmax( name2 ) );
        get_user_ip( player, ip2, charsmax( ip2 ), 1 );

name = player name
name2 = admin name
id means admin and player = player?...sorry, I don't get it.

fysiks 08-05-2013 05:31

Re: get_user_name
 
Quote:

Originally Posted by Bladell (Post 2005999)
I don't uderstand something...how know the plugin what name, ip or id to get?
For example here:
Code:

        new name[ 32 ], name2[ 32 ], ip2[ 16 ];
        get_user_name( id, name, charsmax( name ) );
        get_user_name( player, name2, charsmax( name2 ) );
        get_user_ip( player, ip2, charsmax( ip2 ), 1 );

name = player name
name2 = admin name
id means admin and player = player?...sorry, I don't get it.

It doesn't matter what the variables are called. It only matters what value the variable contains. "id" just contains an entity number that corresponds to the person that is using the command (assuming you are looking at code from admin.sma). Likewise, the variable "player" just contains an entity number corresponding to a player on the server. So, the output of those functions are are not dependent on the variable names (as it seems you are assuming) but rather the actual value they contain.

Bladell 08-05-2013 11:16

Re: get_user_name
 
I don't understand it...For example, if I (Bladell) execute a command on SOMEBODY, and I want the plugin to show "Bladell execute the command x on SOMEBODY", how do I get my name and the name of SOMEBODY?

fysiks 08-05-2013 11:27

Re: get_user_name
 
Quote:

Originally Posted by Bladell (Post 2006221)
I don't understand it...For example, if I (Bladell) execute a command on SOMEBODY, and I want the plugin to show "Bladell execute the command x on SOMEBODY", how do I get my name and the name of SOMEBODY?

See the code for amx_kick. Everything you need to know is there.


All times are GMT -4. The time now is 15:45.

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