Jump to content

Search the Community

Showing results for tags 'millitary'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. Hello, I have a problem with the script, when I add id rhino and id fire truck this script does not work tankdx = 2 tankdy = 4 tankdz = 2 function boomOn () booming = true --outputDebugString("Boomon!") end function start () maxDamage = get("maxTankDamage") eightDistance = get("eightTankDistance") --outputDebugString("tankdamage settings: maxTankDamage = "..tostring(maxDamage).." - eightTankDistance = "..tostring(eightDistance)) boomOn() end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),start) function boom (x,y,z,boomType) --outputDebugString("boom type "..tostring(boomType)) if booming then booming = false boomTimer = setTimer(boomOn,1000,1) --outputDebugString("location: " .. tostring(x) .. "," .. tostring(y) .. "," .. tostring(z)) local rhinos = getVehiclesOfType(432 ) --outputDebugString(tostring(#rhinos).." rhinos found") for i,vehicle in ipairs (rhinos) do if getElementModel(vehicle) == 432 then local vx, vy, vz = getElementPosition(vehicle) local sx = x - vx local sy = y - vy local sz = z - vz --outputDebugString("distance to rhino: " .. tostring(sx) .. "," .. tostring(sy) .. "," .. tostring(sz)) if sx^2 + sy^2 + sz^2 < 1000 then local rotvX,rotvY,rotvZ = getVehicleRotation(vehicle) local t = math.rad(rotvX) local p = math.rad(rotvY) local f = math.rad(rotvZ) local ct = math.cos(t) local st = math.sin(t) local cp = math.cos(p) local sp = math.sin(p) local cf = math.cos(f) local sf = math.sin(f) local dz = ct*cp*sz + (sf*st*cp + cf*sp)*sx + (-cf*st*cp + sf*sp)*sy local dx = -ct*sp*sz + (-sf*st*sp + cf*cp)*sx + (cf*st*sp + sf*cp)*sy local dy = st*sz - sf*ct*sx + cf*ct*sy local damage if math.abs(dx) < tankdx and math.abs(dy) < tankdy and math.abs(dz) < tankdz then damage = maxDamage else dx = math.abs(dx) -tankdx dy = math.abs(dy) -tankdy dz = math.abs(dz) -tankdz if dx < 0 then dx=0 end if dy < 0 then dy=0 end if dz < 0 then dz=0 end local distance = math.sqrt(dx^2+dy^2+dz^2) if distance > 10 then damage = 0 elseif distance < 1 then damage = maxDamage else damage = maxDamage*((distance/eightDistance)+1)^(-3) end --outputDebugString("explosion distance: ".. tostring(distance)) end setElementHealth(vehicle,getElementHealth(vehicle)-damage) -- outputDebugString("tank damaged " .. tostring(damage)) end end end end end function boom (x,y,z,boomType) triggerServerEvent("onBoom",getLocalPlayer(),x,y,z,boomType) end addEventHandler("onClientExplosion",getRootElement(),boom) <meta> <info author="Killeryoyo" name="tankdamage" version="0.2.2" type="script"/> <script src="tankdamage.lua" type="server" /> <script src="tankdamageCL.lua" type="client" /> <settings> <setting name="*maxTankDamage" value="250"/> <setting name="*eightTankDistance" value="20"/> </settings> </meta>
×
×
  • Create New...