public static Pickup CreatePickup(Vector3 position, WeaponID weaponType, int ammo) { var weapon = new WeaponType(null, weaponType); var model = weapon.Model; var group = weapon.Slot; if (group == 11 || group == 1 || group == 2) { return(Pickup.CreatePickup(position, model, PickupType.PickupRespawn)); } var retval = Internal.Function.Call <Pickup>(0x032B, model, group, ammo, position); PickupHandler.Register(retval); retval._origPos = position; return(retval); }
void TestScript1_Tick(object sender, EventArgs e) { Pickup.CreatePickup(new Vector3(1.23f, 1.23f, 1.23f), WeaponID.Assault_AK47, 500); if (myPed == null) { myPed = World.CreatePed(PedID.WFYSEX, Player.Character.Position.Around(10), 23); myBlip = Blip.AddBlip(myPed); myBlip.Color = BlipColor.Pickup; Player.Character.Weapons[WeaponID.Assault_M4].Load(); Player.Character.Weapons[WeaponID.Assault_M4].Ammo = 200; Player.Character.Weapons[WeaponID.Assault_M4].Select(); } if (!myPed.IsAlive) { myBlip.Delete(); myPed = null; } }