• 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Today I learned - Share your newly found knowledge!
#1
Credits for the concept of this thread go to Slice.

Slice Wrote:Simple.?If you learned something new?related to SA-MP scripting, share it here!

Please:
  • Explain what it is you learned, don't just say you learned something.?<----
  • Try keeping it concise.
  • Don't post stupid pictures or otherwise annoying, non-related stuff.
  • Don't link to or quote posts then say you learned that.


Today I learned that natives can be forwarded and this can be used to deprecate natives and add replacements for them without getting a deprecation warning inside the replacement function:

PHP Code:
forward DeprecatedNative(); stock NewFunction() { ? ?return DeprecatedNative(); // no warning here } #pragma deprecated Use `NewFunction` instead. native DeprecatedNative(); main() { ? ?DeprecatedNative(); //?(warning) function is deprecated (symbol "DeprecatedNative") Use `NewFunction` instead. ? ?NewFunction(); }
  Reply
#2
Today i learn something, using ! without manually set true\false.

Usage:
PHP Code:
main() { var1 = !var1; }

Instead of:
PHP Code:
main() { var1 = true; var1 = false; }
???? ???? ????? ?? ???????? ???? ?????, ?? ???? ???? ?? ?????? ?? ??? ???? ???? ???? ?? ??? ???? ??? ???? ??? ?? ?? ?????? ??????





  Reply