PC GTA IV ScriptHook mod menu help

  • Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

ClonkAndre

New Member
Jan 3, 2019
2
0
1
Hello Guys!
I am new in this Forum and i have a Question about GTA IV creating a Mod Menu.

I'am using Visual Studio 2013 to create a Mod Menu and i almost finished the Trainer but i have 1 big Problem!

When i try to add the Menu Items the Items overlapps itself :/
Here is an Image: https://imgur.com/a/4RMVshs (on imgur)
You see?

It schould be like that:
  • lol0
  • lol1
  • lol2
  • lol3
  • lol4
  • lol5
Here is my Code: (vb.net)
Code:
Private avatext(5) As String
Public Sub New()
  avatext(0) = "lol0"
  avatext(1) = "lol1"
  avatext(2) = "lol2"
  avatext(3) = "lol3"
  avatext(4) = "lol4"
  avatext(5) = "lol5"
End Sub

Private Sub GTAIV_TEST_MENU2_PerFrameDrawing(ByVal sender As Object, ByVal e As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
  Dim num As Integer = 0
  Dim topItem As UShort = PtopItem

  If menuOpen Then
  'While CInt(topItem) <= CInt(PtopItem) + 30 AndAlso CInt(topItem) < Me.avatext.Length
  '  e.Graphics.DrawText(avatext(CInt(topItem)), 20.0F, 30.0F, If(CInt(PtopItem) = CInt(Me.selectedItem), Me.selectedItemColor, Me.defaultItemColor))
  '  topItem += 1
  'End While

  For Each Element As String In avatext
  e.Graphics.DrawText(Element, 10, 10 + 30, If(CInt(topItem) = CInt(Me.selectedItem), Me.selectedItemColor, Me.defaultItemColor))
  Next
  End If
End Sub
 
DrawText has X and Y coordinate parameters. Right now you are drawing each on the same place.

You want a column of items so your X should stay the same value for each item, but your Y needs to increase for every item. I don't know much about that garbage VisualBasic language, but I can give you an example in C:

Code:
float x = 20.0f;
float y = 20.0f;
float spacing = 0.04f; // change this to increase space between each item
for (int i = 0; i < item_count; i++)
{
    // set up text formatting here
    DISPLAY_TEXT_WITH_LITERAL_STRING(x, y + (i * spacing), "STRING", "Menu Item Text");
}

If you need to use .NET, C# is at least a little better. Or C++ ScriptHook if you want to be a champion.
 
DrawText has X and Y coordinate parameters. Right now you are drawing each on the same place.

You want a column of items so your X should stay the same value for each item, but your Y needs to increase for every item. I don't know much about that garbage VisualBasic language, but I can give you an example in C:

Code:
float x = 20.0f;
float y = 20.0f;
float spacing = 0.04f; // change this to increase space between each item
for (int i = 0; i < item_count; i++)
{
    // set up text formatting here
    DISPLAY_TEXT_WITH_LITERAL_STRING(x, y + (i * spacing), "STRING", "Menu Item Text");
}

If you need to use .NET, C# is at least a little better. Or C++ ScriptHook if you want to be a champion.
Thank you for helping him, great work m8 ;)
 
DrawText has X and Y coordinate parameters. Right now you are drawing each on the same place.

You want a column of items so your X should stay the same value for each item, but your Y needs to increase for every item. I don't know much about that garbage VisualBasic language, but I can give you an example in C:

Code:
float x = 20.0f;
float y = 20.0f;
float spacing = 0.04f; // change this to increase space between each item
for (int i = 0; i < item_count; i++)
{
    // set up text formatting here
    DISPLAY_TEXT_WITH_LITERAL_STRING(x, y + (i * spacing), "STRING", "Menu Item Text");
}

If you need to use .NET, C# is at least a little better. Or C++ ScriptHook if you want to be a champion.

Much thanks to you, it's working now! ;)
 
General chit-chat
Help Users
  • @ lurch6661:
    iam good
  • @ lurch6661:
    got my bd disc in
  • @ lurch6661:
    it comes with games lol
  • @ QM|T:
    lol
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    Tural is our newest member. Welcome!
  • Chat Bot:
    Pharaotix is our newest member. Welcome!
  • Chat Bot:
    Duran_1911 is our newest member. Welcome!
  • Chat Bot:
    LilBoat100 has left the room.
  • Chat Bot:
    keonhacaivoto is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    estro101 is our newest member. Welcome!
  • Chat Bot:
    yeclipsex is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    Diabloron is our newest member. Welcome!
  • Chat Bot:
    mr kiki is our newest member. Welcome!
  • Chat Bot:
    NorwayVon is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    cynthia is our newest member. Welcome!
  • Chat Bot:
    LilBoat100 has joined the room.
  • @ LilBoat100:
    been a min
  • @ LilBoat100:
    i have uncharted 3, (digital) my disc aint working for shit lol, so whenever i try finding "LAN Party" its not on digital, only on disc. so if theres like a eboot maybe, or something i can do to activate the LAN Party to play offline, that shit would be dope bro. anyone.
  • @ LilBoat100:
    or maybe if i download it as iso? idk
      @ LilBoat100: or maybe if i download it as iso? idk