View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0007905||Multi Theft Auto : San Andreas||Client||public||2013-11-21 15:13||2014-04-30 17:19|
|Target Version||1.3.5||Fixed in Version||1.3.5|
|Summary||0007905: setPedStat sometimes not synced to client|
I made M4 poor do super damage and everyone else logs in and has every weapon set to 1000 stat yet certain players were killing me with 1 bullet as if their M4 stat was desynced so I added some debug and went around getting shot at until I found somebody with the problem:
#Marco-ACAB shot you with M4, damage: 7.9900035858154 M4 stat: 0
Which is shouldn't ever be as this is set when you login:
And it seems to be set correctly server side but for some reason my client wasn't informed:
Server: getPedStat(getPlayerFromName("#Marco-ACAB"), 78)
I did this to see how many are wrong
for i, plr in pairs(getElementsByType("player")) do
8 out of 728 players had their stat set to 0 when it should have been 1000 as they all logged in.
I'll change it to use onPlayerJoin and see if that makes any difference to it being desynced.
Edit: Checked with onPlayerJoin and no players had desynced stat, but then I reconnected and checked again, 14 players were bugged so it seems to only happen with players that were online before you as I'd been online for a very long time when it returned none.
|Tags||No tags attached.|
This bug was caused by the false assumption that a dead (or unspawned) player cannot have stats.
When a player was dead, while you were connecting their stat values were not sent to the client. Thus they stayed on the default value of zero, which allowed them to kill you after being respawned.