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

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

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

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

HazardX

[BETA] GTAIV .Net ScriptHook

Recommended Posts

Southern_Smoke

Hey Guys,

 

i need your help. I need a simple script, which creates cars.

For example:

 

1) Admiral, xxx, xx, yyy, yy, zz, zzz, Doorlock=true, Alarm=off

2) Banshee, xxx, xx, yyy, yy, zz, zzz, Doorlock=true, Alarm=off

 

Only a VB script....can you help me?

Share this post


Link to post
Share on other sites
Threepwood

Hey guys.. what opportunities do I have to manipulate car characteristics also known as handling? Grip and height position..

 

Any hint would be helpful, thanks smile.gif

Share this post


Link to post
Share on other sites
Driftking120

Hi there,

I think the file you are looking for is called "handling.dat".

It helps manipulate grip and ride height, Rob.Zombie makes a lot of handling lines for Smokey's cars,

so maybe he could help you with getting started.

Share this post


Link to post
Share on other sites
Threepwood

Thanks Driftking, thats common knowledge for a modder like I am wink.gif You meant it good I guess.

But take a look were we are here, in the .NET Scripthook topic.. so its kinda obvious I ask for a way to do it with .NET.. wink.gif

Share this post


Link to post
Share on other sites
wilus0503

i'm sorry for my weak english.

 

My problem relies on it, that scripthookdotnet.asi it is not started.

 

In GTAIV main folder, file of notebook scripthookdotnet does not appear.

 

I had versions earlier 1.0.4.0, and scripthookdotnet.asi Version 0.893 BETA worked correctly , but doesn't work some mods.

I have decided modernize GTAIV to 1.0.7.0 and use "GTAIV .Net Script Hook v1.7.1.7 BETA" .

 

but.. now only work mods .asi , and don't work mods .net sad.gif

 

screen on my GTAIV main folder:

 

user posted image

 

it's good install all file ?

 

Mods .net put in scripts folder.

 

please for help

 

------------------------------------------------------------------------------------------------------

 

Jest tutaj jakiś polak? nie umiem angielskiego tounge.gif

Share this post


Link to post
Share on other sites
Rushlink

I'm having problems with some code i've written.

 

This was working, but no longer works at all!!!

I am completely stumped as to why this isn't working! It doesn't make sense to me at all.

 

When the script loads, the lights are on. As soon as it goes into the tick and attempts to update any of the lights positions, etc... the lights all go away...

I understand that everything looks stupid - this isn't my entire code, but this section should run on its own... It doesn't...

 

 

using System;using System.Collections.Generic;using System.Text;using GTA;using System.Drawing;using System.Windows.Forms;namespace PLM{   public class plm : Script   {       public System.Drawing.Color blue;       public System.Drawing.Color red;       public System.Drawing.Color white;       public System.Drawing.Color yellow;       private bool firstrun = true;       private bool firstveh = true;       //Lights       //                   //F/B    |  AREA      |  L/R   | TYPE  | DONE?       public Light light1; //FRONT  |  OUTSIDE   |  LEFT  | PRIM  | COMPLETED       public Light light2; //FRONT  |  OUTSIDE   |  RIGHT | PRIM  | COMPLETED       public Light light3; //REAR   |  OUTSIDE   |  LEFT  | PRIM  | COMPLETED       public Light light4; //REAR   |  OUTSIDE   |  RIGHT | PRIM  | COMPLETED       public Light light5; //FRONT  |  MIDDLE1   |  LEFT  | PRIM  | COMPLETED       public Light light6; //FRONT  |  MIDDLE1   |  RIGHT | PRIM  | COMPLETED       public Light light7; //REAR   |  MIDDLE1   |  LEFT  | PRIM  | COMPLETED       public Light light8; //REAR   |  MIDDLE1   |  RIGHT | PRIM  | COMPLETED       public Light light9; //FRONT  |  MIDDLE2   |  LEFT  | PRIM  | COMPLETED       public Light light10;//FRONT  |  MIDDLE2   |  RIGHT | PRIM  | COMPLETED       public Light light11;//REAR   |  MIDDLE2   |  LEFT  | PRIM  | COMPLETED       public Light light12;//REAR   |  MIDDLE2   |  RIGHT | PRIM  | COMPLETED       public Light light13;//FRONT  |  INSIDE    |  LEFT  | PRIM  | COMPLETED       public Light light14;//FRONT  |  INSIDE    |  RIGHT | PRIM  | COMPLETED       public Light light15;//REAR   |  INSIDE    |  LEFT  | PRIM  | COMPLETED       public Light light16;//REAR   |  INSIDE    |  RIGHT | PRIM  | COMPLETED       public Light light17;//FRONT  |  LEFT      |  LEFT  | PRIM  | COMPLETED       public Light light18;//REAR   |  LEFT      |  LEFT  | PRIM  | COMPLETED       public Light light19;//FRONT  |  RIGHT     |  RIGHT | PRIM  | COMPLETED       public Light light20;//REAR   |  RIGHT     |  RIGHT | PRIM  | COMPLETED       public plm()       {           Interval = 10;           this.Tick += new EventHandler(this.plm_tick);           //Initalize colors           string hexValue = "#0000FF";           System.Drawing.Color blue = System.Drawing.ColorTranslator.FromHtml(hexValue);           hexValue = "#FF0000";           System.Drawing.Color red = System.Drawing.ColorTranslator.FromHtml(hexValue);           hexValue = "#FFFFFF";           System.Drawing.Color white = System.Drawing.ColorTranslator.FromHtml(hexValue);           hexValue = "#E69900";           System.Drawing.Color yellow = System.Drawing.ColorTranslator.FromHtml(hexValue);           //Initalize lights           light1 = new GTA.Light(blue, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light2 = new GTA.Light(red, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light3 = new GTA.Light(blue, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light4 = new GTA.Light(red, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light5 = new GTA.Light(blue, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light6 = new GTA.Light(red, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light7 = new GTA.Light(blue, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light8 = new GTA.Light(red, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light9 = new GTA.Light(blue, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light10 = new GTA.Light(red, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light11 = new GTA.Light(blue, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light12 = new GTA.Light(red, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light13 = new GTA.Light(blue, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light14 = new GTA.Light(red, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light15 = new GTA.Light(blue, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light16 = new GTA.Light(red, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light17 = new GTA.Light(blue, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light18 = new GTA.Light(blue, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light19 = new GTA.Light(red, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light20 = new GTA.Light(red, 1, 5000, Player.Character.GetOffsetPosition(new Vector3(0.5F, 0, 1)));           light1.Enabled = true;           light2.Enabled = true;           light3.Enabled = true;           light4.Enabled = true;           light5.Enabled = true;           light6.Enabled = true;           light7.Enabled = true;           light8.Enabled = true;           light9.Enabled = true;           light10.Enabled = true;           light11.Enabled = true;           light12.Enabled = true;           light13.Enabled = true;           light14.Enabled = true;           light15.Enabled = true;           light16.Enabled = true;           light17.Enabled = true;           light18.Enabled = true;           light19.Enabled = true;           light20.Enabled = true;           light1.Range = 100.0F;           light2.Range = 100.0F;           light3.Range = 100.0F;           light4.Range = 100.0F;           light5.Range = 100.0F;           light6.Range = 100.0F;           light7.Range = 100.0F;           light8.Range = 100.0F;           light9.Range = 100.0F;           light10.Range = 100.0F;           light11.Range = 100.0F;           light12.Range = 100.0F;           light13.Range = 100.0F;           light14.Range = 100.0F;           light15.Range = 100.0F;           light16.Range = 100.0F;           light17.Range = 100.0F;           light18.Range = 100.0F;           light19.Range = 100.0F;           light20.Range = 100.0F;       }       private void plm_tick(object sender, EventArgs e)       {           Interval = 30;           if (Exists(Player.Character.CurrentVehicle))           {               //update the light position               light1.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-0.43F, -0.09F, 0.847F)); //done               light2.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(0.45F, -0.09F, 0.847F)); //done               light3.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-0.43F, -0.45F, 0.847F)); //done               light4.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(0.45F, -0.45F, 0.847F)); //done               light5.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-0.31F, -0.09F, 0.847F)); //done               light6.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(0.33F, -0.09F, 0.847F)); //done               light7.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-0.31F, -0.45F, 0.847F)); //done               light8.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(0.33F, -0.45F, 0.847F)); //done;               light9.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-100.09F, -0.09F, 0.847F)); //done               light10.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(0.21F, -0.09F, 0.847F)); //done               light11.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-100.09F, -0.45F, 0.847F)); //done               light12.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(0.21F, -0.45F, 0.847F)); //done               light13.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-0.06F, -0.09F, 0.848F)); //done               light14.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(0.08F, -0.09F, 0.848F)); //done                               light15.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-0.06F, -0.45F, 0.848F)); //done               light16.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(0.08F, -0.45F, 0.848F)); //done               light17.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-0.54F, -100.06F, 0.850F)); //done               light18.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-0.54F, -0.39F, 0.850F)); //done               light19.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(0.55F, -100.06F, 0.850F)); //done               light20.Position = Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(0.55F, -0.39F, 0.850F)); //done               light1.Color = yellow;               light1.Color = yellow;               light2.Color = yellow;               light3.Color = yellow;               light4.Color = yellow;               light5.Color = yellow;               light6.Color = yellow;               light7.Color = yellow;               light8.Color = yellow;               light9.Color = yellow;               light10.Color = yellow;               light11.Color = yellow;               light12.Color = yellow;               light13.Color = yellow;               light14.Color = yellow;               light15.Color = yellow;               light16.Color = yellow;               light17.Color = yellow;               light18.Color = yellow;               light19.Color = yellow;               light20.Color = yellow;               light1.Enabled = true;               light1.Enabled = true;               light2.Enabled = true;               light3.Enabled = true;               light4.Enabled = true;               light5.Enabled = true;               light6.Enabled = true;               light7.Enabled = true;               light8.Enabled = true;               light9.Enabled = true;               light10.Enabled = true;               light11.Enabled = true;               light12.Enabled = true;               light13.Enabled = true;               light14.Enabled = true;               light15.Enabled = true;               light16.Enabled = true;               light17.Enabled = true;               light18.Enabled = true;               light19.Enabled = true;               light20.Enabled = true;           }       }   }}

 

 

 

Any Ideas??

 

Thanks

Share this post


Link to post
Share on other sites
Rushlink
i'm sorry for my weak english.

 

My problem relies on it, that scripthookdotnet.asi it is not started.

 

In GTAIV main folder, file of notebook scripthookdotnet does not appear.

 

I had versions earlier 1.0.4.0, and scripthookdotnet.asi Version 0.893 BETA worked correctly , but doesn't work some mods.

I have decided modernize GTAIV to 1.0.7.0 and use "GTAIV .Net Script Hook v1.7.1.7 BETA" .

 

but.. now only work mods .asi , and don't work mods .net sad.gif

 

screen on my GTAIV main folder:

 

user posted image

 

it's good install all file ?

 

Mods .net put in scripts folder.

 

please for help

 

------------------------------------------------------------------------------------------------------

 

Jest tutaj jakiś polak? nie umiem angielskiego tounge.gif

ScripthookDotNet.asi needs to go into the ROOT gtaIV folder

 

Any .net SCRIPTS go into the 'scripts' folder

Share this post


Link to post
Share on other sites
vdhAbraxas

All hope is gone. I've been trying to figure it out for hours, but I'm just too stupid for it and need your help guys sad.gif

 

I'm trying to get native function to work

 

 

float x1 = 0.0f;float x2 = 0.0f;float x3 = 0.0f;   GTA.Native.Function.Call("GET_NTH_CLOSEST_CAR_NODE", Player.Character.Position.X, Player.Character.Position.Y, Player.Character.Position.Z, 3,  x1, x2, x3 );Game.DisplayText("Test "+ x1 + " " + x2 + " " +x3 + " ", 15000);

 

 

And all I get is:

Error during NetHook.Tick:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

at Scripting.NativeContext2.Invoke(SByte* name, NativeContext2* cxt)

at GTA.Native.Function.BaseCall(String Name, Parameter[] Arguments)

at GTA.Native.Function.Call(String Name, Parameter[] Arguments)

at GTA.Native.Template.Invoke()

at GTA.ScriptDomain.RemoteEvent(RemoteEventArgs ev)

at GTA.ScriptDomain.ProcessRemoteEvents()

at GTA.ScriptDomain.Tick()

at GTA.NetHook.Tick()

 

I've tried with other car node native functions, but also without success. I'm new to modding and .NET and try to learn from examples etc., but this time I'm hopeless.

Edited by vdhAbraxas

Share this post


Link to post
Share on other sites
kmccmk9

Hi! Great mod. I'm working on a script that loads a custom model I made, but not added to the game. Is there anyway to add it as a resource into the script and spawn it that way? I've been studying the texture drawing example however I can't seem to use it for models instead.

Share this post


Link to post
Share on other sites
fengyeblade

HI hazardX. i am back. What are you get new mod ?

Share this post


Link to post
Share on other sites
Timmoboy

Hello. I'm in really deep water with this and I have no knowledge of coding what so ever!

 

The only reason I started was because I could not find one single mod/script that did what I wanted. Basically, all I want is when I fire my silenced gun in the game, it won't attract much attention, if none. Especially if you are alone and you kill a cop you shouldn't get chased by everyone because there was no witnesses etc.

 

I have no idea if that's even possible but I gave it a shot and this is what I came up with:

 

If Player.isShooting.DesertEagle = True Then (I have replaced the eagle with a silenced gun)

 

Player.IgnoredByEveryone = True

 

The first line is something I just came up with because I could not find anything better.

 

I would really like some big help with this and I will forever be in your debt if you get something like this working!

Share this post


Link to post
Share on other sites
fengyeblade

I make a ped , add a task to enter vehicle.

 

 

 GudList[z].Task.ClearAll();GudList[z].Task.AlwaysKeepTask = true;GudList[z].Task.EnterVehicle(GudCar[0], VehicleSeat.Driver);

 

 

and make he drive vehicle to a point.

 

 

 if (GudList[z].isInVehicle(GudCar[0]))GudList[z].Task.DriveTo(endpoint, sspeed, false); 

 

 

but , in game, the ped get in car, get out ,get in ,get out , get in , get out ....

he can't stay in the vehicle.

how make he stay in the car , still i give he command?

Share this post


Link to post
Share on other sites
_Charger_

hi i have a problem... i wanna remove buttons with

this.Controls.Remove()

but it doesn't work...

 

 

2012-08-05 17:37:46 - Error during Form.ShowDialog:                     System.NullReferenceException: Object reference not set to an instance of an object.                        at GTA.Forms.Control.get_Controls()                        at GTA.Forms.Control.set_Parent(Control value)                        at GTA.Forms.ControlCollection.Remove(Control item)                        at IV_SA_Tuning_Garage.GarageUI.neonOffBtn_Click(Object sender, MouseEventArgs e)                        at GTA.Forms.Control.raise_Click(Object value0, MouseEventArgs value1)                        at GTA.Forms.Button.OnClick(MouseEventArgs e)                        at GTA.Forms.FormHost.TriggerMouseUp(MouseEventArgs e)                        at GTA.Script.ProcessEvents()                        at GTA.Forms.Form.ShowDialog()

 

is the error message, but i don't understand why it says NullReferenceException. The buttons are visible and enabled, and they work... they are "global" so the function (btw it's the mouseclick event of one of these buttons) should be able to remove them.

Can anyone tell me if the remove function works, or isn't it possible to remove buttons?

Share this post


Link to post
Share on other sites
_Charger_
Hello. I'm in really deep water with this and I have no knowledge of coding what so ever!

 

The only reason I started was because I could not find one single mod/script that did what I wanted. Basically, all I want is when I fire my silenced gun in the game, it won't attract much attention, if none. Especially if you are alone and you kill a cop you shouldn't get chased by everyone because there was no witnesses etc.

 

I have no idea if that's even possible but I gave it a shot and this is what I came up with:

 

If Player.isShooting.DesertEagle = True Then (I have replaced the eagle with a silenced gun)

 

Player.IgnoredByEveryone = True

 

The first line is something I just came up with because I could not find anything better.

 

I would really like some big help with this and I will forever be in your debt if you get something like this working!

it would be possible, but u have to make a check for it (it must be a backgroudn thread or a function called by timer) and then checking if shooting, but people should only ignore the shot, not the player completly

Share this post


Link to post
Share on other sites
The Great

@HazardX

 

I have a problem when i start GTA IV there written msvcr100.dll is missing and i install msvcr100.dll at C:\Windows\System32 and i start GTA 4 but another problem came but i will give the photo here is ituser posted image

Share this post


Link to post
Share on other sites
_Charger_
hi i have a problem... i wanna remove buttons with
this.Controls.Remove()

but it doesn't work...

 

 

2012-08-05 17:37:46 - Error during Form.ShowDialog:                     System.NullReferenceException: Object reference not set to an instance of an object.                        at GTA.Forms.Control.get_Controls()                        at GTA.Forms.Control.set_Parent(Control value)                        at GTA.Forms.ControlCollection.Remove(Control item)                        at IV_SA_Tuning_Garage.GarageUI.neonOffBtn_Click(Object sender, MouseEventArgs e)                        at GTA.Forms.Control.raise_Click(Object value0, MouseEventArgs value1)                        at GTA.Forms.Button.OnClick(MouseEventArgs e)                        at GTA.Forms.FormHost.TriggerMouseUp(MouseEventArgs e)                        at GTA.Script.ProcessEvents()                        at GTA.Forms.Form.ShowDialog()

 

is the error message, but i don't understand why it says NullReferenceException. The buttons are visible and enabled, and they work... they are "global" so the function (btw it's the mouseclick event of one of these buttons) should be able to remove them.

Can anyone tell me if the remove function works, or isn't it possible to remove buttons?

i found a solution myself. this function is definetly buggy, but with

 

try{this.Controls.Remove(*item*);}catch (Exception e) { }

it worked...

Share this post


Link to post
Share on other sites
carcols.dat

Any way to reload a single script?

Share this post


Link to post
Share on other sites
kmccmk9
Hello. I'm in really deep water with this and I have no knowledge of coding what so ever!

 

The only reason I started was because I could not find one single mod/script that did what I wanted. Basically, all I want is when I fire my silenced gun in the game, it won't attract much attention, if none. Especially if you are alone and you kill a cop you shouldn't get chased by everyone because there was no witnesses etc.

 

I have no idea if that's even possible but I gave it a shot and this is what I came up with:

 

If Player.isShooting.DesertEagle = True Then (I have replaced the eagle with a silenced gun)

 

Player.IgnoredByEveryone = True

 

The first line is something I just came up with because I could not find anything better.

 

I would really like some big help with this and I will forever be in your debt if you get something like this working!

I can look into it.

Share this post


Link to post
Share on other sites
carcols.dat
Any way to reload a single script?

Anyone? Even if it's just a line that I can add into a script that resets it.

Share this post


Link to post
Share on other sites
CrazyRaisin

