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

D5 Driver

 

And how many vehicles and weapons can be added to GTA IV, without "5 seconds crashes"?

-D5 Driver

about 38, and over 50 if u're lucky

Oooh... Shiiiitt!! That many!? I though it was only about 12-20 tounge2.gif . And one more question about same thing; Why my trainer freezes when I try to spawn some added vehicles? dontgetit.gif Or does it freeze just, because I haven't "gave" the car, what I've added, to peds? lol.gif

And thanks! smile.gif

EDIT: The Simple Native Trainer says only, when I try to spawn an added vehicle, "Invalid model". sad.gif So any help, please? tounge.gif

-D5 Driver

Edited by D5 Driver

Share this post


Link to post
Share on other sites
motorsport71

I created my first .net script using visual basic. Everything works great but i would like to set up an INI. I read through lots of forum discussion and the excellent documentation Hazard X gives out with his Scripthook.net. I just can't find an example, or at least, how to tie one into a script. I created an .ini in notepad but don't know how to tie them together. Could someone give me some help?

This is a piece of my script:

 

 

   Public Sub ClosestPedAsPsycho_KeyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown       If e.Key <> Keys.N Then Return       Dim P As Ped = World.GetClosestPed(Player.Character.Position, 50.0F)       If Exists(P) Then           game.displaytext("A Psychotic Pedestrian!")           p.BecomeMissionCharacter()           p.startkillingspree(alsoAttackPlayer:=True)           p.CurrentRoom = Player.Character.CurrentRoom           p.WillDoDrivebys = True           p.PriorityTargetForEnemies = True           p.CanSwitchWeapons = True           p.DuckWhenAimedAtByGroupMember = True           p.SetPathfinding(True, True, True)           p.WillUseCarsInCombat = True           p.Accuracy = 100           p.MaxHealth = 100           p.Armor = 100           p.WillFlyThroughWindscreen = True           p.WantedByPolice = True

 

 

BTW, i'd also like to thank LMS for help with my first forum post. His help gave me some understanding into what was necessary to "grab" peds and vehicle from the world to create my mod.

 

***EDIT: I've read over the tutorial (Sent to me by Hardsty1e) for the C# INI functions and tried but cannot convert them to V.B. My knowledge of V.B. is limited, i know absolutely nothing about C#.

Edited by motorsport71

Share this post


Link to post
Share on other sites
thaCURSEDpie

Wooh, gtaforums, long time no see tounge.gif.

 

Motorsport, can't you address the "Settings" object in VB?

 

Also, if you want to convert C# to VB.net (and vice versa), you can go to this site: http://www.developerfusion.com/tools/convert/csharp-to-vb/ paste your code, click the button, and you're done wink.gif

Share this post


Link to post
Share on other sites
Costar

I have the 5.1 hook and Hazard's (.net for - Max. supported game versions: GTA IV 1.0.7.0 EFLC 1.1.2.0 ) as well as his

