#Database not saving crafting rep.

1 messages · Page 1 of 1 (latest)

frozen ridge
#

Hey guys maybe someone can enlighten me as I’ve been having this problem for a couple of days and can’t get it fixed.

So I’m using crafting and I have edited the config jsut for items to be crafted. The player makes the items gets X amount of crafting xp and when the server restarts they are back at zero.

I have installed the sql, I have cw-crafting & rep all started after MySQL in the cfg. I’m using Qbox and Ox has anyone encountered this issue before or maybe can assist I feel like I have blinders on now so I’m missing whatever the issue is.

Also should add no errors anywhere.

jovial pelican
#

Any errors?

frozen ridge
#

No errors which is what has me stumped.

I installed it changed the items in the config, did the sql tested it in game and you can see it going up, I can also log in and out and it will work but if the server restarts that’s when I get mine reset.

jovial pelican
#

Sounds like a database issue. You sure the SQL is working and the server isn't throwing errors when updating?

The script updates the DB every x seconds/minutes. It sounds like it's just using cache while the server is on and thats why it's working until you restart it.

frozen ridge
#

Yeah I figured as much, so when I run the sql it adds cw-skills to the players row in the db it’s listed as that in the config so I am unsure why it won’t pick up on it.

jovial pelican
#

Try doing a clean install of cw-rep

frozen ridge
#

That’s what I was thinking just cleaning it all out and redoing it all maybe be the best course. I’m in work right now but when I am home I will just redo it all and report back. Thanks for your help.

frozen ridge
# jovial pelican Try doing a clean install of cw-rep

Okay so I have done this fresh install and same issue not saving to the db.

on this line "Config.UpdateFrequency = 60*60 -- Seconds interval between removing values (no need to touch this)"

is this 60 times 60?

jovial pelican
#

That is for if you want to have skills that degrade over time

#

It should be updating the DB every 10 minutes by default iirc

#

Config.MinutesBetweenUpdates to change

frozen ridge
#

and this on the server side now until I changed the minutes between updates it was gaining xp in the ui but since i lowered it now it does not gain xp,

I also tried a full restart too with no joy.

jovial pelican
#

It should've been there by default tho

#

add this in shared_scripts
'@qbx_core/modules/playerdata.lua',

frozen ridge
#

OKay, it was missing. do I need it in rep too?

jovial pelican
#

Not sure

#

lol

frozen ridge
#

find out I guess

#

So no longer getting any errors client or server side, but you make something an no xp goes up at all in the UI

jovial pelican
#

you sure you enabled Rep for crafting?

frozen ridge
#

Yep I did and I have boht started after ox and the core.

Config.ItemName = "cw_blueprint" -- Name of the item in your items.lua
Config.PlayersTableName = 'players' -- 'players' for qb/qbox, 'characters' for ox. Something else for esx probably
Config.PlayerDbIdentifier = 'citizenId' -- 'citizenId' for qb/qbox, 'stateId' for ox, Something else for ex probably
Config.UseCWRepForCraftingSkill = true -- Set to true if you want to use cw-rep for skill instead of qbs metadata
-- The following all require cw-rep to be enabled:
Config.CraftingSkillName = 'crafting' -- Make sure this matches the crafting skill name in your cw-rep config
Config.CraftingSkillLabel = 'Crafting Skill' -- Default name for the crafting skill
Config.HideRecipeIfSkillNotMet = false -- if this is enabled then players wont see recipes they dont have skill enough to see
Config.UseLevelsInsteadOfSkill = false -- If true then cw-rep will use level instead of pure xp
Config.DefaultMaxCraft = 10 -- Default max amount a player can craft at a time

jovial pelican
#

I'm stumped

#

I assume you went over the guide I posted earlier?

frozen ridge
#

Okay so I can confirm I got one xp, restart the server great and it saved.

the minute I made a change to the config then it stops updating in the ui and the db.

#

oh yeah I went through it all

jovial pelican
#

Ah ok maybe I missed it. You never posted any Debug logs kap

frozen ridge
jovial pelican
#

Is that all the logs?

#

Looks like just the crafting setup, not the actual item crafting, or cw-rep

frozen ridge
#

so that is just the client logs when you try make something sending the server now

jovial pelican
#

Did you miss those errors on server side or?

frozen ridge
#

the item error, no I didnt but that wont affect the rep going up because its ox right ?

jovial pelican
#

Of course it could. If crafting relies on a return value from ox then it could very well fail to execute correctly when Ox fails

#

Not sure what causes that tho

#

CustomDrop was related to weight = 0 iirc

frozen ridge
#

so one of the lads did this for the bridge server file.

"lua function addItem(src, itemName, amount, metadata)
if Config.oxInv then
exports.ox_inventory:AddItem(src, itemName, amount, metadata)
end
end"

now the rep is accumulating on the ui gonna test a restart now

jovial pelican
#

yeah he probably removed the drop functionality

frozen ridge
#

Aye he did.

#

custom drop is gone he said.