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

Symbiote

The rain bug has been reported many times, but I don't think it's likely to be fixed.

 

Not everyone has the bug, so apparently it's some kind of conflict between the scripthook and certain computers (video drivers maybe?). I have the bug, and it's really a shame. I haven't seen the awesome rain splashes in years.

 

One little detail I noticed, maybe it'll help someone find the problem: the splashes actually appear when I open the menu screen, but only while the screen is fading to black. When I close the menu screen, the splashes disappear again.

Share this post


Link to post
Share on other sites
koerdecke

hello ! biggrin.gif

 

can someone explain how i could change the text color in Game.Displaytext ?

and is there any tutorial for a menu like in all these in-game trainers etc. ?

Share this post


Link to post
Share on other sites
thaCURSEDpie

Game.DisplayText() doesnt allow text colours.

 

If you want to make menus, either uses the GTA.Form class, or the GTA.Script.onPerFrameDrawing event.

The latter will allow you to draw text of your choice, rectangles, lines, etc. The former will allow you to make forms (which are kinda like windows in MS Windows)

Share this post


Link to post
Share on other sites
koerdecke
Game.DisplayText() doesnt allow text colours.

 

If you want to make menus, either uses the GTA.Form class, or the GTA.Script.onPerFrameDrawing event.

The latter will allow you to draw text of your choice, rectangles, lines, etc. The former will allow you to make forms (which are kinda like windows in MS Windows)

Thank you ! smile.gif

 

Is there any tutorial for using GTA.Forms ?

Share this post


Link to post
Share on other sites
danjako43

Why can't we use the x64 version of the Microsoft Visual C++?

Share this post


Link to post
Share on other sites
Rbn 3d

I'm trying to use some undocumented native functions whithout luck...

 

 

        public int getVehicleGear(Vehicle v) // Not works. GET_VEHICLE_GEAR it's undocumented       {           GTA.Native.Pointer gear = typeof(int);           GTA.Native.Function.Call("GET_VEHICLE_GEAR", new GTA.Native.Parameter[] {v, gear});           return gear;       }       public bool isVehicleInAir(Vehicle v) // Not works. IS_CAR_IN_AIR_PROPER it's undocumented       {           GTA.Native.Pointer inAir = typeof(int);           GTA.Native.Function.Call("IS_CAR_IN_AIR_PROPER", new GTA.Native.Parameter[] { v, inAir });           return (inAir != 0); // return as bool       }

 

 

I've tried different parameters, but the Natives seems to be always returning nothing (the pointers returned are always 0, because a int cannot be NULL).

 

Anyone tried these Natives??

 

If anyone can point me to the right direction about getting the correct parameters using IDA Pro or something would be nice... I have no experience at all with reverse engeniering

Share this post


Link to post
Share on other sites
MulleDK19
I'm trying to use some undocumented native functions whithout luck...

 

 

        public int getVehicleGear(Vehicle v) // Not works. GET_VEHICLE_GEAR it's undocumented       {           GTA.Native.Pointer gear = typeof(int);           GTA.Native.Function.Call("GET_VEHICLE_GEAR", new GTA.Native.Parameter[] {v, gear});           return gear;       }       public bool isVehicleInAir(Vehicle v) // Not works. IS_CAR_IN_AIR_PROPER it's undocumented       {           GTA.Native.Pointer inAir = typeof(int);           GTA.Native.Function.Call("IS_CAR_IN_AIR_PROPER", new GTA.Native.Parameter[] { v, inAir });           return (inAir != 0); // return as bool       }

 

 

I've tried different parameters, but the Natives seems to be always returning nothing (the pointers returned are always 0, because a int cannot be NULL).

 

Anyone tried these Natives??

 

If anyone can point me to the right direction about getting the correct parameters using IDA Pro or something would be nice... I have no experience at all with reverse engeniering

IS_CAR_IN_AIR_PROPER only accepts one parameter, and returns a bool.

 

 

