Raised This Month: $ Target: $400
 0% 

[SOLVED]amx_showip / listplayers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-28-2015 , 13:24   [SOLVED]amx_showip / listplayers
Reply With Quote #1

Im looking for a showip/listplayers plugin which works like the following
when admin level slay writes amx_showip / amx_listplayers a console print with the following information will be displayed

ID, Name, IP, Steam ID

Ex:

#1234 Max 123.123.123.42 STEAM:blabla
#43 Klark 23.44.53.123 STEAM: asdasda

I was searching for show ip and list players and i couldnt find anything relevant, i only found couple versions of amx_showip, but they all had malicious code inside...
Seriously, 4 code pages doesn't seem right for me...

Last edited by Depresie; 06-29-2015 at 05:03.
Depresie is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 06-28-2015 , 14:01   Re: [REQ]amx_showip / listplayers
Reply With Quote #2

PHP Code:
#include <amxmodx>

#define PLUGIN "Depresie"
#define VERSION "1.0"
#define AUTHOR "GUG"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("amx_showip""ShowIP")
    
register_srvcmd("amx_showip""ShowIP2")
}

public 
ShowIP(admin)
{
    if (
get_user_flags(admin) & ADMIN_SLAY)
    {
        new 
Players[32], pnumidszName[33], szIp[24], szSteam[24]
        
get_players(Playerspnum"c")
        
        for (new 
i=0i<pnumi++)
        {
            
id Players[i]
            
get_user_name(idszNamecharsmax(szName))
            
get_user_ip(idszIpcharsmax(szIp))
            
get_user_authid(idszSteamcharsmax(szSteam))
            
            
client_print(adminprint_console"#%i %s %s %s"idszNameszIpszSteam)
        }
        
        return 
PLUGIN_HANDLED_MAIN
    
}
}
    
public 
ShowIP2(admin)
{
    new 
Players[32], pnumidszName[33], szIp[24], szSteam[24]
    
get_players(Playerspnum"c")
    
    for (new 
i=0i<pnumi++)
    {
        
id Players[i]
        
get_user_name(idszNamecharsmax(szName))
        
get_user_ip(idszIpcharsmax(szIp))
        
get_user_authid(idszSteamcharsmax(szSteam))
            
        
server_print("#%i %s %s %s"idszNameszIpszSteam)
    }


Last edited by Kz1.0; 06-28-2015 at 14:02.
Kz1.0 is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-28-2015 , 15:09   Re: [REQ]amx_showip / listplayers
Reply With Quote #3

thx, only one question, is this gonna show the player's game id too? or just ip and steam id?
Depresie is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-28-2015 , 15:11   Re: [REQ]amx_showip / listplayers
Reply With Quote #4

Quote:
Originally Posted by Depresie View Post
the player's game id
And what is that? Name, SteamID, and IP are the only things that the server can provide that may or may not be useful to a player in-game.

Edit: There is also a UserID which works for admin commands that use cmd_access().
__________________

Last edited by fysiks; 06-28-2015 at 16:10.
fysiks is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-28-2015 , 15:14   Re: [REQ]amx_showip / listplayers
Reply With Quote #5

Quote:
Originally Posted by Depresie View Post
thx, only one question, is this gonna show the player's game id too? or just ip and steam id?
Test and see ?
__________________
HamletEagle is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-28-2015 , 15:28   Re: [REQ]amx_showip / listplayers
Reply With Quote #6

Can't test right now only tomorow

About the player's game id, i saw on a server a plugin called amx_listplayers that i couldn't find anywhere
When that command was called, in the console was displayed all the players online, with an id like this before their names, #134 #3456 etc

Admins could use that id to ban/kick/ change nick of players with the same names or with special characters
It's way easier to use than ip or steam id

Later Edit:

Managed to fix my PC

Works perfect! it has that ID feature too, very nice, thank you very very much
I think i already owe you guys one kidney lol, btw i think you should release this in the subplugin submissions, since you can't find anything like this, and is a very useful plugin

Last edited by Depresie; 06-28-2015 at 15:44.
Depresie is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-28-2015 , 16:09   Re: [REQ]amx_showip / listplayers
Reply With Quote #7

Quote:
Originally Posted by Depresie View Post
Admins could use that id to ban/kick/ change nick of players with the same names or with special characters
It's way easier to use than ip or steam id
That is called the "userid" which is listed after the name when you use the status command.

Quote:
Originally Posted by Depresie View Post
Works perfect! it has that ID feature too, very nice, thank you very very much
No, the "id" listed in the plugin you've just been given cannot be used for admin commands, i.e. it is not the number that you are talking about. That is the entity id, not the userid.
__________________
fysiks is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-28-2015 , 18:05   Re: [REQ]amx_showip / listplayers
Reply With Quote #8

so, the id displayed by this plugin is the entity's id and it cannot be used for admin commands? are you sure?
because i tried to kick and slay using that id and it worked.. o.O
Depresie is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-28-2015 , 19:43   Re: [REQ]amx_showip / listplayers
Reply With Quote #9

Quote:
Originally Posted by Depresie View Post
so, the id displayed by this plugin is the entity's id and it cannot be used for admin commands? are you sure?
because i tried to kick and slay using that id and it worked.. o.O
It probably worked when you tested it because the userid was coincidentally the same as the entity id. This will happen when you just start up your server and join.

FYI, the userid is the number of players that have connected since the server was started. So, if you connect, disconnect, connect again, you'll see that they won't match (likely). Once the userid count gets above 32, it will be impossible for this coincidence to happen (until you stop the server and start it again at which point it starts at 1 again).

If you go into a server that has been running for a while, you'll see higher userid's. Check it out, just use the status command and look at the userid column.
__________________
fysiks is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-28-2015 , 20:32   Re: [REQ]amx_showip / listplayers
Reply With Quote #10

oh, i understood, thanks
but is there a way i could replace the entity id with user id in this code?
i would like to have somethink like "all in one", or that is not possible?

Last edited by Depresie; 06-28-2015 at 20:33.
Depresie is offline
Reply



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 21:22.


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