multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.3k stars 412 forks source link

triggerServerEvent doesn't work for some players #3512

Open RatajVaver opened 2 days ago

RatajVaver commented 2 days ago

Describe the bug

Server events are never fired when triggered by some clients. This issue started happening to few players on my server in last few days. Fresh installation of MTA client on different hard drive helped one of them, another solved it by installing nightly version and it worked for them as well, for many other players neither solution solves it.

Steps to reproduce

Example code:

-- client
addEventHandler("onClientResourceStart", getResourceRootElement(), function()
    iprint(triggerServerEvent("testEvent", getLocalPlayer()))
end)

-- server
addEvent("testEvent", true)
addEventHandler("testEvent", getRootElement(), function()
    iprint("OK!")
end)

Client 1 gets only "INFO: true" and "OK!" is never printed on the server. Client 2 gets both "INFO: true" and "OK!" is printed on the server. Tested on 2 different servers, it produces the same result on both, therefore it seems to be MTA client issue.

Version

Client 1: Multi Theft Auto v1.6-release-22556 (Windows 10, 64-bit) Client 2: Multi Theft Auto v1.6-release-22556 (Windows 11, 64-bit) - works for them

Server 1: Multi Theft Auto v1.6-release-22558 (Windows 10, 64-bit) Server 2: Multi Theft Auto v1.6-release-21846 (Debian 11, 64-bit)

Security Policy

bum8hj commented 2 days ago

Try doing something like setElementHealth instead of iprint. It's possible that this is a bug caused by some of the recent debug view/log changes.

Edit: Although I don't see why they would affect iprint tbh...

botder commented 2 days ago

We have some interference caused by the AC for some players at the moment, it will be fixed soon™.