forked from HazardX/gta4_scripthookdotnet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
3,546 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Put scripts for the GTA IV .Net Script Hook into the "scripts" subfolder of your GTAIV installation. It should be the folder containing this file. DO NOT put code into this file here, it won't run. | ||
|
||
The following filetypes are supported: | ||
|
||
*.vb - for plain VisualBasic.Net scripts | ||
*.cs - for plain C# scripts | ||
*.net - for compiled scripts in any .Net language | ||
*.net.dll - for compiled scripts in any .Net language |
44 changes: 44 additions & 0 deletions
44
dist/scripts/for Developers/PlainScripts/InvincibilityScript.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Windows.Forms; | ||
using GTA; | ||
|
||
// ### Press the I key to become invincible against everything (besides falling damage) ### | ||
// ### Niko will still be affected by fire, explosions, etc. but won't die. ### | ||
|
||
public class InvincibilityScript : Script { | ||
|
||
bool bInvincible = false; | ||
const int HEALTH_VALUE = 500000; | ||
|
||
public InvincibilityScript() { | ||
Interval = 250; | ||
BindKey(Keys.I, new KeyPressDelegate(ToggleInvincibility)); | ||
this.Tick += new EventHandler(this.InvincibilityScript_Tick); | ||
} | ||
|
||
private void InvincibilityScript_Tick(object sender, EventArgs e) { | ||
if (bInvincible) { | ||
Player.Character.Health = HEALTH_VALUE; | ||
Player.Character.Armor = HEALTH_VALUE; | ||
} | ||
} | ||
|
||
private void ToggleInvincibility() { | ||
bInvincible = !bInvincible; | ||
Player.Character.ForceHelmet(bInvincible); // Show a helmet to visualize the invincibility | ||
if (bInvincible) { | ||
Player.MaxHealth = HEALTH_VALUE; | ||
Player.MaxArmor = HEALTH_VALUE; | ||
Player.Character.Health = HEALTH_VALUE; | ||
Player.Character.Armor = HEALTH_VALUE; | ||
Game.DisplayText("Invincible!"); | ||
} else { | ||
Player.MaxHealth = 100; | ||
Player.MaxArmor = 100; | ||
Player.Character.Health = 100; | ||
Player.Character.Armor = 100; | ||
Game.DisplayText("NOT invincible!"); | ||
} | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
dist/scripts/for Developers/PlainScripts/InvincibilityScript.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Imports System | ||
Imports System.Windows.Forms | ||
Imports GTA | ||
|
||
' ### Press the I key to become invincible against everything (besides falling damage) ### | ||
' ### Niko will still be affected by fire, explosions, etc. but won't die. ### | ||
|
||
Public Class InvincibilityScript | ||
Inherits Script | ||
|
||
Private bInvincible As Boolean = False | ||
Private Const HEALTH_VALUE As Integer = 500000 | ||
|
||
Public Sub New() | ||
Me.Interval = 250 | ||
BindKey(Keys.I, AddressOf ToggleInvincibility) | ||
End Sub | ||
|
||
Private Sub InvincibilityScript_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick | ||
If bInvincible Then | ||
Player.Character.Health = HEALTH_VALUE | ||
Player.Character.Armor = HEALTH_VALUE | ||
End If | ||
End Sub | ||
|
||
Private Sub ToggleInvincibility() | ||
bInvincible = Not bInvincible | ||
Player.Character.ForceHelmet(bInvincible) ' Show a helmet to visualize the invincibility | ||
If bInvincible Then | ||
Player.MaxHealth = HEALTH_VALUE | ||
Player.MaxArmor = HEALTH_VALUE | ||
Player.Character.Health = HEALTH_VALUE | ||
Player.Character.Armor = HEALTH_VALUE | ||
Game.DisplayText("Invincible!") | ||
Else | ||
Player.MaxHealth = 100 | ||
Player.MaxArmor = 100 | ||
Player.Character.Health = 100 | ||
Player.Character.Armor = 100 | ||
Game.DisplayText("NOT invincible!") | ||
End If | ||
End Sub | ||
|
||
End Class |
15 changes: 15 additions & 0 deletions
15
dist/scripts/for Developers/PlainScripts/PositionScript.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Windows.Forms; | ||
using GTA; | ||
|
||
public class PositionScript : Script { | ||
|
||
public PositionScript() { | ||
this.KeyDown += new GTA.KeyEventHandler(this.PositionScript_KeyDown); | ||
} | ||
|
||
private void PositionScript_KeyDown(object sender, GTA.KeyEventArgs e) { | ||
if (e.Key == Keys.Home) Game.DisplayText(Player.Character.Position.ToString()); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
dist/scripts/for Developers/PlainScripts/PositionScript.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Imports System | ||
Imports System.Windows.Forms | ||
Imports GTA | ||
|
||
Public Class PositionScript | ||
Inherits Script | ||
|
||
Private Sub PositionScript_KeyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown | ||
If e.Key = Keys.Home Then Game.DisplayText(Player.Character.Position.ToString) | ||
End Sub | ||
|
||
End Class |
36 changes: 36 additions & 0 deletions
36
dist/scripts/for Developers/TestScriptCS/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("TestScriptCS")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Microsoft")] | ||
[assembly: AssemblyProduct("TestScriptCS")] | ||
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("cad8122d-51c0-40c1-b0ee-5ba42044a065")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.