• 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!

NPC Marriage system 8.6+ [Fixed]

Change db.executeQuery to db.query or add this in compat.lua/global.lua.
Code:
db.executeQuery = db.query


Under
Code:
for i = 1, #players do
Add
Code:
[i]
After players till the "end" under that.
So it will be:
Code:
players[i]

I'm getting this same error but I don't understand what you mean, I have the problem about the [ i ] thing but I don't get where i put it
 
Which one? The first or the second? What you don't understand?
 
second part im not sure where you have to place the [ i ] exactly, for this error. I also Do not get a ring when i marry or it does not say over my head who im married too xD


[02/01/2015 17:15:56] [Error - Npc interface]
[02/01/2015 17:15:56] data/npc/scripts/marriage.lua:eek:nCreatureSay
[02/01/2015 17:15:56] Description:
[02/01/2015 17:15:56] (luaGetPlayerNameByGUID) Player not found
 
Last edited:
Under line 65, which is this
Code:
for i = 1, #players do
Change players to
Code:
players[i]
So line 66 till 71.
 
now i get this

[02/01/2015 21:22:35] [Error - LuaScriptInterface::loadFile] data/npc/scripts/marriage.lua:65: '<name>' expected near '['
Reloaded npcs.
[02/01/2015 21:22:35] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/marriage.lua
[02/01/2015 21:22:35] data/npc/scripts/marriage.lua:65: '<name>' expected near '['
 
Code:
for [i] = 1, #players[i] do
local ring = doPlayerAddItem(getPlayerByNameWildcard(getPlayerNameByGUID(players[i])), marry_config.RingID, 1)
doItemSetAttribute(ring, "description", getCreatureName(cid) .. " & " .. getPartner(cid) .. " forever - married on " ..getMarryDate(cid).. ".")
doCreatureSay(getPlayerByNameWildcard(getPlayerNameByGUID(players[i])), marry_config.Text[math.random(1,#marry_config.Text)], TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(getPlayerByNameWildcard(getPlayerNameByGUID(players[i]))), 35)
setPlayerStorageValue(getPlayerByNameWildcard(getPlayerNameByGUID(players[i])), marry_config.storage3, 1)
setPlayerStorageValue(getPlayerByNameWildcard(getPlayerNameByGUID(players[i])), 150420, 1)
end
 
Keep this line the way it was
Code:
for i = 1, #players do
 
ok i will try this...sigh.. Now i get this. The npc works untill i said proceed then it lags and i get this error and then nothing happens at all

[02/01/2015 21:38:40] mysql_real_query(): INSERT INTO `marriage_system` (`player_id`, `partner`, `marriage_date`) VALUES ('11', '10', '1420252720'); - MYSQL ERROR: Duplicate entry '0' for key 'PRIMARY' (1062)

[02/01/2015 21:38:41] [Error - Npc interface]
[02/01/2015 21:38:41] data/npc/scripts/marriage.lua:eek:nCreatureSay
[02/01/2015 21:38:41] Description:
[02/01/2015 21:38:41] data/lib/004-database.lua:76: [Result:getDataString] Result not set!
[02/01/2015 21:38:41] stack traceback:
[02/01/2015 21:38:41] [C]: in function 'error'
[02/01/2015 21:38:42] data/lib/004-database.lua:76: in function 'getDataString'
[02/01/2015 21:38:42] [string "marry_config = {..."]:50: in function 'getPartner'
[02/01/2015 21:38:42] data/npc/scripts/marriage.lua:67: in function 'callback'
[02/01/2015 21:38:42] data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
[02/01/2015 21:38:42] data/npc/scripts/marriage.lua:8: in function <data/npc/scripts/marriage.lua:8>
 
Last edited:
Execute this query
Code:
DROP TABLE `marriage_system`;
Then this
Code:
CREATE TABLE `marriage_system` (
   `id` INT NOT NULL AUTO_INCREMENT,
   `player_id` INT NOT NULL,
   `partner` VARCHAR(255) NOT NULL,
   `marriage_date` INT NOT NULL,
   PRIMARY KEY (`id`)
) ENGINE = InnoDB;
 
Ok great! it works thank you so much, but one last thing.. When I look at my partner it does not say who I am married.. But i dont get any errors do you know whats wrong?
 
Last edited:
[03/01/2015 15:49:26] [Error - LuaScriptInterface::loadFile] data/npc/scripts/marriagesystem.lua:6: function arguments expected near ':'
[03/01/2015 15:49:26] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/marriagesystem.lua
[03/01/2015 15:49:26] data/npc/scripts/marriagesystem.lua:6: function arguments expected near ':'
i found this error when i tried to summon the npc
/n celest
 
Change those 4 lines at the top
It's because of the missing Lua tags, it makes : o into a :eek: smiley.
Code:
function onCreatureAppear(cid)     npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)     npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg) end
function onThink()     npcHandler:onThink() end
 
When I talk with the NPC he marry the players, but occurs some errors in the database and the NPC do not gives the wedding ring.

Here are the photos from the errors:

a4lmz6.png


Sorry my bad english. :\
 
No, the lines under that line, not that line, so line 66 till 71.
Code:
players[i]
 
Back
Top