public static async Task InitStores()
        {
            string ped     = "S_M_M_Tailor_01";
            uint   HashPed = await Miscellanea.GetHash(ped);

            foreach (var store in GetConfig.Config["Stores"])
            {
                int   blipIcon   = int.Parse(store["BlipIcon"].ToString());
                float x          = float.Parse(store["EnterStore"][0].ToString());
                float y          = float.Parse(store["EnterStore"][1].ToString());
                float z          = float.Parse(store["EnterStore"][2].ToString());
                float Pedx       = float.Parse(store["NPCStore"][0].ToString());
                float Pedy       = float.Parse(store["NPCStore"][1].ToString());
                float Pedz       = float.Parse(store["NPCStore"][2].ToString());
                float Pedheading = float.Parse(store["NPCStore"][3].ToString());

                int _blip = Function.Call <int>((Hash)0x554D9D53F696D002, 1664425300, x, y, z);
                Function.Call((Hash)0x74F74D3207ED525C, _blip, blipIcon, 1);
                Function.Call((Hash)0x9CB1A1623062F402, _blip, store["name"].ToString());
                StoreBlips.Add(_blip);

                int _PedShop = API.CreatePed(HashPed, Pedx, Pedy, Pedz, Pedheading, false, true, true, true);
                while (!API.DoesEntityExist(_PedShop))
                {
                    await Delay(200);
                }
                Function.Call((Hash)0x283978A15512B2FE, _PedShop, true);
                StorePeds.Add(_PedShop);
                API.SetEntityNoCollisionEntity(API.PlayerPedId(), _PedShop, false);
                API.SetEntityCanBeDamaged(_PedShop, false);
                API.SetEntityInvincible(_PedShop, true);
                API.FreezeEntityPosition(_PedShop, true);
            }
        }
示例#2
0
        private async Task CreateCams()
        {
            Camera            = API.CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -560.83f, -3776.33f, 239.58f, -13.56231f, 0.00f, -91.93626f, 45.00f, false, 0);
            Camera_Male       = API.CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -559.6671f, -3775.44f, 239.4266f, -9.622695f, 0.0f, -86.08074f, 45.00f, false, 0);
            Camera_Female     = API.CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -559.8455f, -3776.596f, 239.4435f, -13.41718f, 0.0f, -88.04576f, 45.00f, false, 0);
            Camera_Editor     = API.CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -560.1333f, -3780.923f, 239.4437f, -11.32719f, 0.0f, -90.96693f, 45.00f, false, 0);
            Camera_FaceEditor = API.CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -558.9781f, -3780.955f, 239.186f, 6.591177f, 0.0f, -92.76723f, 40.00f, false, 0);
            Camera_Waist      = API.CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -559.1779f, -3780.964f, 238.4654f, -0.6631846f, 0.0f, -91.76698f, 40.00f, false, 0);
            Camera_Legs       = API.CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -559.2103f, -3781.039f, 238.4678f, -42.50001f, 0.0f, -89.2997f, 40.00f, false, 0);
            Camera_Body       = API.CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -560.6195f, -3780.708f, 239.1954f, -15.75687f, 0.0f, -89.49976f, 40.00f, false, 0);
            //Camera_Back = API.CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -563.0956f, -3780.669f, 238.465f, 0.906957f, 0.0f, -89.36639f, 40.00f, false, 0);

            uint HashVeh = await Miscellanea.GetHash("hotAirBalloon01");

            uint HashPed = await Miscellanea.GetHash("CS_balloonoperator");
        }
示例#3
0
        private async Task CreationSelectPeds()
        {
            uint hash_f = await Miscellanea.GetHash(model_f);

            uint hash_m = await Miscellanea.GetHash(model_m);

            await Miscellanea.GetHash("mp_head_fr1_sc08_c0_000_ab");

            /*
             * Esperamos a que cargen los modelos en cache
             */
            /*
             * Creamos los modelos en el sitio de creacion
             */
            PedFemale = API.CreatePed((uint)hash_f, -558.43f, -3776.65f, 237.7f, 93.2f, false, true, true, true);
            PedMale   = API.CreatePed((uint)hash_m, -558.52f, -3775.6f, 237.7f, 93.2f, false, true, true, true);

            /*
             * Necesitan un radom Outfit ya que no se por que no salen si no
             */
            while (!(API.DoesEntityExist(PedFemale) && API.DoesEntityExist(PedMale)))
            {
                await Delay(100);
            }
            while (!(Function.Call <bool>((Hash)0xA0BC8FAED8CFEB3C, PedFemale) && Function.Call <bool>((Hash)0xA0BC8FAED8CFEB3C, PedMale)))
            {
                await Delay(100);
            }
            Function.Call((Hash)0x283978A15512B2FE, PedFemale, true);

            //female fix need to set default
            ApplyDefaultSkin(PedFemale);
            //male fix need to set default
            ApplyDefaultSkin(PedMale);
            await Delay(10);

            /*
             * Congelamos las Peds
             */
            API.FreezeEntityPosition(PedFemale, true);
            API.FreezeEntityPosition(PedMale, true);
            TriggerEvent("vorp:setInstancePlayer", true);
        }
