hlmod.hu
https://hlmod.hu/

Ez melyik plugin?
https://hlmod.hu/viewtopic.php?f=9&t=14294
Oldal: 1 / 1

Szerző:  Telapo11 [2014.02.08. 14:44 ]
Hozzászólás témája:  Ez melyik plugin?

Ez kéne nekem hogy átt tudjam szinezni

Csatolmányok:
2014-02-08_00001.jpg
2014-02-08_00001.jpg [1.81KiB |Megtekintve 264 alkalommal ]

Szerző:  lis789 [2014.02.08. 15:35 ]
Hozzászólás témája:  Re: Ez melyik plugin?

SMA Forráskód: [ Mindet kijelol ]
  1. #include < amxmodx >
  2.  
  3. enum Icon {
  4. C4 = 0,
  5. Escape,
  6. Rescue,
  7. Defuser,
  8. Buyzone,
  9. VipSafety
  10. };
  11.  
  12. new Trie:g_tIconNames, g_pCvars[ Icon ];
  13.  
  14. public plugin_init( ) {
  15. register_plugin( "Icons Color Changer", "1.1", "xPaw" );
  16.  
  17. register_message( get_user_msgid( "StatusIcon" ), "MessageStatusIcon" );
  18.  
  19. g_tIconNames = TrieCreate( );
  20.  
  21. new const DefaultValues[ Icon ][ ] = { "255 100 0", "255 215 0", "255 100 0 ", "0 100 255", "0 160 0", "0 160 0" };
  22. new const IconNames[ Icon ][ ] = { "c4", "escape", "rescue", "defuser", "buyzone", "vipsafety" };
  23.  
  24. new szCvarName[ 17 ], iAppend = formatex( szCvarName, 16, "icons_" );
  25.  
  26. for( new Icon:i = C4; i < Icon; i++ ) {
  27. formatex( szCvarName[ iAppend ], 10, IconNames[ i ] );
  28.  
  29. g_pCvars[ i ] = register_cvar( szCvarName, DefaultValues[ i ] );
  30.  
  31. TrieSetCell( g_tIconNames, IconNames[ i ], i );
  32. }
  33. }
  34.  
  35. public plugin_end( )
  36. TrieDestroy( g_tIconNames );
  37.  
  38. public MessageStatusIcon( const iMsgId, const iMsgDest, const id ) {
  39. if( get_msg_arg_int( 1 ) == 0 )
  40. return;
  41.  
  42. new szIcon[ 10 ], Icon:iIcon;
  43. get_msg_arg_string( 2, szIcon, 9 );
  44.  
  45. if( !TrieGetCell( g_tIconNames, szIcon, iIcon ) )
  46. return;
  47.  
  48. new szColor[ 12 ], szRGB[ 3 ][ 4 ];
  49. get_pcvar_string( g_pCvars[ iIcon ], szColor, 11 );
  50. parse( szColor, szRGB[ 0 ], 3, szRGB[ 1 ], 3, szRGB[ 2 ], 3 );
  51.  
  52. new iRed = clamp( str_to_num( szRGB[ 0 ] ), 0, 255 );
  53. new iGreen = clamp( str_to_num( szRGB[ 1 ] ), 0, 255 );
  54. new iBlue = clamp( str_to_num( szRGB[ 2 ] ), 0, 255 );
  55.  
  56. set_msg_arg_int( 3, ARG_BYTE, iRed );
  57. set_msg_arg_int( 4, ARG_BYTE, iGreen );
  58. set_msg_arg_int( 5, ARG_BYTE, iBlue );
  59. }
  60.  

RGB kóddal te adod meg a szinét!

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/