Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
899
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. using System;
  2. using System.Threading.Tasks;
  3. using GTANetworkAPI;
  4. using VMP_CNR.Module.Players.Buffs;
  5. using VMP_CNR.Module.Players.Db;
  6. using VMP_CNR.Module.Players.PlayerAnimations;
  7.  
  8. namespace VMP_CNR.Module.Items.Scripts
  9. {
  10. public static partial class ItemScript
  11. {
  12. public static bool joint(DbPlayer iPlayer, ItemModel ItemData)
  13. {
  14. if (iPlayer.Player.IsInVehicle)
  15. {
  16. return false;
  17. }
  18.  
  19. bool antiinterrupt = false;
  20. if (iPlayer.HasData("disableAnim"))
  21. {
  22. antiinterrupt = Convert.ToBoolean(iPlayer.GetData("disableAnim"));
  23. }
  24.  
  25. if (antiinterrupt)
  26. {
  27. return false;
  28. }
  29.  
  30. Task.Run(async () =>
  31. {
  32. iPlayer.PlayAnimation( (int)(AnimationFlags.Loop | AnimationFlags.AllowPlayerControl), Main.AnimationList["joint_start"].Split()[0], Main.AnimationList["joint_start"].Split()[1]);
  33. iPlayer.Player.TriggerEvent("freezePlayer", true);
  34. await Task.Delay(8000);
  35. iPlayer.PlayAnimation( (int)(AnimationFlags.Loop | AnimationFlags.AllowPlayerControl), Main.AnimationList["joint_end"].Split()[0], Main.AnimationList["joint_end"].Split()[1]);
  36. await Task.Delay(2500);
  37. iPlayer.Player.TriggerEvent("freezePlayer", false);
  38. NAPI.Player.StopPlayerAnimation(iPlayer.Player);
  39. int actArmor = NAPI.Player.GetPlayerArmor(iPlayer.Player);
  40. int jointBuff = 20;
  41. int newArmor = 0;
  42. int maxArmor = 80;
  43.  
  44. if(actArmor >= maxArmor - jointBuff)
  45. newArmor = maxArmor;
  46. else
  47. newArmor = actArmor + 20;
  48.  
  49. NAPI.Player.SetPlayerArmor(iPlayer.Player, newArmor);
  50. });
  51.  
  52. /*Altes System von Jeff - leider verbuggt
  53. iPlayer.SetJointBuffs();
  54. iPlayer.IncreasePlayerDrugInfection();
  55. */
  56. // RefreshInventory
  57. return true;
  58. }
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement