SHARE
TWEET

Untitled

a guest Aug 12th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public Load ( iPlayer )
  2. {
  3.     LoadXP ( iPlayer )
  4.     LoadStats ( iPlayer )
  5. }
  6.  
  7. public Save ( iPlayer )
  8. {
  9.     SaveXP ( iPlayer )
  10.     SaveStats ( iPlayer )
  11. }
  12.  
  13. public LoadXP ( iPlayer )
  14. {
  15.     new data [ 129 ]
  16.    
  17.     new key [ 72 ], stats [ 34 ], stat [ 3 ] [ 12 ]
  18.     formatex ( key, 71, "%s-OG", g_iAuthID [ iPlayer ] )
  19.    
  20.     nvault_get ( g_vaultLevel, key, stats, 33 )
  21.    
  22.     parse ( stats, stat [ 0 ], 11, stat [ 1 ], 11, stat [ 2 ], 11 )
  23.    
  24.     iXP [ iPlayer ] = str_to_num ( stat [ 0 ] )
  25.     iLevel [ iPlayer ] = str_to_num ( stat [ 1 ] )
  26.     iGold [ iPlayer ] = str_to_num ( stat [ 2 ] )
  27.    
  28.     nvault_get ( g_vaultLevel, g_iAuthID [ iPlayer ], data, 128 )
  29. }
  30.  
  31. public SaveXP ( iPlayer )
  32. {
  33.     new data [ 129 ]
  34.    
  35.     new key [ 72 ], stats [ 34 ]
  36.     formatex ( key, 71, "%s-OG", g_iAuthID [ iPlayer ] )
  37.     formatex ( stats, 3, "%i %i %i", iXP [ iPlayer ], iLevel [ iPlayer ], iGold [ iPlayer ] )
  38.     nvault_set ( g_vaultLevel, key, stats )
  39.     nvault_set ( g_vaultLevel, g_iAuthID [ iPlayer ], data )
  40. }
  41.  
  42. public LoadStats ( iPlayer )
  43. {
  44.     new data [ 129 ]
  45.    
  46.     new key [ 72 ], stats [ 34 ], stat [ 4 ] [ 12 ]
  47.    
  48.     formatex ( key, 71, "%s-OG", g_iAuthID [ iPlayer ] )
  49.    
  50.     nvault_get ( g_vaultStats, key, stats, 33 )
  51.    
  52.     parse ( stats, stat [ 0 ], 11, stat [ 1 ], 11, stat [ 2 ], 11, stat [ 3 ], 11 )
  53.    
  54.     iTalent [ iPlayer ] = str_to_num ( stat [ 0 ] )
  55.     iSta [ iPlayer ] = str_to_num ( stat [ 1 ] )
  56.     iStr [ iPlayer ] = str_to_num ( stat [ 2 ] )
  57.     iAgi [ iPlayer ] = str_to_num ( stat [ 3 ] )
  58.    
  59.     nvault_get ( g_vaultStats, g_iAuthID [ iPlayer ], data, 128 )
  60. }
  61.  
  62. public SaveStats ( iPlayer )
  63. {
  64.     new data [ 129 ], key [ 72 ], stats [ 34 ]
  65.    
  66.     formatex ( key, 71, "%s-OG", g_iAuthID [ iPlayer ] )
  67.     formatex ( stats, 3, "%i %i %i %i", iTalent [ iPlayer ], iSta [ iPlayer ], iStr [ iPlayer ], iAgi [ iPlayer ] )
  68.    
  69.     nvault_set ( g_vaultStats, key, stats )
  70.     nvault_set ( g_vaultStats, g_iAuthID [ iPlayer ], data )
  71. }
RAW Paste Data
Top