Exemplo n.º 1
0
 private void API_onResourceStart()
 {
     DiscordBot.startBot();
     API.delay(2000, true, () =>
     {
         DiscordBot.sendMessageToServer($"[{Environment.MachineName}] Started Server: {serverIP}");
         DiscordBot.sendMessageToTesters($"[{Environment.MachineName}] Started Server: {serverIP}");
     });
 }
Exemplo n.º 2
0
        private void API_onPlayerDeath(Client player, NetHandle entityKiller, int weapon)
        {
            if (API.getEntityType(entityKiller) == EntityType.Player)
            {
                Client killer = API.getPlayerFromHandle(entityKiller);
                DiscordBot.sendMessageToServer(string.Format("{0} was killed by {1}", player.name, killer.name));
                return;
            }

            if (API.getEntityType(entityKiller) == EntityType.Vehicle)
            {
                DiscordBot.sendMessageToServer(string.Format("{0} was killed by a vehicle.", player.name));
                return;
            }

            DiscordBot.sendMessageToServer(string.Format("{0} was killed by unnatural causes.", player.name));
        }
Exemplo n.º 3
0
        private void API_onEntityDataChange(NetHandle entity, string key, object oldValue)
        {
            if (API.getEntityType(entity) != EntityType.Player)
            {
                return;
            }

            Client player = API.getPlayerFromHandle(entity);

            switch (key)
            {
            case "Instance":
                DiscordBot.sendMessageToServer(string.Format("{0} logged in.", player.name));
                return;

            case "Mission":
                DiscordBot.sendMessageToServer(string.Format("{0} joined a mission.", player.name));
                return;
            }
        }
Exemplo n.º 4
0
 private void API_onPlayerConnected(Client player)
 {
     DiscordBot.sendMessageToServer(string.Format("{0} connected.", player.name));
 }
Exemplo n.º 5
0
 private void API_onResourceStop()
 {
     DiscordBot.sendMessageToServer($"[{Environment.MachineName}] Stopped Server: {serverIP}");
     DiscordBot.sendMessageToTesters($"[{Environment.MachineName}] Stopped Server: {serverIP}");
 }