AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [REQ][CS:S] Timed Commands (https://forums.alliedmods.net/showthread.php?t=314991)

YoUrEnD 03-16-2019 11:12

[REQ][CS:S] Timed Commands
 
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.

Pilo 03-16-2019 19:28

Re: [REQ][CS:S] Timed Commands
 
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");



CliptonHeist 03-17-2019 05:33

Re: [REQ][CS:S] Timed Commands
 
1 Attachment(s)
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

YoUrEnD 03-17-2019 12:52

Re: [REQ][CS:S] Timed Commands
 
Quote:

Originally Posted by CliptonHeist (Post 2643737)
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 :D


All times are GMT -4. The time now is 07:43.

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