Raised This Month: $ Target: $400
 0% 

[SOLVED] user_kill Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 05-12-2011 , 15:17   [SOLVED] user_kill Problem
Reply With Quote #1

Error:
Code:
New message started when msg '83' has not been sent yet
Code:
PHP Code:
#include <amxmodx>
#include <cstrike>

new g_iMsgSayText

public plugin_init() 
{
    
g_iMsgSayText get_user_msgid"SayText" )
    
    
register_messageget_user_msgid"TextMsg" ), "Message_HostageText" )
}

public 
Message_HostageTextmsg_idmsg_destid )
{
    static 
szChannel64 ]
    
get_msg_arg_string2szChannelcharsmaxszChannel ) )
    
    if( 
equalszChannel"#Hostages_Not_Rescued" ) )
    {
        
SlayTeamCS_TEAM_CT"Slay!!!" )
        
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE
}

public 
SlayTeamCsTeams:iTeam , const szMessage[] )
{
    new 
iPlayers[32], iNumidi
    get_players
(iPlayersiNum"a")
    
    for( 
0iNumi++ )
    {
        
id iPlayers]
        if( 
cs_get_user_team(id) == iTeam )
        {
            
user_kill(id1)
            
            
ColorChat(idszMessage)
        }
    }
}

ColorChatid, const fmt[ ], any:... )
{        
    static 
szMsg192 ], MSG_TARGET
    
    szMsg
] = 0x04
    
    vformat
szMsg], charsmaxszMsg ), fmt)
    
    
MSG_TARGET id MSG_ONE_UNRELIABLE MSG_ALL
    
    message_begin
MSG_TARGETg_iMsgSayText, .player id )
    {
        
write_byteid id )
        
write_stringszMsg )
    }
    
message_end()

Tried to check If player connected and doesn't work! What is the problem ?

Tested on cs_assault ; Windows.

Last edited by dFF; 05-13-2011 at 06:10. Reason: Problem solved.
dFF is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 05-12-2011 , 17:22   Re: user_kill Problem
Reply With Quote #2

not sure but

PHP Code:
message_beginMSG_TARGETg_iMsgSayText, .player id )
    {
        
write_byteid id )
        
write_stringszMsg )
    }
    
message_end() 
->
PHP Code:
message_beginMSG_TARGETg_iMsgSayText, .player id )
write_byteid id )
write_stringszMsg )
message_end() 
jimaway is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-13-2011 , 01:57   Re: user_kill Problem
Reply With Quote #3

Quote:
Originally Posted by jimaway View Post
not sure but

PHP Code:
message_beginMSG_TARGETg_iMsgSayText, .player id )
    {
        
write_byteid id )
        
write_stringszMsg )
    }
    
message_end() 
->
PHP Code:
message_beginMSG_TARGETg_iMsgSayText, .player id )
write_byteid id )
write_stringszMsg )
message_end() 
No, that doesn't matter.

The issue is that return PLUGIN_HANDLED blocks the message ending so when you show the chat message it gives that error.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-13-2011 , 02:02   Re: user_kill Problem
Reply With Quote #4

So if he removes the return it'll work ? O.o I thought if you send any message while in another message hook you get that error...

Still, you could just register_event() and filter the type there...
Code:
register_event("TextMsg", "event_HostagesNotRescued", "a", "2=#Hostages_Not_Rescued")
And in the event_HostagesNotRescued() function you just slay the CTs and print the message.

EDIT: Hmm, actually yeah, I also send a screenfade message while in textmsg in my jctf mod and no errors there... and I guess if I block it, it'll crash xD
__________________

Last edited by Hunter-Digital; 05-13-2011 at 02:08.
Hunter-Digital is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-13-2011 , 02:03   Re: user_kill Problem
Reply With Quote #5

Quote:
Originally Posted by Hunter-Digital View Post
So if he removes the return it'll work ?
It's worked for me before.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 05-13-2011 , 06:10   Re: user_kill Problem
Reply With Quote #6

Thanks guys for replies! Problem solved.
dFF 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 04:29.


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