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. Los Santos Summer Special
      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

Sign in to follow this  
Maro Hannover

[HELP]Assembly Keybind Logging

Recommended Posts

Maro Hannover

i Have re-installed GTA IV but now i got an issue with my mod. Here is the Scripthooknet log

014-06-10 23:00:08 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.7.0 with C++ Hook version 0.5.1)2014-06-10 23:01:43 - Direct3D device created!2014-06-10 23:01:43 - SEARCHING FOR SCRIPTS...2014-06-10 23:01:43 - Loading scripts in Assembly 'scripts\ChoirMusic.net.dll' ...2014-06-10 23:01:43 -  ...found script 'ChoirMusic.Choir'!2014-06-10 23:01:43 - DONE! 1 valid scripts found!2014-06-10 23:01:43 - STARTING SCRIPTS...2014-06-10 23:01:43 - INFO: Phone number checks are not available!2014-06-10 23:01:43 -  ...successfully started script 'ChoirMusic.Choir'!2014-06-10 23:01:48 - Error during Tick in script 'ChoirMusic.Choir':                      System.IO.FileNotFoundException: Could not load file or assembly 'NAudio, Version=1.7.0.15, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.                      File name: 'NAudio, Version=1.7.0.15, Culture=neutral, PublicKeyToken=null'                         at ChoirMusic.Choir.tickEvent(Object sender, EventArgs e)                         at GTA.Script.TryTick()                         at GTA.Script.DoTick()                         at GTA.ScriptThread.OnTick()                                            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].                      2014-06-10 23:01:58 - Direct3D device lost!

Here is my Code

using System;using System.Collections.Generic;using System.Linq;using System.Text;using GTA;using NAudio;using NAudio.WindowsMediaFormat;namespace ChoirMusic{    public class Choir : GTA.Script    {        public Choir()        {            this.Interval = 5000;            this.Tick += new EventHandler(tickEvent);        }           public void tickEvent(object sender, EventArgs e)           {            NAudio.Wave.WaveFileReader s = new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav");            NAudio.Wave.WaveChannel32 wc = new NAudio.Wave.WaveChannel32(new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav"));            NAudio.Wave.DirectSoundOut player = new NAudio.Wave.DirectSoundOut();            if(Player.Character.Health < 25)            {                player.Init(wc);                player.Play();            }            if (Player.Character.Health > 25)            {                player.Stop();                player.Dispose();            }        }    }}

Share this post


Link to post
Share on other sites
stef538

you need the naudio.dll file. Naudio.codeplex.com

 

Then, unzip it to a folder of your choice. Copy and paste NAudio.dll into your GTA4 root folder.

Edited by stef538
  • Like 1

Share this post


Link to post
Share on other sites
Maro Hannover

you need the naudio.dll file. Naudio.codeplex.com

 

Then, unzip it to a folder of your choice. Copy and paste NAudio.dll into your GTA4 root folder.

Thank you very much Helped

  • Like 1

Share this post


Link to post
Share on other sites
Rugz007

I got to admit this was funny

Share this post


Link to post
Share on other sites
LordOfTheBongs

u do realize that if your health is below 25 every 5 seconds u create new NAudio objects without disposing the objects created in the previous call to your tick method??

 

since u create a new NAudio objects every tick, then dispose it every tick or only create it once and don't dispose it. You look to be creating a memory leak.

 

If u exit the tick method without disposing the created NAudio objects then u will lose reference to those objects in memory and wont be able to dispose them... so u will have NAudio stuff sitting in memory that will never get used again.

Edited by LordOfTheBongs

Share this post


Link to post
Share on other sites
Jitnaught

 

i Have re-installed GTA IV but now i got an issue with my mod. Here is the Scripthooknet log

014-06-10 23:00:08 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.7.0 with C++ Hook version 0.5.1)2014-06-10 23:01:43 - Direct3D device created!2014-06-10 23:01:43 - SEARCHING FOR SCRIPTS...2014-06-10 23:01:43 - Loading scripts in Assembly 'scripts\ChoirMusic.net.dll' ...2014-06-10 23:01:43 -  ...found script 'ChoirMusic.Choir'!2014-06-10 23:01:43 - DONE! 1 valid scripts found!2014-06-10 23:01:43 - STARTING SCRIPTS...2014-06-10 23:01:43 - INFO: Phone number checks are not available!2014-06-10 23:01:43 -  ...successfully started script 'ChoirMusic.Choir'!2014-06-10 23:01:48 - Error during Tick in script 'ChoirMusic.Choir':                      System.IO.FileNotFoundException: Could not load file or assembly 'NAudio, Version=1.7.0.15, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.                      File name: 'NAudio, Version=1.7.0.15, Culture=neutral, PublicKeyToken=null'                         at ChoirMusic.Choir.tickEvent(Object sender, EventArgs e)                         at GTA.Script.TryTick()                         at GTA.Script.DoTick()                         at GTA.ScriptThread.OnTick()                                            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].                      2014-06-10 23:01:58 - Direct3D device lost!

Here is my Code

using System;using System.Collections.Generic;using System.Linq;using System.Text;using GTA;using NAudio;using NAudio.WindowsMediaFormat;namespace ChoirMusic{    public class Choir : GTA.Script    {        public Choir()        {            this.Interval = 5000;            this.Tick += new EventHandler(tickEvent);        }           public void tickEvent(object sender, EventArgs e)           {            NAudio.Wave.WaveFileReader s = new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav");            NAudio.Wave.WaveChannel32 wc = new NAudio.Wave.WaveChannel32(new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav"));            NAudio.Wave.DirectSoundOut player = new NAudio.Wave.DirectSoundOut();            if(Player.Character.Health < 25)            {                player.Init(wc);                player.Play();            }            if (Player.Character.Health > 25)            {                player.Stop();                player.Dispose();            }        }    }}

 

