Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading.Tasks;
- using GTANetworkAPI;
- using VMP_CNR.Module.Players.Buffs;
- using VMP_CNR.Module.Players.Db;
- using VMP_CNR.Module.Players.PlayerAnimations;
- namespace VMP_CNR.Module.Items.Scripts
- {
- public static partial class ItemScript
- {
- public static bool joint(DbPlayer iPlayer, ItemModel ItemData)
- {
- if (iPlayer.Player.IsInVehicle)
- {
- return false;
- }
- bool antiinterrupt = false;
- if (iPlayer.HasData("disableAnim"))
- {
- antiinterrupt = Convert.ToBoolean(iPlayer.GetData("disableAnim"));
- }
- if (antiinterrupt)
- {
- return false;
- }
- Task.Run(async () =>
- {
- iPlayer.PlayAnimation( (int)(AnimationFlags.Loop | AnimationFlags.AllowPlayerControl), Main.AnimationList["joint_start"].Split()[0], Main.AnimationList["joint_start"].Split()[1]);
- iPlayer.Player.TriggerEvent("freezePlayer", true);
- await Task.Delay(8000);
- iPlayer.PlayAnimation( (int)(AnimationFlags.Loop | AnimationFlags.AllowPlayerControl), Main.AnimationList["joint_end"].Split()[0], Main.AnimationList["joint_end"].Split()[1]);
- await Task.Delay(2500);
- iPlayer.Player.TriggerEvent("freezePlayer", false);
- NAPI.Player.StopPlayerAnimation(iPlayer.Player);
- int actArmor = NAPI.Player.GetPlayerArmor(iPlayer.Player);
- int jointBuff = 20;
- int newArmor = 0;
- int maxArmor = 80;
- if(actArmor >= maxArmor - jointBuff)
- newArmor = maxArmor;
- else
- newArmor = actArmor + 20;
- NAPI.Player.SetPlayerArmor(iPlayer.Player, newArmor);
- });
- /*Altes System von Jeff - leider verbuggt
- iPlayer.SetJointBuffs();
- iPlayer.IncreasePlayerDrugInfection();
- */
- // RefreshInventory
- return true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement