[STK] CvarToColor
2 Attachment(s)
CvarToColor .: Description :. I saw many plugins where coders getting colors from cvar, but some coders dont know how to do that, so i dedicated to make this simple stock :).: Usage :. .: Example :. .: Stock :.
|
Re: CvarToColor( )
Nice xpaw. +karma
|
Re: CvarToColor( )
Awesome Work xPaw
I need this so much! +karma :D |
Re: CvarToColor( )
I would stick with jim_yang method as it calls less natives than the spaced one.
Also, you could save clamp native call. Here a way using 1 native instead of 4 in your example (haven't cound get_pcvar since your code doesn't integrate it. PHP Code:
PHP Code:
|
Re: CvarToColor( )
Connor is right what jim's way is calls less natives, but with spaces its more friendly for server owners ;)
|
Re: CvarToColor( )
Credit is for jim_yang not Connor. Also what is the advantage to use 0xFF instead of 255 ? 255 is more readable and 'understable'.
|
Re: CvarToColor( )
Quote:
Quote:
|
Re: CvarToColor( )
Quote:
Quote:
|
Re: CvarToColor( )
clamp byte was from me, but everyone could have made it :P
|
Re: CvarToColor( )
I think that I would make it more like the get_(p)cvar_* commands (for continuity :)).
Code:
get_cvar_color(pointer, iColor[3]) Code:
get_pcvar_color(pointer, iColor[3]) |
All times are GMT -4. The time now is 05:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.