Quantcast

Jump to content

» «
Photo

[BETA] GTAIV .Net ScriptHook

2,951 replies to this topic
Highflex
  • Highflex

    Player Hater

  • Members
  • Joined: 09 Jan 2008
  • None

#151

Posted 03 February 2009 - 10:39 PM

i have a problem can't launch the game with this

user posted image

sjaak327
  • sjaak327

    Big Homie

  • Feroci
  • Joined: 01 Dec 2008
  • None
  • Modding Contribution Award

#152

Posted 03 February 2009 - 10:43 PM

QUOTE (THECOUNTER @ Feb 3 2009, 22:39)
i have a problem can't launch the game with this

user posted image

Try Yaasil instead of Alexander's asi loader.


algrn912005
  • algrn912005

    Player Hater

  • Members
  • Joined: 19 Jan 2009

#153

Posted 03 February 2009 - 11:07 PM

hi, I have a question:

How would I check to see if a car using World.GetClosestCar exists? Because when I use it and I am around no cars, the script gives me an error. I created a check once but somehow I forgot how I did it and it's bugging me.

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#154

Posted 03 February 2009 - 11:25 PM

QUOTE (algrn912005 @ Feb 4 2009, 00:07)
hi, I have a question:

How would I check to see if a car using World.GetClosestCar exists? Because when I use it and I am around no cars, the script gives me an error. I created a check once but somehow I forgot how I did it and it's bugging me.

CODE
dim v as Vehicle = World.GetClosestVehicle(Player.Character.Position, 3.0F)
If Exists(v) Then
  .... your code here ...
End If

Highflex
  • Highflex

    Player Hater

  • Members
  • Joined: 09 Jan 2008
  • None

#155

Posted 04 February 2009 - 12:04 AM

i want to create a boost mode when you press a button your car is faster for some seconds how can i do that? sorry not very good with coding suicidal.gif

Indi
  • Indi

    Don't cross the streams.

  • Andolini Mafia Family
  • Joined: 22 Nov 2008
  • None

#156

Posted 04 February 2009 - 12:17 AM

Hazard, how can you make people follow you on Bikes or something?

boomer678
  • boomer678

    Mark Chump

  • Members
  • Joined: 02 Jan 2009

#157

Posted 04 February 2009 - 12:40 AM

QUOTE (HazardX @ Feb 3 2009, 06:34)
QUOTE (boomer678 @ Feb 3 2009, 01:20)
Can you rotate objects 180 degrees? while spawning?

Sure. You have to do it right after spawning the object. if obj is the name of the newly spawned object, do the following:

CODE
obj.Heading += 180


@fengyeblade: Your answer is HERE. Please don't ask the same question in multiple threads.

ok ty. Also is it possible to reload a script with the console like. !reload (script name ) or something like that. so i dont have to keep exiting then starting gta just to see if one tiny change makes it work

pwd
  • pwd

    Player Hater

  • Members
  • Joined: 18 Jan 2009

#158

Posted 04 February 2009 - 01:22 AM

This looks amazing! i've got the console to appear with '~' but how do I execute a script? For instance, the bodyguard example uses Insert and Delete right? I press insert but nothing seems to happen. I've checked out the readmes but can't seem to find out how to get that to work blush.gif .

boomer678
  • boomer678

    Mark Chump

  • Members
  • Joined: 02 Jan 2009

#159

Posted 04 February 2009 - 01:23 AM

Hey hazard. Could it be possible to make a INGAME MENU using the thing you did to make the console. IT seems like it would be possible.

pwd
  • pwd

    Player Hater

  • Members
  • Joined: 18 Jan 2009

#160

Posted 04 February 2009 - 01:24 AM

This looks amazing! i've got the console to appear with '~' but how do I execute a script? For instance, the bodyguard example uses Insert and Delete right? I press insert but nothing seems to happen. I've checked out the readmes but can't seem to find out how to get that to work blush.gif .

boomer678
  • boomer678

    Mark Chump

  • Members
  • Joined: 02 Jan 2009

#161

Posted 04 February 2009 - 01:40 AM

QUOTE (pwd @ Feb 4 2009, 01:24)
This looks amazing! i've got the console to appear with '~' but how do I execute a script? For instance, the bodyguard example uses Insert and Delete right? I press insert but nothing seems to happen. I've checked out the readmes but can't seem to find out how to get that to work blush.gif .

