Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      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. Forum Support

    3. Suggestions

[BETA] GTAIV .Net ScriptHook


HazardX
 Share

Recommended Posts

I don't have .net exceptions, but unmanaged exceptions and so I had hoped you got exceptions at the same offset everytime so we maybe can find the issue.

Link to comment
Share on other sites

Hi pls when i wanna compile TestScript, compiler shows me a lot of errors, which are saying about undeclared scriptings like Player, Ped, ...I m using VS 2008...

Link to comment
Share on other sites

SHDN uses .NET Framework 4, so you won't be able to use it with VS 2008. So I guess you can solve your problems by updating to the latest Visual Studio.

Link to comment
Share on other sites

nightwalker83

When creating the script do you need to use any external code? For example in C# putting Using... or is the code for example the invincible health/ammo C# in the first post compiled as is? Also, does the Scripts folder go in the same folder as GTAVI or another folder?

Link to comment
Share on other sites

When creating the script do you need to use any external code? For example in C# putting Using... or is the code for example the invincible health/ammo C# in the first post compiled as is? Also, does the Scripts folder go in the same folder as GTAVI or another folder?

You need a reference to the ScriptHookDotNet.dll in the developers folder included in the zip.

 

The using directive is just for convenience.

 

Rather than having to do GTA.World.Weather, you just do World.Weather, if you've used the using directive on the GTA namespace.

Link to comment
Share on other sites

nightwalker83

I can't get the scripts working even through I put them in a folder called "scripts" located inside the "Grand Theft Auto IV" folder and run the game.

Link to comment
Share on other sites

I can't get the scripts working even through I put them in a folder called "scripts" located inside the "Grand Theft Auto IV" folder and run the game.

Have you installed the hook? And an asi loader?

Link to comment
Share on other sites

nightwalker83
I can't get the scripts working even through I put them in a folder called "scripts" located inside the "Grand Theft Auto IV" folder and run the game.

Have you installed the hook? And an asi loader?

If you mean extracting them to the root GTA IV folder then yes I have.

Link to comment
Share on other sites

 

I can't get the scripts working even through I put them in a folder called "scripts" located inside the "Grand Theft Auto IV" folder and run the game.

Have you installed the hook? And an asi loader?

If you mean extracting them to the root GTA IV folder then yes I have.

Which asi loader are you using?

 

If you want a quicker response, click my signature to join my irc channel.

Edited by MulleDK19
Link to comment
Share on other sites

ScriptHookDotNet.asi

That's not an asi loader. That's the script hook. You need an asi loader. Like XLiveLess.

Link to comment
Share on other sites

nightwalker83
ScriptHookDotNet.asi

That's not an asi loader. That's the script hook. You need an asi loader. Like XLiveLess.

Ah ok, I am using dsound.dll and now it is working.

Link to comment
Share on other sites

ScriptHookDotNet.asi

That's not an asi loader. That's the script hook. You need an asi loader. Like XLiveLess.

Ah ok, I am using dsound.dll and now it is working.

Does that remove anti-debugger checks? If not, you won't be able to debug your projects. If it doesn't remove anti-debugger checks, I suggest you use XLiveLess.

Link to comment
Share on other sites

nightwalker83
ScriptHookDotNet.asi

That's not an asi loader. That's the script hook. You need an asi loader. Like XLiveLess.

Ah ok, I am using dsound.dll and now it is working.

Does that remove anti-debugger checks? If not, you won't be able to debug your projects. If it doesn't remove anti-debugger checks, I suggest you use XLiveLess.

I wouldn't know but just to be safe I will use xliveless.

Link to comment
Share on other sites

hello if anyone could help find out why I keep getting frozen out of game that would be great here are some logs

 

scripthook.net log

 

