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

    1. GTANet.com

    1. GTA Online

      1. The Contract
      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

Script help for mod!


TheOriginalNic
 Share

Recommended Posts

TheOriginalNic

Hey Guys

 

I am working on a map mod called "living los santos".

 

Creating these scenarios is very cool but i would love to make them even more realistic and living with scripts added( for the peds, vehicles and so on). I know a little. About c#/c++ but reffering to gta i have absolutely no clue. Is there anyone out there who wants to help me making my mod better? Teaching me the script basics and help me using them in Living Los Santos?

 

You would make me really happy guys!

 

Looking forward to your responds!

 

Greetings from Switzerland:)

Link to comment
Share on other sites

  • 4 months later...
TheOriginalNic

 

are you still available?

what do you need help with exactly?I would like to learn the basics of scripting to make my map mod more alive( add callouts, new spawns and these things):)
Link to comment
Share on other sites

Map Editor has added support for javascript in the recent update. You can check it out. About scripting you can start with studying those open source mods on gta5mods, as well as watching tutorial videos, cause that's where i started. Hope this helped.

Edited by GeorgeZhang
Link to comment
Share on other sites

TheOriginalNic

Map Editor has added support for javascript in the recent update. You can check it out. About scripting you can start with studying those open source mods on gta5mods, as well as watching tutorial videos, cause that's where i started. Hope this helped.

Which kinda mods? The most have .dll files..:/ are there any good vids? I just found one for a simple trainer.. Should i keep on learning java or c#? Thanks for your help:)

Link to comment
Share on other sites

I'm using C# and I don't know javascript. If you decide to go with C#:

you'll need visual basic, 2015 (2013 is ok), also it's requirements, .Net Framework 4.5.2 & Visual C++ redis- pack for visual studio 2013 / 2015, google them to download

 

here's some helpful scripting vids:

 

Edited by GeorgeZhang
Link to comment
Share on other sites

TheOriginalNic

Thank you!:) and yeah i would love to look at the already existing mods but they are all .dll...:/

Link to comment
Share on other sites

Thank you! :) and yeah i would love to look at the already existing mods but they are all .dll... :/

If it's a .NET .dll then you can easily decompile it BUT it's 1. not good to "steal" codes from others and 2. not really helpful (when you're new to coding):

Example for jedijosh's Stance mod:

 

 

using GTA;using GTA.Native;using System.Windows.Forms;namespace Stance{  public class Main : Script  {    private bool IsCrouch;    private bool IsProne;    private bool IsProneCrawling;    private Keys CrouchKey;    private Keys ProneKey;    private ScriptSettings IniSettings;    public Main()    {      base..ctor();      this.IniSettings = ScriptSettings.Load("scripts\\Stance.ini");      this.CrouchKey = (Keys) this.IniSettings.GetValue<Keys>("Keys", "CrouchKey", (M0) 74);      this.ProneKey = (Keys) this.IniSettings.GetValue<Keys>("Keys", "ProneKey", (M0) 75);      Function.Call((Hash) 7972635428772450029, new InputArgument[1]      {        InputArgument.op_Implicit("move_ped_crouched")      });      Function.Call((Hash) 7972635428772450029, new InputArgument[1]      {        InputArgument.op_Implicit("move_ped_crouched_strafing")      });      Function.Call((Hash) -3189321952077349130, new InputArgument[1]      {        InputArgument.op_Implicit("move_crawl")      });      this.add_KeyDown(new KeyEventHandler(this.OnKeyDown));      this.add_KeyUp(new KeyEventHandler(this.OnKeyUp));    }    private void OnKeyDown(object sender, KeyEventArgs e)    {      if (e.KeyCode == this.CrouchKey && !this.IsCrouch)      {        Function.Call((Hash) -5797657820774978577, new InputArgument[3]        {          InputArgument.op_Implicit(Game.get_Player().get_Character()),          InputArgument.op_Implicit("move_ped_crouched"),          InputArgument.op_Implicit(1048576000)        });        Function.Call((Hash) 3000117804892870740, new InputArgument[2]        {          InputArgument.op_Implicit(Game.get_Player().get_Character()),          InputArgument.op_Implicit("move_ped_crouched_strafing")        });        Game.get_Player().get_Character().get_Task().ClearAll();        this.IsProne = false;        this.IsCrouch = true;      }      else if (e.KeyCode == this.CrouchKey && this.IsCrouch)      {        Function.Call((Hash) -6164042450715612628, new InputArgument[2]        {          InputArgument.op_Implicit(Game.get_Player().get_Character()),          InputArgument.op_Implicit(1048576000)        });        Function.Call((Hash) 2328651364711703671, new InputArgument[1]        {          InputArgument.op_Implicit(Game.get_Player().get_Character())        });        Game.get_Player().get_Character().get_Task().ClearAll();        this.IsCrouch = false;      }      if (e.KeyCode == this.ProneKey && !this.IsProne && Game.get_Player().get_Character().get_IsSprinting())      {        Game.get_Player().get_Character().get_Task().ClearAll();        Game.get_Player().get_Character().get_Task().PlayAnimation("move_jump", "dive_start_run", 8f, -1, false, 0.0f);        Script.Wait(1000);        Function.Call((Hash) 8798111594244947200, new InputArgument[4]        {          InputArgument.op_Implicit(Game.get_Player().get_Character()),          InputArgument.op_Implicit((int) Function.Call<int>((Hash) -3292914402564945716, new InputArgument[1]          {            InputArgument.op_Implicit("SCRIPTED_GUN_TASK_PLANE_WING")          })),          InputArgument.op_Implicit(1),          InputArgument.op_Implicit(1)        });        this.IsCrouch = false;        this.IsProne = true;      }      else if (e.KeyCode == this.ProneKey && !this.IsProne && !Game.get_Player().get_Character().get_IsSprinting())      {        Game.get_Player().get_Character().get_Task().ClearAll();        Function.Call((Hash) 8798111594244947200, new InputArgument[4]        {          InputArgument.op_Implicit(Game.get_Player().get_Character()),          InputArgument.op_Implicit((int) Function.Call<int>((Hash) -3292914402564945716, new InputArgument[1]          {            InputArgument.op_Implicit("SCRIPTED_GUN_TASK_PLANE_WING")          })),          InputArgument.op_Implicit(1),          InputArgument.op_Implicit(1)        });        this.IsCrouch = false;        this.IsProne = true;      }      else if (e.KeyCode == this.ProneKey && this.IsProne)      {        Game.get_Player().get_Character().get_Task().ClearAll();        Function.Call((Hash) -6164042450715612628, new InputArgument[2]        {          InputArgument.op_Implicit(Game.get_Player().get_Character()),          InputArgument.op_Implicit(1048576000)        });        Function.Call((Hash) 2328651364711703671, new InputArgument[1]        {          InputArgument.op_Implicit(Game.get_Player().get_Character())        });        Game.get_Player().get_Character().get_Task().PlayAnimation("[email protected]@[email protected][email protected]", "getup_l_0", 8f, 1250, false, 0.0f);        this.IsProneCrawling = false;        this.IsProne = false;      }      if (!this.IsProne)        return;      if (e.KeyCode == Keys.A)        ((Entity) Game.get_Player().get_Character()).set_Heading(((Entity) Game.get_Player().get_Character()).get_Heading() + 2.5f);      if (e.KeyCode == Keys.D)        ((Entity) Game.get_Player().get_Character()).set_Heading(((Entity) Game.get_Player().get_Character()).get_Heading() - 2.5f);      if (!this.IsProneCrawling)      {        if (e.KeyCode == Keys.W)        {          Function.Call((Hash) -1565002832890405996, new InputArgument[11]          {            InputArgument.op_Implicit(Game.get_Player().get_Character()),            InputArgument.op_Implicit("move_crawl"),            InputArgument.op_Implicit("onfront_fwd"),            InputArgument.op_Implicit(8f),            InputArgument.op_Implicit(-4f),            InputArgument.op_Implicit(-1),            InputArgument.op_Implicit(9),            InputArgument.op_Implicit(0.0f),            InputArgument.op_Implicit(false),            InputArgument.op_Implicit(false),            InputArgument.op_Implicit(false)          });          this.IsProneCrawling = true;        }        if (e.KeyCode == Keys.S)        {          Function.Call((Hash) -1565002832890405996, new InputArgument[11]          {            InputArgument.op_Implicit(Game.get_Player().get_Character()),            InputArgument.op_Implicit("move_crawl"),            InputArgument.op_Implicit("onfront_bwd"),            InputArgument.op_Implicit(8f),            InputArgument.op_Implicit(-4f),            InputArgument.op_Implicit(-1),            InputArgument.op_Implicit(9),            InputArgument.op_Implicit(0.0f),            InputArgument.op_Implicit(false),            InputArgument.op_Implicit(false),            InputArgument.op_Implicit(false)          });          this.IsProneCrawling = true;        }      }    }    private void OnKeyUp(object sender, KeyEventArgs e)    {      if (!this.IsProneCrawling || e.KeyCode != Keys.W && e.KeyCode != Keys.S)        return;      Game.get_Player().get_Character().get_Task().ClearAll();      Function.Call((Hash) 8798111594244947200, new InputArgument[4]      {        InputArgument.op_Implicit(Game.get_Player().get_Character()),        InputArgument.op_Implicit((int) Function.Call<int>((Hash) -3292914402564945716, new InputArgument[1]        {          InputArgument.op_Implicit("SCRIPTED_GUN_TASK_PLANE_WING")        })),        InputArgument.op_Implicit(1),        InputArgument.op_Implicit(1)      });      this.IsProneCrawling = false;    }  }}

 

 

(Or use IDA but that doesn't make much sense either):

 

 

l5wWv3z.png

 

 

Just watch tutorials, learn from open source mods and a good way is to learn basic C# or C++.

Link to comment
Share on other sites

TheOriginalNic

i do not want to steal something:P i just want to learn how to script at least easy things. I do have a Basic C# knowledge but i have no idea where to start off.

 

Oh this is gonna get a fight..:/

  • Like 1
Link to comment
Share on other sites

No, it's fine not you, I was talking to Unknown Modder. And I'm fine if people ask permission. I can also help you with coding if you need it just send me a message on my Steam or Skype, which my username is jedjiosh920 on both.

Edited by jedijosh920
  • Like 1
Link to comment
Share on other sites

TheOriginalNic

yeah but its my thread....

 

oh wow thank you+_+ i added you on steam_)

Edited by TheOriginalNic
Link to comment
Share on other sites

Really dude? You decompiled my mod. What the f*ck?

Yeah :D, just wanted to show an example and your Stance script is the only .NET script for GTA V I currently have on my PC.

I will remove it in case you want.

Link to comment
Share on other sites

 

Map Editor has added support for javascript in the recent update. You can check it out. About scripting you can start with studying those open source mods on gta5mods, as well as watching tutorial videos, cause that's where i started. Hope this helped.

Which kinda mods? The most have .dll files.. :/ are there any good vids? I just found one for a simple trainer.. Should i keep on learning java or c#? Thanks for your help:)

 

 

The new interactive map feature in Map Editor is very easy! You can play an animation on a ped just by adding an identifier to the ped in the map editor menu and then in the script write

 

thePedIidentified.Task.PlayAnimation("[email protected]", "animation_name", 8f, -1, true, -8f);

 

But you can do all kind of things! Stuff like

 

thePedIidentified.Task.HandsUp(-1);thePedIidentified.Task.GoTo(API.GTA.Game.Player.Character.Position();thePedIidentified.Task.Arrest(anotherPed);

 

etc.

  • Like 1
Link to comment
Share on other sites

TheOriginalNic

wow this is cool thank you:) how do i find this database to add the animations? and btw is there a list of possible animations? thx for your Support:D

Link to comment
Share on other sites

TheOriginalNic

 

 

Map Editor has added support for javascript in the recent update. You can check it out. About scripting you can start with studying those open source mods on gta5mods, as well as watching tutorial videos, cause that's where i started. Hope this helped.

Which kinda mods? The most have .dll files.. :/ are there any good vids? I just found one for a simple trainer.. Should i keep on learning java or c#? Thanks for your help:)

 

 

The new interactive map feature in Map Editor is very easy! You can play an animation on a ped just by adding an identifier to the ped in the map editor menu and then in the script write

thePedIidentified.Task.PlayAnimation("[email protected]", "animation_name", 8f, -1, true, -8f);

But you can do all kind of things! Stuff like

thePedIidentified.Task.HandsUp(-1);thePedIidentified.Task.GoTo(API.GTA.Game.Player.Character.Position();thePedIidentified.Task.Arrest(anotherPed);

etc.

 

API.GTA.Game.thePedIdentified("Officer").Task.PlayAnimation("[email protected]", "[email protected][email protected]@[email protected]_a", 8f, -1, true, -8f);

 

I tried this now (Officer=identifier) but it does not work.. what did i do wrong?:/ thanks for your help

Link to comment
Share on other sites

 

 

 

Map Editor has added support for javascript in the recent update. You can check it out. About scripting you can start with studying those open source mods on gta5mods, as well as watching tutorial videos, cause that's where i started. Hope this helped.

Which kinda mods? The most have .dll files.. :/ are there any good vids? I just found one for a simple trainer.. Should i keep on learning java or c#? Thanks for your help:)

 

 

The new interactive map feature in Map Editor is very easy! You can play an animation on a ped just by adding an identifier to the ped in the map editor menu and then in the script write

thePedIidentified.Task.PlayAnimation("[email protected]", "animation_name", 8f, -1, true, -8f);

But you can do all kind of things! Stuff like

thePedIidentified.Task.HandsUp(-1);thePedIidentified.Task.GoTo(API.GTA.Game.Player.Character.Position();thePedIidentified.Task.Arrest(anotherPed);

etc.

 

API.GTA.Game.thePedIdentified("Officer").Task.PlayAnimation("[email protected]", "[email protected][email protected]@[email protected]_a", 8f, -1, true, -8f);

 

I tried this now (Officer=identifier) but it does not work.. what did i do wrong? :/ thanks for your help

 

Dude, I don't want to be rude, but please learn scripting before doing this. First of all, thePedIidentified is an example variable to show you the what you can do with the Ped class. Second of all, thePedIidentified isn't a method(lol) so you can't just get Officer by just typing in Officer (lmao). You need to get some peds that have the Officer Model. And I don't think API is also used at the beginning. Plus, did you add the refernces to ScripHookVDotNet.dll? And the using namespaces? Send us the whole code. And if you know whats best for you, follow the series GeorgeZhang gave you.

Link to comment
Share on other sites

TheOriginalNic

 

 

 

 

Map Editor has added support for javascript in the recent update. You can check it out. About scripting you can start with studying those open source mods on gta5mods, as well as watching tutorial videos, cause that's where i started. Hope this helped.

Which kinda mods? The most have .dll files.. :/ are there any good vids? I just found one for a simple trainer.. Should i keep on learning java or c#? Thanks for your help:)

 

 

The new interactive map feature in Map Editor is very easy! You can play an animation on a ped just by adding an identifier to the ped in the map editor menu and then in the script write

thePedIidentified.Task.PlayAnimation("[email protected]", "animation_name", 8f, -1, true, -8f);

But you can do all kind of things! Stuff like

thePedIidentified.Task.HandsUp(-1);thePedIidentified.Task.GoTo(API.GTA.Game.Player.Character.Position();thePedIidentified.Task.Arrest(anotherPed);

etc.

 

API.GTA.Game.thePedIdentified("Officer").Task.PlayAnimation("[email protected]", "[email protected][email protected]@[email protected]_a", 8f, -1, true, -8f);

 

I tried this now (Officer=identifier) but it does not work.. what did i do wrong? :/ thanks for your help

 

Dude, I don't want to be rude, but please learn scripting before doing this. First of all, thePedIidentified is an example variable to show you the what you can do with the Ped class. Second of all, thePedIidentified isn't a method(lol) so you can't just get Officer by just typing in Officer (lmao). You need to get some peds that have the Officer Model. And I don't think API is also used at the beginning. Plus, did you add the refernces to ScripHookVDotNet.dll? And the using namespaces? Send us the whole code. And if you know whats best for you, follow the series GeorgeZhang gave you.

 

yeah i am following at the Moment:) it is just cause a guy from the map Editor told me to just tipe it in like this:) i am actually doing the tutorials now:)

Link to comment
Share on other sites

 

 

 

 

 

Map Editor has added support for javascript in the recent update. You can check it out. About scripting you can start with studying those open source mods on gta5mods, as well as watching tutorial videos, cause that's where i started. Hope this helped.

 

Which kinda mods? The most have .dll files.. :/ are there any good vids? I just found one for a simple trainer.. Should i keep on learning java or c#? Thanks for your help:)

 

The new interactive map feature in Map Editor is very easy! You can play an animation on a ped just by adding an identifier to the ped in the map editor menu and then in the script write

 

thePedIidentified.Task.PlayAnimation("[email protected]", "animation_name", 8f, -1, true, -8f);
But you can do all kind of things! Stuff like

 

thePedIidentified.Task.HandsUp(-1);thePedIidentified.Task.GoTo(API.GTA.Game.Player.Character.Position();thePedIidentified.Task.Arrest(anotherPed);
etc.

 

API.GTA.Game.thePedIdentified("Officer").Task.PlayAnimation("[email protected]", "[email protected][email protected]@[email protected]_a", 8f, -1, true, -8f);

 

I tried this now (Officer=identifier) but it does not work.. what did i do wrong? :/ thanks for your help

 

Dude, I don't want to be rude, but please learn scripting before doing this. First of all, thePedIidentified is an example variable to show you the what you can do with the Ped class. Second of all, thePedIidentified isn't a method(lol) so you can't just get Officer by just typing in Officer (lmao). You need to get some peds that have the Officer Model. And I don't think API is also used at the beginning. Plus, did you add the refernces to ScripHookVDotNet.dll? And the using namespaces? Send us the whole code. And if you know whats best for you, follow the series GeorgeZhang gave you.

 

yeah i am following at the Moment:) it is just cause a guy from the map Editor told me to just tipe it in like this:) i am actually doing the tutorials now:) he did it correctly to show you what you can do with the scripthook api. Now learn c# please.
Link to comment
Share on other sites

