Raised This Month: $32 Target: $400
 8% 

Problem with Command (Task Scheduler)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
romeo72
Member
Join Date: Oct 2021
Old 11-14-2021 , 06:36   Problem with Command (Task Scheduler)
Reply With Quote #1

Hello, everyone,

I have a problem with this plugin (Task Scheduler):

Task Scheduler

I would like to change the map at a desired time.
so that de_dust2 starts at 5 o'clock in the morning.
unfortunately it doesn't work with the timer command like in the instructions:

amx_task 05:00 "amx_map de_dust2" t
amx_task 05: 00-06: 00 "amx_map de_dust2" t
and and and ...

I've already tried different variations. unfortunately nothing has led to success.
what works, for example, is this command:
amx_task 5 "sv_restart 1" mr

there the server restarts every 5 minutes.

EDIT:
this command also works:
amx_task 5 “changelevel de_dust2“ mr

then doesn't it have to be because of the time?
maybe you have an idea where the error lies !?

best regards

Last edited by romeo72; 11-14-2021 at 12:59.
romeo72 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-14-2021 , 13:47   Re: Problem with Command (Task Scheduler)
Reply With Quote #2

I just tested it and it works fine, must be another conflicting plugin
__________________
Bugsy is offline
romeo72
Member
Join Date: Oct 2021
Old 11-14-2021 , 16:13   Re: Problem with Command (Task Scheduler)
Reply With Quote #3

hello Bugsy

first of all, thank you very much for trying it. maybe you like to tell me how you proceeded with the installation and what kind of command you used!?
maybe I'm making a mistake somewhere.

Code:
I have the following plugins in the plugins.ini:
; AMX Mod X plugins

; Admin Base - Always one has to be activated
admin.amxx		; admin base (required for any admin-related)
;admin_sql.amxx		; admin base - SQL version (comment admin.amxx)

; Basic
admincmd.amxx		; basic admin console commands
adminhelp.amxx		; help command for admin console commands
adminslots.amxx		; slot reservation
multilingual.amxx	; Multi-Lingual management

; Menus
menufront.amxx		; front-end for admin menus
cmdmenu.amxx		; command menu (speech, settings)
plmenu.amxx		; players menu (kick, ban, client cmds.)
telemenu.amxx		; teleport menu (Fun Module required!)
mapsmenu.amxx		; maps menu (vote, changelevel)
pluginmenu.amxx		; Menus for commands/cvars organized by plugin

; Chat / Messages
adminchat.amxx		; console chat commands
antiflood.amxx		; prevent clients from chat-flooding the server
scrollmsg.amxx		; displays a scrolling message
imessage.amxx		; displays information messages
adminvote.amxx		; vote commands

; Map related
;nextmap.amxx		; displays next map in mapcycle
;mapchooser.amxx		; allows to vote for next map
timeleft.amxx		; displays time left on map

; Configuration
pausecfg.amxx		; allows to pause and unpause some plugins
statscfg.amxx		; allows to manage stats plugins via menu and commands

; Counter-Strike
restmenu.amxx		; restrict weapons menu
statsx.amxx		; stats on death or round end (CSX Module required!)
;miscstats.amxx		; bunch of events announcement for Counter-Strike
;stats_logging.amxx	; weapons stats logging (CSX Module required!)

; Enable to use AMX Mod plugins
;amxmod_compat.amxx	; AMX Mod backwards compatibility layer

; Custom - Add 3rd party plugins here
;galileo.amxx			; Vote Maps
;grenade_trail.amxx		; Granaten Markierung 
;parachute.amxx		; Fallschirm
;mode.amxx			; 2x2 Mode
;cs_team_semiclip.amxx	; Transparente Spieler
;no_team_flash.amxx		; No Team Flash
;Voices_Management.amxx	; Voice
;lastmanbets.amxx		; Bet Menue
;realnadedrops.amxx		; Granaten aufheben
;thron_grenade.amxx		; Thron Granaten
;crx_ranksystem.amxx	; OciXCrom Rank System;bleibt
;accuracy_fix.amxx		; Treffer Fix
;RankSystem.amxx		; Rank System;bleibt
;timer.amxx			; Timer;bleibt
task_scheduler.amxx		; Aufgabenplaner

