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

motorsport71

@MulleDK19

Thanks man, i appreciate it smile.gif

Share this post


Link to post
Share on other sites
Bloodhowl21

Hi there! I have a question regarding ScriptHook , ASIloader , Xliveless etc. Do they all require an original copy of GTA 4? I'm new here and I'm sorry if this will offend you , but why is it only for the retail version? Thanks.

Share this post


Link to post
Share on other sites
Symbiote

@Bloodhowl21

I don't know if it's against the rules to tell you this, but everything you mentioned works with illegal copies of the game.

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
daimyo21

So I just made my first script through a tutorial, I have looked at other peoples script to understand C# more yet I been having a universal problem.

 

I have the 0.4.0 Developer SDK and am thinking that this is the problem.

 

 

using GTA.base;

 

 

puts a red line under base even though I have included the scripthookdotnet in the references...

everytime I use base.Blah.Blah.Blah it says unidentified error: 'base' is not a keyword

 

when I type using GTA. (it brings up all the options and base is @base, which doesnt work).

 

 

 

Any thoughts? Is there a later developer kit?

 

Much help would be greatly appreciated.

 

 

EDIT: Just referenced the latest one (not 0.4.0)

 

The one from this thread in "For Developers" folder and GTA.base is still showing up as error

Edited by daimyo21

Share this post


Link to post
Share on other sites
Symbiote

Sorry for my ignorance, but what is GTA.base? What do you need it for?

Share this post


Link to post
Share on other sites
Threepwood

Since cutscenes support it, the game might support it as well: Do we have removing car parts covered (hood, bumper, etc) in C# or C++ yet? Or is there a native?

Share this post


Link to post
Share on other sites
motorsport71

Hey all, i have questions about "gta.nonexistingobjectexception: Invalid call to an object that doesn't exist anymore", specifically during during "gta.ped.get.position".

 

My mods run most frequently either

world.getpeds()

or

world.getallpeds()

 

Now i've discovered that if you try to used them in conjunction throughout a same script it will flag the error, generally quickly, so it's best to stay with just one or the other. Then it can last a long while.

 

Now for the question...

 

So for the Mod i have out right now it is set to run on a 225 ms interval. I always use

 

 If exists(ped) then

to try to stop any errors, but they still creep up.

 

Technically on each interval isn't SHDN looking for a pedestrian that it seen last interval? So if the pedestrian was a mission ped, the tick happened, that ped was deleted within the script, and the next tick it looks for them again, does / can that cause the error?

 

If the game "skipped", or a background operation such as an antivirus update kicks on, can that cause it?

 

Can SHDN be getting "Clogged up", or too much information causing it to get "Bottlenecked"?

 

Since my mod is "world.getpeds()" so frequently, is there a way to "ignore" the error, write past past it, so that the error doesn't pop up and the entire mod doesn't stop because it looses track of maybe one wayward pedestrian off in the distance for one tick?

 

Share this post


Link to post
Share on other sites
Prof_Farnsworth

 

Hey all, i have questions about "gta.nonexistingobjectexception:  Invalid call to an object that doesn't exist anymore", specifically during during "gta.ped.get.position".

 

My mods run most frequently either

world.getpeds()

or

world.getallpeds()

 

Now i've discovered that if you try to used them in conjunction throughout a same script it will flag the error, generally quickly, so it's best to stay with just one or the other.  Then it can last a long while. 

 

Now for the question...

 

So for the Mod i have out right now it is set to run on a 225 ms interval.  I always use

 

 If exists(ped) then

to try to stop any errors, but they still creep up.

 

Technically on each interval isn't SHDN looking for a pedestrian that it seen last interval?  So if the pedestrian was a mission ped, the tick happened, that ped was deleted within the script, and the next tick it looks for them again, does / can that cause the error?

 

If the game "skipped", or a background operation such as an antivirus update kicks on, can that cause it?

 

Can SHDN be getting "Clogged up", or too much information causing it to get "Bottlenecked"? 

 

Since my mod is "world.getpeds()" so frequently, is there a way to "ignore" the error, write past past it, so that the error doesn't pop up and the entire mod doesn't stop because it looses track of maybe one wayward pedestrian off in the distance for one tick?

Best thing I can recommend is to make sure you have "Exists" checks on everything you are using. Even if you use "And" or "Or" in your statements, have a check in each of the conditions. Also, when done with a ped or vehicle, I recommend using "ped/vehicle.NoLongerNeeded();" so the game does not keep track of it longer than it needs to, and can erase it if need be.

 

In my Fire Dept. mod, that error was the bane of my existence due to the randomness of exploding vehicles, traffic, etc. I literally have checks everywhere to make sure something exists.

Share this post


Link to post
Share on other sites
Symbiote

This is bad practice, but here's what I do to ignore the NonExistingObjectException errors from GetPeds(). I usually use C#, so forgive me if this VB.NET code isn't quite right...

 

' Declare pedArray as an empty array, in case GetPeds() fails.Dim pedArray() = New Ped() { }' Use a try-catch to handle the exception without crashing.Try   pedArray = GTA.World.GetPeds(centerPosition, range)Catch ex As NonExistingObjectException   Dim errorMsg As String = ex.Message   ' You can do something with this error message, like print it to the console   ' or write it to a file. For public releases, I just leave it like this, so   ' that it's ignored.End Try' If GetPeds() failed, then pedArray remains empty and this loop will do nothing.For Each p As Ped In pedArray   If Not Exists(p)       Continue   ' Do stuff for each pedNext

 

Note: This technique works in C#, but VB might crash at the for-each loop when pedArray is empty. If so, just declare pedArray with "Dim pedArray() As Ped" instead, and then after the try-catch, make sure pedArray "Is Not Nothing".

 

@Prof_Farnsworth

In my mods, I make sure peds/vehicles exist just once per function. I don't think the game actually continues to do stuff while your script is executing, because if you do a long, intensive calculation, the game "freezes" each time your script executes, causing stuttering/lag. To me, this indicates that the game can't continue to process other stuff until your script is done — then game stuff executes, then your script executes again, then game stuff executes again, etc. etc. If I'm wrong, someone please tell me!

 

P.S. The above is assuming you haven't used Wait(). If your script waits, then a ped might not exist anymore after it's done waiting.

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
Prof_Farnsworth
This is bad practice, but here's what I do to ignore the NonExistingObjectException errors from GetPeds(). I usually use C#, so forgive me if this VB.NET code isn't quite right...

 

' Declare pedArray as an empty array, in case GetPeds() fails.Dim pedArray() = New Ped() { }' Use a try-catch to handle the exception without crashing.Try   pedArray = GTA.World.GetPeds(centerPosition, range)Catch ex As NonExistingObjectException   Dim errorMsg As String = ex.Message   ' You can do something with this error message, like print it to the console   ' or write it to a file. For public releases, I just leave it like this, so   ' that it's ignored.End Try' If GetPeds() failed, then pedArray remains empty and this loop will do nothing.For Each p As Ped In pedArray   If Not Exists(p)       Continue   ' Do stuff for each pedNext

 

Note: This technique works in C#, but VB might crash at the for-each loop when pedArray is empty. If so, just declare pedArray with "Dim pedArray() As Ped" instead, and then after the try-catch, make sure pedArray "Is Not Nothing".

 

@Prof_Farnsworth

In my mods, I make sure peds/vehicles exist just once per function. I don't think the game actually continues to do stuff while your script is executing, because if you do a long, intensive calculation, the game "freezes" each time your script executes, causing stuttering/lag. To me, this indicates that the game can't continue to process other stuff until your script is done — then game stuff executes, then your script executes again, then game stuff executes again, etc. etc. If I'm wrong, someone please tell me!

 

P.S. The above is assuming you haven't used Wait(). If your script waits, then a ped might not exist anymore after it's done waiting.

@Angry - I was getting errors inside "if" statements that already checked if the ped existed, then used them. However, I also use a fair amount of "Wait's" in my code.

Share this post


Link to post
Share on other sites
motorsport71

@AngryAmoeba

I appreciate that. I recently found and example that is using "Is Not Nothing" during each call in the pedarray() so now it's looking a lot like this:

 

Dim peds as ped() = world.getpeds(player.character.position, 100.0)for each ped as ped in pedsif exists(ped) andalso ped Is Not Nothing then     **ped assignments / valuesend ifnext

 

 

I would just previously use "If exists(ped)", but adding the "Is Not Nothing" seems to have made it much more stable as suggested so you are definately correct there. Very stable.

 

I will also keep the write around technique in mind if i cannot get the secondary part of my script, the more resource intensive one, to remain stable. Thanks again.

 

@Prof_Farnsworth

I also went through the entire script and added the checks as you suggested, but i used the above mentioned "Is Not Nothing" in vehiclearray() as well. As you suggested, it helps a ton.

 

Thanks Guys!

Share this post


Link to post
Share on other sites
TechnoKuchen

omg

Please Help me

ScriptHookDoTnet.asi

NEVER Works -.- The game just doesn't turns on , nothing shows up

Game nevers starts

Win 7 /game Patch 7 tryed several Scripthook.dll's

Never works

And if i remove the ScripthookdotNET.asi, the game works fine cry.gif

Someone has a idea why ? suicidal.gif

Edited by TechnoKuchen

Share this post


Link to post
Share on other sites
Symbiote

 

@AngryAmoeba

I appreciate that.  I recently found and example that is using "Is Not Nothing" during each call in the pedarray() so now it's looking a lot like this:

 

Dim peds as ped() = world.getpeds(player.character.position, 100.0)for each ped as ped in pedsif exists(ped) andalso ped Is Not Nothing then     **ped assignments / valuesend ifnext

 

 

I would just previously use "If exists(ped)", but adding the "Is Not Nothing" seems to have made it much more stable as suggested so you are definately correct there.  Very stable.

Actually, Exists() already includes the "Is Not Nothing" check, so you don't need to do it again after using Exists().

 

Edit: Exists() is equivalent to "object IsNot null AndAlso object.Exists()". I just did some reading on VB.NET, and it turns out 'null' is not the same as 'Nothing', so what I said might be wrong. I guess my best advice, really, is just to use C# instead. It's less confusing! tounge.gif

 

For me, the NonExistingObjectException is not a problem in the for-each loop, but in the "pedArray = World.GetPeds(center, range)" statement. That's why I recommended putting it inside a try-catch.

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
mccahon

Alright why can I install this into GTA on one PC and it loads scripts fine, but on my brothers PC only asi loader works and ignores this asi script, therefore no .net scripts are loaded. Same GTA version and everything. Seriously help please.

Share this post


Link to post
Share on other sites
motorsport71

@mccahon

troubleshooting: .net scripthook

Do you have ScriptHookDotNet and ScriptHook from this file: They go into your main directory.

 

http://dl.hazardx.com/83

 

Do you have c++ 2000 redistributable installed? Get it here:

 

http://www.microsoft.com/downloads/details...23-37bf0912db84

 

Do you have .net framework 4 installed? Get it here:

 

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

 

Then did you make a folder named "scripts" and place the .net and / or .ini files in it you intend to use when you're done?

 

Those are all common questions / links / answers i get / give with my .net mods.

This is straight from the first page of this forum, some information anyway.

 

Share this post


Link to post
Share on other sites
Threepwood

Anyone ever tried

 

                       GTA.Native.Function.Call("SUPPRESS_CAR_MODEL", mCar);

 

? Any hints on that?

Share this post


Link to post
Share on other sites
thaCURSEDpie
Anyone ever tried

 

                       GTA.Native.Function.Call("SUPPRESS_CAR_MODEL", mCar);

 

? Any hints on that?

Nope. Why don't you try it yourself? smile.gif

Share this post


Link to post
Share on other sites
Threepwood

I did, and it works pretty well. But since the GTA Wiki lists it pretty empty, I had hopes someone else yet uses it, because there could be additional options or flags.

So far, this stub works, while mCar is just the vehicle hash as int32. Nice addition/alternative to an IDE flag for not having the actual driven car in traffic. Like romans taxi.

Share this post


Link to post
Share on other sites
motorsport71

When using

 

World.CreatePed()

 

