Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Do you know how to make people glow for all alive players like in the death cam mode? That would help even more for anti-camp plugin.
Anyway, thanks for sharing ! |
Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Here's a small thing I use.
PHP Code:
PHP Code:
|
Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Quote:
|
Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Not without any explanation of why not.
|
Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Quote:
Code:
#define unsafe(i) ( (i) >= 0 ? (i) : -(i) )Your answer may be that you'll just be super careful and won't do these things but it's better to prevent these errors completely through prudent programming than attempt to avoid them with each use. |
Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Well, I use it in the same exact way every time, so as you said, I guess that's the same as saying 'I'll be super careful'.
|
Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
There's something weird about Math_Min() and Math_Max() functions.
PHP Code:
It should work like min()/max() functions in AMXX (or hell, in C++ even), which compare the two provided parameters and return the lower/upper value. |
Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
It's... not like min or max are difficult functions to write...
PHP Code:
|
Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Quote:
The function names and documentation might be a bit confusing tho. |
Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Just use ternary operators. That's what they are for.
a > b ? a : b Well shit, powerlord posted the exact same thing. Virtually all of the stuff in smlib is like this. If you can't write the functions yourself, you probably should not be using them. This goes for almost anything. They're there for convenience, but you should always read the include so you know it does exactly what you need. More often, you should read it's source, so you know how it works and if there are any situations i which it won't work right (undefined, unpredictable, or erroneous results). |
| All times are GMT -4. The time now is 21:59. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.