2011-06-26 14:41:44 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.4.0 with C++ Hook version 0.4.0)2011-06-26 14:42:51 - Direct3D device created!2011-06-26 14:42:53 - SEARCHING FOR SCRIPTS...2011-06-26 14:42:53 - Loading scripts in Assembly 'scripts\FirePatrol.net.dll' ...2011-06-26 14:42:53 -  ...found script 'emergencyscript.emergency'!2011-06-26 14:42:53 - Loading scripts in Assembly 'scripts\TrafficControlSystem.net.dll' ...2011-06-26 14:42:53 -  ...found script 'TrafficControlCS.TrafficControl'!2011-06-26 14:42:53 - Loading scripts in Assembly 'scripts\TrafficMaker.net.dll' ...2011-06-26 14:42:53 -  ...found script 'TrafficControlCS.TrafficControl'!2011-06-26 14:42:53 - Loading scripts in Assembly 'scripts\Umbrella.net.dll' ...2011-06-26 14:42:53 -  ...found script 'umbrellaCS.umbrella'!2011-06-26 14:42:53 -  ...found script 'umbrellaCS.ManualFuncton'!2011-06-26 14:42:53 - Loading dynamic scriptfile 'scripts\Dart.CS' ...2011-06-26 14:42:56 -  ...found script 'Dart.Dart'!2011-06-26 14:42:56 - Loading dynamic scriptfile 'scripts\Doors.CS' ...2011-06-26 14:42:56 -  ...found script 'DOORS.DOORS'!2011-06-26 14:42:56 - Loading dynamic scriptfile 'scripts\DrawObject.CS' ...2011-06-26 14:42:57 -  ...found script 'DrawObject.DrawObject'!2011-06-26 14:42:57 - Loading dynamic scriptfile 'scripts\d_Crawl.CS' ...2011-06-26 14:42:57 -  ...found script 'd_Crawl.d_Crawl'!2011-06-26 14:42:57 - Loading dynamic scriptfile 'scripts\InstantCoffee.CS' ...2011-06-26 14:42:57 -  ...found script 'InstantCoffee.InstantCoffee'!2011-06-26 14:42:57 - Loading dynamic scriptfile 'scripts\Knife.cs' ...2011-06-26 14:42:58 -  ...found script 'Knife.Knife'!2011-06-26 14:42:58 - Loading dynamic scriptfile 'scripts\MoveB.CS' ...2011-06-26 14:42:58 -  ...found script 'Bodymove.Bodymove'!2011-06-26 14:42:58 - Loading dynamic scriptfile 'scripts\PickupProps.CS' ...2011-06-26 14:42:58 -  ...found script 'PickupProps.PickupProps'!2011-06-26 14:42:58 - Loading dynamic scriptfile 'scripts\Sliders.CS' ...2011-06-26 14:42:59 -  ...found script 'Slide.Slide'!2011-06-26 14:42:59 - Loading dynamic scriptfile 'scripts\TEMP.CS' ...2011-06-26 14:42:59 -  ...found script 'Temp.Temp'!2011-06-26 14:42:59 - Loading dynamic scriptfile 'scripts\Trunk.cs' ...2011-06-26 14:42:59 -  ...found script 'Trunk.Trunk'!2011-06-26 14:42:59 - DONE! 16 valid scripts found!2011-06-26 14:42:59 - STARTING SCRIPTS...2011-06-26 14:42:59 - INFO: Phone number checks are not available!2011-06-26 14:43:00 -  ...successfully started script 'Temp.Temp'!2011-06-26 14:43:00 -  ...successfully started script 'DOORS.DOORS'!2011-06-26 14:43:00 -  ...successfully started script 'umbrellaCS.ManualFuncton'!2011-06-26 14:43:00 -  ...successfully started script 'TrafficControlCS.TrafficControl'!2011-06-26 14:43:00 -  ...successfully started script 'TrafficControlCS.TrafficControl'!2011-06-26 14:43:00 -  ...successfully started script 'emergencyscript.emergency'!2011-06-26 14:43:00 -  ...successfully started script 'Trunk.Trunk'!2011-06-26 14:43:00 -  ...successfully started script 'Slide.Slide'!2011-06-26 14:43:00 -  ...successfully started script 'PickupProps.PickupProps'!2011-06-26 14:43:00 -  ...successfully started script 'Bodymove.Bodymove'!2011-06-26 14:43:00 -  ...successfully started script 'Knife.Knife'!2011-06-26 14:43:00 -  ...successfully started script 'InstantCoffee.InstantCoffee'!2011-06-26 14:43:00 -  ...successfully started script 'd_Crawl.d_Crawl'!2011-06-26 14:43:00 -  ...successfully started script 'DrawObject.DrawObject'!2011-06-26 14:43:01 -  ...successfully started script 'Dart.Dart'!2011-06-26 14:43:03 -  ...successfully started script 'umbrellaCS.umbrella'!2011-06-26 14:48:42 - Direct3D device lost!2011-06-26 14:48:46 - Direct3D device created!2011-06-26 14:53:08 - Direct3D device lost!2011-06-26 14:53:13 - Direct3D device created!2011-06-26 15:11:20 - Error during NetHook.Tick:                     System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.                        at unmanaged.NativeContext3.Invoke(Int32 nameptr, Byte[] args, Int32 argnum, NativeContext3* cxt)                        at GTA.ScriptDomain.RemoteEvent(RemoteEventArgs ev)                        at GTA.ScriptDomain.ProcessRemoteEvents()                        at GTA.ScriptDomain.Tick()                        at GTA.NetHook.Tick()

 

always the same Nativecontext3 error

event viewer log

 

error id - 1026Application: GTAIV.exeFramework Version: v4.0.30319Description: The process was terminated due to an unhandled exception.Exception Info: exception code c0000005, exception address 00A220D4Stack:

 

have installed latest c++ and .net4, used .net verification on all says ok

very strange sometimes I can play for hours no crash sometimes 5mins any help or ideas to troubleshoot the cause ?

thanks

Link to comment
Share on other sites

@ ^^:

 

Do your mods require an older patch version (.4) so updating is not an option ?

 

If not then update your game to the latest version but if they do require the older patch then you should be able to find an older version of the hook by searching in this thread, this has come up a few times.

Edited by Donny78
Link to comment
Share on other sites

@ ^^:

 

Do your mods require an older patch version (.4) so updating is not an option ?

 

