Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OnInitID()
- -- [[ Markers ]]
- -- [[ Squad Groups ]]
- -- [[ Entity Groups ]]
- local _vehicleAbilities = {
- "mechanized_grenadier_group", "supply_truck", "tiger_tank", "mortar_halftrack", "elefant_unlock", "tiger_tank_ace", "stug_short_barrel", "stug_iii_e", "armor_commander",
- "mechanized_assault_group", "cmd_kv-8_unlock_mp", "cmd_advanced_t34_85_medium_tank", "cmd_t34_85_medium_tank", "cmd_isu-152", "cmd_is2_heavy_tank", "cmd_kv-1_unlock", "kv-2",
- }
- local SBP_IsVehicle = function(sbp)
- --Skip problematic squads (pak creates splats, panzer_iii causes an error due to not existing yet)
- local _skip_sbp = {
- [1] = {
- name = "pak43",
- isVehcle = false,
- },
- [2] = {
- name = "panzer_iii",
- isVehcle = true,
- },
- }
- local isVehcle = false
- local pos = World_Pos(-512, -512, -512)
- local skipSBP = false
- for key, _sbp in ipairs(_skip_sbp) do
- if string.find(BP_GetName(sbp), _sbp.name) then
- isVehcle = _sbp.isVehcle
- skipSBP = true
- end
- end
- if not skipSBP then
- local squad = Squad_CreateAndSpawnToward(sbp, World_GetPlayerAt(1), 1, pos, pos)
- local entity = Squad_EntityAt(squad, 0)
- if Entity_IsOfType(entity, "vehicle") and not Entity_IsOfType(entity, "team_weapon") then
- isVehcle = true
- else
- isVehcle = false
- end
- Squad_Destroy(squad)
- end
- return isVehcle
- end
- for key, race in pairs(SBP) do
- for key, sbp in pairs(race) do
- if SBP_IsVehicle(sbp) then
- for i = 1, World_GetPlayerCount() do
- Player_SetSquadProductionAvailability(World_GetPlayerAt(i), sbp, ITEM_REMOVED)
- end
- end
- end
- end
- for key, abp in ipairs(_vehicleAbilities) do
- for i = 1, World_GetPlayerCount() do
- Player_SetAbilityAvailability(World_GetPlayerAt(i), BP_GetAbilityBlueprint(abp), ITEM_REMOVED)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement