Armor causes desync when attacked

Before continuing, please make sure that your issue/crash has not been filed before on this forum. If it has, please provide additional information in the existing forum topic by filling out the template there.

To provide valuable feedback for OneSync issues or crashes, please fill out the following template as much as possible.

Client

Using canary? No
Windows version: Windows 10 version 1803, build 17134.829
System specifications:
AMD Ryzen 7 2700x Eight-Core Processor @ 3.7 GHz
32 GB DDR4-2666 MHz of memory
NVidia GeForce GTX 1660 Ti
500 GB SSD

Server

Operating system: Debian 9.8 stretch
Artifact version: 1328
IP address: localhost
Resources: No specific resource
System specifications:
Intel i7-7700K 4-Core @ 4.2 GHz
10 GB of memory

Incident

Summary: It appears that if a player has armor on, when an attacker shoots at them, the attacker will see the victim drop, however, for everyone else, they are still alive and walking around.
Expected behavior: The player will stay standing until they’ve run out of both armor and health.
Actual behavior: The attacker will see the victim die, however, for everyone else, they will still be alive. The victim will remain “dead” for the attacker until they are resurrected again.
Steps to reproduce:

  1. Put on armor
  2. Get shot by someone, tell them to keep shooting until they see you go down.
  3. They will eventually see you go down, but for everyone else, you’re still alive.

Server/Client?
Files for repro (if any): No client crashes
Error screenshot (if any): No error messages
.dmp files/report IDs: No crashes

Any additional info:

Here is a video further demonstrating the bug. Client A has a weapon, and Client B has full armor. Client A shoots until the player is down on their end. Client B is still alive, and attacks Client A until downed.

Couldn’t reproduce this earlier, gave full armor using vMenu, another player got given weapons, and no matter where on the body a player got shot, the target died at the same time for everyone.

I have this too, Vrp 0.5
Any Solution

1 Like

I have this problem too.

1 Like

Wow, you do? Maybe provide actual information on reproducing it instead of making this into some sort of “wow i feel for you having this problem” topic.

I have been trying to fix this problem for several weeks, but with no success, the video below shows the problem, the player dies the same as a ped, starting with a ragdoll and then dying for the shooter, but for the victim he is still alive, it will only really die after the 4th shot.

The problem happens in both Windows and Linux.

https://streamable.com/42v1j

Server

Operating system: Tested on Ubuntu 14.04.5 LTS trusty x64 and Windows Server 2012 R2 6.3(Build 9600) x64
Linux Artifact version: 1056
Windows Artifact version: 1096
System specifications:
Processor: Intel® Xeon® Gold 5120 CPU @ 2.20ghz (4 processors)
RAM: 12.00GB

Are you running any script that messes with damage response?

I’m using the vRP Framework that controls when the player is in coma or not

Code:

Citizen.CreateThread(function() -- coma thread
  while true do
    Citizen.Wait(0)
    local ped = GetPlayerPed(-1)
    
    local health = GetEntityHealth(ped)
    if health <= cfg.coma_threshold and coma_left > 0 then
      if not in_coma then -- go to coma state
        if IsEntityDead(ped) then -- if dead, resurrect
          local x,y,z = tvRP.getPosition()
          NetworkResurrectLocalPlayer(x, y, z, true, true, false)
          Citizen.Wait(0)
        end

        -- coma state
        in_coma = true
        vRPserver.updateHealth({cfg.coma_threshold}) -- force health update
        SetEntityHealth(ped, cfg.coma_threshold)
        SetEntityInvincible(ped,true)
        --tvRP.playScreenEffect(cfg.coma_effect,-1)
        tvRP.ejectVehicle()
        tvRP.setRagdoll(true)
      else -- in coma
        -- maintain life
        if health < cfg.coma_threshold then 
          SetEntityHealth(ped, cfg.coma_threshold) 
        end
      end
    else
      if in_coma then -- get out of coma state
        in_coma = false
        SetEntityInvincible(ped,false)
        tvRP.setRagdoll(false)
        --tvRP.stopScreenEffect(cfg.coma_effect)

        if coma_left <= 0 then -- get out of coma by death
          SetEntityHealth(ped, 0)
        end

        SetTimeout(5000, function()  -- able to be in coma again after coma death after 5 seconds
          coma_left = cfg.coma_duration*60
        end)
      end
    end
  end
end)

We’re using vRP aswell, no general issues regarding PvP or damage.
Check if you have other scripts/resource which may interfere.

in all the resources these are those that use SetEntityHealth

Search "EntityHealth"

  E:\FiveMDev\server\resources\[modmenu]\mellotrainer\cl_admin.lua (1 hit)
	Line 168: 		SetEntityHealth( ped, 0 )

  E:\FiveMDev\server\resources\[modmenu]\mellotrainer\cl_player.lua (2 hits)
	Line 35: 		SetEntityHealth(playerPed, 200)
	Line 51: 		SetEntityHealth(playerPed, 0)

  E:\FiveMDev\server\resources\[modmenu]\mellotrainer\cl_settings.lua (1 hit)
	Line 326: 		if not GetEntityHealth(ped) then -- Dead

  E:\FiveMDev\server\resources\[system]\spawnmanager\spawnmanager.lua (1 hit)
	Line 275:         --SetEntityHealth(ped, 300) -- TODO: allow configuration of this?

  E:\FiveMDev\server\resources\[vrp]\vrp\client\survival.lua (8 hits)
	Line 6:   local n = math.floor(GetEntityHealth(ped)+variation)
	Line 9:   SetEntityHealth(ped,n)
	Line 13:   return GetEntityHealth(GetPlayerPed(-1))
	Line 19:   SetEntityHealth(GetPlayerPed(-1),n)
	Line 88:     local health = GetEntityHealth(ped)
	Line 100:         SetEntityHealth(ped, cfg.coma_threshold)
	Line 108:           SetEntityHealth(ped, cfg.coma_threshold) 
	Line 119:           SetEntityHealth(ped, 0)

  E:\FiveMDev\server\resources\[vrp]\vrp_basic_menu\playerblips\client.lua (1 hit)
	Line 153: 						if not GetEntityHealth( ped ) then -- dead

  E:\FiveMDev\server\resources\[wzl]\jEasyAdmin\admin_client.lua (4 hits)
	Line 77: 	if slapAmount > GetEntityHealth(PlayerPedId()) then
	Line 78: 		SetEntityHealth(PlayerPedId(), 0)
	Line 80: 		SetEntityHealth(PlayerPedId(), GetEntityHealth(PlayerPedId())-slapAmount)
	Line 80: 		SetEntityHealth(PlayerPedId(), GetEntityHealth(PlayerPedId())-slapAmount)

  E:\FiveMDev\server\resources\[wzl]\jEasyAdmin\gui_c.lua (1 hit)
	Line 513: 			table.insert(text,strings.health..": "..GetEntityHealth(targetPed).."/"..GetEntityMaxHealth(targetPed))

Search for

NetworkSetFriendlyFireOption
SetCanAttackFriendly

there is this vRP Framework function

function tvRP.setFriendlyFire(flag)
  NetworkSetFriendlyFireOption(flag)
  SetCanAttackFriendly(GetPlayerPed(-1), flag, flag)
end

and it is used in a playerSpawn event

AddEventHandler("vRP:playerSpawn",function(user_id, source, first_spawn)
  local data = vRP.getUserDataTable(user_id)

  -- disable police
  vRPclient.setPolice(source,{cfg.police})
  -- set friendly fire
  vRPclient.setFriendlyFire(source,{cfg.pvp})
end)

Do you have pvp enabled in the vRP configuration file?

yes

local cfg = {}

cfg = {
  thirst_per_minute = 0.00,
  hunger_per_minute = 0.00,
  overflow_damage_factor = 0,
  pvp = true,
  police = false
}

return cfg

without solution? :disappointed_relieved:

Pls, we really need help with this.

We cant find any trouble. That makes no sense at all.

another day without an answer…

For those of you who dont like reading the main topic.

1 Like