Jump to content

Vehicle dmg


Recommended Posts

Posted (edited)

السلام عليكم  بدي اسوي مود لما أصدم شخص بسيارة يموت فورا  اي

1 Hit = - 200 Dmg

ممكن تقول لي اي فنكشن و ايفنت يجب  الإستعمال؟

Edited by Snakegold
Posted

هذا كود ال onVehicleDamage

function displayVehicleLoss(loss)
    local thePlayer = getVehicleOccupant(source)
    if(thePlayer) then -- Check there is a player in the vehicle
        outputChatBox("Your vehicle just lost " .. tonumber(loss) .. " health.", thePlayer) -- Display the message
    end
end

addEventHandler("onVehicleDamage", root, displayVehicleLoss)

ما إتوقع انو في شي يغير قيمة داماج السيارات ؟

Posted
3 minutes ago, Snakegold said:

هذا كود ال onVehicleDamage


function displayVehicleLoss(loss)
    local thePlayer = getVehicleOccupant(source)
    if(thePlayer) then -- Check there is a player in the vehicle
        outputChatBox("Your vehicle just lost " .. tonumber(loss) .. " health.", thePlayer) -- Display the message
    end
end

addEventHandler("onVehicleDamage", root, displayVehicleLoss)

ما إتوقع انو في شي يغير قيمة داماج السيارات ؟

وين ؟

setElementHealth

 

Posted

اعذرني كنت فاهم الموضوع غلط, جرب هذا الكود :

addEventHandler('onClientVehicleCollision', root, function(player)
    if isElement(player) and (getElementType(player) == 'player' or getElementType(player) == 'ped') and getElementHealth(player) > 0 then
        killPed(player)
    end
end)

 

Posted

أنت تسوق فأي سيارة و عند صدمك لشخص سوف يخسر 10 بالمائة من صحته

انا بدي أغير الدامج يعني لما اصدمه ينقص 200 بالمائة من صحته أي الشخص الخارج السيارة يموت إلي انا صدمته

Posted
5 hours ago, Snakegold said:

أنت تسوق فأي سيارة و عند صدمك لشخص سوف يخسر 10 بالمائة من صحته

انا بدي أغير الدامج يعني لما اصدمه ينقص 200 بالمائة من صحته أي الشخص الخارج السيارة يموت إلي انا صدمته

 

15 hours ago, #,+( _xiRoc[K]; > said:

اعذرني كنت فاهم الموضوع غلط, جرب هذا الكود :


addEventHandler('onClientVehicleCollision', root, function(player)
    if isElement(player) and (getElementType(player) == 'player' or getElementType(player) == 'ped') and getElementHealth(player) > 0 then
        killPed(player)
    end
end)

 

 

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...