AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Icons Color Changer v1.1 (https://forums.alliedmods.net/showthread.php?t=91296)

xPaw 04-29-2009 08:55

Icons Color Changer v1.1
 
2 Attachment(s)
Icons Color Changer
By xPaw

.: Description :.
Another my simple plugin, this changes the color of icons at players hud, such as vipsafety, rescue zone, buy zone, defuser, escape zone, c4.
.: Cvars :.
All cvar uses RGB Colors.

icons_c4 255 100 0 - color of c4 icon.
icons_escape 255 215 0 - color of escape zone icon.
icons_rescue 255 100 0 - color of hostage rescue zone icon.
icons_defuser 0 100 255 - color of defusers icon.
icons_buyzone 0 160 0 - color of buyzone icon.
icons_vipsafety 0 160 0 - color of vip rescue zone icon.

0 160 0 - Standart CS Color.
.: Changelog :.
  • Version 1.1
    • Destroying trie in plugin_end
    • A small memory save

.: Credits :.
  • joaquimandrade - Introduced me into tries/arrays.

alan_el_more 04-29-2009 08:57

Re: Icons Color Changer
 
Nice Job xPaw
+k :D

beckham9224 04-29-2009 09:01

Re: Icons Color Changer
 
waiting 4 da screenie :)

xPaw 04-29-2009 09:06

Re: Icons Color Changer
 
screens added :)

beckham9224 04-29-2009 09:10

Re: Icons Color Changer
 
WOAAHHOW! KOOL 5*s!!!

tuty 04-29-2009 09:18

Re: Icons Color Changer
 
gg my little friend :P

Arkshine 04-29-2009 09:26

Re: Icons Color Changer
 
You should use elseif() here. Though, I would prefer using a switch.

Anyway, I think you could reduce your function like that. It's not necessary to repeat the same code each time.

Code:
public msgStatusIcon ( msgId, msgDest, id ) {     if ( !get_msg_arg_int( 1 ) )     {         return;     }         new iCvarPointer;     new szIcon[ 10 ];         get_msg_arg_string( 2, szIcon, charsmax( szIcon ) );         if ( equal( szIcon, "vipsafety" ) )    { iCvarPointer = g_Color_VipSafety; }     else if ( equal( szIcon, "escape" ) )  { iCvarPointer = g_Color_Escape;    }     else if ( equal( szIcon, "rescue" ) )  { iCvarPointer = g_Color_Rescue;    }     else if ( equal( szIcon, "defuser" ) ) { iCvarPointer = g_Color_Defuser;   }     else if ( equal( szIcon, "buyzone" ) ) { iCvarPointer = g_Color_BuyZone;   }     else if ( equal( szIcon, "c4" ) )      { iCvarPointer = g_Color_C4;        }         if ( iCvarPointer )     {         new szColor[ 12 ], szRed[ 4 ], szGreen[ 4 ], szBlue[ 4 ];             get_pcvar_string( iCvarPointer, szColor, charsmax( szColor ) );         parse( szColor, szRed, charsmax( szRed ) , szGreen, charsmax( szGreen ), szBlue, charsmax( szBlue ) );         set_msg_arg_int( 3, ARG_BYTE, clamp( str_to_num( szRed )  , 0, 255 ) );         set_msg_arg_int( 4, ARG_BYTE, clamp( str_to_num( szGreen ), 0, 255 ) );         set_msg_arg_int( 5, ARG_BYTE, clamp( str_to_num( szBlue ) , 0, 255 ) );     } }

BOYSplayCS 04-29-2009 09:28

Re: Icons Color Changer
 
Very nice ;)

joaquimandrade 04-29-2009 09:28

Re: Icons Color Changer
 
arkshine it has tries now

Arkshine 04-29-2009 09:31

Re: Icons Color Changer
 
Sorry, I don't understand you.


All times are GMT -4. The time now is 02:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.