Advertisement
julioCCs

Draw map on cellphone screen - GTA IV

Feb 4th, 2014
626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.88 KB | None | 0 0
  1. Public Function getPhoneRenderID() As Integer
  2.         Dim rPhone As New Native.Pointer(GetType(Integer))
  3.         Native.Function.Call("GET_MOBILE_PHONE_RENDER_ID", rPhone)
  4.         Dim ci As Integer = Integer.Parse(String.Concat(rPhone.Value))
  5.         Return ci
  6.     End Function
  7.  
  8.  
  9. Dim txdLoad As Int32 = Native.Function.Call(Of Int32)("LOAD_TXD", "race_atob")
  10.     Dim textureLoad As Int32 = Native.Function.Call(Of Int32)("GET_TEXTURE", txdLoad, "race_atob0")
  11.     Dim tmpCenterPos As Vector3 = New Vector3(338, 546, 0)
  12.     Dim tmpXMax As Int16 = 225
  13.     Dim tmpYMax As Int16 = 402
  14.  
  15.     Dim zoomCoef As Double = 4.3
  16.  
  17.     Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
  18.         Dim phoneID As Integer = getPhoneRenderID() ' you dont need to get phone id in every tick
  19.  
  20.         Native.Function.Call("SET_TEXT_RENDER_ID", phoneID)
  21.  
  22.         Dim tmpXDist As Double = tmpCenterPos.X - Player.Character.Position.X
  23.         Dim tmpYDist As Double = Player.Character.Position.Y - tmpCenterPos.Y
  24.  
  25.         Dim tmpXPercent As Double = tmpXDist * 100 / tmpXMax / 100 + 0.5
  26.         Dim tmpYPercent As Double = (tmpYDist * 100 / tmpYMax / 100 + 0.5)
  27.  
  28.         Native.Function.Call("DRAW_SPRITE", textureLoad, tmpXPercent, tmpYPercent, 7.15 * zoomCoef, 2.0 * zoomCoef, 180, 255, 255, 255, 175)
  29.         Native.Function.Call("DRAW_RECT", 0.5, 0.5, 0.025, 0.01, 255, 255, 255, 255)
  30.  
  31.         msgex(phoneID & " > " & tmpXPercent & "  " & tmpYPercent & "    " & tmpXMax & "  " & tmpYMax & "   " & zoomCoef, 100)
  32.  
  33.         If Game.isKeyPressed(Keys.Add) Then tmpXMax += 5
  34.         If Game.isKeyPressed(Keys.Subtract) Then tmpXMax -= 5
  35.         If Game.isKeyPressed(Keys.Y) Then tmpYMax += 5
  36.         If Game.isKeyPressed(Keys.U) Then tmpYMax -= 5
  37.         If Game.isKeyPressed(Keys.D8) Then zoomCoef += 0.1
  38.         If Game.isKeyPressed(Keys.D9) Then zoomCoef -= 0.1
  39.  
  40. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement