1. 02-06-2020, 23:04
    #1

    Junior of PTP
    1,217 • 7,967 • 29
    In-game: Tru-KaaN
    Hey,

    This script disables vehicle explosion damage when another vehicle explodes next to your vehicle, your vehicle will not get damaged and pushed by explosions that caused by other players.

    You can use this client-side script in your maps, I would be happy to see it implemented in all GhostMode rooms.



    Code:
    --- source is attacker, localPlayer is targetPlayer ---
    function disableVehExplosionDmg(x, y, z, theType)
        --- check if targetPlayer is in a vehicle ---
        local veh = getPedOccupiedVehicle(localPlayer)
        --- return if attacker is targetPlayer, so player will see his own explosion and get affected of it ---
        if source == localPlayer then return end
        --- get targetPlayer's vehicle position ---
        local pX, pY, pZ = getElementPosition(veh)
        --- if explosion type is (Car/Car Quick/Boat/Heli) ---
        if (theType == 4 or theType == 5 or theType == 6 or theType == 7) then
        --- check distance between targetPlayer and explosion, if vehicle is near to explosion then cancel explosion for targetPlayer ---
        if getDistanceBetweenPoints3D(pX, pY, pZ, x, y, z) <= getElementRadius(veh)+4 then
            cancelEvent()
        end
        end
    end
    addEventHandler("onClientExplosion", root, disableVehExplosionDmg)


  2. 03-06-2020, 00:42
    Junior Member
    145 • 622 • 2
    In-game: zG'#MRAhmed
    Re: [GENERAL] Script to disable vehicle explosion damage in GM arenas 03-06-2020, 00:42 • #2
    It Will be very useful (͡ ͜ʖ ͡) + keep it up
    2 Likes

1 Users reading this thread (0 Members and 1 Guests)