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

Lua Function db.executeQuery

Wezza

lua nOOb
Joined
May 31, 2008
Messages
2,278
Reaction score
31
Hello,



The idea from this function is to set the Guild which deals most dmg to a monster to become the owners of a castle... http://grand-ot.ddns.net/?subtopic=thecastle

when someone kills the King of the castle, It doesn't update the database for the new guildid owners..

The table name is Castle, and 2 columns in it, guildid and time..

Code:
function setCastleOwners(id, time)
    db.executeQuery("UPDATE `castle` SET `guildid` = '"  .. id .. "', `time` = '" .. time .. "' WHERE `time` > 0;")
end

for example if Guildid = 1 are the current castle owners, when guildid = 2 kill the king of the castle they, should become the castle owners but it doesn't update the column in the database (guildid)..

no errors in console, but maybe I wrote the queries wrong for the database;

please help
 
Hello,



The idea from this function is to set the Guild which deals most dmg to a monster to become the owners of a castle... http://grand-ot.ddns.net/?subtopic=thecastle

when someone kills the King of the castle, It doesn't update the database for the new guildid owners..

The table name is Castle, and 2 columns in it, guildid and time..

Code:
function setCastleOwners(id, time)
    db.executeQuery("UPDATE `castle` SET `guildid` = '"  .. id .. "', `time` = '" .. time .. "' WHERE `time` > 0;")
end

for example if Guildid = 1 are the current castle owners, when guildid = 2 kill the king of the castle they, should become the castle owners but it doesn't update the column in the database (guildid)..

no errors in console, but maybe I wrote the queries wrong for the database;

please help

Have you tried run the query manually from database?
 
Its easy.. The Player kill a monster .. when monster is killed -- > check player guild .. --> set guildid to new guildid in database..

check this it will help you much; http://grand-ot.ddns.net/?subtopic=thecastle


the guild who dealt the most damage (all together), will be the new owners of the Castle.

308fyoz.png



New owners means updating the old guild owners (the guild that already own the castle) to new owners (the guild that are attacking -and dealing the most dmg- to the monster *Castle defender monster*) in database.. and this is what is not working.. everything else works like a charm.. im usingUniformserver, @Cornex
 
Back
Top