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; }
public WeaponType FromID(WeaponID id) { WeaponType retval = null; if (weaponCache == null) { weaponCache = new Dictionary<WeaponID, WeaponType>(); } else if (weaponCache.TryGetValue(id, out retval)) { return retval; } retval = new WeaponType(character, id); weaponCache.Add(id, retval); return retval; }
public void ForceWeapon(WeaponID type) { var weapon = new WeaponType(null, type); GTAUtils.SetPlayerWeaponSlot(weapon.Slot); }