예제 #1
0
        private void KickPlayer([FromSource] Player source, int target, string kickReason = "You have been kicked from the server.")
        {
            if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Kick") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") ||
                IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
            {
                // If the player is allowed to be kicked.
                Player targetPlayer = Players[target];
                if (targetPlayer != null)
                {
                    if (!IsPlayerAceAllowed(targetPlayer.Handle, "vMenu.DontKickMe"))
                    {
                        TriggerEvent("vMenu:KickSuccessful", source.Name, kickReason, targetPlayer.Name);

                        KickLog($"Player: {source.Name} has kicked: {targetPlayer.Name} for: {kickReason}.");
                        TriggerClientEvent(player: source, eventName: "vMenu:Notify", args: $"The target player (<C>{targetPlayer.Name}</C>) has been kicked.");

                        // Kick the player from the server using the specified reason.
                        DropPlayer(targetPlayer.Handle, kickReason);
                        return;
                    }
                    // Trigger the client event on the source player to let them know that kicking this player is not allowed.
                    TriggerClientEvent(player: source, eventName: "vMenu:Notify", args: "Sorry, this player can ~r~not ~w~be kicked.");
                    return;
                }
                TriggerClientEvent(player: source, eventName: "vMenu:Notify", args: "An unknown error occurred. Report it here: vespura.com/vmenu");
            }
            else
            {
                BanManager.BanCheater(source);
            }
        }
예제 #2
0
 /// <summary>
 /// Teleport a specific player to another player.
 /// </summary>
 /// <param name="source"></param>
 /// <param name="target"></param>
 private void SummonPlayer([FromSource] Player source, int target)
 {
     if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Summon") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") ||
         IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
     {
         // Trigger the client event on the target player to make them teleport to the source player.
         Player targetPlayer = Players[target];
         if (targetPlayer != null)
         {
             TriggerClientEvent(player: targetPlayer, eventName: "vMenu:GoToPlayer", args: source.Handle);
             TriggerEvent("ex_logger:SendLogBot", new
             {
                 source       = int.Parse(source.Handle),
                 target       = target,
                 channel      = 646040318214406154,
                 content      = $"**Przyciagnal gracza**",
                 scriptName   = "vMenu",
                 functionName = "SummonPlayer",
             });
             return;
         }
         TriggerClientEvent(player: source, eventName: "vMenu:Notify", args: "An unknown error occurred. Report it here: vespura.com/vmenu");
     }
     else
     {
         BanManager.BanCheater(source);
     }
 }
예제 #3
0
 /// <summary>
 /// Kill a specific player.
 /// </summary>
 /// <param name="source"></param>
 /// <param name="target"></param>
 private void KillPlayer([FromSource] Player source, int target)
 {
     if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Kill") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") ||
         IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
     {
         Player targetPlayer = Players[target];
         if (targetPlayer != null)
         {
             // Trigger the client event on the target player to make them kill themselves. R.I.P.
             TriggerClientEvent(player: targetPlayer, eventName: "vMenu:KillMe", args: source.Name);
             TriggerEvent("ex_logger:SendLogBot", new
             {
                 source       = int.Parse(source.Handle),
                 target       = target,
                 channel      = 635764211284180999,
                 content      = $"**Zabil**",
                 scriptName   = "vMenu",
                 functionName = "KillPlayer",
             });
             return;
         }
         TriggerClientEvent(player: source, eventName: "vMenu:Notify", args: "An unknown error occurred. Report it here: vespura.com/vmenu");
     }
     else
     {
         BanManager.BanCheater(source);
     }
 }
예제 #4
0
        /// <summary>
        /// Kick a specific player.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        /// <param name="kickReason"></param>
        private void KickPlayer([FromSource] Player source, int target, string kickReason = "You have been kicked from the server.")
        {
            if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Kick") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") || IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
            {
                // If the player is allowed to be kicked.
                var targetPlayer = new PlayerList()[target];
                if (!IsPlayerAceAllowed(targetPlayer.Handle, "vMenu.DontKickMe"))
                {
                    TriggerEvent("vMenu:KickSuccessful", source.Name, kickReason, targetPlayer.Name);
                    // Kick the player from the server using the specified reason.
                    DropPlayer(targetPlayer.Handle, kickReason);
                    return;
                }
                // Trigger the client event on the source player to let them know that kicking this player is not allowed.
                TriggerClientEvent(player: source, eventName: "vMenu:KickCallback", args: "Sorry, this player can ~r~not ~w~be kicked.");

                return;
            }
            else
            {
                BanManager.BanCheater(new PlayerList()[target]);
            }
            //// If this happens, the person who thinks they're funny knows exactly what this is for.
            //TriggerClientEvent(player: source, eventName: "vMenu:KickCallback", args: "Have a nice day :)");
            //// todo: Make sure they enjoy their day.
        }