; Deathmatch
;csdm_equip.amxx		;
;csdm_main.amxx		;
;csdm_misc.amxx		;
;csdm_protection.amxx	;
;csdm_spawn_preset.amxx	;
;csdm_tickets.amxx		;
;spawn_editor.amxx		;
I deactivated all 3rd party plugins except for the task_scheduler.amxx.

it does not work even if all 3rd party plugins are deactivated.

does your plugin.ini look the same? or have you activated / deactivated other plugins?
do you have another idea?

best regards

Last edited by romeo72; 11-14-2021 at 16:16.
romeo72 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-14-2021 , 20:16   Re: Problem with Command (Task Scheduler)
Reply With Quote #4

Mine looks different as I run different things.

Run this, and check your amxx log file
PHP Code:
/* AMX Mod script. (Nov 10th, 2002)
*
* Task Scheduler 0.2
*  by JustinHoMi
*
* amx_task time "task" flags
* flags:
*  m - time is in minutes
*  s - time is in seconds
*  r - repeat task
*  t - specific time
*
*/

#include <amxmodx>

new task_cmds[32][108]
new 
task_times[32][16]
new 
numtasks 0

public load_task()
{
    if (
read_argc() < 4) {
        
server_print("[AMX] Usage:  amx_task < time > ^"command^" < flags >")
        return 
PLUGIN_HANDLED
    
}

    new 
args[128]
    
read_args(args,128)
    new 
clock[6], cmd[108], flags[5]

    
parse(args,clock,6,cmd,108,flags,5)
    new 
Float:time_f floatstr(clock)

    new 
flag[2] = ""
    
if (contain(flags,"r") != -1)
        
flag="b"
    
if (contain(flags,"m") != -1)
        
time_f time_f 60

    
if (contain(flags,"t") != -1)
    {
        
copy(task_cmds[numtasks],108,cmd)
        
copy(task_times[numtasks],6,clock)
        
numtasks++
        return 
PLUGIN_HANDLED
    
}

    
set_task(time_f,"run_task",0,cmd,108,flag)

    return 
PLUGIN_CONTINUE
}

public 
run_task(cmd[])
{
    
server_cmd(cmd)
    return 
PLUGIN_HANDLED
}

public 
check_time()
{
    new 
curtime[16]
    
get_time("%H:%M",curtime,16)

    for(new 
i=0i<numtasksi++)
    {
        
log_amx"Checking time. Does [%s] = [%s] ?" curtime task_times[i] );
        if(
equal(curtime,task_times[i]))
        {
            
log_amx"Times match, executing [%s]" task_cmds[i] );
            
server_cmd(task_cmds[i])
        }
    }
    
    return 
PLUGIN_CONTINUE
}

public 
plugin_init()
{
    
register_plugin("Task Scheduler","0.2","JustinHoMi")
    
register_srvcmd("amx_task","load_task")
    
set_task(60.0,"check_time",1,"",0,"b")
    return 
PLUGIN_CONTINUE

__________________
Bugsy is offline
romeo72
Member
Join Date: Oct 2021
Old 11-14-2021 , 23:03   Re: Problem with Command (Task Scheduler)
Reply With Quote #5

Yeeeeah...many many thanks Bugsy !!!
It works now !!!

but ..... after I activated the Galileo plugin it no longer works. I deactivate Galileo, then it works again.

Do you have an idea how to get that that Galileo also works with?

have a nice day !

best regards

Last edited by romeo72; 11-14-2021 at 23:20.
romeo72 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-15-2021 , 20:14   Re: Problem with Command (Task Scheduler)
Reply With Quote #6

Not sure, would need to look at the plugin to know (but don't want to).
__________________
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-15-2021 , 21:50   Re: Problem with Command (Task Scheduler)
Reply With Quote #7

Bugsy didn't change anything about the functionality of the code so it didn't just start working because of his code. He added logging to help determine what is happening when it doesn't work. You should run his code and find the time in your amxmodx logs where the event was supposed to happen so we can see why your code wasn't getting executed.

I can't think of anything in this plugin that would be directly interfering with it's execution. The only thing that might be happening is if there is a delay in the execution of server code such that the time between executions of checking the clock-base tasks is greater than 60 seconds and it is positioned such that it skips the one minute that you have configured. This circumstance is extremely unlikely. However, one thing that would prevent this is would be to change the set_task for "check_time" to execute every 55 seconds instead of 60.
__________________
fysiks 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 05:06.


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