Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
jpm1

[IV | help request] need menu template plz

Recommended Posts

jpm1

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

Share this post


Link to post
Share on other sites
Jitnaught

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! :)

Share this post


Link to post
Share on other sites
jpm1

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 :)

Share this post


Link to post
Share on other sites
Jitnaught

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

Share this post


Link to post
Share on other sites
jpm1

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 :^:

Share this post


Link to post
Share on other sites
Jitnaught

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

Share this post


Link to post
Share on other sites
jpm1

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

Share this post


Link to post
Share on other sites
jpm1

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

Share this post


Link to post
Share on other sites
Jitnaught

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.

Share this post


Link to post
Share on other sites
jpm1

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:

Share this post


Link to post
Share on other sites
Jitnaught

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

Share this post


Link to post
Share on other sites
jpm1

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

Share this post


Link to post
Share on other sites
Jitnaught

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;}

Share this post


Link to post
Share on other sites
jpm1

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

Share this post


Link to post
Share on other sites
Jitnaught

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

Share this post


Link to post
Share on other sites
jpm1

 

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

Share this post


Link to post
Share on other sites
Jitnaught

I don't understand. Those don't work? I don't know what you want

Share this post


Link to post
Share on other sites
jpm1

no they don't work

Share this post


Link to post
Share on other sites
Jitnaught

How are you using them?

Share this post


Link to post
Share on other sites
jpm1

Exactly as in 1st post

Share this post


Link to post
Share on other sites
Jitnaught

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

Share this post


Link to post
Share on other sites
byteMe420
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
jpm1

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.