예제 #5
0
 /// <summary>
 /// Teleport a specific player to another player.
 /// </summary>
 /// <param name="source"></param>
 /// <param name="target"></param>
 private void SummonPlayer([FromSource] Player source, int target)
 {
     if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Summon") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") || IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
     {
         // Trigger the client event on the target player to make them teleport to the source player.
         var targetPlayer = new PlayerList()[target];
         TriggerClientEvent(player: targetPlayer, eventName: "vMenu:GoToPlayer", args: source.Handle);
         return;
     }
     else
     {
         BanManager.BanCheater(new PlayerList()[target]);
     }
 }
예제 #6
0
 /// <summary>
 /// Kill a specific player.
 /// </summary>
 /// <param name="source"></param>
 /// <param name="target"></param>
 private void KillPlayer([FromSource] Player source, int target)
 {
     if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Kill") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") || IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
     {
         var targetPlayer = new PlayerList()[target];
         // Trigger the client event on the target player to make them kill themselves. R.I.P.
         TriggerClientEvent(player: targetPlayer, eventName: "vMenu:KillMe");
         return;
     }
     else
     {
         BanManager.BanCheater(new PlayerList()[target]);
     }
 }
예제 #7
0
 private void SummonPlayer([FromSource] Player source, int target)
 {
     if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Summon") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") ||
         IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
     {
         // Trigger the client event on the target player to make them teleport to the source player.
         Player targetPlayer = Players[target];
         if (targetPlayer != null)
         {
             TriggerClientEvent(player: targetPlayer, eventName: "vMenu:GoToPlayer", args: source.Handle);
             return;
         }
         TriggerClientEvent(player: source, eventName: "vMenu:Notify", args: "An unknown error occurred. Report it here: vespura.com/vmenu");
     }
     else
     {
         BanManager.BanCheater(source);
     }
 }
예제 #8
0
 private void KillPlayer([FromSource] Player source, int target)
 {
     if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Kill") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") ||
         IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
     {
         Player targetPlayer = Players[target];
         if (targetPlayer != null)
         {
             // Trigger the client event on the target player to make them kill themselves. R.I.P.
             TriggerClientEvent(player: targetPlayer, eventName: "vMenu:KillMe", args: source.Name);
             return;
         }
         TriggerClientEvent(player: source, eventName: "vMenu:Notify", args: "An unknown error occurred. Report it here: vespura.com/vmenu");
     }
     else
     {
         BanManager.BanCheater(source);
     }
 }
예제 #9
0
 /// <summary>
 /// Dump the language text
 /// </summary>
 /// <param name="source"></param>
 /// <param name="text"></param>
 private void DumpLanguages([FromSource] Player source, string text)
 {
     if (IsPlayerAceAllowed(source.Handle, "vMenu.DumpLanguages.Dump") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") ||
         IsPlayerAceAllowed(source.Handle, "vMenu.DumpLanguages.All"))
     {
         if (!SaveResourceFile(GetCurrentResourceName(), "dumped_text.json", text, -1))
         {
             Log("Could not save dumped_text.json file, reason unknown.", LogLevel.error);
         }
         else
         {
             Log("Dumped data to dumped_text.json");
         }
     }
     else
     {
         BanManager.BanCheater(source);
     }
 }
예제 #10
0
 /// <summary>
 /// Kick a specific player.
 /// </summary>
 /// <param name="source"></param>
 /// <param name="target"></param>
 /// <param name="kickReason"></param>
 private void KickPlayer([FromSource] Player source, int target, string kickReason = "You have been kicked from the server.")
 {
     if (IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.Kick") || IsPlayerAceAllowed(source.Handle, "vMenu.Everything") || IsPlayerAceAllowed(source.Handle, "vMenu.OnlinePlayers.All"))
     {
         // If the player is allowed to be kicked.
         var targetPlayer = new PlayerList()[target];
         if (!IsPlayerAceAllowed(targetPlayer.Handle, "vMenu.DontKickMe"))
         {
             TriggerEvent("vMenu:KickSuccessful", source.Name, kickReason, targetPlayer.Name);
             // Kick the player from the server using the specified reason.
             DropPlayer(targetPlayer.Handle, kickReason);
             KickLog($"Player: {source.Name} has kicked: {targetPlayer.Name} for: {kickReason}.");
             return;
         }
         // Trigger the client event on the source player to let them know that kicking this player is not allowed.
         TriggerClientEvent(player: source, eventName: "vMenu:KickCallback", args: "Sorry, this player can ~r~not ~w~be kicked.");
     }
     else
     {
         BanManager.BanCheater(new PlayerList()[target]);
     }
 }