Log in to reply
 

delete peds and vehicles from the area



  • hey guys i am working on my new mod and i am trying to delete all peds and vehicles from the areas where ever i go
    means if i go to the beach no pads and vehicles should be there if i am driving a vehicle no vehicle should be there and also no peds means my whole city or state or ped and vehicles should not swap in the los santos and if it swap then it will automatically removed from my map
    How can i do that i am working with c#



  • First call these.

        Function.Call(Hash.ADD_SCENARIO_BLOCKING_AREA, -10000.0f, -10000.0f, -1000.0f, 10000.0f, 10000.0f, 1000.0f, 0, 1, 1, 1);
        Function.Call(Hash.SET_CREATE_RANDOM_COPS, false);
        Function.Call(Hash.SET_RANDOM_BOATS, false);
        Function.Call(Hash.SET_RANDOM_TRAINS, false);
        Function.Call(Hash.SET_GARBAGE_TRUCKS, false);
        Function.Call(Hash.DELETE_ALL_TRAINS);
        Function.Call(Hash.SET_PED_POPULATION_BUDGET, 0);
        Function.Call(Hash.SET_VEHICLE_POPULATION_BUDGET, 0);
        Function.Call(Hash.SET_ALL_LOW_PRIORITY_VEHICLE_GENERATORS_ACTIVE, false);
        Function.Call(Hash.SET_NUMBER_OF_PARKED_VEHICLES, 0);    //  -1, 0
        Function.Call((Hash)0xF796359A959DF65D, false);  //Display distant vehicles
        Function.Call(Hash.DISABLE_VEHICLE_DISTANTLIGHTS, true);
    
        Ped[] all_ped = World.GetAllPeds();
        if (all_ped.Count() > 0)
        {
            foreach (Ped ped in all_ped)
            {
                ped.Delete();
            }
        }
        Vehicle[] all_vecs = World.GetAllVehicles();
        if (all_vecs.Count() > 0)
        {
            foreach (Vehicle vehicle in all_vecs)
            {
                vehicle.Delete();
            }
        }
    

    Then on tick call these.

        Function.Call(Hash.SET_VEHICLE_POPULATION_BUDGET, 0);
        Function.Call(Hash.SET_PED_POPULATION_BUDGET, 0);
        Function.Call(Hash.SET_VEHICLE_DENSITY_MULTIPLIER_THIS_FRAME, 0f);
        Function.Call(Hash.SET_RANDOM_VEHICLE_DENSITY_MULTIPLIER_THIS_FRAME, 0f);
        Function.Call(Hash.SET_PARKED_VEHICLE_DENSITY_MULTIPLIER_THIS_FRAME, 0f);
        Function.Call(Hash.STOP_ALARM, "PRISON_ALARMS", true);
        Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "re_prison");
        Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "re_prisonerlift");
        Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "am_prison");
        Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "re_lossantosintl");
        Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "re_armybase");
        Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "golf_ai_foursome");
        Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "golf_ai_foursome_putting");
        Function.Call((Hash)0x2F9A292AD0A3BD89);
        Function.Call((Hash)0x5F3B7749C112D552);
    

    To repopulate map.

        Function.Call(Hash.REMOVE_SCENARIO_BLOCKING_AREAS);
        Function.Call(Hash.SET_CREATE_RANDOM_COPS, true);
        Function.Call(Hash.SET_RANDOM_BOATS, true);
        Function.Call(Hash.SET_RANDOM_TRAINS, true);
        Function.Call(Hash.SET_GARBAGE_TRUCKS, true);
        Function.Call(Hash.SET_PED_POPULATION_BUDGET, 3); // 0 - 3
        Function.Call(Hash.SET_VEHICLE_POPULATION_BUDGET, 3); // 0 - 3
        Function.Call(Hash.SET_ALL_VEHICLE_GENERATORS_ACTIVE);
        Function.Call(Hash.SET_ALL_LOW_PRIORITY_VEHICLE_GENERATORS_ACTIVE, true);
        Function.Call(Hash.SET_NUMBER_OF_PARKED_VEHICLES, -1);  //  -1, 0
        Function.Call((Hash)0xF796359A959DF65D, true);  //Display distant vehicles
        Function.Call(Hash.DISABLE_VEHICLE_DISTANTLIGHTS, false);


  • So if I remove peds and vehicles and try to swap manualy it will remove my peds and vehicles or not



  • @harshil said in delete peds and vehicles from the area:

    swap? You mean spawn. No they wont be deleted.



  • @aimless so can you help me to do that I want to spawn vehicles minimum 10 around player where ever i go and it should be on the street i try to do that but because of that my mod is crash and stop working i can not open my menu again to disable the mod
    Can you help me to spawn the vehicles on the street where ever i go



  • @harshil I am not sure what you mean. " where ever i go" Do you mean traffic. Or to fallow your player? You will have to post your code so someone can help.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.