public static void Spawn(SharpBridge.Player player, object[] param)
        {
            string name     = ((string)param[0]).ToUpper();
            int    vehModel = VehicleModels.getModelByName(name);

            if (vehModel == -1)
            {
                player.sendMsg($"'{name}' is an invalid model", ChatColor.ERROR);
                return;
            }

            int     color = new Random().Next(0, 140);
            Vector3 pos   = player.getPos();

            pos.z += 1.0f;
            Vehicle veh = Entities.createVehicle(vehModel, pos, new Vector3(0.0f, 0.0f, player.getHeading()),
                                                 color, color, color, color, player.getWorld());

            player.sendMsg($"{name} spawned: {veh.getId()}", ChatColor.SUCCESS);
        }
Exemplo n.º 2
0
        public static void Spawn(SharpBridge.Player player, object[] param)
        {
            if (objs.Count != 0)
            {
                foreach (var i in objs)
                {
                    i.Destroy();
                }
                objs.Clear();
            }

            Vector3 pos = player.getPos();

            pos.y += 200.0f;
            uint[] boatObjs = { 1239854102, 2219185248, 67157199, 1930762713, 1233545547, 1005833766 };
            foreach (uint obj in boatObjs)
            {
                objs.Add(Entities.createObject(pos, new Quaternion(), obj, player.getWorld(), false, 0, 255));
            }
        }