AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Temporary Admin - Add admin for x days (https://forums.alliedmods.net/showthread.php?t=288875)

eyal282 10-09-2016 14:07

Temporary Admin - Add admin for x days
 
1 Attachment(s)
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 :).

Syturi0 10-09-2016 15:25

Re: Temporary Admin - Add admin for x days
 
Quote:

Originally Posted by eyal282 (Post 2460660)
I know that GHW_Chronic has created a similar plugin but this one is much better.

Why? What makes it MUCH better?

eyal282 10-09-2016 15:47

Re: Temporary Admin - Add admin for x days
 
Quote:

Originally Posted by Syturi0 (Post 2460683)
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?

EFFx 10-09-2016 16:41

Re: Temporary Admin - Add admin for x days
 
lmao ;D

eyal282 10-09-2016 18:09

Re: Temporary Admin - Add admin for x days
 
Quote:

Originally Posted by EFFx (Post 2460711)
lmao ;D

Perhaps you should comment stuff that aren't spam.

Black Rose 10-09-2016 19:18

Re: Temporary Admin - Add admin for x days
 
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.

eyal282 10-10-2016 00:19

Re: Temporary Admin - Add admin for x days
 
Quote:

Originally Posted by Black Rose (Post 2460744)
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 )

Bugsy 10-14-2016 21:26

Re: Temporary Admin - Add admin for x days
 
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.

Blizzard_87 10-14-2016 22:03

Re: Temporary Admin - Add admin for x days
 
Bugsy you could do the rewrite in your sleep...

eyal282 10-16-2016 13:16

Re: Temporary Admin - Add admin for x days
 
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 ).


All times are GMT -4. The time now is 05:05.

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