Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

[IV | help request] need menu template plz


jpm1
 Share

Recommended Posts

i'm trying to do a menu . i found a script that could be easy to tweak to get what i'm looking for . but the problem it's that the menu opens when called by a vector . i would just like a menu that opens using a key . i would need a template plz . here's the script

// E:\Jeux\GTA\GTAIV\scripts\CarUpgrade.net// GTAIV.Net_Script1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null// Architecture: x86// Runtime: .NET 4.0using GTA;using GTA.Native;using System;using System.Diagnostics;using System.Drawing;using System.Reflection;using System.Runtime.CompilerServices;using System.Runtime.InteropServices;using System.Runtime.Versioning;using System.Windows.Forms;[assembly: AssemblyVersion("1.0.0.0")][assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)][assembly: AssemblyCompany("")][assembly: AssemblyConfiguration("")][assembly: AssemblyCopyright("Copyright ©  2013")][assembly: AssemblyDescription("")][assembly: AssemblyFileVersion("1.0.0.0")][assembly: AssemblyProduct("GTAIV.Net_Script1")][assembly: AssemblyTitle("GTAIV.Net_Script1")][assembly: AssemblyTrademark("")][assembly: CompilationRelaxations(8)][assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)][assembly: ComVisible(false)][assembly: Guid("6ecba6a1-7ce2-4f1d-8196-79de603a4b63")][assembly: TargetFramework(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]namespace Reparation{public class CarUpgrade : Script{  private Keys toggleMenuKey;  private Keys selectionKey;  private Keys menuUpKey;  private Keys menuDownKey;  private bool isMenuOn;  private bool menuReady;  private int menuSelection;  private float x;  private float y;  private float spacing;  private Vector3[] positions;  private bool IsAtPayNSpray()  {   Vector3[] array = this.positions;   for (int i = 0; i < array.Length; i++)   {    Vector3 position = array[i];    if (base.Player.Character.Position.DistanceTo(position) < 5f)    {     return true;    }   }   return false;  }  public CarUpgrade()  {   this.positions = new Vector3[]   {    new Vector3(793.78f, 212.8f, 6.06f),    new Vector3(703.17f, 1503.79f, 14.84f),    new Vector3(-473.33f, 1747f, 8.73f),    new Vector3(166.82f, 164.44f, 14.77f),    new Vector3(-1099.93f, 672.52f, 8.53f)   };   Vector3[] array = this.positions;   for (int i = 0; i < array.Length; i++)   {    Vector3 target = array[i];    Blip blip = Blip.AddBlip(target);    blip.Name = "YOU WILL NEVER SEE THIS";    blip.ShowOnlyWhenNear = true;    blip.Icon = BlipIcon.Building_Garage;    blip.Scale = 0.5f;    blip.Display = BlipDisplay.ArrowAndMap;   }   this.x = (float)Game.Resolution.Width * 0.1f;   this.y = (float)Game.Resolution.Height * 0.1f;   this.spacing = (float)Game.Resolution.Height / 50f;   this.toggleMenuKey = base.Settings.GetValueKey("TOGGLE_MENU_KEY", Keys.G);   this.selectionKey = base.Settings.GetValueKey("SELECTION_KEY", Keys.Return);   this.menuUpKey = base.Settings.GetValueKey("MENU_UP_KEY", Keys.Prior);   this.menuDownKey = base.Settings.GetValueKey("MENU_DOWN_KEY", Keys.Next);   base.BindKey(this.toggleMenuKey, false, false, false, new KeyPressDelegate(this.ToggleMenu));   base.Tick += new EventHandler(this.HelpTick);  }  private void ToggleMenu()  {   if (!this.menuReady)   {    return;   }   this.isMenuOn = !this.isMenuOn;   if (this.isMenuOn)   {    base.Tick -= new EventHandler(this.HelpTick);    base.PerFrameDrawing += new GraphicsEventHandler(this.Menu_PerFrameDrawing);    base.KeyDown += new GTA.KeyEventHandler(this.Menu_KeyDown);    base.Player.CanControlCharacter = false;    return;   }   base.Tick += new EventHandler(this.HelpTick);   base.PerFrameDrawing -= new GraphicsEventHandler(this.Menu_PerFrameDrawing);   base.KeyDown -= new GTA.KeyEventHandler(this.Menu_KeyDown);   base.Player.CanControlCharacter = true;  }  private void Menu_KeyDown(object sender, GTA.KeyEventArgs e)  {   if (e.Key == this.menuUpKey)   {    this.menuSelection--;    this.menuSelection = ((this.menuSelection < 0) ? 2 : this.menuSelection);   }   if (e.Key == this.menuDownKey)   {    this.menuSelection++;    this.menuSelection = ((this.menuSelection > 2) ? 0 : this.menuSelection);   }   if (e.Key == this.selectionKey)   {    switch (this.menuSelection)    {    case 0:     this.Fix();     return;    //case 1:     //this.BPTires();     return;    //case 2:     //this.CollisionProof();     break;    default:     return;    }   }  }  private void Menu_PerFrameDrawing(object sender, GraphicsEventArgs e)  {   e.Graphics.DrawText("Réparer (1$)", this.x, this.y, (this.menuSelection == 0) ? Color.Blue : Color.White);   //e.Graphics.DrawText("Bulletproof Tires (5000$)", this.x, this.y + this.spacing, (this.menuSelection == 1) ? Color.Red : Color.White);   //e.Graphics.DrawText("Make Collision Proof (10000$)", this.x, this.y + this.spacing * 2f, (this.menuSelection == 2) ? Color.Red : Color.White);  }  private void Fix()  {   if (!Game.Exists(base.Player.Character.CurrentVehicle))   {    Game.DisplayText("You need a vehicle first!");    return;   }   if (base.Player.Money >= 1)   {    Game.FadeScreenOut(2000, true);    Function.Call("SET_TIME_OF_DAY", new Parameter[]    {     World.CurrentDayTime.Hours + 4,     World.CurrentDayTime.Minutes    });    base.Player.Character.CurrentVehicle.Repair();    Game.FadeScreenIn(2000, true);    base.Player.Money -= 1;    Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", new Parameter[]    {     "STRING",     "Ton véhicule est réparé!",     2000,     1    });    return;   }   Game.DisplayText("Pas assez d'argent.");  }  private void BPTires()  {   if (!Game.Exists(base.Player.Character.CurrentVehicle))   {    Game.DisplayText("You need a vehicle first!");    return;   }   if (base.Player.Money >= 5000)   {    Game.FadeScreenOut(2000, true);    Function.Call("SET_TIME_OF_DAY", new Parameter[]    {     World.CurrentDayTime.Hours + 4,     World.CurrentDayTime.Minutes    });    base.Player.Character.CurrentVehicle.CanTiresBurst = false;    Game.FadeScreenIn(2000, true);    base.Player.Money -= 5000;    Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", new Parameter[]    {     "STRING",     "Your tires are now bulletproof!",     2000,     1    });    return;   }   Game.DisplayText("Not enough money.");  }  private void CollisionProof()  {   if (!Game.Exists(base.Player.Character.CurrentVehicle))   {    Game.DisplayText("You need a vehicle first!");    return;   }   if (base.Player.Money >= 10000)   {    Game.FadeScreenOut(2000, true);    Function.Call("SET_TIME_OF_DAY", new Parameter[]    {     World.CurrentDayTime.Hours + 4,     World.CurrentDayTime.Minutes    });    base.Player.Character.CurrentVehicle.CanBeVisiblyDamaged = false;    Game.FadeScreenIn(2000, true);    base.Player.Money -= 10000;    Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", new Parameter[]    {     "STRING",     "Your vehicle is now collision proof!",     2000,     1    });    return;   }   Game.DisplayText("Not enough money.");  }  private void HelpTick(object sender, EventArgs e)  {   this.menuReady = this.IsAtPayNSpray();   if (this.menuReady)   {    Game.DisplayText("Appuie sur G pour le menu", 500);   }  }}}

