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

crash whenever motd is called


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 04-10-2004 , 06:56   crash whenever motd is called
Reply With Quote #1

when i want to show top15 or my stats normally a motd is opened.
but it just crashs with the message
"Tried to create a Message with a Bogus message type(0)"

but the motd of Adminmod (2.50.59) works fine

running:
Opossing force
metamod 1.17
amxx 0.16
karlos is offline
RAW_OmarBKhatab
Member
Join Date: Mar 2004
Location: USA
Old 04-17-2004 , 09:19   Re: crash whenever motd is called
Reply With Quote #2

Quote:
Originally Posted by karlos
when i want to show top15 or my stats normally a motd is opened.
but it just crashs with the message
"Tried to create a Message with a Bogus message type(0)"

but the motd of Adminmod (2.50.59) works fine

running:
Opossing force
metamod 1.17
amxx 0.16
see this post:

http://forums.alliedmods.net/showthr...?p=10631#11495

Same problem but with details.
__________________
RAW_OmarBKhatab is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 04-21-2004 , 08:08  
Reply With Quote #3

this bug is defenitly due to amx / amxx

motd in amxx source:
Code:
void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name)
{
  MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client );
    WRITE_STRING(name);
  MESSAGE_END();

  char *n = motd;
  char c = 0;
  int a;

  while ( *n ) {
    a = mlen;
    if ( a > 175 ) a = 175;
    mlen -= a;
    c = *(n+=a);
    *n = 0;
    MESSAGE_BEGIN( MSG_ONE , gmsgMOTD, NULL, client );
      WRITE_BYTE( c ? FALSE : TRUE );
      WRITE_STRING( motd );
    MESSAGE_END();
    *n = c;
    motd = n;
  }

  MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client );
    WRITE_STRING( hostname->string );
  MESSAGE_END();
}
but when i am using in plugins:
Code:
public show_motd_fix(id, motdmsg[]){
	message_begin( MSG_ONE, get_user_msgid("MOTD"), {0,0,0}, id )
	write_string( motdmsg )
	message_end()
}
i can display any motd without the "tried to create ..." error except that max message lenght is only 192

anyone know why its like that?
karlos is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 04-23-2004 , 16:32  
Reply With Quote #4

just made it

i deleted

MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client );
WRITE_STRING(name);
MESSAGE_END();

and

MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client );
WRITE_STRING( hostname->string );
MESSAGE_END();

recompiled

and it is working
karlos 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 17:06.


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