Raised This Month: $90 Target: $400
 22% 

[REQ][CS:S] Timed Commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
YoUrEnD
Junior 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
Jail:213.202.212.239:27035 (Only GER/CHE/AUT)
MiniGames:213.202.212.239:27065
Bhop:213.202.212.239:27015
GunGame:213.202.212.239:27055
Rats:213.202.212.239:27165
AWP NoScope:213.202.212.239:27085
SurfDM:213.202.212.239:27045
Public:213.202.212.239:27120
YoUrEnD is offline
Pilo
Junior Member
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");

__________________

STEAM
DISCORD
Pilo#0552

Pilo is offline
CliptonHeist
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 - 2 views - 2.2 KB)

Last edited by CliptonHeist; 03-17-2019 at 16:15. Reason: oops
CliptonHeist is offline
YoUrEnD
Junior 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
Jail:213.202.212.239:27035 (Only GER/CHE/AUT)
MiniGames:213.202.212.239:27065
Bhop:213.202.212.239:27015
GunGame:213.202.212.239:27055
Rats:213.202.212.239:27165
AWP NoScope:213.202.212.239:27085
SurfDM:213.202.212.239:27045
Public:213.202.212.239:27120
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 21:11.


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