Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Entity GetCurrentWeapon(Ped ped)
- {
- return Function.Call<Entity>(Hash.GET_CURRENT_PED_WEAPON_ENTITY_INDEX, player.Character);
- }
- private void ChangeWeaponModel()
- {
- Entity weap = null;
- Object weapObject = null;
- if ((weap = GetCurrentWeapon(Game.Player.Character)) != null)
- {
- if (weap.Model.Hash == WantedWeaponModelHash)
- {
- weapObject = Function.Call(Hash.CREATE_WEAPON_OBJECT, WantedWeaponHash, -1, weap.Position.X, weap.Position.Y, weap.Position.Z, true, weap.Heading/*Not sure about the heading, might need tweaking*/, 0);
- if (weapObject != null)
- {
- weapObject.AttachTo(Game.Player.Character, playerHandBoneIndex, weapObject.Position, new Vector3(objRot.X, objRot.Y, objRot.Z));
- Function.Call(Hash.CREATE_MODEL_SWAP, weapObject.Position.X, weapObject.Position.X, weapObject.Position.X, hashRadius, wantedWeaponModelHash, newWeaponModelHash, true);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement