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! ♥

@doggyboi74
Copy link

uh it doesnt really kill it just ragdolls me how do i make it so it actually just kills me i don't wanna mess anything up

@David-Lor
Copy link
Author

@doggyboi74 have you got scripthookv & scripthookvdotnet updated? for dotnet you actually should be using this https://github.com/scripthookvdotnet/scripthookvdotnet-nightly/releases

some things in gta v scripting got broken with some update during past year

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