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 Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. 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. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

      1. St Andrews Cathedral
    3. GTA V

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

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    9. GTA Vice City

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

      1. Guides & Strategies
      2. Help & Support
    11. 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. DYOM
      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

RomerJon17
I have a big problem with the Scriptdotnet

 

It always crashes when loading the game...

 

Here are the codes:

 

 

2011-05-15 17:50:53 - CRASH!2011-05-15 17:50:53 - Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.                     File name: 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'                        at 0.LCPDFR-Obfuscated-6.1()                        at 0.LCPDFR-Obfuscated-6.0(Object A_0)                        at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)                        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)                        at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()                        at System.Threading.ThreadPoolWorkQueue.Dispatch()                        at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()                                          WRN: Assembly binding logging is turned OFF.                     To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.                     Note: There is some performance penalty associated with assembly bind failure logging.                     To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].                     2011-05-15 17:50:53 - CRASH!

 

You should really read the instructions for lcpdfr and install the full version of the .NET Framework 4, found here:

http://www.microsoft.com/downloads/en/deta...9f-b21f31ab88b7

I red all the instructions...

BUt I think that C++ was causing the problem...

Thanks smile.gif

Share this post


Link to post
Share on other sites
notspectre

You realise that C++ has nothing to do with System.Web, right? It's caused by you only having the client profile version of the .NET Framework 4, and not the full version.

Share this post


Link to post
Share on other sites
RomerJon17

Still causing the crash tounge.gif

I installed everything what you said tounge.gif But here all the codes u understand...

Sorry about that mate...

 

2011-05-15 17:49:50 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.7.0 with C++ Hook version 0.5.1)2011-05-15 17:50:47 - Direct3D device created!2011-05-15 17:50:49 - SEARCHING FOR SCRIPTS...2011-05-15 17:50:49 - Loading scripts in Assembly 'scripts\FirePatrol.net.dll' ...2011-05-15 17:50:49 -  ...found script 'emergencyscript.emergency'!2011-05-15 17:50:49 - Loading scripts in Assembly 'scripts\FirstResponse.net.dll' ...2011-05-15 17:50:49 -  ...found script '0.LCPDFR-Obfuscated-13'!2011-05-15 17:50:49 -  ...found script '0.LCPDFR-Obfuscated-5'!2011-05-15 17:50:49 -  ...found script '0.LCPDFR-Obfuscated-16'!2011-05-15 17:50:49 -  ...found script '0.LCPDFR-Obfuscated-1'!2011-05-15 17:50:49 -  ...found script '0.3.LCPDFR-Obfuscated-0'!2011-05-15 17:50:49 -  ...found script '0.3.LCPDFR-Obfuscated-1'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-8'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-14'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-9'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-11'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-10'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-13'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-2'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-4'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-15'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-3'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-12'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-6'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-5'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-0'!2011-05-15 17:50:49 -  ...found script '0.1.LCPDFR-Obfuscated-7'!2011-05-15 17:50:49 -  ...found script '1.0.LCPDFR-Obfuscated-0'!2011-05-15 17:50:49 -  ...found script '0.2.LCPDFR-Obfuscated-1'!2011-05-15 17:50:49 -  ...found script '0.2.LCPDFR-Obfuscated-0'!2011-05-15 17:50:49 - Loading scripts in Assembly 'scripts\gkFuelMod.net.dll' ...2011-05-15 17:50:49 -  ...found script 'gkFuelMod.fuelMod'!2011-05-15 17:50:49 - Loading scripts in Assembly 'scripts\LessOvertake.net.dll' ...2011-05-15 17:50:49 -  ...found script 'trafficruleCS.lessovertake'!2011-05-15 17:50:49 - DONE! 27 valid scripts found!2011-05-15 17:50:49 - STARTING SCRIPTS...2011-05-15 17:50:49 - INFO: Phone number checks are not available!2011-05-15 17:50:50 -  ...successfully started script 'trafficruleCS.lessovertake'!2011-05-15 17:50:50 -  ...successfully started script 'gkFuelMod.fuelMod'!2011-05-15 17:50:53 -  ...successfully started script '0.2.LCPDFR-Obfuscated-0'!2011-05-15 17:50:53 -  ...successfully started script '0.2.LCPDFR-Obfuscated-1'!2011-05-15 17:50:53 -  ...successfully started script '1.0.LCPDFR-Obfuscated-0'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-7'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-0'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-5'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-6'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-12'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-3'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-15'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-4'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-2'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-13'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-10'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-11'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-9'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-14'!2011-05-15 17:50:53 -  ...successfully started script '0.1.LCPDFR-Obfuscated-8'!2011-05-15 17:50:53 -  ...successfully started script '0.3.LCPDFR-Obfuscated-1'!2011-05-15 17:50:53 -  ...successfully started script '0.3.LCPDFR-Obfuscated-0'!2011-05-15 17:50:53 -  ...successfully started script '0.LCPDFR-Obfuscated-1'!2011-05-15 17:50:53 -  ...successfully started script '0.LCPDFR-Obfuscated-16'!2011-05-15 17:50:53 -  ...successfully started script '0.LCPDFR-Obfuscated-5'!2011-05-15 17:50:53 -  ...successfully started script '0.LCPDFR-Obfuscated-13'!2011-05-15 17:50:53 -  ...successfully started script 'emergencyscript.emergency'!2011-05-15 17:50:53 - Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.                     File name: 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'                        at 0.LCPDFR-Obfuscated-6.1()                        at 0.LCPDFR-Obfuscated-6.0(Object A_0)                        at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)                        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)                        at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()                        at System.Threading.ThreadPoolWorkQueue.Dispatch()                        at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()                                          WRN: Assembly binding logging is turned OFF.                     To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.                     Note: There is some performance penalty associated with assembly bind failure logging.                     To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].                     2011-05-15 17:50:53 - CRASH!2011-05-15 17:50:53 - Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.                     File name: 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'                        at 0.LCPDFR-Obfuscated-6.1()                        at 0.LCPDFR-Obfuscated-6.0(Object A_0)                        at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)                        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)                        at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()                        at System.Threading.ThreadPoolWorkQueue.Dispatch()                        at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()                                          WRN: Assembly binding logging is turned OFF.                     To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.                     Note: There is some performance penalty associated with assembly bind failure logging.                     To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].                     2011-05-15 17:50:53 - CRASH!

 

Share this post


Link to post
Share on other sites
ikt

The rotation values in GTA IV, what are they in? Degrees? Radians? Percents?

Also, in the world, what's are the axes?

 

North/South = x

West/East = z

Up/Down = y

 

according to addforcetoplayer, but the ingame location thing displays something else.

 

HNNNNG.

Share this post


Link to post
Share on other sites
untrackable

There is my code

 

...  public void Flee()  {      targetedDriver.Task.DriveTo(vector, 70F, false);  }...

 

When I use this method then targeted car is fleeing, but when I turn my sirens on it stops. I want to make he not react to sirens and just fleeing all time.

 

I tried this way

 

  Start_Flee()  {      this.Tick += new EventHandler(Flee_Tick);  }  public void Flee_Tick(object Sender, EventArgs e)  {      targetedDriver.Task.DriveTo(vector, 70F, false);  }

 

This way working but when car is further away from me about 30~40 units I've got exception "GTA.NonExistingObjectException: Invalid call to an object that doesn't exist anymore!".

 

The question is: how make car to just fleeing and didn't react to anything?

Share this post


Link to post
Share on other sites
motorsport71

@untrackable

 

I don't know if this helps, but i wrote this in .vb. It takes all the drivers in the set vector and tells them to go the set randomxy coordinates, at 30mph, not obeying traffic laws. the player is also not affected while driving.

use "If exists(ped)" equivilent so if the tick can't find the object it doesn't throw out the exception.

 

 

Private Sub PanicTraffic_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick       Me.interval = 1453       Dim vehicles As vehicle() = world.getvehicles(player.character.GetOffsetPosition(New Vector3(0.0F, 8.0F, 0.0F)), 55.0F)       For Each vehicle As Vehicle In vehicles           If exists(vehicle) Then               Dim ped As Ped = vehicle.getpedonseat(vehicleseat.Driver)               If exists(ped) AndAlso ped.isrequiredformission = False AndAlso Ped.RelationshipGroup = RelationshipGroup.Player = False Then                   ped.Task.DriveTo(Vector3.randomxy, 30.0, False)                   ped.nolongerneeded()

 

hope that helps.

Edited by motorsport71

Share this post


Link to post
Share on other sites
Gravarty

damn this doesn't work, and yes I installed C++ and .NET 4

Edited by countergame

Share this post


Link to post
Share on other sites
sjaak327
This is so sh*t! THis doesn't work anymore, i installed all needed Programs AND IT DOESN'T WORK, it doesn't work on other pc, nowhere, is this a totally fake now, or you just did something wrong? I think you did something wrong!

judging from a lot of posts before yours, this does wok. Why do people always assume it's the mod instead of a local configuration issue ? Make sure you have installed the c++ redist and .net 4.0

Share this post


Link to post
Share on other sites
creat3d22
This is so sh*t! THis doesn't work anymore, i installed all needed Programs AND IT DOESN'T WORK, it doesn't work on other pc, nowhere, is this a totally fake now, or you just did something wrong? I think you did something wrong!

Since it works for everyone else, I'm pretty sure you did something wrong.

Share this post


Link to post
Share on other sites
Exxon

I get this error, any help?

 

 

2011-05-27 18:16:41 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.4.0 with C++ Hook version 0.4.0)2011-05-27 18:17:49 - Direct3D device created!2011-05-27 18:17:50 - SEARCHING FOR SCRIPTS...2011-05-27 18:17:50 - Loading scripts in Assembly 'scripts\moveDoors.net.dll' ...2011-05-27 18:17:50 -  ...found script 'Test.EPM0'!2011-05-27 18:17:50 -  ...found script 'Test.ButtonTest'!2011-05-27 18:17:50 -  ...found script 'Test.EPM5'!2011-05-27 18:17:50 -  ...found script 'Test.EPM4'!2011-05-27 18:17:50 -  ...found script 'Test.EPM3'!2011-05-27 18:17:50 -  ...found script 'Test.EPM2'!2011-05-27 18:17:50 -  ...found script 'Test.EPM1'!2011-05-27 18:17:50 - DONE! 7 valid scripts found!2011-05-27 18:17:50 - STARTING SCRIPTS...2011-05-27 18:17:50 - INFO: Phone number checks are not available!2011-05-27 18:17:50 -  ...successfully started script 'Test.EPM1'!2011-05-27 18:17:50 -  ...successfully started script 'Test.EPM2'!2011-05-27 18:17:50 -  ...successfully started script 'Test.EPM3'!2011-05-27 18:17:50 -  ...successfully started script 'Test.EPM4'!2011-05-27 18:17:50 -  ...successfully started script 'Test.EPM5'!2011-05-27 18:17:50 -  ...successfully started script 'Test.ButtonTest'!2011-05-27 18:17:50 -  ...successfully started script 'Test.EPM0'!2011-05-27 18:18:13 - Error during Tick in script 'Test.EPM1':                     System.IndexOutOfRangeException: Index was outside the bounds of the array.                        at Test.EPM1.GetLightsOnOff_Tick(Object sender, EventArgs e)                        at System.EventHandler.Invoke(Object sender, EventArgs e)                        at GTA.Script.TryTick()                        at GTA.Script.DoTick()                        at GTA.ScriptThread.OnTick()2011-05-27 18:18:13 - Error during Tick in script 'Test.EPM2':                     System.IndexOutOfRangeException: Index was outside the bounds of the array.                        at Test.EPM2.GetLightsOnOff_Tick(Object sender, EventArgs e)                        at System.EventHandler.Invoke(Object sender, EventArgs e)                        at GTA.Script.TryTick()                        at GTA.Script.DoTick()                        at GTA.ScriptThread.OnTick()2011-05-27 18:18:13 - Error during Tick in script 'Test.EPM3':                     System.IndexOutOfRangeException: Index was outside the bounds of the array.                        at Test.EPM3.GetLightsOnOff_Tick(Object sender, EventArgs e)                        at System.EventHandler.Invoke(Object sender, EventArgs e)                        at GTA.Script.TryTick()                        at GTA.Script.DoTick()                        at GTA.ScriptThread.OnTick()2011-05-27 18:18:13 - Error during Tick in script 'Test.EPM4':                     System.IndexOutOfRangeException: Index was outside the bounds of the array.                        at Test.EPM4.GetLightsOnOff_Tick(Object sender, EventArgs e)                        at System.EventHandler.Invoke(Object sender, EventArgs e)                        at GTA.Script.TryTick()                        at GTA.Script.DoTick()                        at GTA.ScriptThread.OnTick()2011-05-27 18:18:13 - Error during Tick in script 'Test.EPM5':                     System.IndexOutOfRangeException: Index was outside the bounds of the array.                        at Test.EPM5.GetLightsOnOff_Tick(Object sender, EventArgs e)                        at System.EventHandler.Invoke(Object sender, EventArgs e)                        at GTA.Script.TryTick()                        at GTA.Script.DoTick()                        at GTA.ScriptThread.OnTick()2011-05-27 18:18:13 - Error during Tick in script 'Test.EPM0':                     System.IndexOutOfRangeException: Index was outside the bounds of the array.                        at Test.EPM0.GetLightsOnOff_Tick(Object sender, EventArgs e)                        at System.EventHandler.Invoke(Object sender, EventArgs e)                        at GTA.Script.TryTick()                        at GTA.Script.DoTick()                        at GTA.ScriptThread.OnTick()

 

