OneSync PvP problem


#1

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


#2

Are you running any script that messes with damage response?


#3

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)

#4

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


#5

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))

#6

Search for

NetworkSetFriendlyFireOption
SetCanAttackFriendly

#7

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)

#8

Do you have pvp enabled in the vRP configuration file?


#9

yes

local cfg = {}

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

return cfg

#10

without solution? :disappointed_relieved:


#11

Pls, we really need help with this.


#12

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


#13

another day without an answer…


#14

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


#15

Do you believe that you are alone?
This issue is not even onesync related, please stop asking for thing that you can fix yourself.


#16

so if u think we can fix ourselves, we’re just asking for help cuz we dont even know how. :slight_smile: