Advertisement
TheVideoVolcano

DrawText GTA V Scripthook.NET

Jul 15th, 2015
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.75 KB | None | 0 0
  1. 'use like so
  2. 'inside main_tick, put update_status_text()
  3. 'write text by calling, set_status_text("TEXT_YOU_WANT", 2000, true/false)
  4.  
  5. Imports GTA
  6.  
  7. Public Class TText
  8.  
  9.     Private Shared statusTextGxtEntry As Boolean = False
  10.     Private Shared statusTextDrawTicksMax As Integer = 0
  11.     Private Shared statusText As String = ""
  12.  
  13.     Public Shared Function GetTickCount() As Integer
  14.         Return Environment.TickCount()
  15.     End Function
  16.  
  17.     Public Shared Sub update_status_Text()
  18.  
  19.         If GetTickCount() < statusTextDrawTicksMax Then
  20.  
  21.             Native.Function.Call(Native.Hash.SET_TEXT_FONT, 0)
  22.             Native.Function.Call(Native.Hash.SET_TEXT_SCALE, 0.55F, 0.55F)
  23.             Native.Function.Call(Native.Hash.SET_TEXT_COLOUR, 255, 255, 255, 255)
  24.             Native.Function.Call(Native.Hash.SET_TEXT_WRAP, 0.0F, 1.0F)
  25.             Native.Function.Call(Native.Hash.SET_TEXT_CENTRE, 1)
  26.             Native.Function.Call(Native.Hash.SET_TEXT_DROPSHADOW, 0, 0, 0, 0, 0)
  27.             Native.Function.Call(Native.Hash.SET_TEXT_EDGE, 1, 0, 0, 0, 205)
  28.  
  29.             If (statusTextGxtEntry) Then
  30.  
  31.                 Native.Function.Call(Native.Hash._SET_TEXT_ENTRY, statusText)
  32.  
  33.             Else
  34.  
  35.                 Native.Function.Call(Native.Hash._SET_TEXT_ENTRY, "STRING")
  36.                 Native.Function.Call(Native.Hash._ADD_TEXT_COMPONENT_STRING, statusText)
  37.             End If
  38.  
  39.             Native.Function.Call(Native.Hash._DRAW_TEXT, 0.5F, 0.5F)
  40.  
  41.         End If
  42.     End Sub
  43.  
  44.     Public Shared Sub set_status_text(ByVal str As String, ByVal time As Integer, Optional ByVal isGxtEntry As Boolean = False)
  45.         statusText = str
  46.         statusTextGxtEntry = isGxtEntry
  47.         statusTextDrawTicksMax = GetTickCount() + time
  48.     End Sub
  49. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement