Jump to content

Help me creating a vb script


RIPAciD

Recommended Posts

Hi guys, can someone help me to create a vb script?

I want to lock/unlock the car doors remotely, after locking the doors set alarm and when a ped is trying to steal the car, the alarm will start. Don't worry about peds stealing cars, I already have a mod called CriminalActs and peds are stealing cars, they steal money from your pocket, etc. :happy:

I can't create a script from start, I managed to edit some vb scripts but nothing more ...

An example of a lock/unlock script but this works only if the player is in vehicle.






Public Class LockPick

Inherits Script



Public vehlockveh As Vehicle



Public Sub New()

Interval = 1500

End Sub



Private Sub LockPick(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown

If e.Key = Keys.L Then

If Player.Character.isInVehicle Then

carlock()

End If

End If

End Sub

Private Sub carlock()

If ((Player.Character.CurrentVehicle.Model.isHelicopter Or Player.Character.CurrentVehicle.Model.isCar) And Player.Character.CurrentVehicle.GetPedOnSeat(VehicleSeat.Driver) = Player.Character) Then

If Not Player.Character.CurrentVehicle.DoorLock = DoorLock.None Then

Player.Character.CurrentVehicle.DoorLock = DoorLock.None

My.Computer.Audio.Play(Game.InstallFolder & "\scripts\LockPick\audio\unlock.wav")

Game.DisplayText("Doors open", 1000)

Else

Player.Character.CurrentVehicle.DoorLock = DoorLock.ImpossibleToOpen

My.Computer.Audio.Play(Game.InstallFolder & "\scripts\LockPick\audio\lock.wav")

Game.DisplayText("Doors locked!", 1000)

vehlockveh = Player.Character.CurrentVehicle

End If

End If

End Sub

Thank you!

Edited by RIPAciD
Link to comment
Share on other sites

Hi guys, can someone help me to create a vb script?

I want to lock/unlock the car doors remotely, after locking the doors set alarm and when a ped is trying to steal the car, the alarm will start. Don't worry about peds stealing cars, I already have a mod called CriminalActs and peds are stealing cars, they steal money from your pocket, etc. :happy:

I can't create a script from start, I managed to edit some vb scripts but nothing more ...

An example of a lock/unlock script but this works only if the player is in vehicle.






Public Class LockPick

Inherits Script



Public vehlockveh As Vehicle



Public Sub New()

Interval = 1500

End Sub



Private Sub LockPick(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown

If e.Key = Keys.L Then

If Player.Character.isInVehicle Then

carlock()

End If

End If

End Sub

Private Sub carlock()

If ((Player.Character.CurrentVehicle.Model.isHelicopter Or Player.Character.CurrentVehicle.Model.isCar) And Player.Character.CurrentVehicle.GetPedOnSeat(VehicleSeat.Driver) = Player.Character) Then

If Not Player.Character.CurrentVehicle.DoorLock = DoorLock.None Then

Player.Character.CurrentVehicle.DoorLock = DoorLock.None

My.Computer.Audio.Play(Game.InstallFolder & "\scripts\LockPick\audio\unlock.wav")

Game.DisplayText("Doors open", 1000)

Else

Player.Character.CurrentVehicle.DoorLock = DoorLock.ImpossibleToOpen

My.Computer.Audio.Play(Game.InstallFolder & "\scripts\LockPick\audio\lock.wav")

Game.DisplayText("Doors locked!", 1000)

vehlockveh = Player.Character.CurrentVehicle

End If

End If

End Sub

Thank you!

To do it remotely try making it so. if player.area = (5.0) then if e.key = keys.l then carlock() (this is not the correct code)

something of that nature, ive not got experience with IV scripst, but i do have experience with vb. sorry i couldent be of more help

|| All my New || Unreleased || Current, Mods can be found || HERE ||

Link to comment
Share on other sites

Yeah, but you must specify the player car not a random car, damn why I suck so much :(

I searched google for some tutorials but I found only a list of native events

--edit--

Oh yeah, I found scripthook.NET full documentation

I will read it, let's hope I'm not too stupid and I can learn something.

--edit--

Yeap, I'm to stupid, I also have an eye disease and that is a looong documentation, too much to read :sad:

--edit--

I found a script but is not vb, is C# car alarm

Edited by RIPAciD
Link to comment
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.



×
×
  • Create New...