Every time I try to connect to the download site it wont work, always get

 

 

Oops! Google Chrome could not connect to dl.hazardx.com

 

Share this post


Link to post
Share on other sites
thaCURSEDpie

EDIT:

Below post is probably irrelevant since I've already spoken with some competent people. None of whom can think of a fix at the moment. Too bad.

 

 

 

Since everyone in #gtaivnetscripthook seems afk I'll ask the question here.

 

I'm building a function-hooking module. It's got an unmanaged base which does all the actually dirty work (patching in jmp's and the like). Then there's the .Net part which can 'register' with the unmanaged part. This part is meant to act as an intermediate to allow end-developers (in .Net) to not have to deal with the unmanaged base. The intermediate exposes methods which allow .Net code to register detour methods.

 

So, say a hooked function is called (Let's take CPlayerChar::SetCharHealth as an example. If you don't agree with the naming, then too bad tounge.gif):

 

Flow of execution would be:

Game -> C++ module -> .Net intermediate -> .Net registered detours

 

So in our case we luckily have the .Net scripthook, which we can use to host the registered detour methods. I made a test class:

 

// Delegatespublic delegate void Del_CPlayerChar_AddCharHealth(IntPtr CharInstance, int Instance, float amount);public delegate void Del_CPlayerChar_SetCharHealth(IntPtr CharInstance, float amount, int unkInt);public class Example : GTA.Script   {       private Del_CPlayerChar_AddCharHealth AddCharHealthDetour_Del;       private Del_CPlayerChar_SetCharHealth SetCharHealthDetour_Del;       private HookIntermediate hi;              // Constructor       public Example()       {           this.AddCharHealthDetour_Del = new Del_CPlayerChar_AddCharHealth(this.CPlayerChar_AddCharHealthDetour);           this.SetCharHealthDetour_Del = new Del_CPlayerChar_SetCharHealth(this.CPlayerChar_SetCharHealthDetour);           // We get a reference to the HookIntermediate instance           this.hi = HookIntermediate.Get();           // We register our detour. This works out fine.           int retVal = hi.RegisterDetour("CPlayerChar::AddCharHealth", this.AddCharHealthDetour_Del);       }       private void CPlayerChar_SetCharHealthDetour(IntPtr CharInstance, float amount, int unkInt)       {           // This function is then called when the hooked function is called. The values are all correct, but the game hangs when the next line is executed:           Game.Console.Print("Player health set to: " + amount.ToString());       }   }

 

 

When the detour method is called, everything works out *until* the moment a .net scripthook method is called (for example: Game.Console.Print() ). It seems it's not possible to call these methods from a different thread than the script-thread. Is this true?

 

The HookIntermediate is initialized (if it not yet exists) in the Get() method, so we are also always in the same AppDomain as the .net scripthook (SHDN_ScriptDomain wink.gif, yes, I've checked).

 

So the question is: how should I deal with this? Is there really no way to call for example Game.Console.Print() from any other thread?

Edited by thaCURSEDpie

Share this post


Link to post
Share on other sites
Sunnyak

@HazardX

Plz Help me !! after installing Your Dot net Scripthook when i launch GTA 4, It says MSVCR 100.dll is missing or not design to run .......

 

Share this post


Link to post
Share on other sites
Sunnyak

@HazardX

i have a problem when i launch the Game it says MSVCR 100.dll is missing or not design to run ............. ??? plz HElp Me sad.gif

 

Share this post


Link to post
Share on other sites
mj3150

 

 

If you get a "MSVCR100.dll not found" error:

Try installing the Microsoft Visual C++ 2010 Redistributable Package! Make sure to install the linked x86 version, even on x64 systems!

 

or just go to google and download the file and put it into the gta main folder

Share this post


Link to post
Share on other sites
motorsport71

hey all, i have a question. i've written a script that saves info to an ini when i exit the mod, and loads that info when restarted. the problem i'm having is it will only write to the ini once. if i reloadscripts it will overwrite it once. i'm using!

settings.load() and settings.getvalueinteger

and to write the

value

settings.setvalue

 

is there a command to allow it to overwrite it without needing to restart the script?

Share this post


Link to post
Share on other sites
ch3y3zze

@motorsport

 

Maybe don't use gta settings class and handle everything manually using stream classes from system.io, I haven't researched your issue but maybe that will give u more control wink.gif

Share this post


Link to post
Share on other sites
gtaivEflc

Hello everybody!

 

I've found a bug or something like this..

There is no information about GET_STATE_OF_CLOSEST_DOOR_OF_TYPE native function, so I opened some .sco scripts and saw something like this:

GET_STATE_OF_CLOSEST_DOOR_OF_TYPE( iVar5, vVar6[0], ref uVar3, ref uVar4 ); (ray6.sco)

So, iVar5 is model hash, vVar6 is door location (Vector3),

ref uVar3 is locked/unlocked, ref uVar4 is door rotation angle.

The problem is -- uVar3 and uVar4 are ref.

GTA.Native.Function.Call("GET_STATE_OF_CLOSEST_DOOR_OF_TYPE", model.Hash, location.X, location.Y, location.Z, ref locked, ref angle) is incorrect!

Parameter can't be 'ref'.

Please solve this problem!

Edited by gtaivEflc

Share this post


Link to post
Share on other sites
pedro2555
Any way to reload a single script?

Anyone? Even if it's just a line that I can add into a script that resets it.

You can always use

 

 

 try {     // code }catch (Exception E) {    // maybe send the error to the console }

 

 

to avoid script stoping on error.

Share this post


Link to post
Share on other sites
Max4X

Hi everyone!

Does anybody know what all these errors mean in my ScriptHookDotNet log file? I don't know why but net scripts don't work in my game (1.0.0.4). I have everything installed for it including .net framework 4.

Here is my log:

 

2012-09-30 22:44:14 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.0.4 with C++ Hook version 0.4.0)2012-09-30 22:44:14 - WARNING: Your C++ ScriptHook version 0.4.0 and GTA IV version 1.0.0.4 are NOT known to be compatible! Use C++ ScriptHook version 0.5.1 or the newest version of the game AND the C++ ScriptHook instead!2012-09-30 22:44:45 - Direct3D device created!2012-09-30 22:44:45 - Error during ScriptDomain.Create:                     System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.                        at GTA.RemoteScriptDomain..ctor()                        --- End of inner exception stack trace ---                        at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)                        at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)                        at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)                        at System.Activator.CreateInstance(Type type, Boolean nonPublic)                        at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)                        at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)                        at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)                        at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)                        at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)                        at GTA.ScriptDomain.Create()2012-09-30 22:44:45 -  -> InnerException:                     System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.                        at GTA.RemoteScriptDomain..ctor()2012-09-30 22:44:45 - INFO: Phone number checks are not available!2012-09-30 22:47:41 - Direct3D device lost!

 

 

So is there any errors which could stop running the scripts?

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.
Note: Your post will require moderator approval before it will be visible.

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.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.