ch3y3zze Posted October 8, 2012 Share Posted October 8, 2012 (edited) I actually wanted to write this when I first started scripting but forgot all about it. At the time a mod I used did this but it was part of a larger script I did not want to use so here I finally wrote a disarm script for myself and whoever wants this simple and fun to use feature uses the E key by default but u can change in the script itself namespace Disarm{ using System; using System.Windows.Forms; using GTA; using GTA.Native; public class Main : Script { AnimationSet anims = new AnimationSet("melee_counters"); public Main() { BindKey(Keys.E, DisarmPed); } bool isArmed(Ped theGunman) { if (theGunman.Weapons.CurrentType == Weapon.Unarmed || theGunman.Weapons.CurrentType == Weapon.Misc_Object) return false; return true; } void DisarmPed() { if (Game.LocalPlayer.Character.Weapons.CurrentType != Weapon.Unarmed) return; foreach (Ped gunman in World.GetPeds(Game.LocalPlayer.Character.Position, 5)) { if (!Game.Exists(gunman)) continue; if (gunman == Game.LocalPlayer.Character) continue; if (!gunman.isAliveAndWell) continue; if (!isArmed(gunman)) continue; if (Function.Call<bool>("IS_CHAR_FACING_CHAR", Game.LocalPlayer.Character, gunman, 45.0F) && Game.LocalPlayer.Character.Position.DistanceTo(gunman.Position) < 2.5f) { Game.LocalPlayer.Character.Animation.Play(anims, "disarm_knife_b", 1.0f); gunman.Task.PlayAnimation(anims, "disarmed_knife_b", 1.0f, AnimationFlags.Unknown01); Wait(800); gunman.DropCurrentWeapon(); gunman.ChangeRelationship(RelationshipGroup.Player, Relationship.Hate); if (gunman.PedType == PedType.Cop && Game.LocalPlayer.WantedLevel < 2) Game.LocalPlayer.WantedLevel = 2; } } } }} Gamers: https://dl.dropbox.com/u/55310026/Disarm.rar Devs: https://dl.dropbox.com/u/55310026/Disarm%20for%20Devs.rar Edited October 11, 2012 by ch3y3zze Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now