Raised This Month: $32 Target: $400
 8% 

Fatal Errors: SZ_GetSpace and MSG_ONE


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 09-29-2012 , 22:23   Fatal Errors: SZ_GetSpace and MSG_ONE
Reply With Quote #1

Hi mates.. I have an problem with my plugins.

I'm using the code bellow, but I have this error and the server crashes: SZ_GetSpace: overflow on dxTT FATAL ERROR (shutting down): MSG_ONE or MSG_ONE_UNRELIABLE with no target entity

Code:
stock kick_user(index, const szKickMsg[], any:...) {     new szMsg[128];     vformat(szMsg, sizeof(szMsg) - 1, szKickMsg, 3);         emessage_begin(MSG_ONE, SVC_DISCONNECT, _, index);     ewrite_string(szMsg);     emessage_end(); }
__________________
kramesa is offline
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 09-30-2012 , 01:46   Re: Fatal Errors: SZ_GetSpace and MSG_ONE
Reply With Quote #2

PHP Code:
stock kick_user(index, const szKickMsg[], any:...) 
{
     if(!
is_user_connected(index))
          return

     new 
szMsg[128];     
     
format(szMsgsizeof(szMsg) - 1szKickMsg3)

     
emessage_begin(MSG_ONE_UNRELIABLESVC_DISCONNECT_index)
     
ewrite_string(szMsg);    
     
emessage_end(); 


Last edited by dias; 09-30-2012 at 01:47.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-01-2012 , 12:22   Re: Fatal Errors: SZ_GetSpace and MSG_ONE
Reply With Quote #3

Quote:
Originally Posted by dias View Post
PHP Code:
stock kick_user(index, const szKickMsg[], any:...) 
{
     if(!
is_user_connected(index))
          return

     new 
szMsg[128];     
     
format(szMsgsizeof(szMsg) - 1szKickMsg3)

     
emessage_begin(MSG_ONE_UNRELIABLESVC_DISCONNECT_index)
     
ewrite_string(szMsg);    
     
emessage_end(); 

Thanks man, I will test.
__________________
kramesa is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-01-2012 , 13:50   Re: Fatal Errors: SZ_GetSpace and MSG_ONE
Reply With Quote #4

This doesn't kick players properly (this is only half of the kick process), use kick command.

PHP Code:
KickUser(idfmt[] = ""any:...)
{
    if( !
fmt[0] )
    {
        
server_cmd("kick #%d"get_user_userid(id))
    }
    else
    {
        static 
szReason[1024]
        
vformat(szReasoncharsmax(szReason), fmt3)
        
server_cmd("kick #%d ^"%s^""get_user_userid(id), szReason)
    }

More complete way if you still want to use that message would be :

PHP Code:
KickUser(idfmt[], any:...)
{
    if( !
is_user_connected(id) )
    {
        return
    }
    static 
szReason[1024], i
    i 
vformat(szReasoncharsmax(szReason), fmt3)
    if( 
== charsmax(szReason) )
    {
        
server_print("DropClient : A client drop message had to be truncated.")
    }

    static 
szName[32]
    
pev(idpev_netnameszNamecharsmax(szName))
    
server_print("Dropped %s, reason: %s"szNameszReason)

    
dllfunc(DLLFunc_ClientDisconnectid)

    
szReason[63] = EOS

    message_begin
(MSG_ONESVC_DISCONNECT, .player=id)
    
write_string(szReason)
    
message_end()

But i'm not sure it is complete, anyway, kick command is more efficient.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 10-01-2012 at 13:54.
ConnorMcLeod is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-01-2012 , 17:41   Re: Fatal Errors: SZ_GetSpace and MSG_ONE
Reply With Quote #5

Quote:
Originally Posted by dias View Post
PHP Code:
stock kick_user(index, const szKickMsg[], any:...) 
{
     if(!
is_user_connected(index))
          return

     new 
szMsg[128];     
     
format(szMsgsizeof(szMsg) - 1szKickMsg3)

     
emessage_begin(MSG_ONE_UNRELIABLESVC_DISCONNECT_index)
     
ewrite_string(szMsg);    
     
emessage_end(); 

Crash with same error.

Quote:
Originally Posted by ConnorMcLeod View Post
This doesn't kick players properly (this is only half of the kick process), use kick command.

PHP Code:
KickUser(idfmt[] = ""any:...)
{
    if( !
fmt[0] )
    {
        
server_cmd("kick #%d"get_user_userid(id))
    }
    else
    {
        static 
szReason[1024]
        
vformat(szReasoncharsmax(szReason), fmt3)
        
server_cmd("kick #%d ^"%s^""get_user_userid(id), szReason)
    }

More complete way if you still want to use that message would be :

PHP Code:
KickUser(idfmt[], any:...)
{
    if( !
is_user_connected(id) )
    {
        return
    }
    static 
szReason[1024], i
    i 
vformat(szReasoncharsmax(szReason), fmt3)
    if( 
== charsmax(szReason) )
    {
        
server_print("DropClient : A client drop message had to be truncated.")
    }

    static 
szName[32]
    
pev(idpev_netnameszNamecharsmax(szName))
    
server_print("Dropped %s, reason: %s"szNameszReason)

    
dllfunc(DLLFunc_ClientDisconnectid)

    
szReason[63] = EOS

    message_begin
(MSG_ONESVC_DISCONNECT, .player=id)
    
write_string(szReason)
    
message_end()

But i'm not sure it is complete, anyway, kick command is more efficient.
Thanks, I will try.
__________________
kramesa 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:25.


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