Raised This Month: $63 Target: $400
 15% 

Admins for each map


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-21-2019 , 19:40   Re: Admins for each map
Reply With Quote #11

Doing this would make it so that nobody is admin on any maps that don't have an amx_addadmin in the map-specific config file which seems like a strange thing to do. The OP said he wanted to add admins not replace/define all admins on a per-map basis.

FYI, the OnAutoConfigsBuffered forward does not exist in the currently released version of AMX Mod X (v1.8.2) so you should specify that you need 1.9.0.
__________________

Last edited by fysiks; 01-21-2019 at 19:50.
fysiks is offline
DJEarthQuake
Senior Member
Join Date: Jan 2014
Location: Midwest
Old 01-21-2019 , 20:23   Re: Admins for each map
Reply With Quote #12

I just retested it. Amx_addadmin wasn't what I thought it was. 1.9 forward only. Where is that so I can be of better help next time?
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 01-22-2019 at 01:22.
DJEarthQuake is offline
SomewhereLost
Senior Member
Join Date: Mar 2014
Location: Tomorrowland
Old 01-21-2019 , 21:25   Re: Admins for each map
Reply With Quote #13

To be more specific, de_ maps would have 2 admins, cs_ maps 3 completely different admins and so on.
And yes, I use 182 and not going to do any changes any time soon.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
DJEarthQuake
Senior Member
Join Date: Jan 2014
Location: Midwest
Old 01-21-2019 , 21:38   Re: Admins for each map
Reply With Quote #14

Flag management in your per map prefixes.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
SomewhereLost
Senior Member
Join Date: Mar 2014
Location: Tomorrowland
Old 01-21-2019 , 22:03   Re: Admins for each map
Reply With Quote #15

Nope and nope, not even close.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
DJEarthQuake
Senior Member
Join Date: Jan 2014
Location: Midwest
Old 01-22-2019 , 00:52   Re: Admins for each map
Reply With Quote #16

Quote:
Originally Posted by SomewhereLost View Post
To be more specific, de_ maps would have 2 admins, cs_ maps 3 completely different admins and so on.
And yes, I use 182 and not going to do any changes any time soon.

user_flags
Usage: user_flags <name or #userid> [flags] [+|-] - gets/sets/adds/subtracts user flags


prefix_cs.cfg:user_flags "ADMIN1" abcdefghijklmnopqrstu +
prefix_cs.cfg:user_flags "ADMIN2" abcdefghijklmnopqrstu +
prefix_cs.cfg:user_flags "ADMIN3" abcdefghijklmnopqrstu +
prefix_cs.cfg:user_flags "ADMIN4" abcdefghijklmnopqrstu -
prefix_cs.cfg:user_flags "ADMIN5" abcdefghijklmnopqrstu -


prefix_de.cfg:user_flags "ADMIN1" abcdefghijklmnopqrstu -
prefix_de.cfg:user_flags "ADMIN2" abcdefghijklmnopqrstu -
prefix_de.cfg:user_flags "ADMIN3" abcdefghijklmnopqrstu -
prefix_de.cfg:user_flags "ADMIN4" abcdefghijklmnopqrstu +
prefix_de.cfg:user_flags "ADMIN5" abcdefghijklmnopqrstu +


Pluses only are needed when you use my demo plugin in the future.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 01-22-2019 at 02:36.
DJEarthQuake is offline
SomewhereLost
Senior Member
Join Date: Mar 2014
Location: Tomorrowland
Old 01-23-2019 , 13:49   Re: Admins for each map
Reply With Quote #17

I was thinking of a better solution, something like modification of admin.sma, adding maybe one more "" in users.ini which would define maps like "de_" so on, empty quotes = admin on every map.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
DJEarthQuake
Senior Member
Join Date: Jan 2014
Location: Midwest
Old 01-23-2019 , 16:23   Re: Admins for each map
Reply With Quote #18

How familiar are you with 'per map' prefixes already? I posted several links. Prefix_de.cfg and prefix_cs.cfg covers every de and cs map you have not 1 per map. The mapname.cfg is per map.

  • Copy and paste my work.
  • Change admin 1-5 and their corresponding STEAMIDs.

