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

How to hook new round?


Post New Thread Reply   
 
Thread Tools Display Modes
Bos93
Veteran Member
Join Date: Jul 2010
Old 08-20-2012 , 15:15   Re: How to hook new round?
Reply With Quote #21

I hooked round start, but how to hook round end? TextMsg?
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
thatguyzp
Junior Member
Join Date: Mar 2009
Old 10-28-2012 , 00:16   Re: How to hook new round?
Reply With Quote #22

Here's how I hook Round_Start / Round_End in Metamod using AlertMessage (For counter-strike anyway)

PHP Code:
//======================================================================
void AlertMessage_Post(ALERT_TYPE atypechar *szFmt, ...) {
    if(
atype != at_logged)
        
RETURN_META(MRES_IGNORED);

    
va_list argptr;
    static 
char string[1024];

    
va_start(argptrszFmt);
    
vsprintf(stringszFmtargptr);
    
va_end(argptr);

    if (
FStrEq(string"World triggered \"Round_Start\"\n"))
        
// stuff to do on Round_Start event
    
else if (FStrEq(string"World triggered \"Round_End\"\n"))
        
// stuff to do on Round_End event

    
RETURN_META(MRES_IGNORED);
}
//====================================================================== 
Probably not the most efficient way, as I'm still learning c++ / hlsdk, but it works fairly well for my needs.

Round_Start is fired when the round actually starts (after freezetime), not at player spawn

Round_End is fired as soon as an objective is completed (bomb detonate / defuse), not sure about hostage maps though.

Last edited by thatguyzp; 10-28-2012 at 00:34.
thatguyzp 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 20:37.


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