AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help scripting a fairly easy task (https://forums.alliedmods.net/showthread.php?t=243055)

Alb0 06-29-2014 06:03

Help scripting a fairly easy task
 
So I've been running across some issues with my server lately where the users.ini file won't read upon map change. I would have to execute the amx_reloadadmins through rcon each time for the privileges to be set again, or have the admin reconnect to the server.
All I'm asking from you genuine gentlemen is something that would automatically execute the amx_reloadadmins command upon every mapchange. I would appreciate that very much :)

YamiKaitou 06-29-2014 06:10

Re: Help scripting a fairly easy task
 
Execute the command during plugin_cfg

Alb0 06-29-2014 06:33

Re: Help scripting a fairly easy task
 
Quote:

Originally Posted by YamiKaitou (Post 2159138)
Execute the command during plugin_cfg

Hmm, it seems as though even when running the rcon amx_reloadadmins, I'm getting issues now.
This is the output, with no changes happening whatsoever, no privileges being set, only through reconnecting.

Code:

] rcon amx_reloadadmins
[AMXBans] Loaded 57 admins from file
L 06/29/2014 - 05:31:54: [amxbans_main.amxx] [AMXBans Notice] DB Info Tuple from amxbans_core initialized twice! Maybee used command amx_realoadadmins.


YamiKaitou 06-29-2014 06:45

Re: Help scripting a fairly easy task
 
You never said you were using AMXBans.

Update AMXBans to the latest development version and then add a task to your plugin

Alb0 06-29-2014 07:40

Re: Help scripting a fairly easy task
 
Quote:

Originally Posted by YamiKaitou (Post 2159155)
You never said you were using AMXBans.

Update AMXBans to the latest development version and then add a task to your plugin

I have the 6.0.5 DEV version running at the moment. How would I go about adding a task to the plugin?

.Dare Devil. 06-29-2014 07:52

Re: Help scripting a fairly easy task
 
well, here is the code how set_task works
PHP Code:

set_task0.1"myfunc" )
public 
myfunc()
{



0.1 is time but
there's no needs for task.

just put this somewhere in your plugin
PHP Code:

public plugin_init() server_cmd("amx_reloadadmins"


YamiKaitou 06-29-2014 07:55

Re: Help scripting a fairly easy task
 
Quote:

Originally Posted by Alb0 (Post 2159187)
I have the 6.0.5 DEV version running at the moment.

The latest Dev build?

Quote:

How would I go about adding a task to the plugin?
set_task

Quote:

Originally Posted by .Dare Devil. (Post 2159190)
there's no needs for task.

just put this somewhere in your plugin
PHP Code:

public plugin_init() server_cmd("amx_reloadadmins"


AMXBans doesn't like initializing itself twice, so you have to delay it until it has already initialized before you reload it.

Alb0 06-29-2014 08:07

Re: Help scripting a fairly easy task
 
Quote:

Originally Posted by YamiKaitou (Post 2159192)
The latest Dev build?

Code:

----- Currently loaded plugins -----
name              version    author            file            status 
AMXBans Core      6.0.5-dev  YamiKaitou        amxbans_core.amxx   
AMXBans Main      6.0.5-dev  YamiKaitou        amxbans_main.amxx

So how would I go about delaying the set_task so it executes lets say 15 seconds after mapchange?

YamiKaitou 06-29-2014 08:44

Re: Help scripting a fairly easy task
 
Not sure if that is the latest or not, you might want to update it again as the latest copy doesn't share SQL info between the 2 plugins (which is what your above error seems to indicate that it is still sharing the info)



Put this in plugin_config

set_task(15.0, ...


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

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