Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use like so
- 'inside main_tick, put update_status_text()
- 'write text by calling, set_status_text("TEXT_YOU_WANT", 2000, true/false)
- Imports GTA
- Public Class TText
- Private Shared statusTextGxtEntry As Boolean = False
- Private Shared statusTextDrawTicksMax As Integer = 0
- Private Shared statusText As String = ""
- Public Shared Function GetTickCount() As Integer
- Return Environment.TickCount()
- End Function
- Public Shared Sub update_status_Text()
- If GetTickCount() < statusTextDrawTicksMax Then
- Native.Function.Call(Native.Hash.SET_TEXT_FONT, 0)
- Native.Function.Call(Native.Hash.SET_TEXT_SCALE, 0.55F, 0.55F)
- Native.Function.Call(Native.Hash.SET_TEXT_COLOUR, 255, 255, 255, 255)
- Native.Function.Call(Native.Hash.SET_TEXT_WRAP, 0.0F, 1.0F)
- Native.Function.Call(Native.Hash.SET_TEXT_CENTRE, 1)
- Native.Function.Call(Native.Hash.SET_TEXT_DROPSHADOW, 0, 0, 0, 0, 0)
- Native.Function.Call(Native.Hash.SET_TEXT_EDGE, 1, 0, 0, 0, 205)
- If (statusTextGxtEntry) Then
- Native.Function.Call(Native.Hash._SET_TEXT_ENTRY, statusText)
- Else
- Native.Function.Call(Native.Hash._SET_TEXT_ENTRY, "STRING")
- Native.Function.Call(Native.Hash._ADD_TEXT_COMPONENT_STRING, statusText)
- End If
- Native.Function.Call(Native.Hash._DRAW_TEXT, 0.5F, 0.5F)
- End If
- End Sub
- Public Shared Sub set_status_text(ByVal str As String, ByVal time As Integer, Optional ByVal isGxtEntry As Boolean = False)
- statusText = str
- statusTextGxtEntry = isGxtEntry
- statusTextDrawTicksMax = GetTickCount() + time
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement