NTAuthority Posted March 9, 2009 Share Posted March 9, 2009 (edited) What is this mod? This modification is, like other script hooks, adds a external scripting possibility to SA. I know CLEO already exists, but SA's SCM language has some major limitations -- so I wrote this .NET scripting hook. It is inspired by HazardX's IV scripting hook, and based on the existing C++ SA script hook. This version is a pretty tiny initial testing version, with just a few APIs (and a CallOpcode function ) How to use this mod? Just copy the scripts directory and the .asi file to your SA directory. The .NET Framework 3.5, and the Visual C++ 2008 Runtime are required. For development I recommend using Visual Studio/Visual C# Express's IntelliSense feature, example scripts for C# are in the scripts/development/ directory. The hook will read both compiled .dll files, and .cs/.vb files, though Visual Basic is untested. To open or close the console, just press `. TestScript2.cs has a keybinding of 'U': spawn a Ballas member and add some health to the player. RandomStuff.cs has more key bindings: - 'I': display a text box - 'O': Spawn a Vagos member. - 'kill' in console: Kill the player. - 'spawn groves' in console: spawn 3 GSF members around the player Where to download? Version 0.0.3 You will need at least the DirectX November 2008 runtimes to use the script hook! I look forward to your comments. Edited April 16, 2009 by NTAuthority genghisfuckingkhan, Hacker Message and dkluin 3 Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
Wesser Posted March 9, 2009 Share Posted March 9, 2009 Really interesting, but it seems that there aren't any references, or am I wrong? 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
NTAuthority Posted March 9, 2009 Author Share Posted March 9, 2009 Really interesting, but it seems that there aren't any references, or am I wrong? You can simply add the .asi file as reference in Visual Studio if you copy it to a .dll -- didn't know VS would give errors if it's not a .dll file, will fix it in the next version. Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
GaryRoachSanderson Posted March 9, 2009 Share Posted March 9, 2009 cool! but this means i have to learn C++ to code for this hook? I only know Java, VB.Net and Cleo Link to comment Share on other sites More sharing options...
NTAuthority Posted March 9, 2009 Author Share Posted March 9, 2009 (edited) cool! but this means i have to learn C++ to code for this hook? I only know Java, VB.Net and Cleo Nope, you can't even use C++ 'officially' The examples are just C#, but I have also written in support for VB.NET scripts, though you will need to discover the syntax yourself. By the way, C# is almost Java syntax with VB.NET's class libraries. Next up for this hook: car APIs, and some more character stuff. EDIT: ported RandomStuff.cs to VB.NET: Imports SystemImports System.Collections.GenericImports System.TextNamespace TestScript1 Public Class TestScript Inherits GTA.Script Public Sub TestScript() BindKey(System.Windows.Forms.Keys.O, New GTA.KeyPressDelegate(AddressOf SpawnVago)) BindKey(System.Windows.Forms.Keys.I, New GTA.KeyPressDelegate(AddressOf ShowText)) BindConsoleCommand("kill", New GTA.ConsoleCommandDelegate(AddressOf Kill), Me) BindConsoleCommand("spawn groves", New GTA.ConsoleCommandDelegate(AddressOf NewGroves), Me) End Sub Public Sub Kill(ByVal args As String()) PlayerObject.Character.Health = 0 GTA.Console.WriteLine("Killed the player!") End Sub Public Sub NewGroves(ByVal args As String()) Dim ped As GTA.Char = GTA.World.CreateChar(GTA.PedID.FAM1, PlayerObject.Character.Position.Around(2), 4) ped = GTA.World.CreateChar(GTA.PedID.FAM2, PlayerObject.Character.Position.Around(2), 4) ped = GTA.World.CreateChar(GTA.PedID.FAM3, PlayerObject.Character.Position.Around(2), 4) End Sub Public Sub SpawnVago() Dim vector As GTA.Vector3 = PlayerObject.Character.Position vector.pY += 1 Dim ped As GTA.Char = GTA.World.CreateChar(GTA.PedID.LSV2, vector, 4) End Sub Public Sub ShowText() GTA.Game.DisplayTextBox("You pressed I") End Sub End ClassEnd Namespace Edited March 9, 2009 by NTAuthority Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
Zach Posted March 10, 2009 Share Posted March 10, 2009 Nice. Any chance you'll release the source code (for your hook) as well? Link to comment Share on other sites More sharing options...
GaryRoachSanderson Posted March 10, 2009 Share Posted March 10, 2009 lol cool. Ive been learning VB.NET in college lately! Really should look into learning this tool. Link to comment Share on other sites More sharing options...
rlim201 Posted May 17, 2009 Share Posted May 17, 2009 download link is dead! Link to comment Share on other sites More sharing options...
joemomma53 Posted June 2, 2009 Share Posted June 2, 2009 Sorry for bump, But I downloaded this and started testing it. It's really nice. The only thing I found wrong with it is that I can't get it to read .dll's, but thats not really a big deal, as it reads the C# source file By the way, is there a documentation on it, like for what it supports, like vehicle API's for example? I was also wondering if it had a weapons API in it Link to comment Share on other sites More sharing options...
NTAuthority Posted June 9, 2009 Author Share Posted June 9, 2009 Sorry for bump, But I downloaded this and started testing it. It's really nice. The only thing I found wrong with it is that I can't get it to read .dll's, but thats not really a big deal, as it reads the C# source file By the way, is there a documentation on it, like for what it supports, like vehicle API's for example? I was also wondering if it had a weapons API in it (sorry for bumping, have been away from april 30th to today) It should be able to use .dll files, if not, could you please post the log file entries? Also, the GTA.Next version of the hook supports weapon changing (but Native.CallOpcode is a good help) -- I'll update the links later this week. Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
joemomma53 Posted June 11, 2009 Share Posted June 11, 2009 Sorry for bump, But I downloaded this and started testing it. It's really nice. The only thing I found wrong with it is that I can't get it to read .dll's, but thats not really a big deal, as it reads the C# source file By the way, is there a documentation on it, like for what it supports, like vehicle API's for example? I was also wondering if it had a weapons API in it (sorry for bumping, have been away from april 30th to today) It should be able to use .dll files, if not, could you please post the log file entries? Also, the GTA.Next version of the hook supports weapon changing (but Native.CallOpcode is a good help) -- I'll update the links later this week. Well, My second hard drive got formatted the other day and I still need to re install San Andreas. When I re install it, I will get the logs and upload them for you . Thank you for your answer, when I get every thing set back up I will be experimenting with this more. Link to comment Share on other sites More sharing options...
Donny78 Posted August 20, 2009 Share Posted August 20, 2009 Is this still being developed ? Just thought I'd ask as I'm interested in this for sure. Link to comment Share on other sites More sharing options...
joemomma53 Posted August 22, 2009 Share Posted August 22, 2009 I don't think it is Link to comment Share on other sites More sharing options...
sgt.slaughter Posted August 23, 2009 Share Posted August 23, 2009 I tried the link,it seems to get some sort of error .I'll post the link to the GTAGaming download page just in-case someone else is getting the same thing : http://www.gtagaming.com/downloads/gta-san...reas/tools/2354 Link to comment Share on other sites More sharing options...
NTAuthority Posted August 24, 2009 Author Share Posted August 24, 2009 I don't think it is It is, though I haven't gotten around to releasing the new version (with HUGE updates) Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
Donny78 Posted August 24, 2009 Share Posted August 24, 2009 I don't think it is It is, though I haven't gotten around to releasing the new version (with HUGE updates) Good news, thankyou. Link to comment Share on other sites More sharing options...
joemomma53 Posted September 3, 2009 Share Posted September 3, 2009 Yay! I look forward to the updates Link to comment Share on other sites More sharing options...
NTAuthority Posted September 5, 2009 Author Share Posted September 5, 2009 A tiny hint of one of the more special features in the next version... texture drawing. And by that, I mean with the old DX hooking code, but with a feature the IV hook doesn't have. If you know some C#, check out the code below: this.tex = new Texture(256, 32);// ...Graphics rbg = this.tex.LockBitmap();rbg.DrawString("Woef", this.font, new SolidBrush(Color.Black), 125, 0);this.tex.UnlockBitmap();// and... in another 'event'Direct3D.DrawSprite(tex, new RectangleF(vPos.X, vPos.Y, GetX(105), GetY(28)), Color.White, 256f, 32f); Indeed, the most annoying thing in the world (LockRectangle) now in a easy-to-use package for drawing your own dynamic textures. Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
joemomma53 Posted September 5, 2009 Share Posted September 5, 2009 (edited) Very nice EDIT : Oh yeah, forgot to say. Well, in C# I added SanAndreasScriptHook as a reference, and even when I have using SanAndreasScriptHook; I get the error : The type or namespace name 'SanAndreasScriptHook' could not be found (are you missing a using directive or an assembly reference?) I never got it before cause I never added the reference. Any way to fix this? Edited September 6, 2009 by joemomma53 Link to comment Share on other sites More sharing options...
NTAuthority Posted September 13, 2009 Author Share Posted September 13, 2009 EDIT : Oh yeah, forgot to say. Well, in C# I added SanAndreasScriptHook as a reference, and even when I have using SanAndreasScriptHook; I get the error : The type or namespace name 'SanAndreasScriptHook' could not be found (are you missing a using directive or an assembly reference?) I never got it before cause I never added the reference. Any way to fix this? Sorry for the late response... but as you may have already figured out, the assembly name is indeed SanAndreasScriptHook, but the namespace everything's in is named GTA. By the way, the next release will have another very cool feature that allows you to 'hack' into the control state stuff... I have already made a cool gamepad control mod for the next version! I just want to release it now since it's so cool, but I can't Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
joemomma53 Posted September 14, 2009 Share Posted September 14, 2009 Thanks for the help man, I can't believe I didn't think of that, with everything being GTA, haha Yeah man i'm looking forward to the new version, That sounds awesome!. Keep up the good work Link to comment Share on other sites More sharing options...
johnathon956 Posted October 16, 2009 Share Posted October 16, 2009 does this work with cleo 3 Link to comment Share on other sites More sharing options...
joemomma53 Posted October 17, 2009 Share Posted October 17, 2009 does this work with cleo 3 Err, i'm not quite sure what you mean by that, but I don't see why cleo wouldn't work if you used this also. Link to comment Share on other sites More sharing options...
Donny78 Posted October 28, 2009 Share Posted October 28, 2009 I just tested this on Windows 7 (64) and it doesn't seem to goto plan. It crashed once at the loading screen before you spawn, it just froze at the end when the white bar was full. This was when I forgot to put my scripts asi into the scripts folder, I dropped it in the root along with your scripthook asi but when I put it in the script folder it didn't crash but didn't appear to load as the console wouldn't activate and I couldn't test the button binds as it gives me an error on compile so I removed the lines that binds 'i' & 'o' ("Windows is not a member of System"). I'm using VB Express (free, just downloaded it now), I added the reference dll to my project and compiled after removing the bind lines so it's the RandomStuff.vb file without the binds on Windows 7 x64 and the 'gta_sa.exe' is set to run compatible for XP SP3 (can I do this for a dll, it's not a program so I haven't checked). Does this have a log file it outputs ? I couldn't find one to explore the issue myself, I'll keep it testing and see if I can get it working but I thought I'd report this incase you already have a fix. Cheers. Link to comment Share on other sites More sharing options...
NTAuthority Posted October 29, 2009 Author Share Posted October 29, 2009 (edited) I just tested this on Windows 7 (64) and it doesn't seem to goto plan. It crashed once at the loading screen before you spawn, it just froze at the end when the white bar was full. This was when I forgot to put my scripts asi into the scripts folder, I dropped it in the root along with your scripthook asi but when I put it in the script folder it didn't crash but didn't appear to load as the console wouldn't activate and I couldn't test the button binds as it gives me an error on compile so I removed the lines that binds 'i' & 'o' ("Windows is not a member of System"). I'm using VB Express (free, just downloaded it now), I added the reference dll to my project and compiled after removing the bind lines so it's the RandomStuff.vb file without the binds on Windows 7 x64 and the 'gta_sa.exe' is set to run compatible for XP SP3 (can I do this for a dll, it's not a program so I haven't checked). Does this have a log file it outputs ? I couldn't find one to explore the issue myself, I'll keep it testing and see if I can get it working but I thought I'd report this incase you already have a fix. Cheers. This current version is really buggy and out-of-date, a more recent version can be found here (copy the .asi to a .dll for a reference, you need a scripts folder and datafiles folder... all old code should still work after recompiling. and please, remove the old .asi), but it does not contain the console. Also, for key bindings, you need to add a reference to System.Windows.Forms to your project. (though I usually prefer the new GTAKey in a OnTick event... it's what you prefer) (that version in the mod has some of the bugs still in, but a lot more features and such ) Also, did you really have the code 'extend'-ing ('Inherits' in VB, possibly?) Script? Your file structure should, by the way, be for example: GTASA\ -- citizenhook.asi -- scripts\ ---- DBNetwork.Citizen.Game.dll (your DLL file) ------ datafiles\ (nothing specific needed in there) Another thing is that the mod still is incompatible with the CLEO GXTHook, but it's possible to emulate it using the new Game.CustomGXTs property. Also, it hasn't been used much with VB, but since both are full .NET languages, it should still work. (offtopic: decided you didn't like C++? ) PS: Do you intend on releasing a mod made with this? If so, it's just about time. Edited October 29, 2009 by NTAuthority Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
Donny78 Posted October 31, 2009 Share Posted October 31, 2009 I'm going to reinstall XP on another drive soon so I'll have another go with this then dude, nothing seems to work no matter what I do, everything is setup correctly like you explained so I'm either being retarded or it's this bloody OS messing with me (probably the case). No I like C++ just fine, it's C++ that doesn't like me I plan on doing a few mods if I ever get anything working, I have many ideas that I would like to put into action, once I go back to XP then I'll start on them for sure. Cheers for the help, I apreciate it. Link to comment Share on other sites More sharing options...
denisy Posted February 1, 2010 Share Posted February 1, 2010 I tried the link,it seems to get some sort of error .I'll post the link to the GTAGaming download page just in-case someone else is getting the same thing : http://www.gtagaming.com/downloads/gta-san...reas/tools/2354 Thanks for the link man! Link to comment Share on other sites More sharing options...
NTAuthority Posted February 1, 2010 Author Share Posted February 1, 2010 I tried the link,it seems to get some sort of error .I'll post the link to the GTAGaming download page just in-case someone else is getting the same thing : http://www.gtagaming.com/downloads/gta-san...reas/tools/2354 Thanks for the link man! Noooooooooooooooooooooooo, do not use that very old version! Until I write a new topic for the new GTAScriptHook, you should use the pre-release instead... unless you like compatibility with the 2 crap scripts I've written Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
TheSiggi Posted September 27, 2010 Share Posted September 27, 2010 Could you upload your latest version aswell? cheers Link to comment Share on other sites More sharing options...
TheSiggi Posted November 1, 2010 Share Posted November 1, 2010 I know this is a bump and I'm also doubleposting But: Can it be that some incompability problems occour when VC++ 2010 Runtime is installed? Because I noticed starnge behaviour of scripts since i updated the Runtime... I also know .NET 4 is compatible downwards but could it be a cause for problems too? cheers Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now