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_message( get_user_msgid( "TextMsg" ), "Message_HostageText" )
}
public Message_HostageText( msg_id, msg_dest, id )
{
static szChannel[ 64 ]
get_msg_arg_string( 2, szChannel, charsmax( szChannel ) )
if( equal( szChannel, "#Hostages_Not_Rescued" ) )
{
SlayTeam( CS_TEAM_CT, "Slay!!!" )
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public SlayTeam( CsTeams:iTeam , const szMessage[] )
{
new iPlayers[32], iNum, id, i
get_players(iPlayers, iNum, "a")
for( i = 0; i < iNum; i++ )
{
id = iPlayers[ i ]
if( cs_get_user_team(id) == iTeam )
{
user_kill(id, 1)
ColorChat(id, szMessage)
}
}
}
ColorChat( id, const fmt[ ], any:... )
{
static szMsg[ 192 ], MSG_TARGET
szMsg[ 0 ] = 0x04
vformat( szMsg[ 1 ], charsmax( szMsg ), fmt, 3 )
MSG_TARGET = id ? MSG_ONE_UNRELIABLE : MSG_ALL
message_begin( MSG_TARGET, g_iMsgSayText, .player = id )
{
write_byte( id ? id : 1 )
write_string( szMsg )
}
message_end()
}
Tried to check If player connected and doesn't work! What is the problem ?
Tested on cs_assault ; Windows.