Raised This Month: $51 Target: $400
 12% 

[REQ] Module


Post New Thread Reply   
 
Thread Tools Display Modes
-B1ng0-
Member
Join Date: Nov 2009
Old 05-03-2010 , 14:37   Re: [REQ] Module
Reply With Quote #11

Quote:
Originally Posted by Seta00 View Post
After coding the whole thing, I found out there's no way to differ server shutdown from changelevel...

You can always modify your HLDS launcher script to execute the SQL commands after HLDS quit.
can you give me an exemple?
-B1ng0- is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 05-03-2010 , 16:51   Re: [REQ] Module
Reply With Quote #12

Quote:
Originally Posted by -B1ng0- View Post
can you give me an exemple?
I'm assuming you have a Linux server. It should have a launcher script, like HLDS_launcher.sh or such, you can add your own lines to the end of the script (when the server has been shut down) to perform SQL operations, or any shell operation.

I can't give you a real example 'cause I don't run a Linux, but it can't be hard. However, if you post your launcher script, I can give you a practical example.
Seta00 is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 05-03-2010 , 19:35   Re: [REQ] Module
Reply With Quote #13

I don't know if this can work, but if you create a class, like this:


PHP Code:
class CShoutDown
{
public:
    
CShoutDown()
    {
        
//
    
}
    
    ~
CShoutDown()
    {
        
// Here Server ShoutDown
        // All SQL Command
    
}
};

CShoutDown IAmHere
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 05-06-2010 , 11:07   Re: [REQ] Module
Reply With Quote #14

Quote:
Originally Posted by AntiBots View Post
I don't know if this can work, but if you create a class, like this:


PHP Code:
class CShoutDown
{
public:
    
CShoutDown()
    {
        
//
    
}
    
    ~
CShoutDown()
    {
        
// Here Server ShoutDown
        // All SQL Command
    
}
};

CShoutDown IAmHere
lolwut?!
Seta00 is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 05-06-2010 , 13:41   Re: [REQ] Module
Reply With Quote #15

What about hooking SV_Shutdown with orpheu? Is it possible?
I didn't find any reference to that for changelevel.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 05-06-2010 , 17:31   Re: [REQ] Module
Reply With Quote #16

Quote:
Originally Posted by joropito View Post
What about hooking SV_Shutdown with orpheu? Is it possible?
I didn't find any reference to that for changelevel.
Hmm, never thought of it.. I'll try.
Seta00 is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 05-08-2010 , 20:44   Re: [REQ] Module
Reply With Quote #17

PHP Code:
FM_Sys_Error
FM_GameShutdown
FM_ServerDeactivate 
?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 05-09-2010 , 08:53   Re: [REQ] Module
Reply With Quote #18

Try this:
Code:
#include <amxmodx> #include <orpheu> public plugin_init() {     OrpheuRegisterHook(OrpheuGetFunction("Host_ShutdownServer"), "OnShutdownServer"); } public OrpheuHookReturn:OnShutdownServer() {         // do stuff here         return OrpheuIgnored; }
Code:
{
    "name"        : "Host_ShutdownServer",
    "library"     : "engine",
    "identifiers" :
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x55,0x8B,0xEC,0xA1,"*","*","*","*",0x85,0xC0,0x0F,"*","*","*","*","*",0x56,"*","*","*","*",0x6A,0x01]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "Host_ShutdownServer"
        }
    ]
}
Seta00 is offline
-B1ng0-
Member
Join Date: Nov 2009
Old 05-09-2010 , 09:31   Re: [REQ] Module
Reply With Quote #19

I create a file in configs/orpheu/functions with name Host_ShutdownServer, I'm not sure I did correctly but result is this:

-B1ng0- is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-09-2010 , 10:24   Re: [REQ] Module
Reply With Quote #20

Try to replace all the signature [0x55, etc, .. ] by : 0x50050
__________________
Arkshine 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 07:10.


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