Optimize the script, remove MySQL queries and client script#1
Open
emrik00 wants to merge 7 commits intopolacy2018:mainfrom
Open
Optimize the script, remove MySQL queries and client script#1emrik00 wants to merge 7 commits intopolacy2018:mainfrom
emrik00 wants to merge 7 commits intopolacy2018:mainfrom
Conversation
Optimize, add support for new and old ESX and drop MySQL queries and client script.
Fix Config.Webhook
Author
|
This is untested, although it should work, please send me a message if something is broken. |
RockySouthpaw
suggested changes
Dec 18, 2021
| RegisterNetEvent('esx:playerLoaded') -- When a player loads in, we can store some basic information about them locally | ||
| AddEventHandler('esx:playerLoaded', function(playerId, xPlayer, isNew) | ||
| ESX.Players[playerId] = xPlayer.job.name | ||
| local zPlayer = ESX.GetPlayerFromId(playerId) |
There was a problem hiding this comment.
Do you really need to define this here as xPlayer is passed via this event: (playerId, xPlayer, isNew)
You use xPlayer to trigger a notification below this.
|
|
||
| RegisterNetEvent('esx:playerLoaded') -- When a player loads in, we can store some basic information about them locally | ||
| AddEventHandler('esx:playerLoaded', function(playerId, xPlayer, isNew) | ||
| ESX.Players[playerId] = xPlayer.job.name |
| } | ||
| } | ||
|
|
||
| if message == nil or message == '' then return FALSE end |
There was a problem hiding this comment.
There's no need to return a bool here as you're doing nothing with it. Best to toss an error print then to just return.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No need for commands or MySQL queries, just do everything automatically.