Postado Agosto 25, 2016 8 anos Autor 7 minutos atrás, Talesigorvr disse: @pablobion, qual arquivo que seta o storage "COH_PREPARE"? Eu pensei que fosse uma palavra, mas aparentemente é um número... poderia ver esse arquivo? Spoiler COH_PUSHTIME = 10800 -- Tempo (em segundos) de exhausted para usar o comando !gocastle - Padrão (3 horas) COH_AREA = {{x = 1056, y = 1124, z = 8}, {x = 1096, y = 1185, z = 8}} -- Canto superior esquerdo / inferior direito do Castle -- // Não mexa daqui para baixo COH_STATUS = 201320111714 COH_PREPARE1 = 201320111715 COH_PUSHSTOR = 201320111716 COH_PREPARE2 = 201320111717 function doCastleRemoveEnemies() for index, creature in ipairs(getPlayersOnline()) do if isInArea(getThingPos(creature), COH_AREA[1], COH_AREA[2]) then if getPlayerGuildName(creature) ~= getGlobalStorageValue(COH_STATUS) then doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature))) end end end return true end Editado Agosto 25, 2016 8 anos por pablobion (veja o histórico de edições) Scriptszinhos: Spoiler [CREATURESCRIPT] Auto TP depois de matar boss [ACTION] Clean Area [TALKACTION] !FelizAnoNovo [ACTION + MOVEMENT] Cartas ao GOD [CREATURESCRIPT] Always Emblem System [ACTION] Anihi simples [TALKACTIONS] Urinar / fazer xixi Não abandone seu tópico, quando você tiver a dúvida resolvida sozinho tente ensinar aos outros como resolve-la (você pode não ser o único com o problema) e quando ela for resolvida por outra pessoa não se esqueça de marcar como melhor resposta e deixar o gostei.
Postado Agosto 25, 2016 8 anos Segundo o log do distro, o erro está nesta linha local leader = db.getResult("SELECT `ownerid` FROM `guilds` WHERE `name` = ".. db.escapeString(name) .. ")") Ali no final, ")" não é esperado. [25/08/2016 11:08:06] mysql_real_query(): SELECT `ownerid` FROM `guilds` WHERE `name` = '201320111715') Veja que ele aparece no final #edit Tenta esse código: Spoiler local function getGuildLeaderId(name) local leader = db.getResult("SELECT `ownerid` FROM `guilds` WHERE `name` = ".. db.escapeString(name) .. "") if(leader:getID() ~= -1) then return leader:getDataInt("id") end return nil end function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você nao pertence a guild "..getGlobalStorageValue(COH_STATUS)..".") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!") setGlobalStorageValue(COH_PREPARE1, -1) setGlobalStorageValue(COH_PREPARE2, -1) setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid)) doCastleRemoveEnemies() doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estao no comando do castelo, va dominar e impedir isso!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[Castle of Honor] Voce nao possui uma guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid)) doPlayerSendTextMessage(getGuildLeaderId (COH_PREPARE1), 21, "[Castle of Honor] Atencao! A guild "..getPlayerGuildName(cid).." esta tentando dominar o castelo, preparem-se!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[Castle of Honor] Voce nao possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid)) doPlayerSendTextMessage(getGuildLeaderId (COH_PREPARE2), 21, "[Castle of Honor] Atencao! A guild "..getPlayerGuildName(cid).." esta tentando dominar o castelo, preparem-se!") end end return true end Editado Agosto 25, 2016 8 anos por Enzo Caue (veja o histórico de edições)
Postado Agosto 25, 2016 8 anos function getGuildLeaderName(GuildName) -- function by vodkart local leader = db.getResult("SELECT `players`.`name` FROM `players` WHERE `players`.`id` = (SELECT `guilds`.`ownerid` FROM `guilds` WHERE `guilds`.`name` = ".. db.escapeString(GuildName) .. ")") if(leader:getID() ~= -1) then return leader:getDataString("name") end return nil end function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você nao pertence a guild "..getGlobalStorageValue(COH_STATUS)..".") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!") setGlobalStorageValue(COH_PREPARE1, -1) setGlobalStorageValue(COH_PREPARE2, -1) setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid)) doCastleRemoveEnemies() doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estao no comando do castelo, va dominar e impedir isso!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[Castle of Honor] Voce nao possui uma guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then local leader = getGuildLeaderName(getGlobalStorageValue(COH_PREPARE1)) local player = getPlayerByName(leader) if player then doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "[Castle of Honor] Atencao! A guild "..getPlayerGuildName(cid).." esta tentando dominar o castelo, preparem-se!") end setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid)) end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[Castle of Honor] Voce nao possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then local leader = getGuildLeaderName(getGlobalStorageValue(COH_PREPARE2)) local player = getPlayerByName(leader) if player then doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "[Castle of Honor] Atençao! A guild "..getPlayerGuildName(cid).." esta muito proxima do domíinio, ataquem!") end setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid)) end end return true end Editado Agosto 25, 2016 8 anos por Vodkart (veja o histórico de edições) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Agosto 25, 2016 8 anos Autor [25/08/2016 14:14:37] [Error - MoveEvents Interface] [25/08/2016 14:14:37] data/movements/scripts/castelo/COH.lua:onStepIn [25/08/2016 14:14:37] Description: [25/08/2016 14:14:37] (luaDoPlayerSendTextMessage) Player not found Editado Agosto 25, 2016 8 anos por pablobion (veja o histórico de edições) Scriptszinhos: Spoiler [CREATURESCRIPT] Auto TP depois de matar boss [ACTION] Clean Area [TALKACTION] !FelizAnoNovo [ACTION + MOVEMENT] Cartas ao GOD [CREATURESCRIPT] Always Emblem System [ACTION] Anihi simples [TALKACTIONS] Urinar / fazer xixi Não abandone seu tópico, quando você tiver a dúvida resolvida sozinho tente ensinar aos outros como resolve-la (você pode não ser o único com o problema) e quando ela for resolvida por outra pessoa não se esqueça de marcar como melhor resposta e deixar o gostei.
Postado Agosto 25, 2016 8 anos arrumei agr esqueci de deletar uma coisa, tenta agr [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
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.