示例#4
0
        private static async void StartAnim()
        {
            uint HashVeh = await Miscellanea.GetHash("hotAirBalloon01");

            Vector3 coords = new Vector3(GetConfig.Config["StartingCoords"][0].ToObject <float>(), GetConfig.Config["StartingCoords"][1].ToObject <float>(), 220.3232f);

            vehCreated = API.CreateVehicle(HashVeh, coords.X + 1, coords.Y, coords.Z, 0, false, true, true, true);
            //Spawn
            Function.Call((Hash)0x283978A15512B2FE, vehCreated, true);
            //TaskWanderStandard
            Function.Call((Hash)0xBB9CE077274F6A1B, 10, 10);


            uint HashPed = await Miscellanea.GetHash("CS_balloonoperator");

            pedCreated = API.CreatePed(HashPed, coords.X + 1, coords.Y, coords.Z, 0.0f, false, true, true, true);
            //Spawn
            Function.Call((Hash)0x283978A15512B2FE, pedCreated, true);

            Function.Call((Hash)0xF75B0D629E1C063D, API.PlayerPedId(), vehCreated, -1, false);


            API.TaskLeaveVehicle(API.PlayerPedId(), vehCreated, 0, 0);


            //API.SetEntityCoords(API.PlayerPedId(), coords.X, coords.Y, coords.Z, true, true, true, false);
            //API.SetEntityHeading(API.PlayerPedId(), 0);

            //SetPedIntoVehicle
            Function.Call((Hash)0xF75B0D629E1C063D, pedCreated, vehCreated, -1, false);

            API.SetEntityAsMissionEntity(pedCreated, true, true);
            API.SetEntityAsMissionEntity(pedCreated, true, true);

            API.FreezeEntityPosition(pedCreated, true);

            API.SetRelationshipBetweenGroups(1, HashPed, (uint)API.GetHashKey("PLAYER"));

            TriggerEvent("vorp:Tip", GetConfig.Langs["TipFinal"], 15000);
        }
示例#5
0
        private async void CreationSexPed(string model, int camedit)
        {
            model_selected    = model;
            skinPlayer["sex"] = model;

            await Delay(200);

            int pID    = API.PlayerId();
            int pPedID = API.PlayerPedId();

            Menus.MainMenu.GetMenu();
            Miscellanea.TeleportToCoords(-558.3258f, -3781.111f, 237.60f, 93.2f);
            API.FreezeEntityPosition(pPedID, true);
            uint model_hash = await Miscellanea.GetHash(model);

            if (model_selected == model_m)
            {
                //SetPlayerDebugBodyComponent(PedMale, (uint)SkinsUtils.WAIST_TYPES.ElementAt(0));

                skinPlayer["albedo"] = await Miscellanea.GetHash("mp_head_mr1_sc08_c0_000_ab");

                texture_types["albedo"] = await Miscellanea.GetHash("mp_head_mr1_sc08_c0_000_ab");

                texture_types["normal"] = await Miscellanea.GetHash("mp_head_mr1_000_nm");

                texture_types["material"]        = 0x7FC5B1E1;
                texture_types["color_type"]      = 1;
                texture_types["texture_opacity"] = 1.0f;
                texture_types["unk_arg"]         = 0;
            }
            else
            {
                skinPlayer["albedo"] = await Miscellanea.GetHash("mp_head_fr1_sc08_c0_000_ab");

                texture_types["albedo"] = await Miscellanea.GetHash("mp_head_fr1_sc08_c0_000_ab");

                texture_types["normal"] = await Miscellanea.GetHash("head_fr1_mp_002_nm");

                texture_types["material"]        = 0x7FC5B1E1;
                texture_types["color_type"]      = 1;
                texture_types["texture_opacity"] = 1.0f;
                texture_types["unk_arg"]         = 0;
            }
            Function.Call((Hash)0xED40380076A31506, pID, model_hash, true);
            Function.Call((Hash)0x283978A15512B2FE, pPedID, true);
            while (!API.DoesEntityExist(API.PlayerPedId()))
            {
                await Delay(100);
            }
            while (!Function.Call <bool>((Hash)0xA0BC8FAED8CFEB3C, API.PlayerPedId()))
            {
                await Delay(100);
            }
            ApplyDefaultSkin(API.PlayerPedId());

            API.RenderScriptCams(false, true, 3000, true, true, 0);
            await Delay(2500);

            API.SetCamActive(Camera_Editor, true);
            API.RenderScriptCams(true, true, 1000, true, true, 0);
            API.DeletePed(ref PedFemale);
            API.DeletePed(ref PedMale);
            isInCharCreation = true;
            Menus.MainMenu.GetMenu().OpenMenu();

            //MenuCreateCharacter(model);
        }