Share this post


Link to post
Share on other sites
tomsteel1

Whenver i use this Scripthook.dll with no scripts and with scripts it GTA always crashes the second the game fully loads, any help, i dont have this problem without the scripthook.

 

Im running Patch 1.0.4.0 retail and using Xliveless.dll my specs are in my sig

Share this post


Link to post
Share on other sites
MulleDK19

 

Whenver i use this Scripthook.dll with no scripts and with scripts it GTA always crashes the second the game fully loads, any help, i dont have this problem without the scripthook.

 

Im running Patch 1.0.4.0 retail and using Xliveless.dll my specs are in my sig

 

Read the topic:

 

If you get crashes and are using GTA IV version 1.0.4.0 or older, try to install this older version of the C++ ScriptHook, which works fine with the current .Net ScriptHook.
Edited by MulleDK19

Share this post


Link to post
Share on other sites
tomsteel1
Whenver i use this Scripthook.dll with no scripts and with scripts it GTA always crashes the second the game fully loads, any help, i dont have this problem without the scripthook.

 

Im running Patch 1.0.4.0 retail and using Xliveless.dll my specs are in my sig

 

Read the topic:

 

If you get crashes and are using GTA IV version 1.0.4.0 or older, try to install this older version of the C++ ScriptHook, which works fine with the current .Net ScriptHook.

yh i installed, it didnt crash but the the scripthook didnt even load, plus that website is down so i searched for the file on google

Share this post


Link to post
Share on other sites
Gravarty

i installed C++ and .NET 4, but it still doesn't work. I don't know why it doesn't work, so it can't by my fault

Share this post


Link to post
Share on other sites
nonamehero
i installed C++ and .NET 4, but it still doesn't work. I don't know why it doesn't work, so it can't by my fault

Well it works for everyone else. So yeah, whatever, it can't be your fault. bored.gif

Share this post


Link to post
Share on other sites
MulleDK19
i installed C++ and .NET 4, but it still doesn't work. I don't know why it doesn't work, so it can't by my fault

Make sure you installed the C++ Runtime 2010 and .NET 4.0 FULL, not just the Client Profile.

 

 

If that doesn't work, update your game to 1.0.7.0. No excuse not to, really.

Share this post


Link to post
Share on other sites
lindsayslorach

Hey guys, is there anyway to keep doing something while a GTA.Forms.Button is held down? I'm trying to get an object to move while the button is pressed, but I cant figure it out.

 

I've tried the button's MouseDown event, but it does the same as the Click event.

 

Any help is appreciated, thanks.

Share this post


Link to post
Share on other sites
Donny78

Find my 'Parking' thread in the showroom (coding), it has click events which move vehicle doors etc so you could use the same code to move your object.

 

It's open sourced, you are free to use any of the code dude.

Share this post


Link to post
Share on other sites
lindsayslorach

I had a look in the showroom, and it seems the source for your script is offline (both links). I think it was the right thread? > http://www.gtaforums.com/index.php?showtopic=458692

 

Also, by your answer, it sounds like your buttons do something when you click them, what I need is to have some code repeat while the button is pressed. I may have got mixed messages from your post, thought.

Edited by lindsayslorach

Share this post


Link to post
Share on other sites
MulleDK19
I had a look in the showroom, and it seems the source for your script is offline (both links). I think it was the right thread? > http://www.gtaforums.com/index.php?showtopic=458692

 

Also, by your answer, it sounds like your buttons do something when you click them, what I need is to have some code repeat while the button is pressed. I may have got mixed messages from your post, thought.

Use a timer or a thread, then start the timer or create the thread on MouseDown, and stop the timer or terminate the thread on MouseUp.

 

The timer or thread does the movement.

 

 

Join the IRC channel in my sig if you need live help.

Share this post


Link to post
Share on other sites
Donny78

 

I had a look in the showroom, and it seems the source for your script is offline (both links). I think it was the right thread? > http://www.gtaforums.com/index.php?showtopic=458692

 

Also, by your answer, it sounds like your buttons do something when you click them, what I need is to have some code repeat while the button is pressed. I may have got mixed messages from your post, thought.

Yes it seems as it is gone, annoying.

 

I've got no scripts currently as my HDD failed so all my work is gone so I can't pull up a backup but it did indeed work as you thought, I thought that's what you were asking for but now I understand you weren't so no worries.

 

Edit:

 

A post was made before this on the previous page that answered your post, in case you miss it I thought I'd say so.

Share this post


Link to post
Share on other sites
iriedreadlock23

I have a simple question. How could I get vehicle handle from GTA.Vehicle class? I need an Integer value, that is returned originally by GET_CLOSEST_CAR for example. I was always wondering why can't we directly access Handle property in Ped and Vehicle classes. I found out that GTA.Vehicle class inherits GTA.base.HandleObject, including GetHashCode() function, which returns pHandle property from its HandleObject. Is this the handle I need?

 

Hopefully someday Scripthookdotnet will provide more freedom in accessing CPed and CVehicle classes (reading voice from ped, or steering wheel/gas position from cars). Aswell as Pool access for Tasks, etc.

 

Thanks.

Share this post


Link to post
Share on other sites
lindsayslorach
A post was made before this on the previous page that answered your post, in case you miss it I thought I'd say so.

Yeah, thanks for your help tounge.gif Now I'm using timers to move my objects.

Share this post


Link to post
Share on other sites
MulleDK19

 

I have a simple question. How could I get vehicle handle from GTA.Vehicle class? I need an Integer value, that is returned originally by GET_CLOSEST_CAR for example. I was always wondering why can't we directly access Handle property in Ped and Vehicle classes. I found out that GTA.Vehicle class inherits GTA.base.HandleObject, including GetHashCode() function, which returns pHandle property from its HandleObject. Is this the handle I need?

 

Hopefully someday Scripthookdotnet will provide more freedom in accessing CPed and CVehicle classes (reading voice from ped, or steering wheel/gas position from cars). Aswell as Pool access for Tasks, etc.

 

Thanks.

This is .NET. You can easily manipulate other assemblies beyond their intention. Eg, call private, protected or internal methods from an external assembly, or even change or read private, protected or internal fields, like an integer.

 

 

I just put this method together for you. My graphics card is dead at the moment, so I have no way to test it. But it should work just fine.

 

Add "using System.Reflection;" at the top of your class file.

 

private int GetVehicleHandle(Vehicle vehicle){   FieldInfo fi = typeof(Vehicle).BaseType.GetField("pHandle", BindingFlags.Instance | BindingFlags.NonPublic);   if (fi == null)       return -1;   int pHandleValue = (int)fi.GetValue(vehicle);   return pHandleValue;}

 

 

 

Now, read my signature:

 

 

 

 

 

Edited by MulleDK19

Share this post


Link to post
Share on other sites
iriedreadlock23

MulleDK, you're the man. I was trying to access properties with CallByName method, which unfortunately works only for public members. You were very helpful. Thank you very much!

Share this post


Link to post
Share on other sites
odiomoratti

sorry wrong thread.

Edited by odiomoratti

Share this post


Link to post
Share on other sites
noczh

i have a problem like that ,can you help me fix it?

 

 

ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.4.0 with C++ Hook version 0.4.0

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()

Share this post


Link to post
Share on other sites
MulleDK19

 

i have a problem like that ,can you help me fix it?

 

 

ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.4.0 with C++ Hook version 0.4.0

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()

Just a side node: If you're using a cracked GTAIV.exe, forget it.

 

 

 

 

 

 

Does anyone know the offset of the Wheel class?

Edited by MulleDK19

Share this post


Link to post
Share on other sites
vici30

It crashes my game sad.gif I tried every game version and every scripthook version and I have the framework and all that stuff installed

Share this post


Link to post
Share on other sites
MulleDK19

 

It crashes my game sad.gif I tried every game version and every scripthook version and I have the framework and all that stuff installed

What does the log files say? ScriptHook.log and ScriptHookDotNet.log

 

 

 

 

 

Btw, HazardX, LMS, and whoever's working on the hook.

 

My mod is doing a lot of stuff, and I have lots of classes and timers, and whatnot, and it works fine. For a period of time.

 

Then I get a "The application has stopped working" thingy, and if I press Debug, it says that a .NET Framework exception occurred in EFLC.exe.

 

However, it's not in my script, so I'm suspecting there's some unhandled exception somewhere in the ScriptHook, however, I haven't found a way to pinpoint it yet.

 

user posted image

Edited by MulleDK19

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.