If not then update your game to the latest version but if they do require the older patch then you should be able to find an older version of the hook by searching in this thread, this has come up a few times.

From the looks of it, they're all .NET scripts, so that shouldn't be an issue.

 

No good reason not to update, really.

Link to comment
Share on other sites

I couldn't find answer before so I'm typing new post. I have problem with ScriptHookDotNet.asi. I get no rain splash on objects. I can see it only any time I get to menu/map, hitting escape key or when pop up of upcoming message etc. comes up. I noticed also rain indoors. I don't mind to much the last thing too much but rain splash outside is one of cooler looking graphic effect. I really wanted to have rain effect but also keeping traffic control scripts.

This is text from log file.

 

2011-06-26 21:26:07 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.7.0 with C++ Hook version 0.5.1)

2011-06-26 21:27:15 - Direct3D device created!

 

2011-06-26 21:27:15 - SEARCHING FOR SCRIPTS...

2011-06-26 21:27:15 - Loading scripts in Assembly 'scripts\TrafficControlSystem.net.dll' ...

2011-06-26 21:27:15 - ...found script 'TrafficControlCS.TrafficControl'!

2011-06-26 21:27:15 - Loading scripts in Assembly 'scripts\TrafficFlow.net.dll' ...

2011-06-26 21:27:15 - ...found script 'TrafficFlow.Taxi'!

2011-06-26 21:27:15 - DONE! 2 valid scripts found!

 

2011-06-26 21:27:15 - STARTING SCRIPTS...

2011-06-26 21:27:15 - INFO: Phone number checks are not available!

2011-06-26 21:27:15 - ...successfully started script 'TrafficFlow.Taxi'!

2011-06-26 21:27:15 - ...successfully started script 'TrafficControlCS.TrafficControl'!

2011-06-26 21:31:00 - Direct3D device lost!

2011-06-26 21:31:00 - Direct3D device created!

2011-06-26 21:31:18 - Direct3D device lost!

2011-06-26 21:31:18 - SCRIPTS TERMINATED!

Edited by Trigger_85
Link to comment
Share on other sites

gamerzworld

Does anyone have any information on this native? REMOVE_ALL_PICKUPS_OF_TYPE The wiki has nothing on it.

Edited by gamerzworld
Link to comment
Share on other sites

Does anyone have any information on this native? REMOVE_ALL_PICKUPS_OF_TYPE The wiki has nothing on it.

The wiki has only a small subset of natives defined. This particular native is cleaned up in scripting.h, it has just one parm:type, which is most likely just an integer value.

Link to comment
Share on other sites

gamerzworld
Does anyone have any information on this native? REMOVE_ALL_PICKUPS_OF_TYPE The wiki has nothing on it.

The wiki has only a small subset of natives defined. This particular native is cleaned up in scripting.h, it has just one parm:type, which is most likely just an integer value.

Yep, figured as much. Thanks!

Link to comment
Share on other sites

 

From the looks of it, they're all .NET scripts, so that shouldn't be an issue.

 

No good reason not to update, really.

I didn't know it was backwards compatible, thanks for clearing that up.

 

I agree about the updating, no reason unless they have a long beard and a parrot on their shoulder in which case shame on them !

Link to comment
Share on other sites

It's not important so I will ask this here and this isn't necessarily a request, but would it be possible to make all peds 'drunk'? I was thinking it would be an interesting take on a zombie mod.

Link to comment
Share on other sites

It's not important so I will ask this here and this isn't necessarily a request, but would it be possible to make all peds 'drunk'? I was thinking it would be an interesting take on a zombie mod.

No. The game limits the number of simultaneous ragdolls.

Link to comment
Share on other sites

What's the difference between object.Exists() and Exists(object)?

 

I've been using the first one in some of my scripts, but while testing just now it wasn't preventing null reference crashes. So I changed it to the second one, and that fixed it.

Link to comment
Share on other sites

lindsayslorach

Yeah, doesn't "Exists(obj);" do "obj.Exists() && obj != null"?

 

I think I read that that's what it does.

Link to comment
Share on other sites

 

Yeah, doesn't "Exists(obj);" do "obj.Exists() && obj != null"?

 

I think I read that that's what it does.

The other way around, actually.

 

This is pretty much what it does:

 

public static bool Exists(GTA.Object objectToCheck){   if (objectToCheck == null)       return false;   return objectToCheck.Exists();}

 

 

 

If you just use the obj.Exists(), it will only check if the object that obj represents exists by asking the game engine. This will cause a NullReferenceException if obj is null, 'cause you can't call anything on a null object.

 

If you use Game.Exists(obj), it will first check if obj is null, then call obj.Exists().

 

 

So, you should either do

 

if(obj != null && obj.Exists())

 

 

Or

 

if(Game.Exists(obj))

 

Edited by MulleDK19
Link to comment
Share on other sites

Can anyone help me?After i start playing GTAIV with scripthook the game shuts down in about 20 minutes.I have the 1.0.7.0 version and the newest of scripthook(i think).Please advice something.

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.