Onyx Weed | Weed Growing

For the seeds get rid of the remove item function, and around line 130 (where it tryes to plant) add

xPlayer.removeInventoryItem(type,1)

Anyone getting server hitch warnings? I’m getting 200ms warnings every time my plants update.

Script has been updated to hopefully resolve these issues, any errors or bugs please let me know as I had to update it without testing. I don’t currently have ESX set up.

Thanks! I’m going to do some testing!

Unexpected symbol near “if”.
sv/main.lua line 229

Getting the same thing. I’ll try and look into it later if no one else does

Same. Will try a couple things later too

Sorry couldnt test the changes, I’ll look into this now for you guys

try replacing the event with this

RegisterServerEvent('orp:weed:server:updateWeedPlant')
AddEventHandler('orp:weed:server:updateWeedPlant', function(id, data)
    local result = MySQL.Sync.fetchAll('SELECT * FROM weed_plants WHERE plantid = @plantid', {
        ['@plantid'] = id
    })

    if result[1] then
        local newData = json.encode(data)
        MySQL.Async.execute('UPDATE weed_plants SET properties = @properties WHERE plantid = @id', {
            ['@properties'] = newData,
            ['@id'] = id
        })
    end
end)

ok that part definitely works ^^
But i it looks like the Plants will not be saved in the database.

I think the last thing that needs to be changed is the save plant function.

RegisterServerEvent('orp:weed:server:saveWeedPlant')
AddEventHandler('orp:weed:server:saveWeedPlant', function(data, plantId)
    local data = json.encode(data)
    
    MySQL.Async.execute('INSERT INTO weed_plants (properties, plantid) VALUES (@properties, @plantid)', {
        ['@properties'] = data,
        ['@plantid'] = plantId
    }, function ()
    end)
end)

I just added the plantId to it
@HighHowdy could you confirm and add it to your branch?

image

Very optimased* they said

If you’re getting 121ms then you’ve probably changed something

You closed the entire thread because a few people complained? How petty can you get.

Don’t close it. The script is awesome and you took a lot of work into it. Bugreports are here to improve a script. Thats all. :slight_smile:

mh :confused: well it was on a good way and the implementation was nice.
Sure there are bugs and people will complain about it but that is normal.
Of course you do not have to force yourself into ESX and especially not if you do not have time.
But well ok ^^

It’s because I don’t have the time to maintain it, I develop on another framework and convert some scripts I make over to ESX to help out others. The script is available on github still. If that’s too much of a problem for you, as someone with a degree in game design you should have no problem creating your own.

Nah nah that doesn’t change anything. You’re removing it. You released something, now you’re removing it which is the ultimate petty move. It would be different if you were merely discontinuing it, but you removed it either for attention or out of pure spite. You need to do some self reflection, friend.

It’s still available for people to download in its current state…

I will work on an update to fix errors within a week or two, but as I’ve stated previously I don’t the time to fully maintain this resources and future updates will be pushed slowly.

Well i can tell you the script itself is awesome. Its just how its optimized. When planting a few plants, the server is getting a hitch warning and with 100 plants its even crashing. I took a look into a very similar script (DopePlant) which was coded similar and it had the exact same issue like your script. I even tryed to optimize it myself but i think, it needs to be recoded. I’m using uteknark atm and i can plant over 1000 plants without any issues. The code is very diferent but you could take a look into it, how he optimized his script. I hope this will help you :slight_smile: