public SafeLootItem(Safe safe, Vector3 offset) { Amount = Main.SafeRNG.Next(Main.SafeMinLoot, Main.SafeMaxLoot + 1); Object = API.shared.createObject(API.shared.getHashKey("bkr_prop_moneypack_01a"), safe.Position, new Vector3(0.0, 0.0, 0.0)); Object.attachTo(safe.Object.handle, null, offset, new Vector3(0.0, 0.0, 0.0)); Label = API.shared.createTextLabel("~g~$" + Amount, safe.Position, 7.5f, 0.65f, true); Label.attachTo(Object.handle, null, new Vector3(0, 0, 0.17), new Vector3(0, 0, 0)); }
public void CreateWeaponProp(Client player, WeaponHash weapon) { if (!WeaponData.ContainsKey(weapon)) { return; } RemoveWeaponProp(player, WeaponData[weapon].Type); // make sure player has the weapon if (Array.IndexOf(player.weapons, weapon) == -1) { return; } string bone = ""; Vector3 offset = new Vector3(0.0, 0.0, 0.0); Vector3 rotation = new Vector3(0.0, 0.0, 0.0); switch (WeaponData[weapon].Type) { case WeaponAttachmentType.RightLeg: bone = "SKEL_R_Thigh"; offset = new Vector3(0.02, 0.06, 0.1); rotation = new Vector3(-100.0, 0.0, 0.0); break; case WeaponAttachmentType.LeftLeg: bone = "SKEL_L_Thigh"; offset = new Vector3(0.08, 0.03, -0.1); rotation = new Vector3(-80.77, 0.0, 0.0); break; case WeaponAttachmentType.RightBack: bone = "SKEL_Spine3"; offset = new Vector3(-0.1, -0.15, -0.13); rotation = new Vector3(0.0, 0.0, 3.5); break; case WeaponAttachmentType.LeftBack: bone = "SKEL_Spine3"; offset = new Vector3(-0.1, -0.15, 0.11); rotation = new Vector3(-180.0, 0.0, 0.0); break; } GrandTheftMultiplayer.Server.Elements.Object temp_handle = API.createObject(API.getHashKey(WeaponData[weapon].Model), player.position, new Vector3()); temp_handle.attachTo(player.handle, bone, offset, rotation); player.setData(WeaponKeys[(int)WeaponData[weapon].Type], temp_handle); }
/// <summary> /// Перемещает груз в фургон /// </summary> private static void DetachBooty(Vehicle vehicle, Object bootyObject, int bootyCount) { var place = (MissionPlace)bootyObject.getData(PLACE_KEY); var offsets = MissionDataGetter.VansOffsets[place]; if (offsets.ContainsKey(bootyCount)) { bootyObject.detach(); bootyObject.position = vehicle.position; bootyObject.attachTo(vehicle, null, offsets[bootyCount], new Vector3(0.0, 0.0, 0.15)); ((List <Object>)vehicle.getData(ClanCourtyard.BOOTY_IN_TRUNK)).Add(bootyObject); } else { API.shared.deleteEntity(bootyObject); } }