Raised This Month: $ Target: $400
 0% 

Detect "restart" command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
grankee
Member
Join Date: Jun 2008
Old 05-19-2009 , 18:14   Re: Detect "restart" command
Reply With Quote #1

Quote:
Originally Posted by -=hunter=- View Post
grankee
When you write "restart" then all plugins stop
Good idea

but first exec plugin_end() func, right?

but when server crash and stand up trice, no functions are executed, right?


Sometimes server just automatically restart and I need to detect what option is true
-server crash and stand up trice
-wicked guy, who borrow me one of four dedicated server on machine, type restart
grankee is offline
Pinatz
Member
Join Date: Dec 2008
Old 05-20-2009 , 08:38   Re: Detect "restart" command
Reply With Quote #2

Are you running this from ingame?

PHP Code:
plugin_init()
{
      
register_clcmd("rcon restart""cmd_restart")
      
register_srvcmd("restart""cmd_restart")
}
 
public 
cmd_restart()
{
      
server_print("The command ^"restart^" used!")
 
      return 
PLUGIN_CONTINUE // use PLUGIN_HANDLED if you want to block the command

This should work ingame and from the admin console.
__________________
Pinatz is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-20-2009 , 22:13   Re: Detect "restart" command
Reply With Quote #3

Do you need to know when the actual "restart" command is used or are you just trying to detect when your server crashed?

Are these the two conditions you want to be detected?

-server crash and stand up trice [what does stand up trice mean?]

OR

-wicked guy, who borrow me one of four dedicated server on machine, type restart

??
__________________

Last edited by Bugsy; 05-20-2009 at 23:00.
Bugsy 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 01:30.


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