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

[REQ][CS:S] Timed Commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
YoUrEnD
Member
Join Date: Nov 2015
Location: Germany
Old 03-16-2019 , 11:12   [REQ][CS:S] Timed Commands
Reply With Quote #1

I search/request a plugin that makes me possible to execute commands x seconds after roundstart.

for example
i want to execute "sm_speed @t 0.5" 30 seconds after roundstart.

thanks for help and sorry if a plugin like this exist. i seached and find nothing.
__________________
Counter-Strike Source Server
https://high-devil-force.de
YoUrEnD is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 03-16-2019 , 19:28   Re: [REQ][CS:S] Timed Commands
Reply With Quote #2

I mean, you can do like this
PHP Code:
public void OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStart);
}

public 
void Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    
CreateTimer(30.0TimerSetSpeed);
}

public 
Action TimerSetSpeed(Handle timer)
{
    
ServerCommand("sm_speed @t 0.5");

__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$
Pilo is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 03-17-2019 , 05:33   Re: [REQ][CS:S] Timed Commands
Reply With Quote #3

Heya, only tested this on CS:GO but I see no reason why it wouldn't work on CS:S as well.

To setup the commands you want executed you need to create a file called "delayedcommands.txt" (without quotes) in your sourcemod/data folder. After that, you just add in the commands you want executed into the file 1 per line.

Example:
Quote:
// 30 = (amount of seconds until command will be executed) "sm_kick @all" = (the command that will be executed, the quotes are important!)

// Actual line would look something like this:
60 "sm_slay @t"
If you need to encase an argument inside the command in quotes then just use apostrophes e.g. "sm_kick 'worst player'" and the plugin will automatically convert them to quotes.

Let me know if there's any bugs or suggestions you want added.

Code:
Spoiler
Attached Files
File Type: sp Get Plugin or Get Source (delayedcommands.sp - 107 views - 2.2 KB)

Last edited by CliptonHeist; 03-17-2019 at 16:15. Reason: oops
CliptonHeist is offline
YoUrEnD
Member
Join Date: Nov 2015
Location: Germany
Old 03-17-2019 , 12:52   Re: [REQ][CS:S] Timed Commands
Reply With Quote #4

Quote:
Originally Posted by CliptonHeist View Post
Heya, only tested this on CS:GO but I see no reason why it wouldn't work on CS:S as well.

To setup the commands you want executed you need to create a file called "delaycommands.txt" (without quotes) in your sourcemod/data folder. After that, you just add in the commands you want executed into the file 1 per line.

Example:


If you need to encase an argument inside the command in quotes then just use apostrophes e.g. "sm_kick 'worst player'" and the plugin will automatically convert them to quotes.

Let me know if there's any bugs or suggestions you want added.

Code:
Spoiler
NICE it work exactly how i wanted. Thank you
__________________
Counter-Strike Source Server
https://high-devil-force.de
YoUrEnD 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 20:56.


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