u do realize that if your health is below 25 every 5 seconds u create new NAudio objects without disposing the previous object created in the previous call to your tick method??

 

since u create a new one every tick, then dispose it every tick or only create it once and don't dispose it. You look to be creating a memory leak.

 

If u exit the tick method without disposing the created NAudio objects then u will lose reference to those objects in memory and wont be able to dispose them... so u will have NAudio stuff sitting in memory that will never get used again.

 

 

Maybe a little more like this?

using System;using System.Collections.Generic;using System.Linq;using System.Text;using GTA;using NAudio;using NAudio.WindowsMediaFormat;namespace ChoirMusic{    public class Choir : GTA.Script    {		NAudio.Wave.WaveFileReader s;		NAudio.Wave.WaveChannel32 wc;		NAudio.Wave.DirectSoundOut player;	        public Choir()        {			s = new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav");            wc = new NAudio.Wave.WaveChannel32(new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav"));            player = new NAudio.Wave.DirectSoundOut();		            this.Interval = 5000;            this.Tick += new EventHandler(tickEvent);        }           public void tickEvent(object sender, EventArgs e)           {                        if(Player.Character.Health < 25)            {                player.Init(wc);                player.Play();            }            if (Player.Character.Health > 25)            {                player.Stop();                player.Dispose();            }        }    }}

Share this post


Link to post
Share on other sites
Maro Hannover

Thank you Letsplyordy

Share this post


Link to post
Share on other sites
LordOfTheBongs

@LetsPlayOrDy

 

Close ;)

 

Remove the line that disposes the objects since u wont be creating new ones... only play and stop ;)

 

put player.Init(wc); in the constructor too

Edited by LordOfTheBongs
  • Like 1

Share this post


Link to post
Share on other sites
Jitnaught

I wasn't trying to make it perfect. Maro is supposed to be doing that lol

  • Like 1

Share this post


Link to post
Share on other sites
Maro Hannover

I wasn't trying to make it perfect. Maro is supposed to be doing that lol

LOL.

OdE20Z0.gif

 

But What do you Mean?

 

DbnRNG3.jpg

Share this post


Link to post
Share on other sites
Jitnaught

 

I wasn't trying to make it perfect. Maro is supposed to be doing that lol

LOL.

OdE20Z0.gif

 

But What do you Mean?

 

DbnRNG3.jpg

 

 

It wasn't THAT funny.

 

I mean you are the one who is supposed to be coding your mod, correcting errors/bugs and that such, not me, so I wasn't trying to make your code perfect.

Share this post


Link to post
Share on other sites
Wiebrendh

 

 

I wasn't trying to make it perfect. Maro is supposed to be doing that lol

LOL.

OdE20Z0.gif

 

But What do you Mean?

 

DbnRNG3.jpg

 

 

It wasn't THAT funny.

 

I mean you are the one who is supposed to be coding your mod, correcting errors/bugs and that such, not me, so I wasn't trying to make your code perfect.

 

 

That wasn't funny at all, and Maro, just like LetsModOrDie says, people here are doing suggestions, they wont make 90% of the mod for you, you add some simple stuff, and then call it your mod

Share this post


Link to post
Share on other sites
Rugz007

Weibren what did i told you -_- be -------

Share this post


Link to post
Share on other sites
Jitnaught

Weibren what did i told you -_- be -------

 

Be what? Since you didn't write the word, I'm guessing it's a cuss word. The only words that I can think of that consist of 7 letters (you have 7 -'s) are [email protected] and @sshole. Wiebrendh is not being either of those.

 

 

And you are kinda being one of those, if that is what you are implying.

Edited by LetsPlayOrDy

Share this post


Link to post
Share on other sites
Rugz007

nono i just not kept it for guessing he knows what i am telling him :D if you wanna guess take this "--------" -_- and see weibren is my friend and i woundnt say him anything and what do you think i am 1 of those man ? :'(

Share this post


Link to post
Share on other sites
Jitnaught

nono i just not kept it for guessing he knows what i am telling him :D if you wanna guess take this "--------" -_- and see weibren is my friend and i woundnt say him anything and what do you think i am 1 of those man ? :'(

 

Butthole?

Well you're the one that is bleeping words...

Share this post


Link to post
Share on other sites
Rugz007

okay you always think bad yeah? i am saying him somthing good -__________________-

Share this post


Link to post
Share on other sites
Jitnaught

okay you always think bad yeah? i am saying him somthing good -__________________-

 

Then why does it need to be bleeped? If you live in the real world, you will see that the only things that are bleeped are bad things (cuss words and private parts on tv are 2 examples).

Share this post


Link to post
Share on other sites
Rugz007

ok i understand now :D

Share this post


Link to post
Share on other sites
stef538

this is just weird.

Share this post


Link to post
Share on other sites
Rugz007

yep :/

Share this post


Link to post
Share on other sites
Maro Hannover

What is Wierd.?

GTA-4-Nicolauncher.jpg

Share this post


Link to post
Share on other sites
stef538

How Rugz007 responds with the ..... just say it, or say nothing.

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.

Sign in to follow this  

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