Advertisement
Guest User

AddOnSystem.cpp

a guest
Sep 25th, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.42 KB | None | 0 0
  1.  
  2. //| Terms && Perms |\\
  3.  
  4. /*
  5. Copyright holder is and was 0x00000539@UC
  6. Contact: https://www.unknowncheats.me/forum/members/1641196.html
  7.  
  8. If you want to use this snippet please ask me.
  9. */
  10.  
  11. //|    Includes    |\\
  12.  
  13. #include "AddOnSystem.h"
  14.  
  15. //|      Code      |\\
  16.  
  17. AddOnSystem::AddOnGlobalStruct::AddOnGlobalStruct ( std::string name , long float f )
  18. {
  19.     numeric_value = f;
  20.     undefines_value = NULL;
  21. }
  22. AddOnSystem::AddOnGlobalStruct::AddOnGlobalStruct ( std::string name , void* a )
  23. {
  24.     numeric_value = 0;
  25.     undefines_value = a;
  26. }
  27. AddOnSystem::AddOnGlobals::AddOnGlobals ( )
  28. {
  29.     Globals = { };
  30. }
  31. int AddOnSystem::AddOnGlobals::AddValue ( std::string i , long float f )
  32. {
  33.     Globals.push_back ( new AddOnSystem::AddOnGlobalStruct ( i , f ) );
  34. }
  35. int AddOnSystem::AddOnGlobals::AddValue ( std::string i , void* v )
  36. {
  37.     Globals.push_back ( new AddOnSystem::AddOnGlobalStruct ( i , v ) );
  38. }
  39. long float AddOnSystem::AddOnGlobals::GetNumeric ( int i )
  40. {
  41.     if ( i < Globals.size ( ) )
  42.         return Globals [ i ]->numeric_value;
  43.     return 0;
  44. }
  45. long float AddOnSystem::AddOnGlobals::GetNumeric ( std::string i )
  46. {
  47.     for ( int index = 0; index < Globals.size ( ); index++ )
  48.     {
  49.         if ( Globals [ index ]->identifier == i )
  50.             return Globals [ index ]->numeric_value;
  51.     }
  52.     return 0;
  53. }
  54. void* AddOnSystem::AddOnGlobals::GetUndefined ( int i )
  55. {
  56.     if ( i < Globals.size ( ) )
  57.         return Globals [ i ]->undefines_value;
  58.     return NULL;
  59. }
  60. void* AddOnSystem::AddOnGlobals::GetUndefined ( std::string i )
  61. {
  62.     for ( int index = 0; index < Globals.size ( ); index++ )
  63.     {
  64.         if ( Globals [ index ]->identifier == i )
  65.             return Globals [ index ]->undefines_value;
  66.     }
  67.     return NULL;
  68. }
  69. void AddOnSystem::AddOnGlobals::OverwriteNumeric ( int i , long float f )
  70. {
  71.     if ( i < Globals.size ( ) )
  72.         Globals [ i ]->numeric_value = f;
  73. }
  74. void AddOnSystem::AddOnGlobals::OverwriteNumeric ( std::string i , long float f )
  75. {
  76.     for ( int index = 0; index < Globals.size ( ); index++ )
  77.     {
  78.         if ( Globals [ index ]->identifier == i )
  79.             Globals [ index ]->numeric_value = f;
  80.     }
  81. }
  82. void AddOnSystem::AddOnGlobals::OverwriteUndefined ( int i , void* v )
  83. {
  84.     if ( i < Globals.size ( ) )
  85.         Globals [ i ]->undefines_value = v;
  86. }
  87. void AddOnSystem::AddOnGlobals::OverwriteUndefined ( std::string i , void* v )
  88. {
  89.     for ( int index = 0; index < Globals.size ( ); index++ )
  90.     {
  91.         if ( Globals [ index ]->identifier == i )
  92.             Globals [ index ]->undefines_value = v;
  93.     }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement