Search the Community
Showing results for tags 'damage'.
-
how can i change the damage of rocket explosion? when I tried it before, when I fired with a rocket, I was taking damage when any player took damage, I don't want this and I want their cars to take extra damage. please help me
-
Client local armoredVehicles = { [432] = true, [601] = true } function warMachineDamage(attacker, weapon, loss, x, y, z, tire) local model = getElementModel(source) if weapon and armoredVehicles[model] then cancelEvent() triggerServerEvent ("damageWarMachine", source, source, attacker, weapon, bodypart ) end end addEventHandler("onClientVehicleDamage", root, warMachineDamage) Server addEvent( "damageWarMachine", true ) function damageWarMachine( vehicle, attacker, weapon, bodypart) local vehicleHealth = getElementHealth(vehicle) setElementHealth(vehicle, vehicleHealth - 250 ) end addEventHandler( "damageWarMachine", root, damageWarMachine ) Não quero que ele leve Hit Kill, e sim tome danos de leve, exemplo: 1 tiro de RPG tira 40% de vida. Más não consigo ?
-
I have a problem with setElementTarget recently, because I would like to make a script in which when I aim at something, "CreateWeapon" will shoot in that direction, but no matter what I do, it shoots too close or crooked. Anyone got any idea for this?
-
MTA Script :Damage Log v 1.0.0 Roleplay SQL Add DLog.sql in localhost/phpmyadmin add Clear Table Link In Desciption Video اسف على الجودة اهداء لكل المنتدى
-
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>
-
Hi am looking for a script that is a custom damage modifier instead of the original gta sa weapons i want to change the range of guns damage and also accuracy and max clip a gun can hold is that possible?
-
Hello! I have a problem with the damage script. I can't kill other players just if they got headshot.. but I don't know why. local playerInjuries = {} -- create a table to save the injuries function copy( t ) local r = {} if type(t) == 'table' then for k, v in pairs( t ) do r[k] = v end end return r end function isMelee( weapon ) return weapon and weapon <= 15 end function killknockedout(source) setElementHealth(source, 0) end function stabilize() if playerInjuries[source] and not isPedHeadless(source) then if playerInjuries[source]['knockout'] then exports['global']:changeProtectedElementDataEx(source, "injuriedanimation") if isTimer(playerInjuries[source]['knockout']) then killTimer(playerInjuries[source]['knockout']) playerInjuries[source]['knockout'] = nil fadeCamera(source, true, 2) setPedAnimation(source) exports.ls_core:removeAnimation(source) toggleControl(source, 'forwards', true) toggleControl(source, 'left', true) toggleControl(source, 'right', true) toggleControl(source, 'backwards', true) toggleControl(source, 'enter_passenger', true) setElementHealth(source, math.max( 20, getElementHealth(source) ) ) end end if playerInjuries[source][7] and playerInjuries[source][8] then toggleControl(source, 'forwards', true) toggleControl(source, 'left', true) toggleControl(source, 'right', true) toggleControl(source, 'backwards', true) toggleControl(source, 'enter_passenger', true) end end end addEvent( "onPlayerStabilize", false ) addEventHandler( "onPlayerStabilize", getRootElement(), stabilize ) addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then if not getElementData(attacker, "sokkolokezeben") == true then local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) if result == true then killPed(source, attacker, weapon, bodypart) setPedHeadless(source, true) end end end end ) function healInjuries(healed) if playerInjuries[source] and not isPedHeadless(source) then if playerInjuries[source]['knockout'] then exports['global']:changeProtectedElementDataEx(source, "injuriedanimation") if isTimer(playerInjuries[source]['knockout']) then killTimer(playerInjuries[source]['knockout']) playerInjuries[source]['knockout'] = nil if healed then fadeCamera(source, true, 2) setPedAnimation(source) exports.global:removeAnimation(source) end end toggleAllControls(source, true, true, false) else if playerInjuries[source][7] and playerInjuries[source][8] then toggleControl(source, 'forwards', true) toggleControl(source, 'left', true) toggleControl(source, 'right', true) toggleControl(source, 'backwards', true) toggleControl(source, 'enter_passenger', true) toggleControl(source, 'enter_exit', true) end if playerInjuries[source][7] or playerInjuries[source][8] then toggleControl(source, 'sprint', true) toggleControl(source, 'jump', true) end if playerInjuries[source][5] and playerInjuries[source][6] then toggleControl(source, 'fire', true) end if playerInjuries[source][5] or playerInjuries[source][6] then toggleControl(source, 'aim_weapon', true) toggleControl(source, 'jump', true) end end playerInjuries[source] = nil end end addEvent( "onPlayerHeal", false ) addEventHandler( "onPlayerHeal", getRootElement(), healInjuries) function restoreInjuries( ) if playerInjuries[source] and not isPedHeadless(source) then if playerInjuries[source][7] and playerInjuries[source][8] then toggleControl(source, 'forwards', false) toggleControl(source, 'left', false) toggleControl(source, 'right', false) toggleControl(source, 'backwards', false) toggleControl(source, 'enter_passenger', false) toggleControl(source, 'enter_exit', false) end if playerInjuries[source][7] or playerInjuries[source][8] then toggleControl(source, 'sprint', false) toggleControl(source, 'jump', false) end if playerInjuries[source][5] and playerInjuries[source][6] then toggleControl(source, 'fire', false) end if playerInjuries[source][5] or playerInjuries[source][6] then toggleControl(source, 'aim_weapon', false) toggleControl(source, 'jump', false) end end end addEventHandler( "onPlayerStopAnimation", getRootElement(), restoreInjuries ) function resetInjuries() setPedHeadless(source, false) if playerInjuries[source] then healInjuries() end end addEventHandler( "onPlayerSpawn", getRootElement(), resetInjuries) addEventHandler( "onPlayerQuit", getRootElement(), resetInjuries)
-
Bonjour, https://community.multitheftauto.com/index.php?p=resources&s=details&id=6277 Le script fonctionne très bien, mais j'aimerais savoir comment faire en sorte que lorsqu'un zombie est équipé du sabre, qu'on puisse entendre les sons? Car à priori, il n'y a que le joueur qui peu entendre les sons.. Une second question, comment faire en sorte qu'une bat de Baseball (par exemple) puisse one shot un zombie? Merci de votre aide.
-
Hello there, I've got a quick question regarding airplanes. When a specific part of an airplane is damaged - its right wing, for example. The right wing's aileron becomes unstable, making the plane rotate left and right on random. Is there any way to damage this specific part of an airplane? so one can for example type /damagerightwing and the right wing gets damaged. Thanks in advance, Noah
-
Hello, I need help! Can someone make a script that will make minigun not overpowered. I mean that I need minigun that will do low damage, because it sucks So please , please help me guys
-
Alright so I'm trying to make vehicles more deadly. When a player or bot get hit by a vehicle I don't want the vehicle to bounce away but the player to fall 100% of the times (just by a simple touch) and then in some realistic sense loose health depending on the collision force. What function would you recommend? Are any of these properties useful for my needs? I'm thinking of collisionDamageMultiplier and onVehicleCollission for instance, would those be a good approach? have anyone done anything like this before?