and using

 

Ped.BecomeMissionCharacter()

 

to keep up a large group of mission peds, say approximately 35, and I have the script constantly replace "dead" or "nolongerneeded" peds:

 

Why is it that after around 100+ mission peds have been replaced they begin to spawn like a "statue" or "solid", with no brain and completely invulnerable?

 

Also, what can be done to prevent that? I need the pedestrian to remain a mission character to get the tasks and actions necessary, so if i nolonger want to use a ped is it better to at the desired distance "delete" the ped or go with "nolongerneeded" if it's a mission ped? Does one over the other leave a "memory leak" i believe it may be referred to?

 

@AngryAmoeba

I've been running the "if exists(x) andalso x isnot nothing" and though it looks confusing as you mentioned, it works quite well biggrin.gif I know it would be smart of me to look into c#, but i'm not a coder and v.b. "looked" easier to understand as i looked over the two when i decided to try to code my first .net script.

Share this post


Link to post
Share on other sites
CoSm1c gAm3r

When "ScriptHookDotNet.asi" is in main folder then game wont run. If I delete it then game runs but only one script is running. It is SpeedometerIVv03a.

 

Edit:

Somehow I managed to run game with "ScriptHookDotNet.asi" in main folder. But still scripts didnt work. But then I added file "XliveProtectDisabler.asi" and I think that this helped because scripts in SCRIPTS folder worked when I run game. So problem solved.

Edited by CoSm1c gAm3r

Share this post


Link to post
Share on other sites
Prof_Farnsworth
When using

 

World.CreatePed()

 

and using

 

Ped.BecomeMissionCharacter()

 

to keep up a large group of mission peds, say approximately 35, and I have the script constantly replace "dead" or "nolongerneeded" peds:

 

Why is it that after around 100+ mission peds have been replaced they begin to spawn like a "statue" or "solid", with no brain and completely invulnerable?

 

Also, what can be done to prevent that? I need the pedestrian to remain a mission character to get the tasks and actions necessary, so if i nolonger want to use a ped is it better to at the desired distance "delete" the ped or go with "nolongerneeded" if it's a mission ped? Does one over the other leave a "memory leak" i believe it may be referred to?

 

@AngryAmoeba

I've been running the "if exists(x) andalso x isnot nothing" and though it looks confusing as you mentioned, it works quite well biggrin.gif I know it would be smart of me to look into c#, but i'm not a coder and v.b. "looked" easier to understand as i looked over the two when i decided to try to code my first .net script.

It would appear that this is caused by overloading the engine, or the scripthook. I have the same thing happen when I put the update to my business mod into my game. It creates around 90 objects and blips right now, along with the associated business functions.

 

Try this test. The next time you see a frozen ped. Try to go bowling. If the ball gets stuck in midair and/or the pins don't react properly, then I would suspect we have the same problem.

 

Unfortunately, I do not know of a solution. I tried splitting mine into two separate scripts. They work separately, about 45 businesses each, but when run together, the statue peds come back.

 

Only suggestion I have is lowering the amount of peds slowly. The mod I'm working on now spawns 16-17, so you should be able to go at least that high.

Share this post


Link to post
Share on other sites
motorsport71

@Prof_Farnsworth

 

Thanks, I've already split the script up so it wouldn't matter if i added / changed something else. I'll give it a try. Many appreciations. Also thanks for the insight as to what the issue may be, it'll give me something to watch for from now on.

Share this post


Link to post
Share on other sites
Deletor

I am having a nightmare of a time with the .Net Script Hook v1.7.1.7 BETA. As I understand it, the .NET scripthook includes the C++ scripthook within itself, and even though the 1.7.1.7 Beta release is purported to support GTA 1.0.4.0 (requirements state "version 1.0.1.0 up to version 1.0.7.0"), when I run the game with it installed it crashes every time on loading a savegame.

 

The ScriptHookDotNet.log records:

 

2012-04-21 12:01:23 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.4.0 with C++ Hook version 0.5.1)

 

2012-04-21 12:01:24 - WARNING: Your C++ ScriptHook version 0.5.1 and GTA IV version 1.0.4.0 are NOT known to be compatible! Use C++ ScriptHook version 0.4.0 or the newest version of the game AND the C++ ScriptHook instead!

 

 

And from the ScriptHook.log:

 

Log start: Sat Apr 21 12:01:20 2012

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

[iNFO] GTA IV Script Hook 0.5.1 - © 2009, Aru - Initialized

[iNFO] Process base address: 0x1c0000

[iNFO] Auto detecting game version

[iNFO] Using game version 1.0.4

[iNFO] [scriptHookDotNet] Thread started

 

Thus it is obvious that somehow the .Net Script Hook v1.7.1.7 BETA is NOT compatible with GTA 1.0.4.0 (at least for me).

 

HazardX, can you please release a version which has the C++ scripthook compatible with GTA 1.0.4.0? There is a good reason for using 1.0.4.0, as 1.0.7.0 is not supported well by the ENB plugin and presets. Or am I missing something here? I have searched for the answer but none is to be found. Often there is a suggestion to use both the .Net and C++ scripthooks together, but since both have the same name ScriptHook.dll I fail to see how that is possible.

 

Thanks in advance smile.gif

Share this post


Link to post
Share on other sites
Prof_Farnsworth
I am having a nightmare of a time with the .Net Script Hook v1.7.1.7 BETA. As I understand it, the .NET scripthook includes the C++ scripthook within itself, and even though the 1.7.1.7 Beta release is purported to support GTA 1.0.4.0 (requirements state "version 1.0.1.0 up to version 1.0.7.0"), when I run the game with it installed it crashes every time on loading a savegame.

 

The ScriptHookDotNet.log records:

 

2012-04-21 12:01:23 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.4.0 with C++ Hook version 0.5.1)

 

2012-04-21 12:01:24 - WARNING: Your C++ ScriptHook version 0.5.1 and GTA IV version 1.0.4.0 are NOT known to be compatible! Use C++ ScriptHook version 0.4.0 or the newest version of the game AND the C++ ScriptHook instead!

 

 

And from the ScriptHook.log:

 

Log start: Sat Apr 21 12:01:20 2012

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

[iNFO] GTA IV Script Hook 0.5.1 - © 2009, Aru - Initialized

[iNFO] Process base address: 0x1c0000

[iNFO] Auto detecting game version

[iNFO] Using game version 1.0.4

[iNFO] [scriptHookDotNet] Thread started

 

Thus it is obvious that somehow the .Net Script Hook v1.7.1.7 BETA is NOT compatible with GTA 1.0.4.0 (at least for me).

 

HazardX, can you please release a version which has the C++ scripthook compatible with GTA 1.0.4.0? There is a good reason for using 1.0.4.0, as 1.0.7.0 is not supported well by the ENB plugin and presets. Or am I missing something here? I have searched for the answer but none is to be found. Often there is a suggestion to use both the .Net and C++ scripthooks together, but since both have the same name ScriptHook.dll I fail to see how that is possible.

 

Thanks in advance smile.gif

scripthook.net.dll and scripthook.dll are two separate files. You can use HazardX's scripthook.net.dll 1.7.1.7, but you need to get a lower version of scripthook.dll from Aru. If you are on GTA IV 1.0.4.0, you need version 0.4.0, not 0.5.1, just as the error log states.

Share this post


Link to post
Share on other sites
Deletor

Thanks so much Prof Farnsworth tounge.gif . The scripthook package itself comes with the dll named as ScriptHook.dll, and since this is also the name of the C++ dll I thought only one could be used at a time. I was already running the C++ dll, and now thanks to your tip can run the .NET dll as well. Gracias! cool.gif

Share this post


Link to post
Share on other sites
Axeman420

How can I store\restore rotational data from the player? (I saw Direction, it was Vector3, but, seemed to be read only, so I could only store the data.)

 

Request: A DoubleClick event for Forms\Controls would be nice, I can probably fake it, but those are very handy when working on ListBox types, and things like that. That way you can select an item(index\slot) via Click, and activate an action via DoubleClick.

 

---

 

Btw, awesome work on this, the possibilities are amazing.

 

I do a bit of hacking myself, and have a project that would benefit greatly from using a similar technique. I would love to learn from your work. (I have a basic idea of what's been done, but, can't quite figure it all out.)

 

Mind if I PM you, and get advice on it? (I won't bother you too much, just need a few questions answered.)

Edited by Axeman420

Share this post


Link to post
Share on other sites
MulleDK19
How can I store\restore rotational data from the player? (I saw Direction, it was Vector3, but, seemed to be read only, so I could only store the data.)

Use Rotation.

 

If you need to use direction use Helper.DirectionToRotation.

Share this post


Link to post
Share on other sites
Axeman420

Having a bit of trouble with peds going out of existence.

 

I have three checks for ped.Exist(), and some ped != null checks in place, and it STILL happens, apparently, peds can go out of existence mid function, which means, you would need to either wrap the whole thing in a try\catch(which may not be a good idea), wrap every ped related call with Exist() checks, or come up with a better solution on your end. (Not sure what could be done, outside of what you've done already, though.)

 

In particular, the exception has popped up while using a DecisionMaker. (ApplyTo(ped))

 

My script just randomly grabs a ped, and applies various behaviors to them.

 

 

   // Insane   public static void Insane(Ped p)   {       // Sanity Check (Keeps unwanted peds out, cops, etc,.)       if (!SanityCheck(p)) return;       // Toughen Up       DecisionMaker d = DecisionMaker.LoadBehavior(DecisionMaker.BehaviorTemplate.Tough);       d.ApplyTo(p);       // Go Nuts!       p.Task.ClearAll();       p.Weapons.FromType(Weapon.SMG_Uzi);       p.Weapons.Uzi.Ammo = 5000;       p.Weapons.Select(Weapon.SMG_Uzi);       p.StartKillingSpree(true);   }

 

 

For what it's worth, I didn't experience the error until I added the DecisionMaker.

 

 

Error during Tick in script 'PedsEnhanced':

                      GTA.NonExistingObjectException: Invalid call to an object that doesn't exist anymore!

                         at GTA.DecisionMaker.ApplyTo(Ped Ped)

                         at PedBehavior.Insane(Ped p)

                         at PedsEnhanced.PedsEnhanced_Tick(Object sender, EventArgs e)

                         at GTA.Script.TryTick()

                         at GTA.Script.DoTick()

                         at GTA.ScriptThread.OnTick()

 

 

---

 

Request:

 

I would love a custom task for use with TaskSequence.

 

That way I could have a ped, run somewhere, and then explode, or whatever.

 

 

public void CustomTask(Action<Ped> pAction){  // I don't know how you are storing the ped ref, but it needs passed here.. (Could let us supply it..)   pAction(ped);}TaskSequence task;task.AddTask.CustomTask(ExplodePed);void ExplodePed(Ped p){  World.Explode(p.Position); // pseudo...}

 

 

The hard bits, are triggering the custom sequence, and passing the ped ref around properly.

 

But, hopefully, it's doable. smile.gif

Edited by Axeman420

Share this post


Link to post
Share on other sites
slyde

How can I set EngineHealth to 0 (like, engine no working no more but without to set it on fire or crash the car)?

 

I already tryied to set it to 0 (Player.Caracter.CurrentVehicle.EngineHealth=0) but it doesn't work...

 

Some help would be appreciated!

Share this post


Link to post
Share on other sites
Axeman420

 

How can I set EngineHealth to 0 (like, engine no working no more but without to set it on fire or crash the car)?

 

I already tryied to set it to 0 (Player.Caracter.CurrentVehicle.EngineHealth=0) but it doesn't work...

 

Some help would be appreciated!

Are you sure your code is being executed? (Add a Game.DisplayText("I work!"); in there to be sure.)

 

Because, I wrote a script that fried engines on enemy vehicles using the same method, it works fine. (It may not work on the players vehicle, perhaps HazardX made code to avoid that, or something, but it should work.)

 

I believe you can turn off the engine via a command too, something like Vehicle.EngineRunning = false;, that may be more what you're looking for. (Edit: Player.Character.CurrentVehicle.EngineRunning = false;)

Edited by Axeman420

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.


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