Skip to content

The predefined variable "source" sometimes returns nil instead of an element #4164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
androksi opened this issue Apr 17, 2025 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@androksi
Copy link
Member

Describe the bug

It's just what the title says. It does happen sometimes inside server-side events, as far as I tested. I personally haven't experienced any issues on client-side so far.

Steps to reproduce

  1. Add some server-side event and debug the "source" variable.

See examples below.

local function outputInfo()
    iprint(eventName, source)
end

addEventHandler("onPlayerWasted", root, outputInfo)
addEventHandler("onPlayerJoin", root, outputInfo)
addEventHandler("onPlayerQuit", root, outputInfo)
addEventHandler("onPlayerChat", root, outputInfo)
addEventHandler("onPlayerLogin", root, outputInfo)

Version

Client: Multi Theft Auto v1.6-release-23147 (Windows 10 Pro, 64-bit, 19045.5737)
Server: Multi Theft Auto v1.6-release-23146 (Windows 10 Pro, 64-bit, 19045.5737)

Additional context

I've tested it on a clean server, with no mods, just the default MTA resources and no config changed.

Experiences:

  • Sometimes if you die, you will not respawn ("source" inside onPlayerWasted returns nil) and the camera keeps going up infinitely.
  • Pressing T, then typing a message and pressing ENTER sometimes will not send the message. ("source" inside onPlayerChat returns nil)
  • The default joinquit resource sometimes will not output in the chat that someone joined/left the server, it will output a warning on debugscript. ("source" inside both onPlayerJoin / onPlayerQuit returns nil)

Relevant log output

No relevant log output.

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@androksi androksi added the bug Something isn't working label Apr 17, 2025
@Xenius97
Copy link
Contributor

Cannot reproduce via x64-x86-23147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants