Beispiel #1
0
        public void CMD_gethere(Player client, int playerid)
        {
            if (playerid < 0 || playerid >= NAPI.Server.GetMaxPlayers())
            {
                client.SendChatMessage("Неверный ID");
                return;
            }
            Player player = NAPI.Pools.GetAllPlayers().Where(p => p.Value == playerid).FirstOrDefault();

            if (player == null)
            {
                client.SendChatMessage($"Игрок с {playerid} ID не найден!");
                return;
            }
            else if (NAPI.Player.IsPlayerDead(player))
            {
                client.SendChatMessage("Игрок не заспавнен!");
                return;
            }

            player.Position  = UtilityFuncs.GetPosFrontOfPlayer(client, 1.0);
            player.Dimension = client.Dimension;

            client.SendChatMessage($"Вы успешно телепортировались к себе игрока {new Data.PlayerInfo(player).GetName()}[{playerid}]");
        }
Beispiel #2
0
        public void CMD_veh(Player player, string vehname)
        {
            if (player.HasData("admin_car"))
            {
                player.GetData <Vehicle>("admin_car").Delete();
                player.ResetData("admin_car");
            }

            Vehicle veh = NAPI.Vehicle.CreateVehicle(NAPI.Util.GetHashKey(vehname), UtilityFuncs.GetPosFrontOfPlayer(player, 3.0), player.Rotation.Z / 2, new Random().Next(0, 255), new Random().Next(0, 255), numberPlate: "Admin");

            veh.NumberPlate = "Admin";

            player.SetData <Vehicle>("admin_car", veh);
            veh.SetData <bool>("temp_vehicle", true);
        }