Raised This Month: $ Target: $400
 0% 

Help scripting a fairly easy task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alb0
Senior Member
Join Date: Jun 2010
Old 06-29-2014 , 06:03   Help scripting a fairly easy task
Reply With Quote #1

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
Alb0 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-29-2014 , 06:10   Re: Help scripting a fairly easy task
Reply With Quote #2

Execute the command during plugin_cfg
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Alb0
Senior Member
Join Date: Jun 2010
Old 06-29-2014 , 06:33   Re: Help scripting a fairly easy task
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
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.
Alb0 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-29-2014 , 06:45   Re: Help scripting a fairly easy task
Reply With Quote #4

You never said you were using AMXBans.

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

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Alb0
Senior Member
Join Date: Jun 2010
Old 06-29-2014 , 07:40   Re: Help scripting a fairly easy task
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
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?
Alb0 is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-29-2014 , 07:52   Re: Help scripting a fairly easy task
Reply With Quote #6

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"

Last edited by .Dare Devil.; 06-29-2014 at 07:53.
.Dare Devil. is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-29-2014 , 07:55   Re: Help scripting a fairly easy task
Reply With Quote #7

Quote:
Originally Posted by Alb0 View Post
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. View Post
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.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Alb0
Senior Member
Join Date: Jun 2010
Old 06-29-2014 , 08:07   Re: Help scripting a fairly easy task
Reply With Quote #8

Quote:
Originally Posted by YamiKaitou View Post
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?
Alb0 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-29-2014 , 08:44   Re: Help scripting a fairly easy task
Reply With Quote #9

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, ...
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply



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:14.


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