is it possible to change the color of a hud sprite from the default orange to red? I've seen it done in a TFC server but they probably used an amxx plugin.
https://streamable.com/nwzls3
Essentially the concussion_grenade sprite changes colors when you hit the +gren2 key. I'd like to know if im going in the right direction. I was hoping i could just swap out the weapon id / item names but it seems alot more complex than that. tf_weapon_concussiongrenade, TFC_WPN_CONCUSSIONGRENADE are the weapon id / item ids. Are there any other resources i can look at to get a better grasp on this?
original hud sprite concept :
https://forums.alliedmods.net/showthread.php?t=175632
where i got my source fork
https://forums.alliedmods.net/showpo...06&postcount=3
item name / ids
http://www.amxmodx.org/doc/index.htm...cx%2Findex.htm
item name / ids
https://github.com/alliedmodders/met...tamod/ents/tfc
Quote:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <tfcx>
#include <tfcconst>
new MsgIndexWeaponList;
public plugin_precache()
{
precache_generic( "sprites/weapon_mirv.txt" );
precache_generic( "sprites/yolo.spr" );
}
public plugin_init()
{
MsgIndexWeaponList = get_user_msgid( "WeaponList" );
RegisterHam( Ham_Item_AddToPlayer, "tf_weapon_concussiongrenade", "OnAddToPlayerHegrenade", .Post = true );
RegisterHam( Ham_Item_ItemSlot, "tf_weapon_concussiongrenade", "OnItemSlotHegrenade" );
register_clcmd( "tf_weapon_concussiongrenade", "ClientCommand_SelectFlare" );
}
public ClientCommand_SelectFlare( const client )
{
engclient_cmd( client, "tf_weapon_concussiongrenade" );
}
public OnAddToPlayerHegrenade( const item, const player )
{
if( pev_valid( item ) && is_user_alive( player ) ) // just for safety.
{
message_begin( MSG_ONE, MsgIndexWeaponList, .player = player );
{
write_string( "tf_weapon_mirvgrenade" ); // WeaponName
write_byte( -1 ); // PrimaryAmmoID
write_byte( -1 ); // PrimaryAmmoMaxAmount
write_byte( -1 ); // SecondaryAmmoID
write_byte( -1 ); // SecondaryAmmoMaxAmount
write_byte( 4 ); // SlotID (0...N)
write_byte( 1 ); // NumberInSlot (1...N)
write_byte( TFC_WPN_CONCUSSIONGRENADE ); // WeaponID
write_byte( 0 ); // Flags
}
message_end();
}
}
public OnItemSlotGrenade( const item )
{
SetHamReturnInteger( 5 );
return HAM_SUPERCEDE;
}
|