• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Can't add prey rerolls

biaggio12

Member
Joined
Aug 22, 2009
Messages
63
Reaction score
10
gamestore/init.lua
Lua:
function GameStore.processPreyBonusReroll(player, offerCount)
player:addBonusReroll(offerCount)
end
preysystem.lua
Lua:
function Player.addBonusReroll(self, value)
db.query("UPDATE players SET bonus_reroll = bonus_reroll + " ..value.. " WHERE id = " ..self:getGuid())
end
an error
36764

Tried with
Lua:
function GameStore.processPreyBonusReroll(cid, offerCount)
player = Player(cid)
player:addBonusReroll(offerCount)
end
And some other options but didn't worked out. Above thosefunctions there are plenty functions for processing store offers and each and everyone work just fine only this one is not. Any ideas ?
 
Line 275:
Lua:
elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_PREYBONUS      then GameStore.processPreyBonusReroll(nil, offer.count)
The problem is above, you are passing the first argument as nil and your function expects player userdata, that's why you got that error, it should be this way:
Lua:
elseif offer.type == GameStore.OfferTypes.OFFER_TYPE_PREYBONUS      then GameStore.processPreyBonusReroll(player, offer.count)

Working code:
 
that fixed the problem but another happend and i cant get it to work
init.lua
preysystem.lua
gamestore.lua

The error
36767

I noticed that im passing an object as value that's why i can't concatenate it in db query. But honestly i can't find this object anywhere and i'm abit confused
 
Back
Top