TheOriginalNic

 

 

 

 

 

 

Map Editor has added support for javascript in the recent update. You can check it out. About scripting you can start with studying those open source mods on gta5mods, as well as watching tutorial videos, cause that's where i started. Hope this helped.

Which kinda mods? The most have .dll files.. :/ are there any good vids? I just found one for a simple trainer.. Should i keep on learning java or c#? Thanks for your help:)

The new interactive map feature in Map Editor is very easy! You can play an animation on a ped just by adding an identifier to the ped in the map editor menu and then in the script write

 

thePedIidentified.Task.PlayAnimation("[email protected]", "animation_name", 8f, -1, true, -8f);
But you can do all kind of things! Stuff like

 

thePedIidentified.Task.HandsUp(-1);thePedIidentified.Task.GoTo(API.GTA.Game.Player.Character.Position();thePedIidentified.Task.Arrest(anotherPed);
etc.
API.GTA.Game.thePedIdentified("Officer").Task.PlayAnimation("[email protected]", "[email protected][email protected]@[email protected]_a", 8f, -1, true, -8f);

 

I tried this now (Officer=identifier) but it does not work.. what did i do wrong? :/ thanks for your help

Dude, I don't want to be rude, but please learn scripting before doing this. First of all, thePedIidentified is an example variable to show you the what you can do with the Ped class. Second of all, thePedIidentified isn't a method(lol) so you can't just get Officer by just typing in Officer (lmao). You need to get some peds that have the Officer Model. And I don't think API is also used at the beginning. Plus, did you add the refernces to ScripHookVDotNet.dll? And the using namespaces? Send us the whole code. And if you know whats best for you, follow the series GeorgeZhang gave you.yeah i am following at the Moment:) it is just cause a guy from the map Editor told me to just tipe it in like this:) i am actually doing the tutorials now:)he did it correctly to show you what you can do with the scripthook api. Now learn c# please.

 