Double post.... and is the body guard.vb script in ur scripts folder?

pwd
  • pwd

    Player Hater

  • Members
  • Joined: 18 Jan 2009

#162

Posted 04 February 2009 - 01:46 AM

Yes that was the problem... script wasn't in correct folder. Sorry about that, I promise I'll make up for it by making a unique script of some sort.

boomer678
  • boomer678

    Mark Chump

  • Members
  • Joined: 02 Jan 2009

#163

Posted 04 February 2009 - 01:55 AM

QUOTE (pwd @ Feb 4 2009, 01:46)
Yes that was the problem... script wasn't in correct folder. Sorry about that, I promise I'll make up for it by making a unique script of some sort.

ok..

Intosia
  • Intosia

    Playa

  • Members
  • Joined: 11 Dec 2008
  • None

#164

Posted 04 February 2009 - 01:45 PM Edited by Intosia, 04 February 2009 - 03:32 PM.

WAIT WHAT!? No ApplyForceToCar?? Damn! Please add it to the Vehicle object. moto_whistle.gif

Edit:

Is it possible to spawn a weapon and fire it?

iriedreadlock23
  • iriedreadlock23

    Dr. Frankenstein

  • Members
  • Joined: 14 Jan 2009

#165

Posted 04 February 2009 - 10:51 PM

When i ReloadScripts from console, game suddenly crashes. Why is that? Other than that, script hook works excellent.

boomer678
  • boomer678

    Mark Chump

  • Members
  • Joined: 02 Jan 2009

#166

Posted 05 February 2009 - 12:22 AM

QUOTE (iriedreadlock23 @ Feb 4 2009, 22:51)
When i ReloadScripts from console, game suddenly crashes. Why is that? Other than that, script hook works excellent.

same happens to me

iriedreadlock23
  • iriedreadlock23

    Dr. Frankenstein

  • Members
  • Joined: 14 Jan 2009

#167

Posted 05 February 2009 - 01:14 AM

How can i use model hashes in World.CreateObject function?

I have seen that you have used this:

World.CreateObject(&HD130ADEF, Player.Character.Position)

How do i create, for example this?

Park_ob_MH06 - 1617209877 - 0x6064AA15

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#168

Posted 05 February 2009 - 01:16 AM

QUOTE (iriedreadlock23 @ Feb 4 2009, 23:51)
When i ReloadScripts from console, game suddenly crashes. Why is that? Other than that, script hook works excellent.

Yes, that's a very nasty problem. Spent 2 whole days on it now and am not done yet. confused.gif The .Net Garbage Collector interfers with the unmanaged ingame threads. Found and fixed several problems with it already, but i still get crashes after 2-3 reloads. suicidal.gif

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#169

Posted 05 February 2009 - 01:26 AM Edited by HazardX, 05 February 2009 - 01:43 AM.

QUOTE (iriedreadlock23 @ Feb 5 2009, 02:14)
How can i use model hashes in World.CreateObject function?

I have seen that you have used this:

World.CreateObject(&HD130ADEF, Player.Character.Position)

How do i create, for example this?

Park_ob_MH06  -  1617209877  -  0x6064AA15

You can supply either any integer or any string value as a model. The framework will convert it to a model object by itself. Thus you can use one of the Following Methods:

CODE
World.CreateObject(&H6064AA15, World.GetGroundPosition(Player.Character.Position.Around(3)) ) // in VB
World.CreateObject(0x6064AA15, World.GetGroundPosition(Player.Character.Position.Around(3)) ) // in C#
World.CreateObject("Park_ob_MH06", World.GetGroundPosition(Player.Character.Position.Around(3))) // should work for both


[EDIT] CoMPMStR is right, do not use Player.Position directly. The objects will not spawn on the same position as the player. Use some offset instead like World.GetGroundPosition(Player.Character.Position.Around(3)). For Objects you also need to Freeze the position of the object after spawning, or it might just fall through the world. Many Objects have no world collision.

CoMPMStR
  • CoMPMStR

    CoMPuTer MAsSteR

  • Members
  • Joined: 18 Dec 2008

#170

Posted 05 February 2009 - 01:26 AM Edited by CoMPMStR, 05 February 2009 - 01:29 AM.

QUOTE (iriedreadlock23 @ Feb 4 2009, 19:14)
How can i use model hashes in World.CreateObject function?

I have seen that you have used this:

World.CreateObject(&HD130ADEF, Player.Character.Position)

How do i create, for example this?

Park_ob_MH06   -   1617209877   -  0x6064AA15

The easiest way to do it is like this:

CODE
World.CreateObject("Park_ob_MH06", World.GetGroundPosition(Player.Character.Position.Around(3)))

boomer678
  • boomer678

    Mark Chump

  • Members
  • Joined: 02 Jan 2009

#171

Posted 05 February 2009 - 01:36 AM

QUOTE (CoMPMStR @ Feb 5 2009, 01:26)
QUOTE (iriedreadlock23 @ Feb 4 2009, 19:14)
How can i use model hashes in World.CreateObject function?

I have seen that you have used this:

World.CreateObject(&HD130ADEF, Player.Character.Position)

How do i create, for example this?

Park_ob_MH06   -   1617209877   -  0x6064AA15

The easiest way to do it is like this:

CODE
World.CreateObject("Park_ob_MH06", World.GetGroundPosition(Player.Character.Position.Around(3)))

Yea, i think im gonna release a trainer + skate park ramp spawner

CoMPMStR
  • CoMPMStR

    CoMPuTer MAsSteR

  • Members
  • Joined: 18 Dec 2008

#172

Posted 05 February 2009 - 01:40 AM

QUOTE (boomer678 @ Feb 4 2009, 19:36)
QUOTE (CoMPMStR @ Feb 5 2009, 01:26)
QUOTE (iriedreadlock23 @ Feb 4 2009, 19:14)
How can i use model hashes in World.CreateObject function?

I have seen that you have used this:

World.CreateObject(&HD130ADEF, Player.Character.Position)

How do i create, for example this?

Park_ob_MH06   -   1617209877   -  0x6064AA15

The easiest way to do it is like this:

CODE
World.CreateObject("Park_ob_MH06", World.GetGroundPosition(Player.Character.Position.Around(3)))

Yea, i think im gonna release a trainer + skate park ramp spawner

My spawner script can now spawn objects and allow you to position them. Even though you have to cycle though to get to the skate ramps, they aren't that far from the end if you cycle in reverse. It's so much fun and adds so much more to the game. I can't thank HazardX enough. biggrin.gif

boomer678
  • boomer678

    Mark Chump

  • Members
  • Joined: 02 Jan 2009

#173

Posted 05 February 2009 - 01:43 AM

QUOTE (CoMPMStR @ Feb 5 2009, 01:40)
QUOTE (boomer678 @ Feb 4 2009, 19:36)
QUOTE (CoMPMStR @ Feb 5 2009, 01:26)
QUOTE (iriedreadlock23 @ Feb 4 2009, 19:14)
How can i use model hashes in World.CreateObject function?

I have seen that you have used this:

World.CreateObject(&HD130ADEF, Player.Character.Position)

How do i create, for example this?

Park_ob_MH06   -   1617209877   -  0x6064AA15

The easiest way to do it is like this:

CODE
World.CreateObject("Park_ob_MH06", World.GetGroundPosition(Player.Character.Position.Around(3)))

Yea, i think im gonna release a trainer + skate park ramp spawner

My spawner script can now spawn objects and allow you to position them. Even though you have to cycle though to get to the skate ramps, they aren't that far from the end if you cycle in reverse. It's so much fun and adds so much more to the game. I can't thank HazardX enough. biggrin.gif

I like spawning mine going full speed on a nrg900. then you get launchedd off it and do like 3 backflips
*edit//
do u got xfire? and hazard is an ingame menu possible yet with this

Intosia
  • Intosia

    Playa

  • Members
  • Joined: 11 Dec 2008
  • None

#174

Posted 05 February 2009 - 11:30 AM

QUOTE (HazardX @ Feb 5 2009, 01:16)
QUOTE (iriedreadlock23 @ Feb 4 2009, 23:51)
When i ReloadScripts from console, game suddenly crashes. Why is that? Other than that, script hook works excellent.

Yes, that's a very nasty problem. Spent 2 whole days on it now and am not done yet. confused.gif The .Net Garbage Collector interfers with the unmanaged ingame threads. Found and fixed several problems with it already, but i still get crashes after 2-3 reloads. suicidal.gif

