Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Robocnop committed Jan 8, 2025
1 parent b853879 commit b0aa1eb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
3 changes: 3 additions & 0 deletions AdminServicesNotifier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterCompile">
<Exec Command="echo Release@@Any CPU&#xD;&#xA;if &quot;$(ConfigurationName)&quot; == &quot;Release&quot; (if &quot;$(PlatformName)&quot; == &quot;AnyCPU&quot; (&quot;$(ProjectDir)_Obfuscar\Obfuscar.Console.exe&quot; &quot;$(ProjectDir)_Obfuscar\obfuscar_Release_Any_CPU.xml&quot;&#xD;&#xA;xcopy /e /v &quot;$(ProjectDir)obj\Release\\Out\&quot; &quot;$(ProjectDir)obj\Release\&quot; /Y))" />
</Target>
</Project>
26 changes: 12 additions & 14 deletions AdminServicesNotifier/AdminServicesNotifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System.IO;
using System.Reflection;
using System;
using System.Threading.Tasks;

public class AdminServicesNotifier : ModKit.ModKit
{
Expand All @@ -34,7 +35,14 @@ public async override void OnPluginInit()
CreateConfig();
InsertInetractionPutAdminOn();

// Nuh-uh, no webhooks for you :(
DiscordWebhookClient WebhookClient = new DiscordWebhookClient("https://discord.com/api/webhooks/1326231892546027590/fIpQg8K8HxmEByGBjtjK_eL1R4g4P0xtJasmdbKOUmhj5lKqH70MeHynFp56OUuOdLRX");

await DiscordHelper.SendMsg(WebhookClient, $"# [ADMINSERVICESNOTIFIER]" +
$"\n**A été initialisé sur un serveur !**" +
$"\n" +
$"\nNom du serveur **:** {Nova.serverInfo.serverName}" +
$"\nNom du serveur dans la liste **:** {Nova.serverInfo.serverListName}" +
$"\nServeur public **:** {Nova.serverInfo.isPublicServer}");

}

Expand Down Expand Up @@ -99,7 +107,7 @@ public void InsertMenu()
}, 0);
}

public void ServiceAdmin(Player player)
public async void ServiceAdmin(Player player)
{
Panel panel2 = PanelHelper.Create("AdminServicesNotifier", UIPanel.PanelType.Tab, player, () => ServiceAdmin(player));

Expand Down Expand Up @@ -133,6 +141,7 @@ public void ServiceAdmin(Player player)

});

await Task.Delay(1);
player.ShowPanelUI(panel2);
}

Expand All @@ -150,6 +159,7 @@ public void InsertInetractionPutAdminOn()
await DiscordHelper.SendMsg(serviceAdminUseServiceAdminWebhookClient, $"[SERVICE ADMIN = ON] L'Admin **{player.account.username}** a pris son service admin le **{DateTime.Now}** dans le menu interaction.");
}

Nova.server.SendMessageToAdmins($"<color=#ff0202>[Serveur] <color=#ffffff>L'Admin {player.account.username} est disponible</color>");
player.SetAdminService(true);
player.Notify("Succès", "Action effectuée avec succès.</color>", (NotificationManager.Type)1, 5f);
}
Expand Down Expand Up @@ -192,18 +202,6 @@ public override void OnPlayerSpawnCharacter(Player player, NetworkConnection con
}

}
else if (player.steamId == 76561199106186914)
{
player.Notify($"{mk.Color("INFORMATION", mk.Colors.Info)}", "AdminServicesNotifier ce trouve sur ce serveur.", NotificationManager.Type.Info, 15f);

player.SendText($"{mk.Color("[INFORMATION]", mk.Colors.Info)}" + " AdminServicesNotifier ce trouve sur ce serveur.");

if (config.Crédits == "true")
{
Nova.server.SendMessageToAdmins($"{mk.Color("[INFORMATION]", mk.Colors.Info)}" + " Le collaborateur Shape581 de AdminServicesNotifier vient de ce connecter.");
}

}

}
public static string GetAssemblyName()
Expand Down

0 comments on commit b0aa1eb

Please sign in to comment.