YAASIL for 1.0.7 IV and 1.1.2 EFLC (which I'm using) but .net is not loading, asi worx fine, trainer loads w/ it, disable trainer and still no .net .... .net 4 FW and FW extended are installed and started..

Share this post


Link to post
Share on other sites
sigma200

I added your scripthook replacement and made GTA IV stop working.

Share this post


Link to post
Share on other sites
motorsport71

@theCURSEDpie

thanks for the link, it was a big help. I got an INI functional now.

Share this post


Link to post
Share on other sites
motorsport71

I've been trying to set up a toggle for my script; i can get it to to start up "off" and get to to engage, but when I cannot get it to disable. Since It appears using the functions to call my INI are automatically calling the my "Settings.Load" function I don't have to use it. I cannot get the selected blocks of the script to disable. Am i missing something, or is there a better way of doing this?

 


Public Sub New()

Interval = 250

World.PedDensity = 2.0

Bindkey(Keys.F7, AddressOf ToggleScript)

 

 

End Sub

Private Sub ToggleScript()

ScriptTog = Not ScriptTog

If ScriptTog Then

 

BindKey(Settings.GetValueKey("Spawn Patriot with Bodyguards", "SETTINGS", Keys.I), New KeyPressDelegate(AddressOf PlayerDriveByGang))

BindKey(Settings.GetValueKey("Rival Drive By Gang", "SETTINGS", Keys.M), New KeyPressDelegate(AddressOf EnemyCarGang))

BindKey(Settings.GetValueKey("Look For Psychos", "SETTINGS", Keys.N), New KeyPressDelegate(AddressOf ClosestPedAsPsycho))

BindKey(Settings.GetValueKey("Refill Health and Armor", "SETTINGS", Keys.J), New KeyPressDelegate(AddressOf RefillHealth))

BindKey(Settings.GetValueKey("Police Will Ignore You", "SETTINGS", Keys.K), New KeyPressDelegate(AddressOf StarScript))

BindKey(Settings.GetValueKey("Get Closest Ped as Bodyguard", "SETTINGS", Keys.U), New KeyPressDelegate(AddressOf ClosestPedAsBodyGuard))

BindKey(Settings.GetValueKey("Remove Bodyguards", "SETTINGS", Keys.L), New KeyPressDelegate(AddressOf RemoveBodyGuards))

Game.displaytext("RivalDriveByGang Activated")

Else

 

settings.dispose()

Game.displaytext("RivalDriveByGang Deactivated")

 

 

Edited by motorsport71

Share this post


Link to post
Share on other sites
Symbiote

Hey guys, I was just trying to make a little script that will take away money when the player kills any ped that doesn't have a certain skin. thaCursedPie's source code for his kill notification mod was helpful, but I couldn't find a way to get a ped killed by the player.

 

Is there some easy way to do this? Or would I have to do something like: get targeted ped, check their skin; each tick, check if targeted ped dies and the player's people-killed stat goes up at the same time.

Share this post


Link to post
Share on other sites
lindsayslorach

Hey guys, I'm making another script and it involves attaching a camera to a bone on the player.

 

Is there any way to do this?

 

Thanks.

Share this post


Link to post
Share on other sites
iriedreadlock23

-- How do you use garage entity in Scripthook.Net? How do I retrieve the handle of garage, and Is there any way to get all of them? I managed to use garages (open/close etc) without your Gta.Garage class, but it looks interesting your way. Thanks

Share this post


Link to post
Share on other sites
lolpingu

"Well, this was a disappointment" --Spy, Team Fortress 2

The game crashes when i use the scripthook. it just loads for like 5 minutes and then crashes.

Share this post


Link to post
Share on other sites
bartjuuhn

Hello,

 

I've tried to installd this .Net scripthook, but I've a problem.

 

I can"t acces the console.

 

I've tried the 3 differant ASI loaders and it doesn"t worrk.

 

Can someone help me?

 

I'm using w7 64 bit.

 

Thanks

Share this post


Link to post
Share on other sites
pacificblue03

Hello i joined the forum just for a little bit of help please

 

I have the Scripthook installed and 2 scripts

 

- umbrella mod

- ped stop

 

and what happens is the rain falls inside buildings and also you dont see it hitting the ground outside anymore

 

i removed all of the scripts and scripthook and put the original back and that one made it rain outside

 

My question is how can this be fixed? please help me please

 

someone else asked on page 125 but none answered so please if you may look at this issue

 

Antonio.

Share this post


Link to post
Share on other sites
lindsayslorach

Hey guys, I just had a though, is it possible to add a multiline textbox the GTA.Forms namespace?

 

I think it would be very usefull.

 

Thanks smile.gif.

Share this post


Link to post
Share on other sites
Symbiote
I have the Scripthook installed and 2 scripts

 

- umbrella mod

- ped stop

 

and what happens is the rain falls inside buildings and also you dont see it hitting the ground outside anymore

 

i removed all of the scripts and scripthook and put the original back and that one made it rain outside

I use both those mods and I have the rain problem too. I never knew it was from the scripts, just always thought it was because of something like the shaders or timecyc.

 

Was it the scripthook itself or one of the scripts?

Share this post


Link to post
Share on other sites
pacificblue03
I have the Scripthook installed and 2 scripts

 

- umbrella mod

- ped stop

 

and what happens is the rain falls inside buildings and also you dont see it hitting the ground outside anymore

 

i removed all of the scripts and scripthook and put the original back and that one made it rain outside

I use both those mods and I have the rain problem too. I never knew it was from the scripts, just always thought it was because of something like the shaders or timecyc.

 

Was it the scripthook itself or one of the scripts?

I removed the scripts and just left the scripthook in there but it was still happening so the scripts were fine but the scripthook.dll is causing the issue all my graphics are up to date also

 

i have no idea and i really hope it can be fixed as i want traffic to stop behind me when im driving

 

GRRRR rockstar.

 

 

Share this post


Link to post
Share on other sites
lindsayslorach

Hey guys, I was just wondering if there were any ToScreen() or ToWorld() type functions, they would be really useful!

 

Thanks.

Edited by lindsayslorach

Share this post


Link to post
Share on other sites
Intosia
Hey guys, I was just wondering if there were any ToScreen() or ToWorld() type functions, thay would be really useful!

 

Thanks.

Been looking for those to, tried some stuff myself, but no real results sad.gif

Share this post


Link to post
Share on other sites
iriedreadlock23

If you guys need vector projection, than you would need to use shared functions from Vector3 class. There are few that do the job.

 

Related to that, someone asked how to find peds that player is targeting without ScriptHookDotNet ped pool. The answer is right here. Raycast can do that magic and even more. I have done most simple one, that creates bullet trajectory and find all entities on the way. Most of modern games use this approach instead of searching through all game peds.

Share this post


Link to post
Share on other sites
lindsayslorach

I just went through the Vector3 static methods, and I saw Vector3.Project(), and Vector3.Unproject(), the description of these make me think these are what I need to use, but I am unsure of how to use them.

 

I'm really quite confused, any help is appreciated, thanks. smile.gif

Share this post


Link to post
Share on other sites
iriedreadlock23

I couldn't resolve how to use most of these Vector3 shared functions, neither, and even though there are many explanations about using Matrix class to calculate vectors, I think that HazardX could explain this better.

 

Also, has anyone used native "IS_PLAYER_TARGETTING_ANYTHING"? It always returns 0 for me in EFLC. I used player index as param.

Share this post


Link to post
Share on other sites
LMS

@iriedreadlock23

 

Classes Vector2, Vector3, Vector4, Quaternion and Matrix based on sourcecode from SlimDX

 

So looking at their documentation might help.

 

About "IS_PLAYER_TARGETTING_ANYTHING": Looks valid and player index as parameter should be fine:

(EDX is CPlayer.m_pPed)

 

cmp     [edx+3A8h], 0; CPed.m_weapons.m_pTargetEntity

 

 

Share this post


Link to post
Share on other sites
MulleDK19
@iriedreadlock23

 

Classes Vector2, Vector3, Vector4, Quaternion and Matrix based on sourcecode from SlimDX

 

So looking at their documentation might help.

 

About "IS_PLAYER_TARGETTING_ANYTHING": Looks valid and player index as parameter should be fine:

(EDX is CPlayer.m_pPed)

 

cmp     [edx+3A8h], 0; CPed.m_weapons.m_pTargetEntity

 

GetTargetedPed() is really buggy. You have to aim at their feet for it to work.

 

 

 

Also. How do I conver the CurrentVehicle.Speed to kilometers per hour?

Share this post


Link to post
Share on other sites
iriedreadlock23

Actually, LMS, Player Index is wrong parameter for this one. I have tried it again, and it did not work. But when I used Player.ID instead of Player.Index, function worked. Now the thing is, it only returns true if player use melee lock on target. Other weapons just return false, no matter who you target.

Share this post


Link to post
Share on other sites
LMS

I thought player index is Player.ID for you, I don't use the player class but numbers at all. This might be true, havn't tried it but just looked at the code.

Share this post


Link to post
Share on other sites
MulleDK19

Any ETA on when tasks will be fixed?

 

 

Currently, tasks only works sometimes.

 

If I load a game, and I perform tasks, it often works. But after some time (Varying from 5 seconds to 3 minutes) tasks stop working.

 

When assigning tasks to a ped, regardless of type, peds location, etc. the ped just stops whatever he's doing, and stands still forever, completely ignoring any tasks.

 

Reloading scripts doesn't fix it. The only fix is going to the menu and Load a save.

 

 

Then the same thing happens over again.

 

 

 

 

The following code is just a demonstration. No task, no matter how it's initiated works after some time. Even on newly spawned peds, etc.

 

 

TaskSequence tsk = new TaskSequence();tsk.AddTask.EnterVehicle(vehicleToSteal, VehicleSeat.Driver);tsk.AddTask.CruiseWithVehicle(vehicleToSteal, 50, false);actor.AssignTasks(tsk);ped.BlockGestures = true;ped.BlockPermanentEvents = true;ped.Task.ClearAll();ped.Task.PerformSequence(tsk);

 

 

 

 

EDIT: I've found out that there's some kind of queue system or something that prevents the tasks from starting right away. If I wait a few minutes, the ped will start doing the tasks.

Edited by MulleDK19

Share this post


Link to post
Share on other sites
iriedreadlock23

MulleD19, I ve had the same problem for a while, but its gone now. I dont know how I fixed it, but probably by not using TaskSequence class that much. I combine it with natives to get the best result. And it works like charm. The only trouble happens when script try to call certain native in my custom sequence too many times in a row, then ScriptHookDotNet throws an expception in my script. Offcourse, I see it rather logical, because some tasks should not be called at such a short interval. However, I have build few projects, and all of them use tasks very often. One of them is building and starting tasks whenever one of my events trigger (~1ms), and no errors whatsoever. It could be issue with certain Native??

 

On the other side, I have very annoying problem with SHDN, aswell, after like 30-50 ReloadScripts, when I hit aim button, or I try to enter car game crashes! Like something is constantly checking if I am targeting or about to enter some vehicle.

Share this post


Link to post
Share on other sites
TwinTurbine

Any help please , I'm using patch 1.0.4.0 with scripthook 0.4.0 , latest xlive , framework .net 3.5 but still I can't start the game with .net scripthook , it crashed everytime I finish loading the game ( loading { mission name } ) . If I remove the .net scripthook from my gta directory , my game runs back to normal with all the asi mod running perfectly . I even try running the game as administrator , starting a new game instead of my saved game but still it occurs the same problem . Any help will be appreciated .

 

Only tested with 0.893 .net script hook .

Share this post


Link to post
Share on other sites
MulleDK19
Any help please , I'm using patch 1.0.4.0 with scripthook 0.4.0 , latest xlive , framework .net 3.5 but still I can't start the game with .net scripthook , it crashed everytime I finish loading the game ( loading { mission name } ) . If I remove the .net scripthook from my gta directory , my game runs back to normal with all the asi mod running perfectly . I even try running the game as administrator , starting a new game instead of my saved game but still it occurs the same problem . Any help will be appreciated .

 

Only tested with 0.893 .net script hook .

Install the latest GTA IV patch, and .NET ScriptHook.

Share this post


Link to post
Share on other sites
MulleDK19
MulleD19, I ve had the same problem for a while, but its gone now. I dont know how I fixed it, but probably by not using TaskSequence class that much. I combine it with natives to get the best result. And it works like charm. The only trouble happens when script try to call certain native in my custom sequence too many times in a row, then ScriptHookDotNet throws an expception in my script. Offcourse, I see it rather logical, because some tasks should not be called at such a short interval. However, I have build few projects, and all of them use tasks very often. One of them is building and starting tasks whenever one of my events trigger (~1ms), and no errors whatsoever. It could be issue with certain Native??

 

On the other side, I have very annoying problem with SHDN, aswell, after like 30-50 ReloadScripts, when I hit aim button, or I try to enter car game crashes! Like something is constantly checking if I am targeting or about to enter some vehicle.

Argh, this is driving me insane.

 

I just made a small test, where I have 2 keys. One key makes everyone try to get into the car I'm currently in, without using a TaskSequence, and the other makes everyone try to get into the car I'm currently in, using a TaskSequence.

 

 

Press the one without TaskSequence, everyone starts running. Then pressing the one that does use a TaskSequence, and everyone stops. Then press the one without TaskSequence, everyone starts running. Then pressing the one that does use a TaskSequence, and everyone stops. An so on...

 

ARGH!

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.