Skip to content

Instantly share code, notes, and snippets.

@David-Lor
Created January 1, 2021 18:01
Show Gist options
  • Save David-Lor/1afced78a8ed8432357f453a62431f13 to your computer and use it in GitHub Desktop.
Save David-Lor/1afced78a8ed8432357f453a62431f13 to your computer and use it in GitHub Desktop.
GTA V - "Kill Player on Demand" script
using System.Windows.Forms;
using GTA;
using GTA.Native;
public class KillPlayerOnDemand : Script {
public KillPlayerOnDemand() {
KeyUp += OnKeyUp;
}
private void OnKeyUp(object sender, KeyEventArgs e) {
if (e.KeyCode == Keys.K) {
GTA.Native.Function.Call(Hash.SET_PED_TO_RAGDOLL, Game.Player.Character, 30000, 30000, 0, 1, 1, 1);
Game.Player.Character.Kill();
}
}
}
@VertofChest
Copy link

Perfect! ♥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment