예제 #1
0
        private static async Task CreationSelectPeds()
        {
            uint hash_f = (uint)API.GetHashKey(model_f);
            uint hash_m = (uint)API.GetHashKey(model_m);

            /*
             * Esperamos a que cargen los modelos en cache
             */
            await Miscellanea.LoadModel(hash_f);

            await Miscellanea.LoadModel(hash_m);

            /*
             * 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
             */
            Function.Call((Hash)0x283978A15512B2FE, PedFemale, true);
            Function.Call((Hash)0x283978A15512B2FE, PedMale, true);

            /*
             * Congelamos las Peds
             */
            API.FreezeEntityPosition(PedFemale, true);
            API.FreezeEntityPosition(PedMale, true);

            ApplyDefaultSkinCanaryEdition(PedFemale);
            ApplyDefaultSkinCanaryEdition(PedMale);

            TriggerEvent("vorp:setInstancePlayer", true);
        }
예제 #2
0
        private static async void StartAnim()
        {
            uint    HashVeh = (uint)API.GetHashKey("hotAirBalloon01");
            Vector3 coords  = new Vector3(GetConfig.Config["StartingCoords"][0].ToObject <float>(), GetConfig.Config["StartingCoords"][1].ToObject <float>(), 220.3232f);

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


            uint HashPed = (uint)API.GetHashKey("CS_balloonoperator");

            Miscellanea.LoadModel(HashPed);
            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);

            await Delay(1000);

            //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);

            for (int i = 0; i < 255; i++)
            {
                if (API.NetworkIsPlayerActive(i))
                {
                    if (API.GetPlayerPed(i) != API.PlayerPedId())
                    {
                        API.SetEntityAlpha(API.GetPlayerPed(i), 255, false);
                        API.SetEntityNoCollisionEntity(API.PlayerPedId(), API.GetPlayerPed(i), true);
                    }
                }
            }
        }
예제 #3
0
        private async void CreationSexPed(string model, int camedit)
        {
            model_selected    = model;
            skinPlayer["sex"] = model;


            if (model_selected == model_m)
            {
                skinPlayer["albedo"]             = API.GetHashKey("mp_head_mr1_sc08_c0_000_ab");
                texture_types["albedo"]          = API.GetHashKey("mp_head_mr1_sc08_c0_000_ab");
                texture_types["normal"]          = API.GetHashKey("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"]             = API.GetHashKey("mp_head_fr1_sc08_c0_000_ab");
                texture_types["albedo"]          = API.GetHashKey("mp_head_fr1_sc08_c0_000_ab");
                texture_types["normal"]          = API.GetHashKey("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;
            }


            Debug.WriteLine(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 = (uint)API.GetHashKey(model);
            await Miscellanea.LoadModel(model_hash);

            Function.Call((Hash)0xED40380076A31506, pID, model_hash, true);
            Function.Call((Hash)0x283978A15512B2FE, pPedID, true);
            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);
        }
예제 #4
0
        private static 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 = (uint)API.GetHashKey("hotAirBalloon01");
            await Miscellanea.LoadModel(HashVeh);

            uint HashPed = (uint)API.GetHashKey("CS_balloonoperator");
            await Miscellanea.LoadModel(HashPed);
        }
예제 #5
0
        public async Task StartAnim()
        {
            uint hashmodel = (uint)API.GetHashKey("mp_male");
            await Miscellanea.LoadModel(hashmodel);

            int character_1 = API.CreatePed(hashmodel, 1701.316f, 1512.134f, 146.87f, 116.70f, false, false, true, true);

            Function.Call((Hash)0x283978A15512B2FE, character_1, true);
            await Delay(1000);

            API.TaskGoToCoordAnyMeans(character_1, 1696.17f, 1508.474f, 147.85f, 0.5f, 0, false, 524419, -1f);
            await Delay(8000);

            API.TaskGoToCoordAnyMeans(character_1, 1697.74f, 1510.202f, 147.87f, 0.5f, 0, false, 524419, -1f);
            await Delay(5000);

            API.DeletePed(ref character_1);
        }
예제 #6
0
        public static async Task InitStores()
        {
            await Delay(10000);

            string ped     = "S_M_M_Tailor_01";
            uint   HashPed = (uint)API.GetHashKey(ped);
            await Miscellanea.LoadModel(HashPed);

            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);
                Function.Call((Hash)0x283978A15512B2FE, _PedShop, true);
                StorePeds.Add(_PedShop);
                API.SetEntityNoCollisionEntity(API.PlayerPedId(), _PedShop, false);
                API.SetEntityCanBeDamaged(_PedShop, false);
                API.SetEntityInvincible(_PedShop, true);
                API.SetBlockingOfNonTemporaryEvents(_PedShop, true);
                await Delay(1000);

                API.FreezeEntityPosition(_PedShop, true);

                await Delay(100);
            }
        }