@@ -35,11 +35,17 @@ namespace ReallifeGamemode.Server.Util
|
||||
List<string> nextAnimations = animations.Skip(1).ToList();
|
||||
player.SyncAnimation(animationName);
|
||||
|
||||
if (nextAnimations.Count != 0)
|
||||
if (nextAnimations.Count is 0)
|
||||
{
|
||||
player.TriggerEvent("SERVER:QueueAnimation", animationName);
|
||||
animationPair.Add(player, nextAnimations);
|
||||
animationPair.Remove(player);
|
||||
return;
|
||||
}
|
||||
|
||||
player.TriggerEvent("SERVER:QueueAnimation", animationName);
|
||||
if (animationPair.ContainsKey(player))
|
||||
animationPair[player] = nextAnimations;
|
||||
else
|
||||
animationPair.Add(player, nextAnimations);
|
||||
}
|
||||
|
||||
/// <summary>Check if Player has any Animation playing.
|
||||
@@ -55,6 +61,8 @@ namespace ReallifeGamemode.Server.Util
|
||||
/// <param name="animationName">Name of requested animation</param>
|
||||
public static bool HasAnimation(this Player player, dynamic animationName)
|
||||
{
|
||||
string data = player.GetData<string>("Animation");
|
||||
bool x = player.GetData<string>("Animation") == animationName;
|
||||
return player.HasData("Animation") && (player.GetData<string>("Animation") == animationName);
|
||||
}
|
||||
|
||||
@@ -82,9 +90,11 @@ namespace ReallifeGamemode.Server.Util
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:ClearAnimationData")]
|
||||
public void ClearAnimationData(Player player, Player target)
|
||||
public void ClearAnimationData(Player player, bool checkTransition)
|
||||
{
|
||||
target.ClearAnimation();
|
||||
player.ClearAnimation();
|
||||
if (checkTransition)
|
||||
AnimPairTransition(player);
|
||||
}
|
||||
|
||||
[ServerEvent(Event.PlayerWeaponSwitch)]
|
||||
|
||||
Reference in New Issue
Block a user