Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSColored hud sprite for TFC concussion grenade


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
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;
}

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...