prefix_cs.cfg
user_flags "ADMIN4" ab +
user_flags "ADMIN5" ab +


What I have written here is tested, working, with user_flags_control.sma and config prefixes.

Quote:
Originally Posted by SomewhereLost View Post
Hello,

I was wondering if its possible to add admins for specific maps? Like for de_ maps to add certain players and for cs_ other ones. Would that be achieveable by a plugin?
user_flags_control.sma
Use of Per-Map Features from AMX Mod X 1.8.0 release on up.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 01-25-2019 at 15:02. Reason: per not not pre map -- typo on end
DJEarthQuake is offline
deprale
Member
Join Date: Oct 2018
Location: Leeds
Old 02-09-2019 , 18:56   Re: Admins for each map
Reply With Quote #19

You could even try to hardcode something If you don't have a lot of admins or simply don't change them often and you have the same 2-5 admins each time you could just hardcode something on player_putinserver

check if the current map's prefix is de_ or cs_ and give them the flags u want for that map.
and if the prefixes are not met just give them all admin or strip them all off their rights checking their steam_id's.

no need to modify users.ini or anything like that.
__________________
Hey there, I'm eager to learn more and more about amxmodx and coding in general.

If you need any small help I can provide I'll gladly help you!

Last edited by deprale; 02-09-2019 at 18:56.
deprale is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 02-11-2019 , 22:07   Re: Admins for each map
Reply With Quote #20

PHP Code:
/*    Notes and Usage

    This plugin should be placed anywhere under admin.amxx in the plugins.ini file to ensure it loads after admin.amxx 

    Usage in users.ini:
    "STEAM_0:0:1234" "" "abcdefghijklmnopqrstuv" "ce" "fun_"            = (Administrator in all fun_ prefixed maps).
    "STEAM_0:0:5678" "" "abcdefghijklmnopqrstuv" "ce" "de_dust2"        = (Administrator in de_dust2 map).
    "STEAM_0:0:9012" "" "abcdefghijklmnopqrstuv" "ce" ""                = (Administrator in all maps).
    "STEAM_0:0:3456" "" "abcdefghijklmnopqrstuv" "ce"                    = (Administrator in all maps).
*/

#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    
register_plugin("Map Specific Admins""1.0""Partial Cloning");
    
LoadAdmins();
}

LoadAdmins()
{
    
admins_flush();

    new 
szUsersIni[64];
    
get_configsdir(szUsersInicharsmax(szUsersIni));
    
add(szUsersInicharsmax(szUsersIni), "/users.ini");

    new 
File fopen(szUsersIni"r");
    if(!
File)
    {
        
log_amx("Unable to read from file ^"%s^"."szUsersIni);
        return;
    }

    new 
Text[512], Flags[32], Access[32], AuthData[44], Password[32], szUserMap[32], AdminCount;
    while(!
feof(File))
    {
        
fgets(FileTextcharsmax(Text));
        
trim(Text);

        if(
Text[0]==';')
            continue;

        
Flags[0] = Access[0] = AuthData[0] = Password[0] = szUserMap[0] = 0;

        if(
parse(TextAuthDatacharsmax(AuthData), Passwordcharsmax(Password), Accesscharsmax(Access), Flagscharsmax(Flags), szUserMapcharsmax(szUserMap)) < 2)
            continue;

        if(
szUserMap[0] && !IsMapAdmin(szUserMap))
            continue;

        
admins_push(AuthDataPasswordread_flags(Access), read_flags(Flags));
        
AdminCount++;
    }

    
fclose(File);

    if(
AdminCount == 1)
        
server_print("[AMXX] %L"LANG_SERVER"LOADED_ADMIN");
    else
        
server_print("[AMXX] %L"LANG_SERVER"LOADED_ADMINS"AdminCount);
}

bool:IsMapAdmin(szUserMap[])
{
    static 
szMapName[32];
    if(
szMapName[0] == 0)
        
get_mapname(szMapNamecharsmax(szMapName));

    return 
equali(szMapNameszUserMapszUserMap[strlen(szUserMap) - 1] == '_' strlen(szUserMap) : charsmax(szMapName)) ? true false;

PartialCloning 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 18:01.


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