(original script made by TempleOfLight)

 

how do i turn this into a "press a key to open" menu . i've been searching for an example during one day but couldn't find any , and i'm getting bored right now

Edited by jpm1
Link to comment
Share on other sites

There has to be more code than that.

 

I actually am developing a .NET Scripthook menu base atm (started working on it today, same day as you requested help for a menu. Illuminati confirmed.) So, when I'm finished with the base and I release it (if I do), then you could use that! :)

Link to comment
Share on other sites

thanks ! edited above post with complete code as written by TempleOfLight when he released the script (with slight modifications i made for my own use) . i'll get a look at your script when it'll come out of course . but the script i'm trying to tweak fits perfectly with what i'm trying to do :)

Link to comment
Share on other sites

First, change the key on line 86

this.toggleMenuKey = base.Settings.GetValueKey("TOGGLE_MENU_KEY", Keys.G);

to change the key that opens/closes the menu.

Then, remove lines 49-61, 95-97, 102, and 108 (code that isn't required anymore).

Edited by LetsPlayOrDy
Link to comment
Share on other sites

scripting is fun but the learning curve is time consuming . i'll post my help requests here , and maybe someone that has the answer will save me dozens of hours of internet searching . i'd like to know the following :

 

- how do you delay a menu . i have a menu and i want it to spawn after 4 seconds only (believe it or not but searched all night and still stuck)

- how do you do a fade out/in with a background music . i'd like to do a fade out that catches electro choc string

- how do you make a menu disappear once the selection has been done

- how do you create a schedule condition . i'd like a menu to be available during some hours only , and when unavailable to have a text string instead

 

i keep searching , i just post in case someone knows the answers . and btw thanks LPoD :^:

Link to comment
Share on other sites

1. After 4 seconds of what?

 

2. Fade background music? You want to fade the radio?

 

3. In this code

if (e.Key == this.selectionKey)   {    switch (this.menuSelection)    {    case 0:     this.Fix();     return;    //case 1:     //this.BPTires();     return;    //case 2:     //this.CollisionProof();     break;    default:     return;    }   }

add ToggleMenu() to it, like this

if (e.Key == this.selectionKey)   {    switch (this.menuSelection)    {    case 0:     this.Fix();     return;    //case 1:     //this.BPTires();     return;    //case 2:     //this.CollisionProof();     break;    default:     return;    }ToggleMenu();   }

4. At the end of public CarUpgrade() add

Tick += new EventHandler(CarUpgrade_Tick);

then add

private void CarUpgrade_Tick(object sender, EventArgs e)  {   if (Game.GameTime < 0 || Game.GameTime > 500 && isMenuOn) ToggleMenu();  }

and also add

if (Game.GameTime < 0 || Game.GameTime > 500 && !isMenuOn) return;

to the start of the ToggleMenu() function

Edited by LetsPlayOrDy
Link to comment
Share on other sites

i want a delayed menu . when you create a menu it appears , i want it to appear at T + 4s . i want to hear electro choc during my 2 seconds fade out . i know how to do a fade out , i would like to know how to capture electro choc stream during 2 seconds . i'll try your advices soon . i'm making a small pause right now , cause i've been on this for 2 days now

Link to comment
Share on other sites

SOMEBODY CAN GIVE ME COORDINATES OF nIKO INSIDE rOMAN'S MODERN APARTMENT NEAR gROTI'S . any place inside apartment will do . thanks

Link to comment
Share on other sites

SOMEBODY CAN GIVE ME COORDINATES OF nIKO INSIDE rOMAN'S MODERN APARTMENT NEAR gROTI'S . any place inside apartment will do . thanks

Just code a script that tells you. If you don't know how to do that, pm me and I'll make a little script for you.
Link to comment
Share on other sites

thanks but i think you didn't understand me . i'm not asking for a show coordinates script , i'm just asking for some coordinates inside apartment near grotti's , i don't do the missions thus i don't have access to that apartment :) . btw do you know how to make a teleport script that works by entering an area . for example i enter (1000f, 1000f, 10f) area and i get automatically teleported to (1100f, 1100f, 10f) . i'm having hard time learning how vector3 thing works right now :lol:

Link to comment
Share on other sites

Make a timer, check if the player's distance to the position is around 5ft or something, if true, teleport.

Link to comment
Share on other sites

i know that lol . what i'm looking for it's an example

Vector3 PositionToTeleFrom = new Vector3(1000f, 1000f, 10f), PositionToTeleTo = new Vector3(1100f, 1100f, 10f);public ExampleScript(){	Interval = 100;	Tick += MyTick;}private void MyTick(object sender, EventArgs e){	if (Player.Character.Position.DistanceTo(PositionToTeleFrom) < 5f) Player.Character.Position = PositionToTeleTo;}
Link to comment
Share on other sites

Thank you so much . it helped me a lot :) . One last thing do you know the name of the following icons (blips) , i searched during one hour , but couldn't find their names

 

Capture_zps814c84dd.jpg

Link to comment
Share on other sites

Thank you so much . it helped me a lot :) . One last thing do you know the name of the following icons (blips) , i searched during one hour , but couldn't find their names

 

Capture_zps814c84dd.jpg

The name of them in .NET Scripthook?

BlipIcon.Activity_Bar

BlipIcon.Person_Brucie (or maybe BlipIcon.Person_Bernie, not too sure)

BlipIcon.Building_CarWash

BlipIcon.Building_ClothShop

Link to comment
Share on other sites

 

The name of them in .NET Scripthook?

BlipIcon.Activity_Bar

BlipIcon.Building_ClothShop

 

 

i'm looking for these 2 . no , i tried it doesn't work

Link to comment
Share on other sites

If you're talking about

Vector3 target = array[i];Blip blip = Blip.AddBlip(target);blip.Name = "YOU WILL NEVER SEE THIS";blip.ShowOnlyWhenNear = true;blip.Icon = BlipIcon.Building_Garage;blip.Scale = 0.5f;blip.Display = BlipDisplay.ArrowAndMap;

then it should work, and I don't know why it wouldn't. Make sure you are near the position, since you won't see it unless you are (because blip.ShowOnlyWhenNear is set to true).

Edited by LetsPlayOrDy
Link to comment
Share on other sites

i made a class library for easy to code gta v menus... pm me if you want to use it


just noticed i wrote the code in your opening post but it was to show someone how to make a trainer and it looks like he edited it some

Edited by byteMe420
Link to comment
Share on other sites

TempleOfLight

 

i made a class library for easy to code gta v menus... pm me if you want to use it
just noticed i wrote the code in your opening post but it was to show someone how to make a trainer and it looks like he edited it some

 

 

Exactly, haha. Our man Byte here is the one who got me started in C# back in the day when I was a dude who'd never written a single line of code in his life. If I'm not mistaken, that must have been the very first thing I worked on. Those were the days. Still gotta give props to the man for handling my noobish questions all night long without wanting to bash his head into a wall, though. That menu template was entirely his, straight from his mind onto that script. Only thing I remember writing myself are the methods right below that. I still suck at menus today. Not a chance in hell I even tried to tackle that back then, haha.

  • Like 2
Link to comment
Share on other sites

we all do that , taking our inspiration from others work . maybe some may call this stealing , i'd say there are no better way to learn coding . i was taking with LPoD about a NET weather changer . and believe it or not it took several years before such script was released (and i had to ask for it) . i was bored of waiting , i decided to take some action ^^ . the menu above is great so i decided to use it as a base for some of my scripts . now i know where it comes from :)

Edited by jpm1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.