i am working on it:) thank you

Link to comment
Share on other sites

 

 

 

Map Editor has added support for javascript in the recent update. You can check it out. About scripting you can start with studying those open source mods on gta5mods, as well as watching tutorial videos, cause that's where i started. Hope this helped.

Which kinda mods? The most have .dll files.. :/ are there any good vids? I just found one for a simple trainer.. Should i keep on learning java or c#? Thanks for your help:)

 

 

The new interactive map feature in Map Editor is very easy! You can play an animation on a ped just by adding an identifier to the ped in the map editor menu and then in the script write

thePedIidentified.Task.PlayAnimation("[email protected]", "animation_name", 8f, -1, true, -8f);

But you can do all kind of things! Stuff like

thePedIidentified.Task.HandsUp(-1);thePedIidentified.Task.GoTo(API.GTA.Game.Player.Character.Position();thePedIidentified.Task.Arrest(anotherPed);

etc.

 

API.GTA.Game.thePedIdentified("Officer").Task.PlayAnimation("[email protected]", "[email protected]_hum[email protected]@[email protected]_a", 8f, -1, true, -8f);

 

I tried this now (Officer=identifier) but it does not work.. what did i do wrong? :/ thanks for your help

 

 

You're overthinking it. Just use Officer as your identifier: Officer.Task.PlayAnimation("a... etc);

Please note that this is for the Map Editor mapscript feature, and has nothing to do with C# or .NET (It's javascript).

Edited by Guad
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.