AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hold All Connected Players Id (https://forums.alliedmods.net/showthread.php?t=228076)

oxygen935 10-13-2013 12:46

Hold All Connected Players Id
 
Hey everyone,

I'm wondering how we can hold each connected players' id and print his ip in console with a command like amx_ip. Important: I don't want a player's ip(like amx_ip "playername here", i know how to do this), but how to hold ALL players' id.

Thanks in advance,
Oxygen

Baws 10-13-2013 14:27

Re: Hold All Connected Players Id
 
Look at this. I think you can learn from this code? https://forums.alliedmods.net/showthread.php?t=227319

Black Rose 10-13-2013 16:42

Re: Hold All Connected Players Id
 
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Test Plugin 3", "", "");         register_clcmd("amx_ip", "cmd_ip", ADMIN_ADMIN); } public cmd_ip(id, level, cid) {         if ( ! cmd_access(id, level, cid, 0) )         return;         new players[32], playersnum;     new name[32], ip[16];         get_players(players, playersnum, "c");         for ( new i = 0 ; i < playersnum ; i++ ) {         get_user_name(players[i], name, charsmax(name));         get_user_ip(players[i], ip, charsmax(ip));                 client_print(id, print_console, "%d: %s, %s", i, name, ip);     } }


All times are GMT -4. The time now is 00:57.

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