I had this myself to yesterday. I used cs scripts. It sometimes also crashed when there are a error in the script. But i also managed to reload myscript like 7-8 in a row...

AnttiAnA
  • AnttiAnA

    Player Hater

  • Members
  • Joined: 12 Dec 2008

#175

Posted 05 February 2009 - 06:41 PM

Multiplayer crashes after 10-30 seconds, executing reloadscripts crashes the game too.

CoMPMStR
  • CoMPMStR

    CoMPuTer MAsSteR

  • Members
  • Joined: 18 Dec 2008

#176

Posted 05 February 2009 - 10:00 PM Edited by CoMPMStR, 05 February 2009 - 10:03 PM.

QUOTE (boomer678 @ Feb 4 2009, 19:43)
QUOTE (CoMPMStR @ Feb 5 2009, 01:40)
QUOTE (boomer678 @ Feb 4 2009, 19:36)
QUOTE (CoMPMStR @ Feb 5 2009, 01:26)
QUOTE (iriedreadlock23 @ Feb 4 2009, 19:14)
How can i use model hashes in World.CreateObject function?

I have seen that you have used this:

World.CreateObject(&HD130ADEF, Player.Character.Position)

How do i create, for example this?

Park_ob_MH06   -   1617209877   -  0x6064AA15

The easiest way to do it is like this:

CODE
World.CreateObject("Park_ob_MH06", World.GetGroundPosition(Player.Character.Position.Around(3)))

Yea, i think im gonna release a trainer + skate park ramp spawner

My spawner script can now spawn objects and allow you to position them. Even though you have to cycle though to get to the skate ramps, they aren't that far from the end if you cycle in reverse. It's so much fun and adds so much more to the game. I can't thank HazardX enough. biggrin.gif

I like spawning mine going full speed on a nrg900. then you get launchedd off it and do like 3 backflips
*edit//
do u got xfire? and hazard is an ingame menu possible yet with this

If you are going full speed, how do you know which way the ramp will spawn? You might be going in the opposite direction and hit the back of the ramp by accident (or the side), then fall off the bike. lol.gif At least with mine, you can spawn and position it just right, then get a bike and jump it. biggrin.gif I'm sure you can go back far enough to get full speed without the ramp disappearing, and if not, you just increase the distance. tounge.gif

No, I don't have xfire. I have gmail though, you can chat through that if you didn't know; directly from the browser. icon14.gif

I think you can do ingame menus using the new PerFrameDrawing method. Something like this:

CODE
Protected Overrides Sub PerFrameDrawing(ByVal Graphics As GTA.Graphics)

End Sub


I haven't done much work with it yet, but that's what it's there for. wink.gif

webbmister64
  • webbmister64

    Player Hater

  • Members
  • Joined: 25 Jun 2008

#177

Posted 05 February 2009 - 10:02 PM

Just wondering if you can bind keys in the console

For example; I tried this
CODE
bind "key" "spawn annihilator"

(doesn't work)

iriedreadlock23
  • iriedreadlock23

    Dr. Frankenstein

  • Members
  • Joined: 14 Jan 2009

#178

Posted 05 February 2009 - 10:36 PM Edited by iriedreadlock23, 06 February 2009 - 12:45 AM.

Frist, thanks for quicke replies.

Im interested Is there any way to push an object?

When i create object for example in air, how do i make it fall down?

There is applyforce native, so is there any way to apply force/push to objects?

boomer678
  • boomer678

    Mark Chump

  • Members
  • Joined: 02 Jan 2009

#179

Posted 05 February 2009 - 10:46 PM

QUOTE (iriedreadlock23 @ Feb 5 2009, 22:36)
Frist, thanks for quicke replies.

Im interested Is there any way to push and object?

When i create object for example in air, how do i make it fall down?

There is applyforce native, so is there any way to apply force/push to objects?

U gotta spawn it on ground, im gonna release a trainer soon with skate park ramp spawner

iriedreadlock23
  • iriedreadlock23

    Dr. Frankenstein

  • Members
  • Joined: 14 Jan 2009

#180

Posted 06 February 2009 - 12:15 AM

this question was for HazardX, but thanks anyway.

I asked is there a way to push/apply force to any created object with HazardX's ScriptHook library, or with any Native function. So objects actually fall from the sky.




5 user(s) are reading this topic

0 members, 5 guests, 0 anonymous users