Raised This Month: $66 Target: $400
 16% 

Executes Commands When Admin Leave


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Server Management        Approver:   GHW_Chronic (70)
mpDOTcain
Member
Join Date: Jul 2006
Old 08-22-2006 , 00:48   Executes Commands When Admin Leave
Reply With Quote #1

Hey all,

This is the first plugin im releasing so feel free to completely destroy my self esteem.

I have admin on my server who for instance set the gravity to 200 for scoutzknivez, which is fine, but they forget to set it back when they leave and no one else can do it.

This plugin waits 10 seconds after someone disconnects (because everyone disconnects for mapchanges), and then checks to see if any admin are left in the server. If there arent it executes the commands in cmdfile.txt in your configs folder.

simply create a cmdlist.txt in your configs folder and list the commands like:
sv_alltalk 1
amx_gravity 800
amx_unclanvsall
etc.
and it will go through the list executing each command

I searched and the only thing I found that was similar to this was http://forums.alliedmods.net/showthread.php?t=43486 in GHW_Chronic's scripts, but it didn't list him as an author so I dunno what's what with that. If this is repetative just delete it.
Attached Files
File Type: sma Get Plugin or Get Source (admins_gone.sma - 432 views - 979 Bytes)
mpDOTcain is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 08-22-2006 , 01:01   Re: Executes Commands When Admin Leave
Reply With Quote #2

PHP Code:
format(cmdFile,99,"%s\cmdfile.txt",configsdir
-->

PHP Code:
format(cmdFile,99,"%s/cmdfile.txt",configsdir


PHP Code:
log_amx("There Are No Admin, Executing Commands From cmdfile.txt")
client_print(0,print_chat,"All admin have left, settings returning to normal..."
-->

PHP Code:
log_amx("There Are No Admins, Executing Commands From cmdfile.txt")
client_print(0,print_chat,"All admins have left, settings returning to normal..."
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
mpDOTcain
Member
Join Date: Jul 2006
Old 08-22-2006 , 01:09   Re: Executes Commands When Admin Leave
Reply With Quote #3

1: \cmdfile works for me... maybe because I'm on linux? I dont know try it out
Edit: nevermind I tested it on windows not linux, will it not work for linux?

2: I always thought admin was already plural like deer
mpDOTcain is offline
n0pe
Junior Member
Join Date: Aug 2006
Location: Russia, Moscow
Old 08-22-2006 , 13:29   Re: Executes Commands When Admin Leave
Reply With Quote #4

format -> formatex
n0pe is offline
Send a message via ICQ to n0pe
bigman11
Member
Join Date: Jun 2006
Location: Computer
Old 10-28-2006 , 01:47   Re: Executes Commands When Admin Leave
Reply With Quote #5

Going to try on my server but i got a question does it execute when every admin leaves because maybe one of the admins doesn'r have axcess to cvars
__________________
bigman11 is offline
Send a message via MSN to bigman11
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 10-28-2006 , 03:15   Re: Executes Commands When Admin Leave
Reply With Quote #6

Code:
#include <amxmodx>

new cmdFile[100]

public client_disconnect(id)
{
    set_task(10.0,"check_admin")    
    return PLUGIN_CONTINUE
    
}
public check_admin()
{
    if(!get_playersnum()==0)
    {
        for(new i =1;i<get_maxplayers();i++)
        {        
            if(is_user_admin(i))
            {
                return PLUGIN_HANDLED
            }
        }
    }
    executeCmds()
    return PLUGIN_CONTINUE        
}

public executeCmds()
{
    log_amx("There Are No Admin, Executing Commands From cmdfile.txt")
    client_print(0,print_chat,"All admin have left, settings returning to normal...")
    new command[50]
    new numChars = 0
    for(new x = 0;x<file_size(cmdFile,1);x++)
    {
        read_file(cmdFile,x,command,49,numChars)
        log_amx("Executing Command %s From cmdfile.txt",command)
        server_cmd(command)
        server_exec()
    }
}

public plugin_init()
{
    register_plugin("Admin Gone","1.0","mp.cain")
    new configsdir[50]
    get_configsdir(configsdir,49)
    format(cmdFile,99,"%s/cmdfile.txt",configsdir)
    return PLUGIN_CONTINUE
}
Yes it executes on any admin leave (ALL ADMINS MUST BE GONE) If they have any admin access flag.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
dzek
Junior Member
Join Date: Apr 2007
Old 06-20-2007 , 13:02   Re: Executes Commands When Admin Leave
Reply With Quote #7

can't compile this by myself
both: orginal mpDOTcain's version and modified by SweatyBanana

Code:
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Tag mismatch on line 13
Error: Undefined symbol "is_user_admin" on line 17
Error: Undefined symbol "get_configsdir" on line 46

2 Errors.
Could not locate output file D:\Documents and Settings\DvD\Desktop\Counter-Strike 1.6\cstrike\addons\amxmodx\moje\admins_gone.amx (compile failed).
dzek is offline
dzek
Junior Member
Join Date: Apr 2007
Old 06-21-2007 , 17:03   Re: Executes Commands When Admin Leave
Reply With Quote #8

and plugin compiling by the web-compilator fails too!! why?
dzek is offline
surfguitarkevin
Member
Join Date: Aug 2007
Old 10-18-2007 , 09:23   Re: Executes Commands When Admin Leave
Reply With Quote #9

why won't you COMPILE? lol
__________________
surfguitarkevin is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 10-18-2007 , 12:33   Re: Executes Commands When Admin Leave
Reply With Quote #10

Now that plugin's just a bloody good idea.


But I can't resist an invite to destroy self-esteem ...

Surely you only want to check the admin count et c. when an admin leaves? narb :-P
purple_pixie 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 21:38.


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