Ir para conteúdo

Featured Replies

Postado
  • Autor
8 minutos atrás, tetheuscunha disse:

Tenta assim :

 

 

  Mostrar conteúdo oculto

 


 

function onStartup()
    
db.query("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")


db.query("DELETE FROM `guild_wars` WHERE `status` = 0 AND `begin` < " .. (os.time() - 2 * 86400) .. ";")

db.query("UPDATE `guild_wars` SET `status` = 5, `end` = " .. os.time() .. " WHERE `status` = 1 AND `end` > 0 AND `end` < " .. os.time() .. ";")

end
 

 

 

irei testar, mas serve para que isso?

  • Respostas 8
  • Visualizações 907
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

Postado
Agora, jefinho01 disse:

irei testar, mas serve para que isso?

 

db.query("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";") - Atualizar o WORLD dos players

db.query("DELETE FROM `guild_wars` WHERE `status` = 0 AND `begin` < " .. (os.time() - 2 * 86400) .. ";") - Deletar Guilds (acho que as que estão inativa)

db.query("UPDATE `guild_wars` SET `status` = 5, `end` = " .. os.time() .. " WHERE `status` = 1 AND `end` > 0 AND `end` < " .. os.time() .. ";") - Isto e uma função do GuildWar
 

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Postado
  • Autor
18 minutos atrás, tetheuscunha disse:

db.query("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";") - Atualizar o WORLD dos players

db.query("DELETE FROM `guild_wars` WHERE `status` = 0 AND `begin` < " .. (os.time() - 2 * 86400) .. ";") - Deletar Guilds (acho que as que estão inativa)

db.query("UPDATE `guild_wars` SET `status` = 5, `end` = " .. os.time() .. " WHERE `status` = 1 AND `end` > 0 AND `end` < " .. os.time() .. ";") - Isto e uma função do GuildWar
 

 

ainda continua o erro:

 

> Trigger: ondelete_accounts does not exist, creating it...
OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "DELETEON": syntax error (CREATE TRIGGER "ondelete_accounts"BEFORE DELETEON "accounts"FOR EACH ROWBEGIN     DELETE FROM "players" WHERE "account_id" = OLD."id";    DELETE FROM "account_viplist" WHERE "account_id" = OLD."id";    DELETE FROM "bans" WHERE "type" IN (3, 4) AND "value" = OLD."id";END;)
> Trigger: oninsert_account_viplist does not exist, creating it...
OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: no such table: main.account_viplist (CREATE TRIGGER "oninsert_account_viplist" BEFORE INSERT ON "account_viplist" FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'INSERT on table `account_viplist` violates foreign: `account_id`') WHERE NEW."account_id" IS NULL OR (SELECT "id" FROM "accounts" WHERE "id" = NEW."account_id") IS NULL; SELECT RAISE(ROLLBACK, 'INSERT on table `account_viplist` violates foreign: `player_id`') WHERE NEW."player_id" IS NULL OR (SELECT "id" FROM "players" WHERE "id" = NEW."player_id") IS NULL; END;)
> Trigger: onupdate_account_viplist does not exist, creating it...
OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: no such table: main.account_viplist (CREATE TRIGGER "onupdate_account_viplist" BEFORE UPDATE ON "account_viplist" FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'UPDATE on table `account_viplist` violates foreign: `player_id`') WHERE NEW."player_id" IS NULL OR (SELECT "id" FROM "players" WHERE "id" = NEW."player_id") IS NULL; END;)

Postado
4 minutos atrás, jefinho01 disse:

ainda continua o erro:

 

> Trigger: ondelete_accounts does not exist, creating it...
OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "DELETEON": syntax error (CREATE TRIGGER "ondelete_accounts"BEFORE DELETEON "accounts"FOR EACH ROWBEGIN     DELETE FROM "players" WHERE "account_id" = OLD."id";    DELETE FROM "account_viplist" WHERE "account_id" = OLD."id";    DELETE FROM "bans" WHERE "type" IN (3, 4) AND "value" = OLD."id";END;)
> Trigger: oninsert_account_viplist does not exist, creating it...
OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: no such table: main.account_viplist (CREATE TRIGGER "oninsert_account_viplist" BEFORE INSERT ON "account_viplist" FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'INSERT on table `account_viplist` violates foreign: `account_id`') WHERE NEW."account_id" IS NULL OR (SELECT "id" FROM "accounts" WHERE "id" = NEW."account_id") IS NULL; SELECT RAISE(ROLLBACK, 'INSERT on table `account_viplist` violates foreign: `player_id`') WHERE NEW."player_id" IS NULL OR (SELECT "id" FROM "players" WHERE "id" = NEW."player_id") IS NULL; END;)
> Trigger: onupdate_account_viplist does not exist, creating it...
OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: no such table: main.account_viplist (CREATE TRIGGER "onupdate_account_viplist" BEFORE UPDATE ON "account_viplist" FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'UPDATE on table `account_viplist` violates foreign: `player_id`') WHERE NEW."player_id" IS NULL OR (SELECT "id" FROM "players" WHERE "id" = NEW."player_id") IS NULL; END;)

 

Creio que tem alguma função na tua distro que precissa dessas tabelas na SQL, voce vai ter que criar as tabelas.

Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.9k

Informação Importante

Confirmação de Termo