Raised This Month: $ Target: $400
 0% 

get_user_info does not work...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Opik
New Member
Join Date: Jun 2006
Old 06-19-2006 , 18:58   get_user_info does not work...
Reply With Quote #1

Code:
public cmdip(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED
	
	new arg[32], name[32], ip[40], name2[32]
	
	read_argv(1, arg, 31)
	
	new player = cmd_target(id, arg, 5)
	
	if (!player)
		return PLUGIN_HANDLED

	get_user_name(player, name, 31)	
	get_user_info(player, "net_address", ip, 40)  // it not working
	get_user_info(player, "name", name2, 40)  // it works

	console_print(id, "%s net_address is: %s", name, ip)
	return PLUGIN_HANDLED
}
Result is:
Quote:
Opik net_address is:
Dont offer me use get_user_ip.
Opik is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 06-19-2006 , 20:45  
Reply With Quote #2

get_user_info will only display certain things. It will not work for net_address. I believe net_address is only a serverside setting. Your only way is get_user_ip but you don't want that option.

If you do a setinfo on your client cs console. Then those are the are one you can get
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Opik
New Member
Join Date: Jun 2006
Old 06-20-2006 , 04:27  
Reply With Quote #3

How I can see, net_address in client console return local IP address. How I can get this?
client_cmd does not return a value.

Any opinions?
Opik is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-20-2006 , 04:35  
Reply With Quote #4

Quote:
I believe net_address is only a serverside setting. Your only way is get_user_ip
Also you can probably get client "ip" CVAR value using query_client_cvar native (more info: http://www.amxmodx.org/funcwiki.php)
VEN is offline
Opik
New Member
Join Date: Jun 2006
Old 06-20-2006 , 05:00  
Reply With Quote #5

Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    register_plugin("new ban system 2", "0.1", "Opik");
    register_concmd("amx_ip2", "cmdip", ADMIN_BAN, "<name or #userid>")
}


public cmdip(id, level, cid)
{
        if (!cmd_access(id, level, cid, 2))
                return PLUGIN_HANDLED

        new arg[32]

        read_argv(1, arg, 31)

        new player = cmd_target(id, arg, 5)

        if (!player)
                return PLUGIN_HANDLED

        if (!is_user_bot(player)) query_client_cvar(player, "net_address", "cvar_result_func", id);
        return PLUGIN_HANDLED
}

public cvar_result_func(id, const cvar[], const value[], test)
{
    new name[32];
    get_user_name(id, name, 31);

    console_print(test, "%s local ip is: %s", name, value)
}
hlds crashes:
Quote:
./hlds_run: line 342: 16157 Segmentation fault (core dumped) $HL_CMD
gdb: Symbol `emacs_ctlx_keymap' has different size in shared object, consider re-linking
"/home/tpyn/opik/CWSERVER/core.16157" is not a core dump: File truncated
debug.cmds:1: Error in sourced command file:
No stack.
debug.log:
Quote:
CRASH: Tue Jun 20 11:53:04 EEST 2006
Start Line: ./hlds_i686 -game cstrike -debug +sv_lan 1 +map de_dust2 +maxplayers 18 +port 27020 -pingboost 2 + mapchangecfgfile server.cfg -nomaster -pidfil$
Using host libthread_db library "/lib/tls/libthread_db.so.1".
End of crash report
Opik is offline
Opik
New Member
Join Date: Jun 2006
Old 06-20-2006 , 12:08  
Reply With Quote #6

Where is problem?
Opik is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 06-20-2006 , 13:26  
Reply With Quote #7

Is your HLDS up-to-date?
__________________
hello, i am pm
PM 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 08:03.


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