Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] Today I learned - Share your newly found knowledge!

 
  • 0 Vote(s) - 0 Average
Pawn Today I learned - Share your newly found knowledge!
kristo
Offline

Burgershot Member
Posts: 47
Threads: 10
Joined: Feb 2019
Reputation: 7
Location: Estonia
#1
2019-04-17, 02:31 PM (This post was last modified: 2019-04-17, 02:32 PM by kristo.)
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();
} 
« Next Oldest | Next Newest »



Messages In This Thread
Today I learned - Share your newly found knowledge! - by kristo - 2019-04-17, 02:31 PM
RE: Today I learned - Share your newly found knowledge! - by Tama - 2020-08-06, 09:25 AM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode