Ich wollte euch mal meinen anstatz für ein autounfallscript zeigen es ist zwar nichts besonderes ,aber
evtl. kann das der ein oder andere gebrauchen und-oder verbessern
Das script führt vorgegebene Aktionen durch wenn dein fahrzeug beschädigt wird,
(der zugefügte schaden stimmt natürlich nicht mit der geschwindigkeit überein)
bis ca 200kmh entsteht ein schaden so maximal bis 500
d.h. alles über 500 währe dan mit raketenwerfer oder mit handlings
hatte es ausgetestet mehr als 999 schaden geht nicht ( tempo 400)
Lua
-------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------
----------------------------=DHGC= Auto Unfall Script--------------------------------------------------------------------
----------------------------Made by =DHGC= Asphalt Killer----------------------------------------------------------------
----------------------------www.dhgc.de----------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------
function vehicledamage(loss)
local thePlayer = getVehicleOccupant(source)
if(thePlayer) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health.", thePlayer)
if (loss > 0 ) and ( loss < 50) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. nur ein kratzer", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -1)
setElementVelocity(thePlayer,0,0,100)
elseif (loss > 50 ) and ( loss < 100) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. leichter unfall", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -5)
elseif (loss > 100 ) and ( loss < 150) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. mittlerer unfall", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -10)
elseif (loss > 150 ) and ( loss < 200) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. mittlerer unfall2", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -15)
elseif (loss > 200 ) and ( loss < 250) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. mittlerer unfall3", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -20)
elseif (loss > 250 ) and ( loss < 300) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. ittlerer unfall4", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -25)
elseif (loss > 300 ) and ( loss < 350) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. ittlerer unfall5", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -30)
elseif (loss > 350 ) and ( loss < 400) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. ittlerer unfall6", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -35)
elseif (loss > 400 ) and ( loss < 450) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. ittlerer unfall7", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -40)
elseif (loss > 450 ) and ( loss < 500) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. ittlerer unfall8", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -45)
elseif (loss > 500 ) and ( loss < 550) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod1", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -50)
setPedOnFire (thePlayer, true)
elseif (loss > 550 ) and ( loss < 600) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod2", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -55)
setPedOnFire (thePlayer, true)
elseif (loss > 60 ) and ( loss < 650) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod3", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -60)
setPedOnFire (thePlayer, true)
elseif (loss > 650 ) and ( loss < 700) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod4", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -65)
setPedOnFire (thePlayer, true)
elseif (loss > 700 ) and ( loss < 750) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod5", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -70)
setPedOnFire (thePlayer, true)
elseif (loss > 750 ) and ( loss < 800) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod6", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -75)
setPedOnFire (thePlayer, true)
elseif (loss > 800 ) and ( loss < 850) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod7", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -80)
setPedOnFire (thePlayer, true)
elseif (loss > 850 ) and ( loss < 900) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod8", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -85)
setPedOnFire (thePlayer, true)
elseif (loss > 900 ) and ( loss < 950) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod9", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -90)
setPedOnFire (thePlayer, true)
elseif (loss > 950 ) and ( loss < 1000) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod10", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -95)
setPedOnFire (thePlayer, true)
elseif (loss > 1000 ) then
outputChatBox("your vehicle just lost" .. tonumber(loss) .. " health. tod11 und dein fahrzeug ist ein würfel", thePlayer)
setElementHealth (thePlayer, getElementHealth(thePlayer) -100)
setPedOnFire (thePlayer, true)
killPed (thePlayer)
end
end
end
addEventHandler("onVehicleDamage", getRootElement(), vehicledamage)
Alles anzeigen