I can buy a pet but it does not appear to want to following me when pressing Y
Also is does not appear anything is writing to the DB.
Not getting any errors however.
Using ESX Legacy and mysql-async is working just fine.
is other things else stored in the DB?
i think its your server problem or there is a problem with your DB cause i tested it right now and pet followed me
can you add a print("worked") to Line 442 after cb(true) that we understand if it printed in console or not?
(i tested it again right now and it worked)
ESX.RegisterServerCallback("mdr_petshop:setPetFollowing" , function(src, cb, following)
local identifier = src
for k,v in ipairs(GetPlayerIdentifiers(src)) do
if string.match(v, 'license:') then
identifier = string.sub(v, 9)
break
end
end
MySQL.Async.execute('UPDATE pets SET following = @following WHERE identifier = @identifier', {
['@identifier'] = identifier,
['@following'] = following
}, function(rowsChanged) end)
cb(true)
print("worked")
end)
ESX.RegisterServerCallback("mdr_petshop:setPetFollowing" , function(src, cb, following)
local identifier = src
for k,v in ipairs(GetPlayerIdentifiers(src)) do
if string.match(v, 'license:') then
identifier = string.sub(v, 9)
break
end
end
MySQL.Async.execute('UPDATE pets SET following = @following WHERE identifier = @identifier', {
['@identifier'] = identifier,
['@following'] = following
}, function(rowsChanged) end)
cb(true)
print("worked")
end)
Just letting you know, as I made a paid pet script recently, using groups on onesync is not advised. It works great when You are the only one on the server. But as soon as you add someone else, groups seem to break and the ped will no longer be in Your group, but Theirs. An easy way to get around this with Pets following, is to have them just follow the player via gotoentity and then the player every so often when the player is out of X range.