How to Set A bool Function for god mode

Posts 16 of 6 · Page 1 of 1
How to Set A bool Function for god mode
Can Someone Help Me With A bool Function i Have Have Memory Loss Help Me By Making a God Mode Bool Function That Works For The BGG Base
Here is an example of a God Mode script with some minor modifications. Maybe this will help to get you started?

 
GTA 5 God Mode Example

Code:
Imports GTA 'Define Necessary Imports Here
Imports System
Imports System.**** 'Define for Settings File
Imports System.Drawing
Imports System.Windows.Forms 'Needed for easy key access
Public Class Godmode
    Inherits Script
    Dim Player_Godmode_Always As Boolean
    Dim Car_Godmode_Always As Boolean
    Dim WindscreenFlight As Boolean
    Dim Player_Godmode_Toggle As Keys
    Dim Car_Godmode_Toggle As Keys
    Dim GodmodeEnabled As Boolean = False
    Dim CarGMEnabled As Boolean = False
    Public Sub New()
        If Not File.Exists(MyBase.Settings.Filename) Then 'If Settings File does not exist:
            Settings.SetValue("Always_Player_Godmode_On", False) 'Create option in settings file with default Bool as False
            Settings.SetValue("Always_Car_Godmode_On", False) 'Create option in settings file with default Bool as False
            Settings.SetValue("Toggle_Player_Godmode", Keys.Divide) 'Create option in settings file with default Key as Divide
            Settings.SetValue("Toggle_Car_Godmode", Keys.Multiply) 'Create option in settings file with default Key as Multiply
            Settings.SetValue("Can_Player_Fly_From_Windscreen_DuringGodmode", True) 'Create option in settings file with default Bool as True 
            Settings.Save() 'Used to save the settings we set
        End If
        Player_Godmode_Always = Settings.GetValueBool("Always_Player_Godmode_On", False) 'Get the Value of the Bool we specified (Default False)
        Car_Godmode_Always = Settings.GetValueBool("Always_Car_Godmode_On", False) 'Get the Value of the Bool we specified (Default False)
        WindscreenFlight = Settings.GetValueBool("Can_Player_Fly_From_Windscreen_DuringGodmode", True) 'Get the Value of the Bool we specified (Default True)
        Player_Godmode_Toggle = Settings.GetValueKey("Toggle_Player_Godmode", Keys.Divide) 'Get the Value of the Key we specified (Default Divide)
        Car_Godmode_Toggle = Settings.GetValueKey("Toggle_Car_Godmode", Keys.Multiply) 'Get the Value of the Key we specified (Default Multiply)
    End Sub
    Private Sub time_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick 'General Tick in GTA, will do all of the actions below in a tick
        If Player_Godmode_Always = True Then 'If Always Godmode has been set to True in the settings file,
            Player.Character.Invincible = True 'Make Player invincible
            Player.Character.Health = 100 'Set Player's health to 100 
            If WindscreenFlight = False Then 'If WindscreenFlight has been set to False in the settings file,
                Player.Character.WillFlyThroughWindscreen = False 'Player cannot fly through windscreen
            End If


            If WindscreenFlight = True Then 'Else if WindscreenFlight has been set to True in the settings file,
                Player.Character.WillFlyThroughWindscreen = True 'Player can fly through windscreen
            End If
        End If
        If Car_Godmode_Always = True AndAlso Exists(Player.Character.CurrentVehicle) Then 'If Always CarGodMode has been set to True in the settings file and exists Player vehicle,
            Player.Character.CurrentVehicle.CanTiresBurst = False 'Player's current vehicle's tire cannot be burst
            Player.Character.CurrentVehicle.CanBeDamaged = False 'Player's current vehicle cannot be damaged
            Player.Character.CurrentVehicle.CanBeVisiblyDamaged = False 'Player's current vehicle cannot be visibly damaged
        End If
    End Sub


    Shadows Sub KeyDownEvent(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown 'Keydown Event in GTA, will detect keydown
        If e.Key = Player_Godmode_Toggle AndAlso Player_Godmode_Always = False AndAlso GodmodeEnabled = False Then
            Player.Character.Invincible = True 'Make Player invincible
            Player.Character.Health = 100 'Set Player's health to 100 
            GodmodeEnabled = True
            Game.DisplayText("Godmode enabled.") 'Tell player it has been enabled
        ElseIf e.Key = Player_Godmode_Toggle AndAlso Player_Godmode_Always = False AndAlso GodmodeEnabled = True Then
            Player.Character.Invincible = False 'Make Player defeatable
            GodmodeEnabled = False
            Game.DisplayText("Godmode disabled.") 'Tell player it has been disabled


            If WindscreenFlight = False Then 'If WindscreenFlight has been set to False in the settings file,
                Player.Character.WillFlyThroughWindscreen = False 'Player cannot fly through windscreen
            ElseIf WindscreenFlight = True Then 'If WindscreenFlight has been set to True in the settings file,
                Player.Character.WillFlyThroughWindscreen = True
            End If


        End If
        If e.Key = Car_Godmode_Toggle AndAlso Car_Godmode_Always = False AndAlso Exists(Player.Character.CurrentVehicle) AndAlso CarGMEnabled = False Then
            Player.Character.CurrentVehicle.CanTiresBurst = False 'Player's current vehicle's tire cannot be burst
            Player.Character.CurrentVehicle.CanBeDamaged = False 'Player's current vehicle cannot be damaged
            Player.Character.CurrentVehicle.CanBeVisiblyDamaged = False 'Player's current vehicle cannot be visibly damaged
            CarGMEnabled = True
            Game.DisplayText("Car Godmode enabled.") 'Tell player it has been enabled
        ElseIf e.Key = Car_Godmode_Toggle AndAlso Car_Godmode_Always = False AndAlso Exists(Player.Character.CurrentVehicle) AndAlso CarGMEnabled = True Then
            Player.Character.CurrentVehicle.CanTiresBurst = True 'Player's current vehicle's tire can be burst
            Player.Character.CurrentVehicle.CanBeDamaged = True 'Player's current vehicle can be damaged
            Player.Character.CurrentVehicle.CanBeVisiblyDamaged = True 'Player's current vehicle can be visibly damaged
            CarGMEnabled = False
            Game.DisplayText("Car Godmode disabed.") 'Tell player it has been disabled
        End If
    End Sub
End Class
Maybe you should learn C++ basics first?
Quote Originally Posted by PepinCZ View Post
Maybe you should learn C++ basics first?
Well Its Too Late Because BGG Base Is Patched For Me I Am Making An Application
C++ was the language of the elders. You could make any point that you wanted.
Been over a week since last update/bump/answer, marked as "Unresolved" .

/Closed.
Posts 16 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?