Quantcast
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 Cayo Perico Heist
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    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. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. 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. 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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

HazardX

[BETA] GTAIV .Net ScriptHook

Recommended Posts

TwinTurbine
Any help please , I'm using patch 1.0.4.0 with scripthook 0.4.0  , latest xlive , framework .net 3.5 but still I can't start the game with .net scripthook , it crashed everytime I finish loading the game ( loading { mission name } ) . If I remove the .net scripthook from my gta directory , my game runs back to normal with all the asi mod running perfectly . I even try running the game as administrator , starting a new game instead of my saved game but still it occurs the same problem . Any help will be appreciated . 

 

Only tested with 0.893 .net script hook .

Install the latest GTA IV patch, and .NET ScriptHook.

Is it possible to use it without patching the game ?

And the link for the older c ++ on the 1st page seems to be not working , anybody got another link for it ?

Without patching the game?

 

Oh... the legal term... lol...

 

I really see no reason as to why you'd not want to patch it. Unless your copy is not legitimate.

hmm? Sorry , you got it wrong . Im just worrying some graphic mod or any other mod doesnt work with the latest patch , and most of it is for 1.0.4.0 . And even if its a pirated copy , you are still able to patch and crack .

Share this post


Link to post
Share on other sites
MulleDK19
Any help please , I'm using patch 1.0.4.0 with scripthook 0.4.0  , latest xlive , framework .net 3.5 but still I can't start the game with .net scripthook , it crashed everytime I finish loading the game ( loading { mission name } ) . If I remove the .net scripthook from my gta directory , my game runs back to normal with all the asi mod running perfectly . I even try running the game as administrator , starting a new game instead of my saved game but still it occurs the same problem . Any help will be appreciated . 

 

Only tested with 0.893 .net script hook .

Install the latest GTA IV patch, and .NET ScriptHook.

Is it possible to use it without patching the game ?

And the link for the older c ++ on the 1st page seems to be not working , anybody got another link for it ?

Without patching the game?

 

Oh... the legal term... lol...

 

I really see no reason as to why you'd not want to patch it. Unless your copy is not legitimate.

Maybe cause patch 1.7 sucks cow's ass, and makes texture-pops-up and lags for other players.

Uh? lol...

 

It's a great patch... Now I get from 58 to 130 fps.

 

If you have trouble with textures, turn off Clip Capture.

Share this post


Link to post
Share on other sites
lolleroz
Any help please , I'm using patch 1.0.4.0 with scripthook 0.4.0  , latest xlive , framework .net 3.5 but still I can't start the game with .net scripthook , it crashed everytime I finish loading the game ( loading { mission name } ) . If I remove the .net scripthook from my gta directory , my game runs back to normal with all the asi mod running perfectly . I even try running the game as administrator , starting a new game instead of my saved game but still it occurs the same problem . Any help will be appreciated . 

 

Only tested with 0.893 .net script hook .

Install the latest GTA IV patch, and .NET ScriptHook.

Is it possible to use it without patching the game ?

And the link for the older c ++ on the 1st page seems to be not working , anybody got another link for it ?

Without patching the game?

 

Oh... the legal term... lol...

 

I really see no reason as to why you'd not want to patch it. Unless your copy is not legitimate.

Maybe cause patch 1.7 sucks cow's ass, and makes texture-pops-up and lags for other players.

Uh? lol...

 

It's a great patch... Now I get from 58 to 130 fps.

 

If you have trouble with textures, turn off Clip Capture.

Seeing as IV runs at 58 FPS for you, it won't matter on what patch you're running it. Anyways the thing is, it caused many issues for other players, end of the topic.

And they guy just said, he uses ENB series so he prefers 1.4.

Share this post


Link to post
Share on other sites
MulleDK19
Any help please , I'm using patch 1.0.4.0 with scripthook 0.4.0  , latest xlive , framework .net 3.5 but still I can't start the game with .net scripthook , it crashed everytime I finish loading the game ( loading { mission name } ) . If I remove the .net scripthook from my gta directory , my game runs back to normal with all the asi mod running perfectly . I even try running the game as administrator , starting a new game instead of my saved game but still it occurs the same problem . Any help will be appreciated . 

 

Only tested with 0.893 .net script hook .

Install the latest GTA IV patch, and .NET ScriptHook.

Is it possible to use it without patching the game ?

And the link for the older c ++ on the 1st page seems to be not working , anybody got another link for it ?

Without patching the game?

 

Oh... the legal term... lol...

 

I really see no reason as to why you'd not want to patch it. Unless your copy is not legitimate.

Maybe cause patch 1.7 sucks cow's ass, and makes texture-pops-up and lags for other players.

Uh? lol...

 

It's a great patch... Now I get from 58 to 130 fps.

 

If you have trouble with textures, turn off Clip Capture.

Seeing as IV runs at 58 FPS for you, it won't matter on what patch you're running it. Anyways the thing is, it caused many issues for other players, end of the topic.

And they guy just said, he uses ENB series so he prefers 1.4.

No, it doesn't matter which patch I'm using. I got 15-30 before the patch.

Share this post


Link to post
Share on other sites
TwinTurbine

So does anybody got any solution for my problem ? Can I use .net script without patching ? And anybody got a new link for the older c++ like the one hazard posted at the first page ?

Share this post


Link to post
Share on other sites
MulleDK19
So does anybody got any solution for my problem ? Can I use .net script without patching ? And anybody got a new link for the older c++ like the one hazard posted at the first page ?

Post your ScriptHook logs.

Share this post


Link to post
Share on other sites
TwinTurbine

its okay bro . I got it working already . Thanks anyway . biggrin.gif

Share this post


Link to post
Share on other sites
Zach

I searched the topic for both "gang" and "group," but I didn't seem to find the answer. Sorry if I missed it and this has already been covered.

 

 

For the Lost and the Damned, is there a way to obtain a list of the gang members you are currently riding with? Player.Group always comes back with a zero count, and when I try to just scan the area for all Peds and query their type (PedType), only Jim, Clay, and Terry are set to PedType.TheLost--all the rest are just CivMales.

 

The idea is I want to do gang war and make everyone bullet- and fire-proof, but, of course, only those riding with me.

 

And on a side note, even when I called ped.MakeProofTo( true, true, true, true, true ) on the 6 peds around me (Jim, Clay, Terry, and their three passengers), they still all died by gunfire. Does MakeProofTo() only work on the Player?

 

Share this post


Link to post
Share on other sites
MulleDK19

 

And on a side note, even when I called ped.MakeProofTo( true, true, true, true, true ) on the 6 peds around me (Jim, Clay, Terry, and their three passengers), they still all died by gunfire.  Does MakeProofTo() only work on the Player?

Try .Invincible = true;

 

 

 

 

 

 

 

 

Also, I'm trying to create a group, but adding members doesn't seem to work.

 

Note: Contains references to custom classes... But after AddMember, MemberCount still says 0, and even though the vehicle is created, and the people are warped into the vehicle, everyone but the nooseLeader will get out, and then one or two may get in. But they just won't stay in. And unless the few that might try to get in are really fast, the driver just takes off. (Task outside the call) (EDIT: Nevermind! See solution below the code! xD)

 

-snip-

 

 

EDIT: When adding the members I was refering to nooseLeader >.< Can't believe it took me a few hours to notice >.<

Edited by MulleDK19

Share this post


Link to post
Share on other sites
Zach

Invincible seems to work, but in retrospect, all I really want is fire-proof so I can freely toss around some Molotov's. Sucks that MakeProof() does not work.

 

That still leaves the matter of who to apply Invincible to. So no one here knows how fetch all gang members? Bummer. I guess the game is too old.

Share this post


Link to post
Share on other sites
lindsayslorach

Does anyone have any answers to my questions?

 

HazardX, is it possible for you to make a multiline textbox?

 

And, does anyone know anything about the Project() and Unproject() methods?

Share this post


Link to post
Share on other sites
MulleDK19

HazardX, how does the Native.Call method work?

 

Is it only able to call natives that are already known (As in, known parameters)?

 

Because I'm trying to make Sleep Mode work, and it seems to ignore it

 

 

public static void SetSleepMode(bool enabled){   GTA.Native.Function.Call("SET_SLEEP_MODE_ACTIVE", enabled);}

 

Share this post


Link to post
Share on other sites
iriedreadlock23

MulleDK19 I believe that many functions are missing, since HazardX or Aru have not added those functions hashes. Most of EFLC functions can't be used. You can tell by checking your console. It will tell you that function does not exist when you call it, even though you know that it does exist in game. If there is way to call them some other way, I would like to know that. I've read somewhere that Aru's Scripthook support calling custom native functions.

 

Also, what may be interesting to you, as it is to me is MemoryStream class. If someone can explain how to use it to retrieve any information with it would be great.

Share this post


Link to post
Share on other sites
MulleDK19
Also, what may be interesting to you, as it is to me is MemoryStream class. If someone can explain how to use it to retrieve any information with it would be great.

The MemoryStream is just an ordinary stream. Like FileStream.

Share this post


Link to post
Share on other sites
LMS

 

If there is way to call them some other way, I would like to know that.

Sure there is, call them using their addresses. I'd suggest you use assembler because you don't need to define the function then. I call a lot of iv's internal functions (not natives) and simply created a C++/CLI dll I can use from C#.

Share this post


Link to post
Share on other sites
sjaak327
MulleDK19 I believe that many functions are missing, since HazardX or Aru have not added those functions hashes. Most of EFLC functions can't be used. You can tell by checking your console. It will tell you that function does not exist when you call it, even though you know that it does exist in game. If there is way to call them some other way, I would like to know that. I've read somewhere that Aru's Scripthook support calling custom native functions.

 

Also, what may be interesting to you, as it is to me is MemoryStream class. If someone can explain how to use it to retrieve any information with it would be great.

Aru's hook supports calling natives by hash, which indeed circumvents these natives not being inlcuded in the hook. I use this function for the parachute smoke color, which I simply call by it's hash.

 

 

Share this post


Link to post
Share on other sites
iriedreadlock23

Thanks for sorting this out LMS/Sjaak327. The thing is I don't use C++ or ASM, but VB.Net. So I guess there is no way for me to call function directly. Hopefully this feature will be added to ScripthookDotNet, or someone will release the library. It would certainly make it possible to document many many more functions to be used later.

Share this post


Link to post
Share on other sites
MulleDK19

Anyone know how I can retrieve ALL peds? World.GetAllPeds() only retrieves the ones close to you.

 

I know the game only spawns people around you, but World.GetAllPeds() doesn't include peds that are far away but you can still see.

Share this post


Link to post
Share on other sites
LMS

Because they are't peds then. World.GetAllPeds() returns all valid peds from atPool<CPed> so the ones you are missing aren't CPeds. I think they are CDummyPeds and the pool is 0x18219FC in EFLC patch #2. If you can wait some time I can add this to the next scripthook .net release.

Share this post


Link to post
Share on other sites
MulleDK19

 

Because they are't peds then. World.GetAllPeds() returns all valid peds from atPool<CPed> so the ones you are missing aren't CPeds. I think they are CDummyPeds and the pool is 0x18219FC in EFLC patch #2. If you can wait some time I can add this to the next scripthook .net release.

Ya, I figured it was something like that.

 

 

Problem is, that I'm assigning tasks to all peds. Currently I make them wander, ignoring all dangers, but peds that are far away starts screaming and running until I get closer to them.

 

 

Also, would be nice if you could make something like Game.SleepMode

 

This doesn't work, and I assume it's because the .net hook can't call natives that aren't supported by the c++ hook?

 

public static void SetSleepMode(bool enabled){   GTA.Native.Function.Call("SET_SLEEP_MODE_ACTIVE", enabled);}

 

Edited by MulleDK19

Share this post


Link to post
Share on other sites
iriedreadlock23

I noticed that there is property Globals, in Game class in Sciprthookdotnet. I thought that this was for accessing global Gta variables (ones that are used in scripts G[]), but i am wrong. What is it used for? And is there any way to access globals, the G[] variables mentioned in every single script. There's lot of useful data in those.

Share this post


Link to post
Share on other sites
sjaak327

@Mulledk19

 

Set_sleep_mode_active does work, all it does however is set the sleepmode icon on screen. There is no native to put the phone in sleep mode, to achieve this, you need to kill the phonescript. (spcellphone).

 

@iriedreadlock23, using the C++ hook, accessing global variables does work, setting them will lead to instant game crash, I presume since the .net hook is based upon the C++ hook, that doing the same in .net might lead to the same result.

Share this post


Link to post
Share on other sites
MulleDK19

 

I noticed that there is property Globals, in Game class in Sciprthookdotnet.

I think the Game.Globals.* are for reading and writing variables that all .NET ScriptHook scripts can access.

Share this post


Link to post
Share on other sites
iriedreadlock23

Is there any way that I can catch the exception made after calling native with wrong num of params? I want to catch the exception, but it breaks the script even if I put it in Try block.

Share this post


Link to post
Share on other sites
MulleDK19
Is there any way that I can catch the exception made after calling native with wrong num of params? I want to catch the exception, but it breaks the script even if I put it in Try block.

You can't catch AccessViolationExceptions in .NET 4.0

 

There's a way to disable that, so you can, but I'm not sure exactly how.

Share this post


Link to post
Share on other sites
LMS

There's a good reason why you no longer can catch AccessViolationExceptions. They often lead to crashes and you should really avoid them.

Share this post


Link to post
Share on other sites
MulleDK19

 

There's a good reason why you no longer can catch AccessViolationExceptions. They often lead to crashes and you should really avoid them.

The .NET ScriptHook catches them just fine.

 

And even if I have a thousand != null and Exists, and sh*t, I still get AccessViolationExceptions, when calling certain natives.

 

LeaveVehicleImmediatly causes an AccessViolationException 90% of the time.

Share this post


Link to post
Share on other sites
iriedreadlock23

I figured out the same LMS. I agree that the best is to prevent them from happening. However I placed the Native code calls in static/shared method in separate instance of small class. Its replaced with the new one when it can't be used anymore. So, if native turns to be wrong, it does not stop other scripts but only instance of this class. And I didn't see any performance issues by doing it this way.

Share this post


Link to post
Share on other sites
_Charger_

can u help me pls. i have a problem with the ini fiels. allways i get compiler errors when trying to read from ini (getvalueinteger)

 

and all helpfiles didn't help me -.-

Share this post


Link to post
Share on other sites
LMS

Maybe you should post your code and the error?

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.


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