Skip to content

Instantly share code, notes, and snippets.

@aveao
Created July 25, 2015 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aveao/7550e85f801d18b8049e to your computer and use it in GitHub Desktop.
Save aveao/7550e85f801d18b8049e to your computer and use it in GitHub Desktop.
First version of DankNet Menu
//http://github.com/ardaozkal/DankNet-GTAV is current version
//This one took me about 15 mins to write, then I turned this into a menu, which ended up being the (arguably and self claimed) best .Net menu.
using System;
using GTA;
using GTA.Math;
using GTA.Native;
using System.Windows.Forms;
public class SmallTrainer : Script
{
public SmallTrainer()
{
this.KeyUp += this.OnKeyUp;
}
bool contfix = false;
private void OnKeyUp(object sender, KeyEventArgs e)
{
int currentwantedlevel = Game.Player.WantedLevel;
Ped player = Game.Player.Character;
if (e.KeyCode == Keys.F7 || contfix == true)
{
if (player.IsInVehicle())
{
Vehicle vehicle = player.CurrentVehicle;
vehicle.CanBeVisiblyDamaged = false;
vehicle.CanTiresBurst = false;
vehicle.EngineRunning = true;
vehicle.IsDriveable = true;
vehicle.IsStolen = false;
vehicle.BodyHealth = vehicle.MaxHealth;
vehicle.EngineHealth = vehicle.MaxHealth;
vehicle.Repair();
vehicle.IsInvincible = true;
contfix = true;
}
else
{
contfix = false;
}
}
if (e.KeyCode == Keys.F5)
{
if (currentwantedlevel != 0)
{
currentwantedlevel--;
}
}
if (e.KeyCode == Keys.F6)
{
if (currentwantedlevel != 5)
{
currentwantedlevel++;
}
}
Game.Player.WantedLevel = currentwantedlevel;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment