das funktionirt nicht findet wer ein fehler von euch ?
Lua: damage
function cancelAllDamage ( attacker, weapon, bodypart, loss )
if attacker == lp then
local ping = getPlayerPing ( lp )
if ping >= 800 then
triggerServerEvent ( "kickplayerforhighping", lp, ping )
end
if attacker and weapon and bodypart and not isadminduty and getElementModel ( source ) ~= 260 and not isPedDead ( source ) then
if weaponDamages[weapon] then
if hitglocke then
local hitsound = playSound ( "sounds/hitsound.wav" )
setSoundVolume ( hitsound, 0.5 )
end
triggerServerEvent ( "damageCalcServer", lp, source, weapon, bodypart, loss )
end
end
elseif lp == source then
if attacker and weapon and bodypart and loss then
if weaponDamages[weapon] then
cancelEvent ()
end
end
if gangwarlaeuft then
cancelEvent()
end
if getElementData(getLocalPlayer(), "nodmzone") == true then
cancelEvent ()
end
end
end
addEventHandler ( "onClientPlayerDamage", root, cancelAllDamage )
Alles anzeigen