Advertisement
TheVideoVolcano

GTA V TimerClass VB.NET SHKDN

Jul 12th, 2015
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.10 KB | None | 0 0
  1. 'THEVIDEOVOLCANO/RGSOFTWARE
  2.  
  3. Imports GTA
  4.  
  5. Public Class TTimer
  6.  
  7.     Public Shared Sub SetTimer()
  8.         Native.Function.Call(Native.Hash.SETTIMERA, 0)
  9.     End Sub
  10.  
  11.     Public Shared ReadOnly Property ElapsedMilliSeconds() As Int32
  12.  
  13.         Get
  14.             Return Native.Function.Call(Of Int32)(Native.Hash.TIMERA)
  15.         End Get
  16.  
  17.     End Property
  18.  
  19.  
  20.     Public Shared ReadOnly Property GameDuration(ByVal unit As TimeUnit) As Int32
  21.  
  22.         Get
  23.  
  24.             Dim dura As Int32 = Native.Function.Call(Of Int32)(Native.Hash.GET_GAME_TIMER)
  25.  
  26.             If unit <> TimeUnit.Milliseconds Then
  27.                 Return dura / unit
  28.             End If
  29.  
  30.             Return dura
  31.         End Get
  32.  
  33.     End Property
  34.  
  35.  
  36.     Public Shared ReadOnly Property GameDuration() As Int32
  37.  
  38.         Get
  39.             Return Native.Function.Call(Of Int32)(Native.Hash.GET_GAME_TIMER)
  40.         End Get
  41.  
  42.     End Property
  43.  
  44.     Public Enum TimeUnit
  45.  
  46.         Milliseconds = 0
  47.         Seconds = 1000
  48.         Minutes = 60 * Seconds
  49.         Hours = 60 * Minutes
  50.         Day = 23 * Hours
  51.  
  52.     End Enum
  53.  
  54. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement