Conversation
Kr3mu
left a comment
There was a problem hiding this comment.
Also I am not sure but it would be better if you use esx point build in system.
Not everything uses locales. In client/main.lua you have local elements2 and elements move the local elements in do end code block to avoid naming variable to elements2.
The weed.lua CreateThread is unreadable, try creating local functions that handles certian parts please. I would rename localization item to items. And better would be if you add those item names etc. to the locales and then do config variable add default licenses and items or whatever and if it is enable then add them using sql or if i am not mistaken there is a function to do that. In server/main.lua you also use pairs but don't use the plantId. ProcessCannabis is also very nested. you can do if not x then return end to make it slightly more readable
| } | ||
| menuOpen = true | ||
|
|
||
| for k, v in pairs(ESX.GetPlayerData().inventory) do |
There was a problem hiding this comment.
Don't use pairs. Use numeric loop instead as you don't even use key.
| local menuOpen = false | ||
| local inZoneDrugShop = false | ||
| local inRangeMarkerDrugShop = false | ||
| local dealerTextShow = false |
There was a problem hiding this comment.
I don't really like the code structure. Can you use do end code blocks so it much clearer.
Last code snippet: https://www.lua.org/pil/4.2.html
| @@ -159,4 +130,4 @@ CreateThread(function() | |||
| for k,zone in pairs(Config.CircleZones) do | |||
There was a problem hiding this comment.
The same here. You don't need key.
https://springrts.com/wiki/Lua_Performance#TEST_12:_Adding_Table_Items_.28table.insert_vs._.5B_.5D.29
Check the performance article.
|
|
||
| ESX.OpenContext("right", elements2, function(menu2,element2) | ||
| ESX.CloseContext() | ||
| local count = tonumber(menu2.eles[2].inputValue) |
|
Well the commit you have created don't meet the comments again. |
Signed-off-by: Kenshin13 <63159154+Kenshiin13@users.noreply.github.com>
|
Rafael Antunes seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |

Description
Better performance, cleaner code structure, and more reliable plant spawning system.
PR Checklist