Author Topic: sync  (Read 1688 times)

0 Members and 1 Guest are viewing this topic.

Offline glassy

  • Busta
  • *
  • Posts: 33
  • Country: sd
  • Respect: +3/-4
  • Gender: Male
  • Buster
    • View Profile
  • MCNR name: glassy
  • Discord name: glassy#6394
sync
« on: December 13, 2019, 02:42:32 pm »
Hello,in the last 3 or 4 days whenever i being shoot i got synced, whether it's a cop or a civilian

[attachment deleted by admin]
« Last Edit: December 13, 2019, 02:45:07 pm by glassy »

Offline RavenGuard69

  • Banned
  • Baller
  • *
  • Posts: 330
  • Country: 00
  • Respect: +16/-60
  • Gender: Male
    • View Profile
  • MCNR name: Bear
Re: sync
« Reply #1 on: December 14, 2019, 09:55:42 am »
most happens when you jump and get shooted

Offline glassy

  • Busta
  • *
  • Posts: 33
  • Country: sd
  • Respect: +3/-4
  • Gender: Male
  • Buster
    • View Profile
  • MCNR name: glassy
  • Discord name: glassy#6394
Re: sync
« Reply #2 on: December 14, 2019, 11:43:05 am »
no, once i was standing near some players and they started shooting someone, a bullet wrongly hit me and i got synced.

Offline RavenGuard69

  • Banned
  • Baller
  • *
  • Posts: 330
  • Country: 00
  • Respect: +16/-60
  • Gender: Male
    • View Profile
  • MCNR name: Bear
Re: sync
« Reply #3 on: December 14, 2019, 03:02:26 pm »
I didn't say that ONLY happens when you jump I said most.

Offline Mike

  • Server Owner
  • *
  • Posts: 3697
  • Country: gb
  • Respect: +413/-71
  • Gender: Male
    • View Profile
  • MCNR name: Mike
  • Discord name: mp2
Re: sync
« Reply #4 on: January 20, 2020, 03:19:23 pm »
There are two events in SA-MP scripting: OnPlayerWeaponShot and OnPlayerGiveDamage. OnPlayerWeaponShot tells the server that the shooter shot a bullet into a player. This never fails. OnPlayerGiveDamage happens when the bullet that hit the player did damage. Logically, both of these should happen if someone gets shot. It should tell the server they were shot (OnPlayerWeaponShot) and also that they did damage (OnPlayerGiveDamage).

I found through testing that if a player becomes desynced (exit a vehicle as it explodes, and you appear dead to other players and can't be damaged) only OnPlayerWeaponShot is called and not OnPlayerGiveDamage. Therefore if this discrepancy is detected it will re-sync you by placing you into a different virtual world for a moment and then returning you.

Somehow this is being detected for yourself. This doesn't really make any sense, because both OnPlayerWeaponShot and OnPlayerGiveDamage are reported by the shooter, and I can't think why they wouldn't match up. How can it report that you shot someone, but didn't damage them?

Is this a common thing?

I will increase the time check between being shot and taking damage. It's currently checking if you were shot in the last 2 seconds but the last damage was 4 seconds ago, it will resync. I'll increase it to 3 and 5 seconds respectively and see what happens. I will also add debug info to that chat message so if it happens again please provide the debug info shown (after update 1.4.5).
View trailers here.


Offline Mike

  • Server Owner
  • *
  • Posts: 3697
  • Country: gb
  • Respect: +413/-71
  • Gender: Male
    • View Profile
  • MCNR name: Mike
  • Discord name: mp2
Re: sync
« Reply #5 on: January 24, 2020, 09:19:44 pm »
This should be fixed now. Please report if this happens again.
View trailers here.