Quantcast

Jump to content

» «
Photo

Visual studio 2010: script toggle on/off

3 replies to this topic
muro808
  • muro808

    Player Hater

  • Members
  • Joined: 06 Apr 2013

#1

Posted 18 August 2013 - 06:11 PM

What i want to try out (it is my first time ever without any use of a tutorial) is to make this script:

http://www.gtagarage...ow.php?id=11675

toggle on / off with the same button.

As you see in the description it sais:

Press insert to enable slowmotion mode.
Press delete to disable slowmotion mode.

I want to edit it with visual studio 2010 so i dont need to do:

insert: on
delete: off

but enable it with middle mouse button and disabling it when pressing middle mouse button again.
Any Suggestions?

Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#2

Posted 20 August 2013 - 06:14 PM

Hi,

VB CODE:
CODE
Imports System
Imports System.Windows.Forms
Imports GTA

' ### Press MiddleMouseButton to change TIME_SCALE! ###

' Original Script by : TheGrim
' Proper Version by  : Skorpro

Public Class SlowMotionScript
  Inherits Script

  Private onOff As Boolean = True
 
  Public Sub New()
     Interval = 250
  End Sub

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

 If e.Key = Keys.MButton AndAlso onOff = True Then
           Native.Function.Call("SET_TIME_SCALE", 0.5)
           Game.DisplayText("Slowmotion mode Enabled")
  onOff = False
 ElseIf e.Key = Keys.MButton AndAlso onOff = False Then
  Native.Function.Call("SET_TIME_SCALE", 1.0)
           Game.DisplayText("Slowmotion mode Disabled")
  onOff = True
 End If
  End Sub

End Class

Note:
  • Original VB script by TheGrim
  • C++ is my language! I have NO experience with VB ... so maybe there is a smarter way to do that wink.gif Anyway... it works smile.gif
c ya

muro808
  • muro808

    Player Hater

  • Members
  • Joined: 06 Apr 2013

#3

Posted 20 August 2013 - 06:55 PM Edited by muro808, 21 August 2013 - 03:00 PM.

Thanks, ill try it out now biggrin.gif

Edit: does not seem to work, but i appreciate youre help biggrin.gif
EDIT 2: Suddenly i tried againg and it works biggrin.gif thanks!

Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#4

Posted 24 August 2013 - 10:15 AM

You're welcome biggrin.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users