Skip to content

Fix triggerClientEvent nil argument in admin chat handler#713

Open
NightWatch404 wants to merge 1 commit intomultitheftauto:masterfrom
NightWatch404:patch-4
Open

Fix triggerClientEvent nil argument in admin chat handler#713
NightWatch404 wants to merge 1 commit intomultitheftauto:masterfrom
NightWatch404:patch-4

Conversation

@NightWatch404
Copy link
Contributor

@NightWatch404 NightWatch404 commented Mar 21, 2026

The variable client was returning nil when the command was triggered from the console (F8) or a command handler, causing the script to fail because triggerClientEvent requires a valid player
element as the 3rd argument (source).

Screenshot_5

triggerClientEvent failed due to a nil sender
Added a fallback for the sender element using local sender = client or source.
Added a safety check to ensure aPlayers[player] exists before accessing its indices.
Fixed potential script breaks when the admin chat is triggered via certain console commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant