Is this code better than yours if i need only to show dead teammates in radar?
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
public plugin_init() set_task(115.0,"load")
public load()
{
register_plugin( "Show dead (by red stripe) in radar", "-", "-" );
RegisterHam( Ham_Killed, "player", "ham_Killed_Post", 1 );
}
public ham_Killed_Post( id, Attacker, shouldgib )
{
new Float:flLocation[ 3 ];
pev( id, pev_origin, flLocation );
new players[ 32 ], num, player;
get_players( players, num );
for( new i ; i < num ; i ++ )
{
player = players[ i ];
if( get_user_team( player ) != get_user_team( id ) || !is_user_alive( player ) )
continue;
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "HostagePos" ), { 0, 0, 0 }, player );
write_byte( player );
write_byte( id ) ;
engfunc( EngFunc_WriteCoord, flLocation[ 0 ] );
engfunc( EngFunc_WriteCoord, flLocation[ 1 ] );
engfunc( EngFunc_WriteCoord, flLocation[ 2 ] );
message_end();
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "HostageK" ), { 0, 0, 0 }, player );
write_byte( id );
message_end();
}
}