Raised This Month: $ Target: $400
 0% 

[REQ] Auto command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Psikotik
Member
Join Date: May 2013
Old 05-27-2013 , 11:26   [REQ] Auto command
Reply With Quote #1

Hello everyone I'm looking for a plugin that sends the server a command every 2 minutes.

For example: !rp_db_save
Psikotik is offline
pubhero
Veteran Member
Join Date: Aug 2012
Location: Central Europe
Old 05-27-2013 , 18:34   Re: [REQ] Auto command
Reply With Quote #2

servercrontab?
pubhero is offline
Alex30555
Member
Join Date: Sep 2011
Location: Paris
Old 05-28-2013 , 06:45   Re: [REQ] Auto command
Reply With Quote #3

Create a timer !
Alex30555 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 05-28-2013 , 10:58   Re: [REQ] Auto command
Reply With Quote #4

Code:
#include <sourcemod>

public OnMapStart()
{
    CreateTimer(120.0, reload, _, TIMER_REPEAT);
}

public Action:Timer_Check(Handle:timer)
{
    ServerCommand("sm_rp_db_save")
}
http://www.sourcemod.net/plugins.php...tion=&search=1

Last edited by Drixevel; 05-30-2013 at 04:01.
Drixevel is offline
Psikotik
Member
Join Date: May 2013
Old 05-28-2013 , 13:15   Re: [REQ] Auto command
Reply With Quote #5

Thank !!!
Psikotik is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 05-29-2013 , 10:21   Re: [REQ] Auto command
Reply With Quote #6

Might wanna do that on plugin start, or use the timer flag no mapchange
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 05-29-2013 , 16:33   Re: [REQ] Auto command
Reply With Quote #7

Indeed. Also, flags is the fourth argument in CreateTimer, not the third, which can lead to confusing errors if you don't catch that mistake. (as I recently found out)
PHP Code:
public OnMapStart()
{
    
CreateTimer(120.0Timer_Check_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action:Timer_Check(Handle:timer)
{
    
ServerCommand("sm_rp_db_save");

__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 05-30-2013 , 04:02   Re: [REQ] Auto command
Reply With Quote #8

Quote:
Originally Posted by MasterOfTheXP View Post
Indeed. Also, flags is the fourth argument in CreateTimer, not the third, which can lead to confusing errors if you don't catch that mistake. (as I recently found out)
PHP Code:
public OnMapStart()
{
    
CreateTimer(120.0Timer_Check_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action:Timer_Check(Handle:timer)
{
    
ServerCommand("sm_rp_db_save");

My mistake.

Last edited by Drixevel; 05-30-2013 at 04:04.
Drixevel is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 05-31-2013 , 02:31   Re: [REQ] Auto command
Reply With Quote #9

You could pass INVALID_HANDLE for clarity... I think
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Reply



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 17:26.


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