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
  • Chat Bot:
    adaml7nx is our newest member. Welcome!
  • Chat Bot:
    zx1l0x is our newest member. Welcome!
  • Chat Bot:
    mstr88homes is our newest member. Welcome!
  • Chat Bot:
    Rachid Oran is our newest member. Welcome!
  • Chat Bot:
    keonhacaipizzaaa is our newest member. Welcome!
  • Chat Bot:
    baobinhuaxanh is our newest member. Welcome!
  • Chat Bot:
    cakhiacom is our newest member. Welcome!
  • Chat Bot:
    luck80net2 is our newest member. Welcome!
  • Chat Bot:
    88vbetinet1 is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    shaeir7 is our newest member. Welcome!
  • Chat Bot:
    789fgg1 is our newest member. Welcome!
  • Chat Bot:
    go99tlcomm is our newest member. Welcome!
  • Chat Bot:
    s8hicom12 is our newest member. Welcome!
  • Chat Bot:
    linkrr88com is our newest member. Welcome!
  • Chat Bot:
    ev88city is our newest member. Welcome!
  • Chat Bot:
    32winsorg is our newest member. Welcome!
  • Chat Bot:
    kkwin1dev2 is our newest member. Welcome!
  • Chat Bot:
    jw88seocom1 is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    wamulongo is our newest member. Welcome!
  • Chat Bot:
    matrixmtm22 is our newest member. Welcome!
  • @ matrixmtm22:
    consolecrunch.com/threads/free-paradisesprx-mod-menu-hen
  • Chat Bot:
    sparenone is our newest member. Welcome!
  • Chat Bot:
    arazic is our newest member. Welcome!
      Chat Bot: arazic is our newest member. Welcome!