Fix blip duplication and name issue

This commit is contained in:
Sardelka9515 2022-08-20 11:08:51 +08:00
parent 52cc9b647c
commit 3a088ddbfc
3 changed files with 15 additions and 15 deletions

View File

@ -90,17 +90,17 @@ namespace RageCoop.Client
{
p.FakeBlip=World.CreateBlip(p.Position);
}
if (p.Position.DistanceTo(Main.PlayerPosition)>500)
if (p.Character?.MainPed != null && p.Character.MainPed.Exists())
{
p.FakeBlip.Color=Scripting.API.Config.BlipColor;
p.FakeBlip.Scale=Scripting.API.Config.BlipScale;
p.FakeBlip.Sprite=Scripting.API.Config.BlipSprite;
p.FakeBlip.DisplayType=BlipDisplayType.Default;
p.FakeBlip.Position=p.Position;
p.FakeBlip.DisplayType = BlipDisplayType.NoDisplay;
}
else
{
p.FakeBlip.DisplayType=BlipDisplayType.NoDisplay;
p.FakeBlip.Color = Scripting.API.Config.BlipColor;
p.FakeBlip.Scale = Scripting.API.Config.BlipScale;
p.FakeBlip.Sprite = Scripting.API.Config.BlipSprite;
p.FakeBlip.DisplayType = BlipDisplayType.Default;
p.FakeBlip.Position = p.Position;
}
});

View File

@ -16,7 +16,7 @@ using System.Resources;
// Version informationr(
[assembly: AssemblyVersion("1.5.1.13")]
[assembly: AssemblyFileVersion("1.5.1.13")]
[assembly: AssemblyVersion("1.5.1.14")]
[assembly: AssemblyFileVersion("1.5.1.14")]
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]

View File

@ -115,7 +115,7 @@ namespace RageCoop.Client
internal override void Update()
{
if (Owner==null) { return; }
if (Owner==null) { OwnerID=OwnerID;return; }
if (IsPlayer)
{
RenderNameTag();
@ -155,11 +155,7 @@ namespace RageCoop.Client
{
PedBlip=MainPed.AddBlip();
if (IsPlayer)
{
// Main.Logger.Debug("blip:"+Player.Username);
Main.QueueAction(() => { PedBlip.Name=Owner.Username; });
}
PedBlip.Color=BlipColor;
PedBlip.Sprite=BlipSprite;
PedBlip.Scale=BlipScale;
@ -174,6 +170,10 @@ namespace RageCoop.Client
{
PedBlip.Sprite=BlipSprite;
}
if (IsPlayer && PedBlip.Name!=Owner.Username)
{
PedBlip.Name = Owner.Username;
}
}
if (!Clothes.SequenceEqual(_lastClothes))