Raised This Month: $12 Target: $400
 3% 

[Any] Delay Command (testing appreciated!)


Post New Thread Reply   
 
Thread Tools Display Modes
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 07-19-2018 , 03:17   Re: [Any] Delay Command (testing appreciated!)
Reply With Quote #11

Quote:
Originally Posted by Mitchell View Post
then why are you using CloseHandle() (old syntax) instead of delete and also I think you need to use KillTimer() not just close the handle.
https://sm.alliedmods.net/new-api/timers/KillTimer
It also has an auto close for the data handle, just briefly looking it may close those datapacks you're also not closing but storing in the ArrayList (this is just how it appears, i'm not familiar with looping through the indices of an ArrayList).
delete is just CloseHandle() with the added bonus of setting the passed variable to null by-reference. In this case, delete is incorrect, because you're totally right: I'm leaking DataPacks by not instead using KillTimer(hTimer, true) in OnClientDisconnect(). This still doesn't explain the error log, though.
__________________

Last edited by ddhoward; 07-19-2018 at 03:40.
ddhoward is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 07-19-2018 , 10:20   Re: [Any] Delay Command (testing appreciated!)
Reply With Quote #12

Quote:
Originally Posted by ddhoward View Post
delete is just CloseHandle() with the added bonus of setting the passed variable to null by-reference. In this case, delete is incorrect, because you're totally right: I'm leaking DataPacks by not instead using KillTimer(hTimer, true) in OnClientDisconnect(). This still doesn't explain the error log, though.
iirc Closing the handle does not stop a timer, so it will execute sooner or later. I may be wrong on this though.

Last edited by Mitchell; 07-19-2018 at 10:23.
Mitchell is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 07-19-2018 , 22:37   Re: [Any] Delay Command (testing appreciated!)
Reply With Quote #13

Closing the Timer's Handle stops the timer. The only difference between KillTimer() and CloseHandle() is that KillTimer() has that second argument which, when set to true, also runs the timer's data through CloseHandle().

And actually, turns out Sourcemod is smart enough to close the Datapack's Handle automatically if the DataTimer's handle is closed prematurely; the timer firing isn't required for Sourcemod to auto-close the DataPack. So I'm not leaking datapack handles lol. delete, KillTimer(), and CloseHandle() are all equally valid here. In most of my functions, CloseHandle is the most efficient.
__________________

Last edited by ddhoward; 07-19-2018 at 23:29.
ddhoward is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 07-25-2018 , 04:04   Re: [Any] Delay Command (testing appreciated!)
Reply With Quote #14

Updated to version 18.0725.0

changes include:
  • Removed sm_delaycmdrcon_list and sm_delaycmdrcon_cancel, integrating their functionality into sm_delaycmd_list and sm_delaycmd_cancel
  • ArrayLists now only exist for players who are connected
  • Fixed bug with log entry on a player disconnecting while having pending commands
  • Cleaned up some LogAction and ShowActivity2 language
  • Guaranteed consistency with the appearance of disconnected players' information in log text
__________________

Last edited by ddhoward; 07-25-2018 at 04:04.
ddhoward is offline
Blacktail92
New Member
Join Date: Feb 2020
Old 02-28-2020 , 17:36   Re: [Any] Delay Command (testing appreciated!)
Reply With Quote #15

Hi. I am absolutely in love with this plugin. Using it for flash timings. One thing that's missing though is floating point numbers support. For example, two consecutive flashes require 1.36s (yes I measured it) delay between them and currently I can only set it to either 1s or 2s delay, which makes it a little bit unrealistic. But again thanks for the lovely plugin.
Blacktail92 is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 02-28-2020 , 23:22   Re: [Any] Delay Command (testing appreciated!)
Reply With Quote #16

Unfortunately, there's a limitation with Sourcemod (or rather, the game engine); plugins can only create timers out to the tenths digit.
  • 1.1 - ok!
  • 1.2 - ok!
  • 1.15 - not ok!

https://wiki.alliedmods.net/Timers_(...Mod_Scripting)

I might be able to extend it out to the tenths (so you can do 1.3s or 1.4s) but 1.36 is impossible, and even 1.3/1.4 might not be 100% reliable.
__________________

Last edited by ddhoward; 02-28-2020 at 23:22.
ddhoward is offline
thinkii
New Member
Join Date: Jul 2020
Old 11-02-2020 , 05:59   Re: [Any] Delay Command (testing appreciated!)
Reply With Quote #17

Quote:
Originally Posted by ddhoward View Post
Unfortunately, there's a limitation with Sourcemod (or rather, the game engine); plugins can only create timers out to the tenths digit.
  • 1.1 - ok!
  • 1.2 - ok!
  • 1.15 - not ok!

https://wiki.alliedmods.net/Timers_(...Mod_Scripting)

I might be able to extend it out to the tenths (so you can do 1.3s or 1.4s) but 1.36 is impossible, and even 1.3/1.4 might not be 100% reliable.
can we remove the chat messages by any chance?

this ones for example

[DelayCmd] Console: Running "mp_restartgame 1" via rcon, queued 10 seconds ago.
[DelayCmd] Console: Running "mp_restartgame 1" via rcon, queued 12 seconds ago.
[DelayCmd] Console: Running "mp_restartgame 3" via rcon, queued 14 seconds ago.

i'm using the plugin to do a 3rr after loading the esl5on5 cfg and it prints that in the chat
thinkii is offline
Tonblader
Senior Member
Join Date: Jul 2011
Location: Peru
Old 01-22-2021 , 07:47   Re: [Any] Delay Command (testing appreciated!)
Reply With Quote #18

Quote:
Originally Posted by ddhoward View Post
[*]sm_delaycmd_list [target], default access ADMFLAG_GENERIC. This command allows the user to view a list of all pending commands queued by the target player(s), printed to the console. Players who do not have access to sm_delaycmd_viewothers (defaults to ADMFLAG_GENERIC) will be unable to specify a target; the target is assumed to be themselves. Players with access to sm_delaycmd_rcon will be able to view the server console's pending commands via either the @all targeting filter, or by using sm_delaycmd_rcon with no arguments, and selecting CONSOLE from the menu that should appear.
Can you change the handle list to a simpler list with a sequence of numbers to be able to quickly select the commands that you want to remove and that after removing, everything is arranged again with a sequence of numbers?

Quote:
Originally Posted by ddhoward View Post
[*]sm_delaycmd_cancel [handle], default access ADMFLAG_GENERIC. Players can use this command, in conjunction with a handle code given to them by sm_delaycmd_list, to cancel a pending command. Players with access to sm_delaycmd_cancelothers (defaults to ADMFLAG_GENERIC) can specify command handles queued by other players. Players without access to this override can only cancel their own pending commands. Further, players with access to sm_delaycmd_rcon can specify commands pending to be run by the server console.
How can I remove all pending commands, when the game restarts, round ends, round restarts, opens server, closes server, changes map, etc?

Quote:
Originally Posted by thinkii View Post
can we remove the chat messages by any chance?

this ones for example

[DelayCmd] Console: Running "mp_restartgame 1" via rcon, queued 10 seconds ago.
[DelayCmd] Console: Running "mp_restartgame 1" via rcon, queued 12 seconds ago.
[DelayCmd] Console: Running "mp_restartgame 3" via rcon, queued 14 seconds ago.

i'm using the plugin to do a 3rr after loading the esl5on5 cfg and it prints that in the chat
The author should include the ideas of this plugin, for me, that plugin is functional, to make cvar to silent.
[ANY] Dev Cmd - sm_cv or cv
or
[ANY] ADVANCED and silent CVAR change - sm_acvar

Additionally I will add the author's plugin, but without the messages that are generated in the chats.
The only thing I did was put a couple of "//" in the ShowActivity2 lines
Attached Files
File Type: sp Get Plugin or Get Source (delayCmd_nochatmessage.sp - 70 views - 14.2 KB)
File Type: smx delayCmd_nochatmessage.smx (11.2 KB, 82 views)

Last edited by Tonblader; 10-30-2021 at 06:38.
Tonblader is offline
hl2dmgamer
Junior Member
Join Date: Dec 2023
Old 12-28-2023 , 14:05   Re: [Any] Delay Command (testing appreciated!)
Reply With Quote #19

deleted

Last edited by hl2dmgamer; 01-11-2024 at 13:24. Reason: no
hl2dmgamer 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 02:07.


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