07.12.2010, 14:29
Hm, do you use the weaponSync variable in OnPlayerUpdate? Not sure if it already existed a year ago. If not, rewrite your code for OnPlayerUpdate.
If you return 0 in OnPlayerUpdate, the sever does not synchronize the players' actions for the other players, so e.g. the grenade is only thrown for the throwing player.
You can either just return 0 in there if weaponSync is 0, but you will have to reset the variable after a certain time, and this would make the player move laggy for the other players.
Or you check if the fire key is pressed directly in OnPlayerUpdate with GetPlayerKeys, and return 0 if it is. This would decrease the "desync lag" for the other players.
If you return 0 in OnPlayerUpdate, the sever does not synchronize the players' actions for the other players, so e.g. the grenade is only thrown for the throwing player.
You can either just return 0 in there if weaponSync is 0, but you will have to reset the variable after a certain time, and this would make the player move laggy for the other players.
Or you check if the fire key is pressed directly in OnPlayerUpdate with GetPlayerKeys, and return 0 if it is. This would decrease the "desync lag" for the other players.