Raised This Month: $ Target: $400
 0% 

[REQ] Only admins can connect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Schpraaankiii
Veteran Member
Join Date: Dec 2009
Location: Sweden Norrköping
Old 03-07-2012 , 15:30   [REQ] Only admins can connect
Reply With Quote #1

Hi there, I want a plugin that would make it only able for admins with accessflag "p" to connect to the server and if that is'nt possible I want a plugin that will automatically kick all players when they connect if they don't have accessflag "p".

I need this because I have a HNS server and an build server for that server where we build blocks, and we have tried with a password but there is always someone who give it to a regular player or someone who forgets it / changes it.

Don't tell me to use the search function or google it because I have allready done that!

Please help me!
Sorry for my bad English

Update:

Problem solved. ( I use accessflag "n" instead of "p" )

Quote:
Originally Posted by fysiks View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>

public client_authorized(id)
{
    new 
szName[32], szSteamID[32];
    
get_user_name(idszNamecharsmax(szName));
    
get_user_authid(idszSteamIDcharsmax(szSteamID));

    
set_hudmessage(02550, -1.0, -1.0)
    if( 
/*is_user_admin(id)*/ get_user_flags(id) & ADMIN_LEVEL_B )
    {
        
show_hudmessage(id"The admin %s has connected! (%s)"szNameszSteamID)
    }
    else
    {
        
show_hudmessage(id"The player %s dont have permission to connect! (%s)"szNameszSteamID)
        
server_cmd("kick #%d ^"Only admins can connectYou can aply for an admin job at www.badstyle.comze.com^""get_user_userid(id));
    }

__________________
CAOSK-ESPORTS.COM

Last edited by Schpraaankiii; 03-14-2012 at 13:48.
Schpraaankiii is offline
Send a message via Skype™ to Schpraaankiii
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-07-2012 , 15:38   Re: [REQ] Only admins can connect
Reply With Quote #2

You don't need plugin for this, look in the amxx.cfg.

Code:
// Mode of logging to a server
// 0 - disable logging, players won't be checked (and access won't be set)
// 1 - normal mode which obey flags set in accounts
// 2 - kick all players not on list
You will to edit the users.ini.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Schpraaankiii
Veteran Member
Join Date: Dec 2009
Location: Sweden Norrköping
Old 03-07-2012 , 15:41   Re: [REQ] Only admins can connect
Reply With Quote #3

Quote:
Originally Posted by wickedd View Post
You don't need plugin for this, look in the amxx.cfg.

Code:
// Mode of logging to a server
// 0 - disable logging, players won't be checked (and access won't be set)
// 1 - normal mode which obey flags set in accounts
// 2 - kick all players not on list
You will to edit the users.ini.
So if I want a player to be able to connect I would just give him flag "z"?

EDIT:


Quote:
Originally Posted by kramesa View Post
try this

Code:
#include <amxmodx> #include <amxmisc> public client_connect(id) {     if(get_user_flags(id) & ADMIN_LEVEL_D) { } else {           server_cmd("kick #%d ^"Only admins can connect^"", get_user_userid(id))     } }
Does'nt work. Noone can connect even if you have all accessflags :/
__________________
CAOSK-ESPORTS.COM

Last edited by Schpraaankiii; 03-07-2012 at 15:54.
Schpraaankiii is offline
Send a message via Skype™ to Schpraaankiii
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-07-2012 , 15:54   Re: [REQ] Only admins can connect
Reply With Quote #4

Quote:
Originally Posted by wickedd View Post
You don't need plugin for this, look in the amxx.cfg.

Code:
// Mode of logging to a server
// 0 - disable logging, players won't be checked (and access won't be set)
// 1 - normal mode which obey flags set in accounts
// 2 - kick all players not on list
You will to edit the users.ini.
This is the best method.

Quote:
Originally Posted by kramesa View Post
try this

Code:
#include <amxmodx> #include <amxmisc> public client_connect(id) {     if(get_user_flags(id) & ADMIN_LEVEL_D) { } else {           server_cmd("kick #%d ^"Only admins can connect^"", get_user_userid(id))     } }
Plugin is not necessary for this. Already a feature of AMXX.

Quote:
Originally Posted by Schpraaankiii View Post
So if I want a player to be able to connect I would just give him flag "z"?
As long as he is listed in the users.ini, any flag will work.

Quote:
Originally Posted by Schpraaankiii View Post
Does'nt work. Noone can connect even if you have all accessflags :/

Shoud'nt it be:

Code:
#include <amxmodx> #include <amxmisc> public client_connect(id) {     if(get_user_flags(id) & ADMIN_LEVEL_D) { } else {           server_cmd("kick #%d ^"Only admins can connect^", get_user_userid(id))     } }
No, and that shouldn't be used anyway.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Schpraaankiii
Veteran Member
Join Date: Dec 2009
Location: Sweden Norrköping
Old 03-07-2012 , 16:02   Re: [REQ] Only admins can connect
Reply With Quote #5

Code:
#include <amxmodx> #include <amxmisc> public client_connect(id) {     new szName[32], szSteamID[32];     get_user_name(id, szName, charsmax(szName));     get_user_authid(id, szSteamID, charsmax(szSteamID));         if(get_user_flags(id) & ADMIN_LEVEL_D)     {         server_print("The admin %s is connected! (%s)", szName, szSteamID);         return PLUGIN_HANDLED;     }     else     {           server_print("The player %s dont have permission to connect! (%s)", szName, szSteamID);         server_cmd("kick #%d ^"Only admins can connect^"", get_user_userid(id));         return PLUGIN_HANDLED;     }     return PLUGIN_CONTINUE; }
This plugin will add the message to the players that tries to connect that the server only are for admins so I want this plugin.
I will add myself an link to our homepage where you can aply for an admin job in the message to.

Thank you!
__________________
CAOSK-ESPORTS.COM

Last edited by Schpraaankiii; 03-07-2012 at 16:07.
Schpraaankiii is offline
Send a message via Skype™ to Schpraaankiii
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 03-07-2012 , 16:06   Re: [REQ] Only admins can connect
Reply With Quote #6

Quote:
Originally Posted by Schpraaankiii View Post
Code:
#include <amxmodx> #include <amxmisc> public client_connect(id) {     new szName[32], szSteamID[32];     get_user_name(id, szName, charsmax(szName));     get_user_authid(id, szSteamID, charsmax(szSteamID));         if(get_user_flags(id) & ADMIN_LEVEL_D)     {         server_print("The admin %s is connected! (%s)", szName, szSteamID);         return PLUGIN_HANDLED;     }     else     {           server_print("The player %s dont have permission to connect! (%s)", szName, szSteamID);         server_cmd("kick #%d ^"Only admins can connect^"", get_user_userid(id));         return PLUGIN_HANDLED;     }     return PLUGIN_CONTINUE; }
This plugin will add the message to the players that tries to connect that the server only are for admins so I want this plugin.
I will add myself an link to our homepage where you can aply for an admin job in the message to.
This is the function of this plugin.
__________________
kramesa is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 03-07-2012 , 15:58   Re: [REQ] Only admins can connect
Reply With Quote #7

Quote:
Originally Posted by Schpraaankiii View Post
So if I want a player to be able to connect I would just give him flag "z"?

EDIT:




Does'nt work. Noone can connect even if you have all accessflags :/
Updated, try now
__________________
kramesa is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 03-07-2012 , 15:40   Re: [REQ] Only admins can connect
Reply With Quote #8

Code:
#include <amxmodx> #include <amxmisc> public client_connect(id) {     new szName[32], szSteamID[32];     get_user_name(id, szName, charsmax(szName));     get_user_authid(id, szSteamID, charsmax(szSteamID));         if(get_user_flags(id) & ADMIN_LEVEL_D)     {         server_print("The admin %s is connected! (%s)", szName, szSteamID);         return PLUGIN_HANDLED;     }     else     {           server_print("The player %s dont have permission to connect! (%s)", szName, szSteamID);         server_cmd("kick #%d ^"Only admins can connect^"", get_user_userid(id));         return PLUGIN_HANDLED;     }     return PLUGIN_CONTINUE; }
__________________

Last edited by kramesa; 03-07-2012 at 15:58.
kramesa is offline
Schpraaankiii
Veteran Member
Join Date: Dec 2009
Location: Sweden Norrköping
Old 03-07-2012 , 16:08   Re: [REQ] Only admins can connect
Reply With Quote #9

Yes, I only explained to exolent why I use this method instead of the easy one :p

Edit:

Quote:
Originally Posted by kramesa View Post
Code:
#include <amxmodx> #include <amxmisc> public client_connect(id) {     new szName[32], szSteamID[32];     get_user_name(id, szName, charsmax(szName));     get_user_authid(id, szSteamID, charsmax(szSteamID));         if(get_user_flags(id) & ADMIN_LEVEL_D)     {         server_print("The admin %s is connected! (%s)", szName, szSteamID);         return PLUGIN_HANDLED;     }     else     {           server_print("The player %s dont have permission to connect! (%s)", szName, szSteamID);         server_cmd("kick #%d ^"Only admins can connect^"", get_user_userid(id));         return PLUGIN_HANDLED;     }     return PLUGIN_CONTINUE; }
Still can't connect with accessflag "p" :/ ...not with any accessflag
__________________
CAOSK-ESPORTS.COM

Last edited by Schpraaankiii; 03-07-2012 at 17:24.
Schpraaankiii is offline
Send a message via Skype™ to Schpraaankiii
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 03-07-2012 , 18:30   Re: [REQ] Only admins can connect
Reply With Quote #10

Does'nt work for me either
Ejziponken 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:09.


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