15.07.2012, 09:36
There's many issues with using Get(...) functions after Set(...) ones. It seems to be an 'issue' with the way they work (sync).
This also goes for Set/GetPlayerFacingAngle, I made a topic about it: https://sampforum.blast.hk/showthread.php?tid=348860
Every OnPlayerUpdate call causes the player's data (such as drunk level) to be sent to the server and stored for use in GetPlayerDrunkLevel, I guess. I always assumed that when you used Get...() functions it sent a request to the player to return the data, but perhaps not.
So basically, this is what is happening:
Player's drunk level is 0.
OnPlayerUpdate called, '0' is sent and stored in the server.
Between an update you set it to 5000 then GetPlayerDrunk level returns 0 because OnPlayerUpdate hasn't been called since.
If I understood the sync system correctly there, it should be fixable by SetPlayerDrunkLevel setting the stored variable instead of waiting for the PLAYER to sync it.
So yeah, fixable.
This also goes for Set/GetPlayerFacingAngle, I made a topic about it: https://sampforum.blast.hk/showthread.php?tid=348860
Every OnPlayerUpdate call causes the player's data (such as drunk level) to be sent to the server and stored for use in GetPlayerDrunkLevel, I guess. I always assumed that when you used Get...() functions it sent a request to the player to return the data, but perhaps not.
So basically, this is what is happening:
Player's drunk level is 0.
OnPlayerUpdate called, '0' is sent and stored in the server.
Between an update you set it to 5000 then GetPlayerDrunk level returns 0 because OnPlayerUpdate hasn't been called since.
If I understood the sync system correctly there, it should be fixable by SetPlayerDrunkLevel setting the stored variable instead of waiting for the PLAYER to sync it.
So yeah, fixable.