Skip to content

Optimize the script, remove MySQL queries and client script#1

Open
emrik00 wants to merge 7 commits intopolacy2018:mainfrom
emrik00:main
Open

Optimize the script, remove MySQL queries and client script#1
emrik00 wants to merge 7 commits intopolacy2018:mainfrom
emrik00:main

Conversation

@emrik00
Copy link
Copy Markdown

@emrik00 emrik00 commented Dec 16, 2021

No need for commands or MySQL queries, just do everything automatically.

Optimize, add support for new and old ESX and drop MySQL queries and client script.
Fix Config.Webhook
@emrik00
Copy link
Copy Markdown
Author

emrik00 commented Dec 16, 2021

This is untested, although it should work, please send me a message if something is broken.

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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk why this is here ether.

}
}

if message == nil or message == '' then return FALSE end
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

2 participants