Raised This Month: $535 Target: $400
 133% 

Temporary Admin - Add admin for x days


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management       
eyal282
Veteran Member
Join Date: Aug 2011
Old 10-09-2016 , 15:07   Temporary Admin - Add admin for x days
Reply With Quote #1

This plugin is intended to add a user as a temporary admin.

I know that GHW_Chronic has created a similar plugin but this one is much better.

Commands:

say /adminstatus <player> - Check my days left as a temporary admin ( If you're a rcon admin you can check another user's time left.

say /managetemp - This will show a list of offline players with their names / steamid's / IP's for easier access to edit. ( I didn't add to change the settings inside the menu because it'll take a while that I don't have.

amx_addtempadmin <name/"steamid"/ip> <flags> <days> <password> - Adds a temporary admin ( steamid must be in quotes ) ( password is only for name )

amx_removetempadmin <name/"steamid"/ip> - Removes a player's temporary admin.

amx_edittempadmin <name/"steamid"/ip> <days> - Edits a temporary admin's time as an admin.

All console commands require ADMIN_RCON.

To Do:

Fix any bug that may show up.

Notes:

1. For obvious reasons, the plugin will prohibit you from adding an admin with rcon access ( l ).
2. Do NOT try to edit the duration in the file, it's simply complex, use the variety of commands above.
3. If a line of a temporary admin in both usersTemp.ini and users.ini is not identical, a set_fail_state will be triggered and SHUT the whole plugin. ( I might change that... )
4. As of version 1.3 I added ability to write in <flags> the words "Manager", "SuperAdmin", "Admin", "VIP" and you can edit the flags as you wish, this was originally made for myself but if you don't need it, just ignore it .
Attached Files
File Type: sma Get Plugin or Get Source (TemporaryAdmin.sma - 906 views - 18.0 KB)

Last edited by eyal282; 10-21-2016 at 21:21.
eyal282 is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 10-09-2016 , 16:25   Re: Temporary Admin - Add admin for x days
Reply With Quote #2

Quote:
Originally Posted by eyal282 View Post
I know that GHW_Chronic has created a similar plugin but this one is much better.
Why? What makes it MUCH better?
Syturi0 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 10-09-2016 , 16:47   Re: Temporary Admin - Add admin for x days
Reply With Quote #3

Quote:
Originally Posted by Syturi0 View Post
Why? What makes it MUCH better?
Let's see... If I am not mistaken, you can't remove an admin by command or edit.

This one allows steamid and ip.

This one has only 100 more lines than his while having 3 different commands that mass like each...

Anything else?
eyal282 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 10-09-2016 , 17:41   Re: Temporary Admin - Add admin for x days
Reply With Quote #4

lmao ;D
__________________
EFFx is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 10-09-2016 , 19:09   Re: Temporary Admin - Add admin for x days
Reply With Quote #5

Quote:
Originally Posted by EFFx View Post
lmao ;D
Perhaps you should comment stuff that aren't spam.
eyal282 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Upplands Väsby, Sweden
Old 10-09-2016 , 20:18   Re: Temporary Admin - Add admin for x days
Reply With Quote #6

I have to agree with eyal282 that the original one is not that good.
However, even if this one has more functions it's not very well written. Sorry.

Rant:
Why can't people seem to find these amazing functions in core.inc:
native time(&hour=0,&minute=0,&second=0);
native date(&year=0,&month=0,&day=0);

I know people generally assume people are male when talking about them in second person on this forum or in games but seriously... FindHim is a horrible name for a function. FindPlayer or FindPerson would do just fine.

You should look into how to use the new file functions, pcvars and dynamic arrays.
Name the variables descriptively. Combat and Combat2 is used for different times, makes no sense at all.
Why is it named /astatus? Where does the "a" come from? Why not /tempadmin or /admintime, /temptime, /adminstatus, /tempstatus, timestatus or all of them?
What is the point of the prefix if you leave it to default "PREFIX"?

I didn't look through it all, but you can start with that.
__________________

Last edited by Black Rose; 10-09-2016 at 20:23.
Black Rose is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 10-10-2016 , 01:19   Re: Temporary Admin - Add admin for x days
Reply With Quote #7

Quote:
Originally Posted by Black Rose View Post
I have to agree with eyal282 that the original one is not that good.
However, even if this one has more functions it's not very well written. Sorry.

Rant:
Why can't people seem to find these amazing functions in core.inc:
native time(&hour=0,&minute=0,&second=0);
native date(&year=0,&month=0,&day=0);

I know people generally assume people are male when talking about them in second person on this forum or in games but seriously... FindHim is a horrible name for a function. FindPlayer or FindPerson would do just fine.

You should look into how to use the new file functions, pcvars and dynamic arrays.
Name the variables descriptively. Combat and Combat2 is used for different times, makes no sense at all.
Why is it named /astatus? Where does the "a" come from? Why not /tempadmin or /admintime, /temptime, /adminstatus, /tempstatus, timestatus or all of them?
What is the point of the prefix if you leave it to default "PREFIX"?

I didn't look through it all, but you can start with that.
I once used a HamBurger_Killed function, it's not like players can see them...

I'll edit the astatus.
The a means admin ( like a plugin that I made, /ahelp )

Last edited by eyal282; 10-10-2016 at 01:19.
eyal282 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-14-2016 , 22:26   Re: Temporary Admin - Add admin for x days
Reply With Quote #8

Since these admins are temporary, I wouldn't even bother with adding them to users.ini. Store them with a method of your choice (nvault, SQL, etc.). When the user connects and he has temporary admin status, call set_user_flags() with the appropriate flags. With nvault, you can set the timestamp to his expire date and when he connects after this expire date, you can remove the nvault record and not give him admin flags. This would essentially be an entire re-write.
__________________

Last edited by Bugsy; 10-14-2016 at 22:28.
Bugsy is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 10-14-2016 , 23:03   Re: Temporary Admin - Add admin for x days
Reply With Quote #9

Bugsy you could do the rewrite in your sleep...
Blizzard_87 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 10-16-2016 , 14:16   Re: Temporary Admin - Add admin for x days
Reply With Quote #10

Update v1.3:

You can type instead of the flags the words "Manager", "SuperAdmin", "Admin", "VIP" and change via defines ( because it will be too easily abused as a cvar ).
eyal282 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 17:45.


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