BoXz_modder 0 Posted May 13, 2015 Hello forum! I want to begin making mods for GTA V PC. I already know a bit C#, so i chose to go with that language. I have downloaded script hook v .net from a post on this forum. When i open the "ScriptHookVDotNet.sln" it opens a solution with two projects in it. The first one is the "ScriptHookVDotNet", and the second is the examples. In the examples all the script hook v stuff has a red underline, because the namespace GTA is missing ("Using GTA;"). I don't really understand how i can get visual studio up and running with script hook v .net. I'm relatively new to Visual Studio so don't judge . Thanks! Quote Share this post Link to post Share on other sites
c39687 61 Posted May 13, 2015 (edited) If you are planning to develop with the .net hook, Open a new c# class library project. In the solution explorer, right click the references folder and then select add reference. You can also remove unwanted references, you only really need System, System.Windows.Forms (for Keys enum) and the ScripthookVdotnet. So anyways browse to the scripthookVdotnet.dll and select it. Then follow the example scripts in the scripthookvdotnet download. Your class needs to inherit GTA.Script and off you go. Edited May 13, 2015 by c39687 Quote Share this post Link to post Share on other sites
BoXz_modder 0 Posted May 13, 2015 If you are planning to develop with the .net hook, Open a new c# class library project. In the solution explorer, right click the references folder and then select add reference. You can also remove unwanted references, you only really need System, System.Windows.Forms (for Keys enum) and the ScripthookVdotnet. So anyways browse to the scripthookVdotnet.dll and select it. Then follow the example scripts in the scripthookvdotnet download. Your class needs to inherit GTA.Script and off you go. Thanks! It worked perfectly! One little more question! How many ticks does gta use per second? Quote Share this post Link to post Share on other sites
c39687 61 Posted May 13, 2015 (edited) If you are planning to develop with the .net hook, Open a new c# class library project. In the solution explorer, right click the references folder and then select add reference. You can also remove unwanted references, you only really need System, System.Windows.Forms (for Keys enum) and the ScripthookVdotnet. So anyways browse to the scripthookVdotnet.dll and select it. Then follow the example scripts in the scripthookvdotnet download. Your class needs to inherit GTA.Script and off you go. Thanks! It worked perfectly! One little more question! How many ticks does gta use per second? not sure but you can always do this... DateTime endTime = DateTime.Now.AddSeconds(1);int ticks = 0;while (DateTime.Now < endTime){ ticks++; base.Wait(0);//this is how it was in gta iv .net hook, should be same, your class should inherit GTA.Script and Wait is a member of this base class} GTA.Game.DisplayText(string.Format("Ticks: {0}", ticks));//this again is a method from gta iv .net hook and should be similiar in the new hook I wouldn't get in the habit of messing with the script interval because it can easily cause conflict. Just be sure you want your every hooked tick event to be delayed. Alternative is to use GTA.Timers (if implemented) or if possible, like in the GTAIV .net hook, you could read GTA.Game.GameTime and make decisions based on elapsed time. That is more versatile than setting the Script.Interval. Edited May 13, 2015 by c39687 Quote Share this post Link to post Share on other sites