bool IsCarInAirProper(Vehicle vehicle)

 

 

 

No idea about GET_VEHICLE_GEAR.

Share this post


Link to post
Share on other sites
Rbn 3d

 

I'm trying to use some undocumented native functions whithout luck...

 

 

        public int getVehicleGear(Vehicle v) // Not works. GET_VEHICLE_GEAR it's undocumented       {           GTA.Native.Pointer gear = typeof(int);           GTA.Native.Function.Call("GET_VEHICLE_GEAR", new GTA.Native.Parameter[] {v, gear});           return gear;       }       public bool isVehicleInAir(Vehicle v) // Not works. IS_CAR_IN_AIR_PROPER it's undocumented       {           GTA.Native.Pointer inAir = typeof(int);           GTA.Native.Function.Call("IS_CAR_IN_AIR_PROPER", new GTA.Native.Parameter[] { v, inAir });           return (inAir != 0); // return as bool       }

 

 

I've tried different parameters, but the Natives seems to be always returning nothing (the pointers returned are always 0, because a int cannot be NULL).

 

Anyone tried these Natives??

 

If anyone can point me to the right direction about getting the correct parameters using IDA Pro or something would be nice... I have no experience at all with reverse engeniering

IS_CAR_IN_AIR_PROPER only accepts one parameter, and returns a bool.

 

 

bool IsCarInAirProper(Vehicle vehicle)

 

 

 

No idea about GET_VEHICLE_GEAR.

 

Thanks, IS_CAR_IN_AIR_PROPER It´s working fine now:

 

 

        public bool isVehicleInAir(Vehicle v)       {           return GTA.Native.Function.Call<bool>("IS_CAR_IN_AIR_PROPER", v);       }

 

 

But I modified GET_VECHICLE_GEAR too like this:

 

 

public int getVehicleGear(Vehicle v)       {           return GTA.Native.Function.Call<int>("GET_VEHICLE_GEAR", v);       }

 

 

And it returns 0 when the car is on the floor, and 1 when it's in air!! wow.gif

 

I'm pretty sure, is not a mistake in my code, there are the calls:

 

 

                e.Graphics.DrawText("\nCurrentGear:" + getVehicleGear(Player.Character.CurrentVehicle) +                    "\nIsVehicleInAir:" + isVehicleInAir(Player.Character.CurrentVehicle), 50f, 30f);

 

Share this post


Link to post
Share on other sites
ricardo8086

The GTA.NonExistingObjectException is becoming too much often... in parts of the code the actually check if the object exists before trying to use... This is really annoying. This way, every script should be in a giant try / catch block!

Share this post


Link to post
Share on other sites
Rbn 3d

I want to get the world X rotation angle of a car direction, so I need to convert the car direction to euler angles... I found this helper function:

 

 

Vector3 GTA.Helper.DirectionToRotation(GTA.Vector3 dir, float roll)

 

 

It need two parameters, dir is Vehicle.Direction, right?

But what is roll??

 

I've used Euler Angles and Quaternions before, but no idea about Yaw/Pitch/Roll

Share this post


Link to post
Share on other sites
Xeon

Can anyone tell me if there's any way to get a bare world with no peds, no vehicles, no missions, etc. ?

Share this post


Link to post
Share on other sites
TeJo.Hr

I got this error with script for Visible Armour.

 

When I start the game it says on screen:

Error in script 'ArmourMod'!

 

In console this are the related messages (searching and loading went fine so I ain't copying that one, only the one from starting lines).

 

...sucessfully starter script 'AmourMod'!

Error during tick in script 'ArmourMod':

System.MissingMethodExeption: Method not found: 'Int32

GTA.value.PedSkin.GetComponentModel (GTA.PedComponent)'.

  at ArmourMod.CheckArmour (Object sender, EventArgs e)

  at GTA.Script.TryTick()

  at GTA,Script.DoTick()

  at GTA.ScriptThread.OnTick()

 

Doesn anyone know what's it about?

Share this post


Link to post
Share on other sites
lindsayslorach

Seems the script was built for a different version of the scripthook, what version of the game/scripthook/.net scripthook/.net framework do you have installed, make sure you have all the latest ones. If you already do, the script needs updating, contact the author.

Share this post


Link to post
Share on other sites
TeJo.Hr

Im running on 1.0.4., not really sure which net scripthook I use, but I think it's this one

http://www.gta4-mods.com/tools/gta-iv-net-...0893-beta-f2941

I got quite a lot of scripts and all are working properly, so maybe this one is outdated. The author is ilmcnessy, he got his own site with little forum there, so I asked him there, but it looks like no one used it in long long time so I went to ask here instad.

 

This script, combines with few other handy ones, could be quite useful to guys like me who likes to play with hud and radar turned off.

 

 

Share this post


Link to post
Share on other sites
lindsayslorach

I suggest updating everything. Because the script is .net you can change it if you know how to. I'm not going to tell you how to, but you might even need to make your own version if you really want it.

Share this post


Link to post
Share on other sites
TeJo.Hr

I'm afraid I know nothing about how to do such things. It's a shame that such a cool script didn't got updated. dontgetit.gif

Share this post


Link to post
Share on other sites
Donny78

I don't know if this has been reported, had a quick search for some keywords like "GetTexture & Resources.GetTexture" but didn't see anything regarding this.

 

When I use "Resources.GetTexture" in a "Forms" class it gives me a object reference error and my script crashes. I got around this be using it in a "Script" class and refering to the object from there (ImageBox).

 

There is a work around so it's a minor issue but it would be good to be able to use it in my forms class when I create my ImageBox.

Share this post


Link to post
Share on other sites
Rushlink

Ok. So I'm trying to make a little marker. I have the coordinates stored as a vector3. What I want to make is one of those yellow arrows, or what I have seen in lcpdfr, those red circles. The circles would be nice!

 

No clue what I'm missing, but how do I make them?

Thanks!

Share this post


Link to post
Share on other sites
rapter014

I know this is a bit late but thanks a ton for the script hook. I have a question though:

Is there a way to limit the speed of the player's car without constantly setting the speed of the car?

 

I'm working on a Manual Transmissions script and I want to be able to limit the speed the player can go up to in each gear.

Right now I'm using:

 

switch (gearState)               {                   case 1:                       if (Exists(v) && v.Speed >= 15.0f) v.Speed = 15.0f;                       break;

 

This works pretty well but it gives the car perfect handling and actually makes it difficult to control unless you shift up. This also doesn't effect the RPM's of the car.

 

Any help would be greatly appreciated!

Thanks

Share this post


Link to post
Share on other sites
Rooft0p

 

Ok.  So I'm trying to make a little marker.  I have the coordinates stored as a vector3.  What I want to make is one of those yellow arrows, or what I have seen in lcpdfr, those red circles.  The circles would be nice!

 

No clue what I'm missing, but how do I make them?

Thanks!

Create an object (something nice and small like a coke can or something) at the vector make it invisible drop it a little and attach a blip, that will give you an arrow at the coordinate, The red spheres that are used in lcpdfr are i think an object, cant remember the name off the top of my head though.

Share this post


Link to post
Share on other sites
Symbiote

Do you really need to create an invisible object? Why not just make a blip at the vector with Blip.AddBlip(Vector3)?

 

 

Blip newBlip = Blip.AddBlip(blipPosition);

 

Share this post


Link to post
Share on other sites
MulleDK19

 

Ok.   So I'm trying to make a little marker.  I have the coordinates stored as a vector3.  What I want to make is one of those yellow arrows, or what I have seen in lcpdfr, those red circles.  The circles would be nice!

 

No clue what I'm missing, but how do I make them?

Thanks!

 

 

Checkpoint checkPoint = new Checkpoint(position, Color.Red, 3.0f);

 

Share this post


Link to post
Share on other sites
MulleDK19

Does anyone know how to disable the prison (Alderney State Correctionial Facility) siren in EFLC?

 

I've looked for natives, terminated all scripts, but I can't get it to stop.

 

And I can't seem to find the sound in any of the .rpf archives.

 

Does anyone know where the sound is located, or have an easier way to remove the stupid siren?

Share this post


Link to post
Share on other sites
Donny78

No dude sorry but have you tried going through the decompiled sco scripts, it would have to be an area check or something to trigger it. I've noticed certain scripts get reactivated even if you have killed them with the native in your net script, I had a script which tracked and killed running scripts and I remember getting a repeated message after jacking a taxi IIRC, it kept killing the same script over and over so something somewhere was re-enabling it as it may be doing in your case.

 

PS. I don't have EFLC so can't check for it with my net script (if I still have it).

Share this post


Link to post
Share on other sites
MulleDK19

 

No dude sorry but have you tried going through the decompiled sco scripts, it would have to be an area check or something to trigger it. I've noticed certain scripts get reactivated even if you have killed them with the native in your net script, I had a script which tracked and killed running scripts and I remember getting a repeated message after jacking a taxi IIRC, it kept killing the same script over and over so something somewhere was re-enabling it as it may be doing in your case.

 

PS. I don't have EFLC so can't check for it with my net script (if I still have it).

Hmm, you're right.

 

I just wrote a simple constant script killer, and the alarm is gone. But constantly killing scripts isn't practical.

 

I just did some more testing, and it seems to work if I kill the script if I'm near the prison.

 

 

I just need to find the script name now, and I can just kill it whenever the player is nearby.

 

 

 

 

Can't believe I didn't think of that before.

 

Helped a lot, thanks.

 

 

 

 

 

EDIT: I got it. I just need to terminate "ambprisonwanted" when the player is close to the prison.

Weird... I could have sworn I had searched for a script name with "prison" in it before, and didn't find anything.

 

Anyways, works now, so that's great.

Edited by MulleDK19

Share this post


Link to post
Share on other sites
Symbiote
I have very annoying problem with ScripthookDotNet.

 

I cannot use mouse in Gta Forms. Its just frozen in the screen centre.

 

I tried to remove all scripts, but no improvements.

I'm having this problem too. I remember not having this problem in the past, so I don't know what might cause it.

 

Until the problem goes away, I guess I'll have to shelve my ambition to learn how to make windows and forms. sad.gif

Share this post


Link to post
Share on other sites
MarkC9

Hey guys,

Im looking for a way to disable ENB and only ENB (none of the other scripts that are running) using the console. Custom command if I must. Any idea on where to start or if this is applicable to .Net ScriptHook?

Share this post


Link to post
Share on other sites
ReynoldsG
I have very annoying problem with ScripthookDotNet.

 

I cannot use mouse in Gta Forms. Its just frozen in the screen centre.

 

I tried to remove all scripts, but no improvements.

I'm having this problem too

Share this post


Link to post
Share on other sites
Symbiote

 

Hey guys,

Im looking for a way to disable ENB and only ENB (none of the other scripts that are running) using the console. Custom command if I must. Any idea on where to start or if this is applicable to .Net ScriptHook?

You can just press Shift-F12 to disable ENB. It doesn't have anything to do with the .NET scripthook.

 

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

 

Also, yeah, I'm still having the problem where the cursor is locked in the center of the screen when using the console or a form. Even when all scripts except WindowExample.cs are removed.

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
Rushlink

Ok so im fairly new to Visual studio...

On one computer i have, when i type something eg: player.character. it pops up with a list of stuff i can put after this, like 'position'

on my other computer, it does not do this, and it gets annoying sometimes. How do i enable it?

I dont know what its called, sad.gif

 

Thanks

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.


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

×
×
  • Create New...

Important Information

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