Quote:
Originally Posted by instinctpt1
Raizo but how we can change their position coz if we write a string we get the position of status icon , But in Images they appears to get their origin over players Head .. How is that possible :/ ?
|
Exist many ways to do it
A little example :
Code:
#include <amxmodx>
new ak47_id, m4a1_id;
public plugin_init()
{
register_event( "CurWeapon", "sprite_model", "be", "1=1" );
}
public sprite_model(id)
{
if(is_user_alive(id) )
{
if(get_user_weapon(id) == CSW_AK47)
{
remove_sprite(id)
ak47_sprite(id)
}
else if(get_user_weapon(id) == CSW_M4A1)
{
remove_sprite(id)
m4a1_sprite(id)
}
}
}
public plugin_precache()
{
ak47_id = precache_model( "sprites/ak47.spr" );
m4a1_id = precache_model( "sprites/m4a1.spr" );
}
stock ak47_sprite( index )
{
if ( !is_user_connected( index ) )
{
return;
}
message_begin( MSG_ALL, SVC_TEMPENTITY );
write_byte( TE_PLAYERATTACHMENT );
write_byte( index );
write_coord( 60 );
write_short( ak47_id );
write_short( 9000 );
message_end();
}
stock m4a1_sprite( index )
{
if ( !is_user_connected( index ) )
{
return;
}
message_begin( MSG_ALL, SVC_TEMPENTITY );
write_byte( TE_PLAYERATTACHMENT );
write_byte( index );
write_coord( 60 );
write_short( m4a1_id );
write_short( 9000 );
message_end();
}
stock remove_sprite( index )
{
if ( !is_user_connected( index ) )
{
return;
}
message_begin( MSG_ALL, SVC_TEMPENTITY );
write_byte( TE_KILLPLAYERATTACHMENTS );
write_byte( index );
message_end();
}