Raised This Month: $ Target: $400
 0% 

Detect "restart" command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-=hunter=-
Senior Member
Join Date: Jul 2008
Old 05-18-2009 , 06:26   Re: Detect "restart" command
Reply With Quote #1

grankee
What for you need it? When you write "restart" then all plugins stop, and then renew work at map loading.
-=hunter=- is offline
Send a message via ICQ to -=hunter=- Send a message via Skype™ to -=hunter=-
grankee
Member
Join Date: Jun 2008
Old 05-19-2009 , 18:14   Re: Detect "restart" command
Reply With Quote #2

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 #3

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
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