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

Symbiote

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

 

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

Share this post


Link to post
Share on other sites
Donny78

"Exists()" has the "!= null" check built in (I think).

 

 

Share this post


Link to post
Share on other sites
lindsayslorach

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

 

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

Share this post


Link to post
Share on other sites
MulleDK19

 

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

 

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

The other way around, actually.

 

This is pretty much what it does:

 

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

 

 

 

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

 

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

 

 

So, you should either do

 

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

 

 

Or

 

if(Game.Exists(obj))

 

Edited by MulleDK19

Share this post


Link to post
Share on other sites
vaikiz

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

Share this post


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

Any error message?

 

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

Share this post


Link to post
Share on other sites
vaikiz

I can't find those logs.Any directory or something?

Share this post


Link to post
Share on other sites
MulleDK19
I can't find those logs.Any directory or something?

In the game folder. The same folder as the EFLC.exe or GTAIV.exe files are.

Share this post


Link to post
Share on other sites
T.A.Z

nevermind, got it working.

Edited by T.A.Z

Share this post


Link to post
Share on other sites
vaikiz

I don't know there are no such folders.Maybe i have the wrong scripthook.net if that's possible.I also tried every script one at a time to see if there is a problem in any of them but no dice.

Share this post


Link to post
Share on other sites
MulleDK19

Suggestion for Vehicle.EngineRunning. Make a getter.

 

Something like

 

 

get { return this.CurrentRPM > 0.0f; }

 

Share this post


Link to post
Share on other sites
Dorak

Link for scripthook 0.40 is down, please fix it smile.gif .

Share this post


Link to post
Share on other sites
MulleDK19
Link for scripthook 0.40 is down, please fix it smile.gif .

Won't be fixed. Update your game.

Share this post


Link to post
Share on other sites
willhub

I'm using .net script hook on 1.0.4.0 with a .net trainer but in game nothing comes up when I press the buttons for the trainer??

Share this post


Link to post
Share on other sites
Dorak
Link for scripthook 0.40 is down, please fix it  smile.gif  .

Won't be fixed. Update your game.

No wink.gif

 

Update ENB first then.

 

What a crappy-ass answer.

Share this post


Link to post
Share on other sites
MulleDK19

 

Link for scripthook 0.40 is down, please fix it  smile.gif  .

Won't be fixed. Update your game.

No wink.gif

 

Update ENB first then.

 

What a crappy-ass answer.

You too. ENB has been updated long ago.

 

 

 

 

 

What a crappy-ass answer.

If you don't want people to answer, don't ask questions.

Edited by MulleDK19

Share this post


Link to post
Share on other sites
MulleDK19

Btw, Model.Hash is wrong. It's an int, while it should be a uint.

 

 

Eg. M_Y_COP has hash 4111764146 (0xF5148AB2). Model.Hash shows -183203150 in decimal, because it's signed.

 

Signed int with value 0xF5148AB2 = -183203150

Unsigned int with value 0xF5148AB2 = 4111764146

 

You can't compare 0xF5148AB2 with Model.Hash because Model.Hash is signed, and as thus, does not allow values as high as 4111764146.

 

if(ped.Model.Hash == 0xF5148AB2) //Comparison to integral constant is useless; the constant is outside the range of type 'int'

 

 

So to compare, you need to do

 

if((uint)ped.Model.Hash == 0xF5148AB2)

 

Edited by MulleDK19

Share this post


Link to post
Share on other sites
motorsport71

I'm having the dumbest problem... i can't get the world.weather function to work in v.b.

"Public Shared Property Weather As GTA.Weather"

Foggy is in GTA.Weather in weather enum's.

 

I tried:

 

World.weather = FoggyWorld.weather = weather.FoggyWorld.weather(Foggy)World.Weather(weather.Foggy)World.weather = (Foggy)World.Weather = (weather.Foggy)Dim w as weather = world.weatherw = foggy

 

and just about every combination in between. I get the error's all stating that "foggy" isn't a member of "weather", and i tried all other weather enums and got the same result. What am i doing wrong? I've used all the other "world.blah" easily enough, so i'm a little frustrated and REALLY sorry to bother the real coders confused.gif

 

BTW, i did look through native functions but the pages were incomplete suicidal.gif

Edited by motorsport71

Share this post


Link to post
Share on other sites
lindsayslorach

@motorsport71, Make sure you use correct casing:

 

 

World.Weather = Weather.Foggy

 

Share this post


Link to post
Share on other sites
motorsport71

@lindsayslorach

I tried it with the correct casing as per your recommendation just to make sure, but still no luck... barf8bd.gif

Share this post


Link to post
Share on other sites
Threepwood

Eyho..

 

any pro having knowledge about getting a trigger if a vehicle having an angle?

In special yaw, pitch, roll? I would need both, positive and negative as a trigger and can't find a proper way.

Share this post


Link to post
Share on other sites
chrisblake

hi all. dont know if this is the right place but i want to request the scripthookdotnet.asi be updated for patch 1070 as i have found its part of the cause of the rain bug! i have fixed both rain bugs (raining inside and no collision) but as soon as scripthookdotnet.asi is put back it has the bugs again! heres the link to the fix!

 

http://www.gtaforums.com/index.php?showtopic=481408

 

without the scripthookdotnet.asi we loose a lot of mods! sad.gif dont think many of you will swap rain for mods! lol but at least we know it can be fixed at last!

 

so what are the chances of getting a new scripthookdotnet.asi that dont cause the bugs?

 

great work anyways people! keep it up! biggrin.gif

Share this post


Link to post
Share on other sites
Threepwood
Eyho..

 

any pro having knowledge about getting a trigger if a vehicle having an angle?

In special yaw, pitch, roll? I would need both, positive and negative as a trigger and can't find a proper way.

And btw why can't I catch LeftCtrl and LeftShift.. damn that makes things pretty difficult.

Share this post


Link to post
Share on other sites
MulleDK19
Eyho..

 

any pro having knowledge about getting a trigger if a vehicle having an angle?

In special yaw, pitch, roll? I would need both, positive and negative as a trigger and can't find a proper way.

And btw why can't I catch LeftCtrl and LeftShift.. damn that makes things pretty difficult.

Catch LeftCtrl? Huh? You mean in the KeyDown event?

 

Ctrl, Shift and Alt are modifiers. e.Control, e.Shift and e.Alt.

Share this post


Link to post
Share on other sites
Threepwood

Thank you, gonna try that immediately. Only found a difference for LeftCtrl, RightCtrl so far, .NEt did not use it.

 

// edit: nope. No reaction. I have a config file which defines the keys. If I use ANY key like A,B,C or else, it works, if I use Control or Shift, nothing works.

 

// edit two:

 

Got it. The game reads it as:

 

LControlKey LShift

 

// edit three:

 

Hazard, why does

 

                              float rotMx = 0f;                              float rotMy = 1f;                              float rotMz = 0f;                                                               Vector3 rotMzNew =   new Vector3(rotMx, rotMy, rotMz);                               veh.ApplyForceRelative(new Vector3(1f, 0f, 0f), rotMzNew);

 

result in a rotation around Z?

Edited by Threepwood

Share this post


Link to post
Share on other sites
Symbiote

What are you rotating? Maybe the object is already rotated, so that the Y axis is where the Z axis should be.

 

I think I had that problem when placing weapon pickups.

Share this post


Link to post
Share on other sites
Madretsma

Hey biggrin.gif

 

I am new here and first i have to say: My english isnt that good. Sorry.

 

At first, thanks to HazardX for developing this .Net ScriptHook.

After reading some Posts, i thought about coding a nice mod that will allow me to control Nico's animations. Easier said i want Niko to play an animation i choose.

i learn VB.Net for two years. Can you tell me how to get Niko playing an animation i choose?

 

And again... Sorry for my bad english biggrin.gif

 

Madretsma

Share this post


Link to post
Share on other sites
Threepwood

 

What are you rotating? Maybe the object is already rotated, so that the Y axis is where the Z axis should be.

 

I think I had that problem when placing weapon pickups.

 

                               veh.ApplyForceRelative(new Vector3(0f, 0f, 0f), rotMzNew);

 

 

This is what I use (edited it in, forgot that, sorry). I rotate a vehicle in relative to its position or vectors, if thats the better term. As you can see, not Z is given a value, but Y. And I wonder how that can result in a rotation around Z.

Share this post


Link to post
Share on other sites
T.A.Z

is there a working fix for the rain collision problem caused by the scripthook.asi?

Share this post


Link to post
Share on other sites
Trigger_85

For me collisions working good. I have also edited handling.cfg to make even more real. I will give probably stupid and common question. Will be a little hot fix for rain bug? I don't mind rain indoors too much but no cool splashes it's a crime. I haven't updated PC not to enjoyed game at full effects tounge.gif

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.


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