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

How to hook new round?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bos93
Veteran Member
Join Date: Jul 2010
Old 08-14-2012 , 07:43   How to hook new round?
Reply With Quote #1

#include "sdk/amxxmodule.h"



moduleconfig.h #define FN_MessageBegin MessageBegin

PHP Code:
void MessageBegin (int msg_destint msg_type, const float *pOriginedict_t *ed)
{    
    if( 
msg_type == 125 )
    {
        
print_srvconsole("New Round!\n");
    }
    
RETURN_META(MRES_HANDLED);

doesn't work .
__________________

Last edited by Bos93; 08-14-2012 at 11:14.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-14-2012 , 10:07   Re: How to hook new round?
Reply With Quote #2

Use Rage module and hook multiplay :: round restart function
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 08-14-2012 , 10:12   Re: How to hook new round?
Reply With Quote #3

Never block MessageBegin or engine will crash.

If you block MessageBegin, you should block associated Write* and MessageEnd.

Also 125 it's for HLTV event. I don't know if it's what you need. You can better check message contents like register_logevent does.
__________________

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
Bos93
Veteran Member
Join Date: Jul 2010
Old 08-14-2012 , 11:13   Re: How to hook new round?
Reply With Quote #4

joropito , thank you.

function is not called

un comment #define FN_MessageBegin MessageBegin in moduleconfig.h

and


PHP Code:
void MessageBegin (int msg_destint msg_type, const float *pOriginedict_t *ed)
{    
    if( 
msg_type == 125 )
    {
        
print_srvconsole("New Round!\n");
    }

?
__________________

Last edited by Bos93; 08-14-2012 at 11:14.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-14-2012 , 12:06   Re: How to hook new round?
Reply With Quote #5

Make sure #define USE_METAMOD is uncomment too.
__________________
Arkshine is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 08-14-2012 , 12:47   Re: How to hook new round?
Reply With Quote #6

Quote:
Originally Posted by Bos93 View Post
joropito , thank you.

function is not called

un comment #define FN_MessageBegin MessageBegin in moduleconfig.h

and


PHP Code:
void MessageBegin (int msg_destint msg_type, const float *pOriginedict_t *ed)
{    
    if( 
msg_type == 125 )
    {
        
print_srvconsole("New Round!\n");
    }

?
You everytime should set a result. For example:

PHP Code:
RETURN_METAMRES_IGNORED ); // for void
RETURN_META_VALUEMRES_IGNOREDNULL ); // for int, qboolean (which is an alias for int) and others like edict_t * 
Maybe you should do something like this:

PHP Code:
#define MAX_BYTES 32 /* a good value to set */

bool bHLTVint iBYTEint iBYTESMAX_BYTES ];

void ResetBytesvoid ) {
  for( 
int i 0MAX_BYTESi++ ) iBYTES] = NULL;
}

void MessageBeginintint TYPE, const float *, edict_t * ) {
  if( 
TYPE == GET_USER_MSG_IDNULL"HLTV"NULL ) ) {
    
bHLTV trueiBYTE NULLResetBytes( );
  } 
RETURN_METAMRES_IGNORED ); }

void MessageEndvoid ) {
  
bHLTV falseRETURN_METAMRES_IGNORED ); }

void WriteByteint BYTE ) {
  if( 
IsHLTV ) {
    
iBYTESiBYTE ] = BYTE;
    if( ++
iBYTE == && !BYTE && !iBYTESNULL ] ) {
      
/* Now the round is restarting! */
    
}
  } 
RETURN_METAMRES_IGNORED );


Last edited by claudiuhks; 08-14-2012 at 12:48.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Bos93
Veteran Member
Join Date: Jul 2010
Old 08-14-2012 , 13:41   Re: How to hook new round?
Reply With Quote #7

error IsHLTV:
__________________

Last edited by Bos93; 08-14-2012 at 13:52.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Bos93
Veteran Member
Join Date: Jul 2010
Old 08-14-2012 , 13:51   Re: How to hook new round?
Reply With Quote #8

function is not called

How to use the functions from moduleconfig.h ? where is my error....
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 08-14-2012 , 13:55   Re: How to hook new round?
Reply With Quote #9

Can you show us the source code?
Show us your moduleconfig.
__________________

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
Bos93
Veteran Member
Join Date: Jul 2010
Old 08-14-2012 , 14:03   Re: How to hook new round?
Reply With Quote #10

meta_api.cpp default +
PHP Code:
void MessageBegin (int msg_destint msg_type, const float *pOriginedict_t *ed)
{    
    if( 
msg_type == 125 )
    {
        
SERVER_PRINT("::ROUND START!!!\n");
    }

Attached Files
File Type: zip sdk.zip (34.3 KB, 106 views)
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
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 09:25.


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