forked from Simnation/Main
ed
This commit is contained in:
parent
4485cc31df
commit
3afa513b4a
22 changed files with 1331 additions and 575 deletions
|
@ -183,28 +183,30 @@ RegisterNetEvent('tdm:playerWasHit', function(gameId, victimTeam, attackerId)
|
|||
game.playerStats[victim] = {hits = 0, deaths = 0}
|
||||
end
|
||||
|
||||
if attackerId and not game.playerStats[attackerId] then
|
||||
game.playerStats[attackerId] = {hits = 0, deaths = 0}
|
||||
end
|
||||
|
||||
-- Stats updaten
|
||||
game.playerStats[victim].deaths = (game.playerStats[victim].deaths or 0) + 1
|
||||
|
||||
-- Wichtig: Nur wenn ein Angreifer identifiziert wurde, zähle den Kill
|
||||
if attackerId then
|
||||
if not game.playerStats[attackerId] then
|
||||
game.playerStats[attackerId] = {hits = 0, deaths = 0}
|
||||
end
|
||||
|
||||
-- Stats updaten
|
||||
game.playerStats[victim].deaths = (game.playerStats[victim].deaths or 0) + 1
|
||||
game.playerStats[attackerId].hits = (game.playerStats[attackerId].hits or 0) + 1
|
||||
|
||||
-- Benachrichtigung an den Angreifer senden
|
||||
TriggerClientEvent('tdm:hitRegistered', attackerId)
|
||||
debugPrint("Treffer von " .. attackerId .. " gegen " .. victim .. " registriert")
|
||||
|
||||
-- Team Score erhöhen
|
||||
if victimTeam == 'team1' then
|
||||
game.score.team2 = game.score.team2 + 1
|
||||
debugPrint("Punkt für Team 2 - Neuer Score: " .. game.score.team2)
|
||||
else
|
||||
game.score.team1 = game.score.team1 + 1
|
||||
debugPrint("Punkt für Team 1 - Neuer Score: " .. game.score.team1)
|
||||
end
|
||||
else
|
||||
debugPrint("Treffer gegen " .. victim .. " von unbekanntem Angreifer registriert")
|
||||
end
|
||||
|
||||
-- Team Score erhöhen
|
||||
if victimTeam == 'team1' then
|
||||
game.score.team2 = game.score.team2 + 1
|
||||
debugPrint("Punkt für Team 2 - Neuer Score: " .. game.score.team2)
|
||||
else
|
||||
game.score.team1 = game.score.team1 + 1
|
||||
debugPrint("Punkt für Team 1 - Neuer Score: " .. game.score.team1)
|
||||
debugPrint("Treffer gegen " .. victim .. " von unbekanntem Angreifer registriert - Kein Punkt vergeben")
|
||||
end
|
||||
|
||||
TriggerClientEvent('tdm:deathRegistered', victim)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue