Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createHeliCrashSite()
- if cargoCol then
- destroyElement(getElementData(cargoCol,"parent"))
- destroyElement(cargoCol)
- end
- local item_id = math.random(table.size(heliCrashSites))
- local x,y,z = heliCrashSites[item_id][1],heliCrashSites[item_id][2],heliCrashSites[item_id][3]
- cargobob = createVehicle(548,x,y,z,nil,nil,nil)
- setElementHealth(cargobob,0)
- setElementFrozen(cargobob,true)
- cargoCol = createColSphere(x,y,z,3)
- setElementData(cargoCol,"parent",cargobob)
- setElementData(cargoCol,"helicrash",true)
- setElementData(cargoCol,"MAX_Slots",0)
- for i, item in ipairs(lootItems["helicrashsides"]) do
- local value = math.percentChance (item[5]*3.5,math.random(1,2))
- setElementData(cargoCol,item[1],value)
- --weapon Ammo
- local ammoData,weapID = getWeaponAmmoType (item[1],true)
- if ammoData and value > 0 then
- setElementData(cargoCol,ammoData,math.random(1,2))
- end
- end
- setTimer(createHeliCrashSite,3600000,1)
- end
- createHeliCrashSite()
Advertisement
Add Comment
Please, Sign In to add comment