Ir para conteúdo
  • 0

MENSAGEM AO TERMINAR EVENTO


igorsilveeira

Pergunta

Nessa parte aqui envia a mensagem que quem ganhou o evento, porem quero que envie o nome de quem ganhou o evento e o nome da guild do cara que ganhou o evento

function getWinnerCastle(cid)
          CastleWalls()
          local player = getTopCreature(THRONE_POS).uid
          if getGlobalStorageValue(STORAGE_EVENT) < 0 then
                    return true
          end
          if (isPlayer(player)) then
                    if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
                              pid = getPlayerGUID(cid)
                              setHouseOwner(100, pid)
                              doPlayerAddPremiumDays(player, 7)
                              for _, cid in ipairs(getPlayersOnline()) do
                                        setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                              end
 doBroadcastMessage(getCreatureName(player) .. " ganhou o evento.", 25)
                              doTeleportThing(player, {x = 531, y = 459, z = 7})
                              doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
                              doCreateItem(391, 1, {x = 561, y = 447, z = 5})
                    end
Editado por IgorSilveira
Link para o comentário
Compartilhar em outros sites

12 respostass a esta questão

Posts Recomendados

  • 0

Tenta isso se não der fala, que faço outro

 

Acho que você sabe editar a msg ali né

function getWinnerCastle(cid)
          CastleWalls()
          local player = getTopCreature(THRONE_POS).uid
          if getGlobalStorageValue(STORAGE_EVENT) < 0 then
                    return true
          end
          if (isPlayer(player)) then
                    if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
                              pid = getPlayerGUID(cid)
                              setHouseOwner(100, pid)
                              doPlayerAddPremiumDays(player, 7)
                              for _, cid in ipairs(getPlayersOnline()) do
                                        setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                              end
 doBroadcastMessage(getCreatureName(player) .. " ganhou o evento, da guild" getPlayerGuildName(cid), 25)
                              doTeleportThing(player, {x = 531, y = 459, z = 7})
                              doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
                              doCreateItem(391, 1, {x = 561, y = 447, z = 5})
                    end
Editado por roga
Link para o comentário
Compartilhar em outros sites

  • 0

[10/08/2013 17:00:20] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/castle.lua:27: ')' expected near 'getPlayerGuildName'
[10/08/2013 17:00:20] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/castle.lua)
[10/08/2013 17:00:20] data/talkactions/scripts/castle.lua:27: ')' expected near 'getPlayerGuildName'

Link para o comentário
Compartilhar em outros sites

  • 0

Testa esses

 

 

 

function getWinnerCastle(cid)
CastleWalls()
local player = getTopCreature(THRONE_POS).uid
if getGlobalStorageValue(STORAGE_EVENT) < 0 then
return true
end
if (isPlayer(player)) then
if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
pid = getPlayerGUID(cid)
setHouseOwner(100, pid)
doPlayerAddPremiumDays(player, 7)
for _, cid in ipairs(getPlayersOnline()) do
setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end
doBroadcastMessage(getCreatureName(player) .. " ganhou o evento, da guild" getPlayerGuildName(cid)), 25)
doTeleportThing(player, {x = 531, y = 459, z = 7})
doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
doCreateItem(391, 1, {x = 561, y = 447, z = 5})
end

 

 

 

 

function getWinnerCastle(cid)
CastleWalls()
local player = getTopCreature(THRONE_POS).uid
if getGlobalStorageValue(STORAGE_EVENT) < 0 then
return true
end
if (isPlayer(player)) then
if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
pid = getPlayerGUID(cid)
setHouseOwner(100, pid)
doPlayerAddPremiumDays(player, 7)
for _, cid in ipairs(getPlayersOnline()) do
setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end
doBroadcastMessage(getCreatureName(player) .. " ganhou o evento, da guild" (getPlayerGuildName(cid), 25)
doTeleportThing(player, {x = 531, y = 459, z = 7})
doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
doCreateItem(391, 1, {x = 561, y = 447, z = 5})
end

 

 

 

 

function getWinnerCastle(cid)
CastleWalls()
local player = getTopCreature(THRONE_POS).uid
if getGlobalStorageValue(STORAGE_EVENT) < 0 then
return true
end
if (isPlayer(player)) then
if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
pid = getPlayerGUID(cid)
setHouseOwner(100, pid)
doPlayerAddPremiumDays(player, 7)
for _, cid in ipairs(getPlayersOnline()) do
setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end
doBroadcastMessage(getCreatureName(player) .. " ganhou o evento, da guild" getPlayerGuildName, 25)
doTeleportThing(player, {x = 531, y = 459, z = 7})
doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
doCreateItem(391, 1, {x = 561, y = 447, z = 5})
end

guildname = getPlayerGuildName(cid)

guild = getPlayerGuildId(cid)

function getWinnerCastle(cid)
CastleWalls()
local player = getTopCreature(THRONE_POS).uid
if getGlobalStorageValue(STORAGE_EVENT) < 0 then
return true
end
if (isPlayer(player)) then
if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
pid = getPlayerGUID(cid)
setHouseOwner(100, pid)
doPlayerAddPremiumDays(player, 7)
for _, cid in ipairs(getPlayersOnline()) do
setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end
doBroadcastMessage(getCreatureName(player) .. " ganhou o evento, da guild" "..guildname..", 25)
doTeleportThing(player, {x = 531, y = 459, z = 7})
doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
doCreateItem(391, 1, {x = 561, y = 447, z = 5})
end

Editado por roga
Link para o comentário
Compartilhar em outros sites

  • 0

Tenta esse, mas, todos deram o mesmo erro?

         function getWinnerCastle(cid)
          CastleWalls()
          local player = getTopCreature(THRONE_POS).uid
          if getGlobalStorageValue(STORAGE_EVENT) < 0 then
                    return true
          end
          if (isPlayer(player)) then
                    if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
                              pid = getPlayerGUID(cid)
                              setHouseOwner(100, pid)
                              doPlayerAddPremiumDays(player, 7)
                              for _, cid in ipairs(getPlayersOnline()) do
                                        setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                              end
 doBroadcastMessage(getCreatureName(player) .. " ganhou o evento. Ele e da guilda" getPlayerGuildName(cid)... , 25)
                              doTeleportThing(player, {x = 531, y = 459, z = 7})
                              doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
                              doCreateItem(391, 1, {x = 561, y = 447, z = 5})
                    end
Link para o comentário
Compartilhar em outros sites

  • 0

Tenta trocar

doBroadcastMessage(getCreatureName(player) .. " ganhou o evento.", 25)

Por

doBroadcastMessage("O vencedor foi "..getCreatureName(player) .." e sua guild eh "..getPlayerGuildName(getPlayerGuildId(player))..".")
Link para o comentário
Compartilhar em outros sites

  • 0

Tbm não foi ;x


Vo colocar o script completo aqui para vcs tentarem

local THRONE_POS = {x = 561, y = 447, z = 5}
local STORAGE_EVENT = 83902
local STORAGE_PLAYER = 73289
local DUR = 1 -- in minutes
       guildname = getPlayerGuildName(cid)    
        guild = getPlayerGuildId(cid)   
function OpenEvent()
          for _, tid in ipairs(getPlayersOnline()) do
                    setPlayerStorageValue(tid, STORAGE_PLAYER, 1)
          end
          setGlobalStorageValue(STORAGE_EVENT, 1)
          doBroadcastMessage("[Castle Event] A guerra pelo castelo de Wisland iniciou, chame sua guild e va batalhar pelo castelo!",22)
end
function getWinnerCastle(cid)
          CastleWalls()
          local player = getTopCreature(THRONE_POS).uid
          if getGlobalStorageValue(STORAGE_EVENT) < 0 then
                    return true
          end
          if (isPlayer(player)) then
                    if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
                              pid = getPlayerGUID(cid)
                              setHouseOwner(100, pid)
                              doPlayerAddPremiumDays(player, 7)
                              for _, cid in ipairs(getPlayersOnline()) do
                                        setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                              end
doBroadcastMessage(getCreatureName(player) .. " ganhou o evento. " ..getGuildName(player), 25)
                              doTeleportThing(player, {x = 531, y = 459, z = 7})
                              doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
                              doCreateItem(391, 1, {x = 561, y = 447, z = 5})
                    end
          else
                    doBroadcastMessage("[Castle Event] Ninguem ganhou o evento, voce tem 1 minuto para sair do castelo, ou sera eliminado pelos guardioes.", 22)
                    for _, pid in ipairs(getPlayersOnline()) do
                              setPlayerStorageValue(pid, STORAGE_PLAYER, 0)
                                    doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
                              doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                    end
          end
          setGlobalStorageValue(STORAGE_EVENT, 0)
          return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER)
end
function CastleWalls()
          local pedra = getTileItemById({ x = 53559, y = 474, z = 7}, 1285)
          local escada = getTileItemById({ x = 53559, y = 474, z = 7}, 3687)
          if pedra.uid > 0 then
                    return doRemoveItem(pedra.uid)
          else
                    return doCreateItem(1285, 1, { x = 53559, y = 474, z = 7})
          end
          if escada.uid > 0 then
                    return doRemoveItem(escada.uid)
          else
                    return doCreateItem(3687, 1, {x = 55539, y = 474, z = 7})
          end
end
function onSay(cid, words, param, channel)
          if ((param == "abrir") and (getGlobalStorageValue(STORAGE_EVENT) == 1)) then
                    doPlayerSendTextMessage(cid, 27, "O evento já esta aberto.") return true
          elseif ((param == "fechar") and (getGlobalStorageValue(STORAGE_EVENT) == 1)) then
                    getWinnerCastle()
                    CastleWalls()
                    return true
          end
          doCreateItem(3687, 1, {x = 55539, y = 474, z = 7})
          OpenEvent()
          CastleWalls()
          addEvent(getWinnerCastle, DUR * 60 * 1000)
          return true
end
Link para o comentário
Compartilhar em outros sites

  • 0
local THRONE_POS = {x = 561, y = 447, z = 5}
local STORAGE_EVENT = 83902
local STORAGE_PLAYER = 73289
local DUR = 1 -- in minutes
       guildname = getPlayerGuildName(cid)    
        guild = getPlayerGuildId(cid)   
function OpenEvent()
          for _, tid in ipairs(getPlayersOnline()) do
                    setPlayerStorageValue(tid, STORAGE_PLAYER, 1)
          end
          setGlobalStorageValue(STORAGE_EVENT, 1)
          doBroadcastMessage("[Castle Event] A guerra pelo castelo de Wisland iniciou, chame sua guild e va batalhar pelo castelo!",22)
end
function getWinnerCastle(cid)
          CastleWalls()
          local player = getTopCreature(THRONE_POS).uid
          if getGlobalStorageValue(STORAGE_EVENT) < 0 then
                    return true
          end
          if (isPlayer(player)) then
                    if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
                              pid = getPlayerGUID(cid)
                              setHouseOwner(100, pid)
                              doPlayerAddPremiumDays(player, 7)
                              for _, cid in ipairs(getPlayersOnline()) do
                                        setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                              end
doBroadcastMessage(getCreatureName(player) .. " ganhou o evento. " ..getPlayerGuildName(player), 25)
                              doTeleportThing(player, {x = 531, y = 459, z = 7})
                              doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
                              doCreateItem(391, 1, {x = 561, y = 447, z = 5})
                    end
          else
                    doBroadcastMessage("[Castle Event] Ninguem ganhou o evento, voce tem 1 minuto para sair do castelo, ou sera eliminado pelos guardioes.", 22)
                    for _, pid in ipairs(getPlayersOnline()) do
                              setPlayerStorageValue(pid, STORAGE_PLAYER, 0)
                                    doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
                              doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                    end
          end
          setGlobalStorageValue(STORAGE_EVENT, 0)
          return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER)
end
function CastleWalls()
          local pedra = getTileItemById({ x = 53559, y = 474, z = 7}, 1285)
          local escada = getTileItemById({ x = 53559, y = 474, z = 7}, 3687)
          if pedra.uid > 0 then
                    return doRemoveItem(pedra.uid)
          else
                    return doCreateItem(1285, 1, { x = 53559, y = 474, z = 7})
          end
          if escada.uid > 0 then
                    return doRemoveItem(escada.uid)
          else
                    return doCreateItem(3687, 1, {x = 55539, y = 474, z = 7})
          end
end
function onSay(cid, words, param, channel)
          if ((param == "abrir") and (getGlobalStorageValue(STORAGE_EVENT) == 1)) then
                    doPlayerSendTextMessage(cid, 27, "O evento já esta aberto.") return true
          elseif ((param == "fechar") and (getGlobalStorageValue(STORAGE_EVENT) == 1)) then
                    getWinnerCastle()
                    CastleWalls()
                    return true
          end
          doCreateItem(3687, 1, {x = 55539, y = 474, z = 7})
          OpenEvent()
          CastleWalls()
          addEvent(getWinnerCastle, DUR * 60 * 1000)
          return true
end

Não sei se vai, mas, tenta xDD

 

Wisland? Radbr Old Times, lembro quando não havia frescuras.

Link para o comentário
Compartilhar em outros sites

  • 0

Meus parabéns Roga, você conseguiu xD

 

Sim. Esse script é um evento do RadBR, eu jogava a uns 5 anos atras tbm kk, fiz servidores de radbr a uns 3 anos era 8.5 ainda os servidores radbr, e alguns dias atras deu vontade de fazer denovo e aqui estou eu :D

 

 

REP+

 

@edit

 

Chegou ao limite de reps hj, amanha eu dou ;D


Cara mais o foda é que a mensagem aparece assim

20:23 Fi da puta ganhou o evento. Cuzinho

Cuzinho é o nome da guild

Fi da puta é o nome do player.

 

 

Não tem como fazer para aparece assim:

O jogador Fi da puta e sua guild Cuzinho ganharam o castelo.

Editado por IgorSilveira
Link para o comentário
Compartilhar em outros sites

  • 0

toma ae.

local THRONE_POS = {x = 561, y = 447, z = 5}
local STORAGE_EVENT = 83902
local STORAGE_PLAYER = 73289
local DUR = 1 -- in minutes
       guildname = getPlayerGuildName(cid)    
        guild = getPlayerGuildId(cid)   
function OpenEvent()
          for _, tid in ipairs(getPlayersOnline()) do
                    setPlayerStorageValue(tid, STORAGE_PLAYER, 1)
          end
          setGlobalStorageValue(STORAGE_EVENT, 1)
          doBroadcastMessage("[Castle Event] A guerra pelo castelo de Wisland iniciou, chame sua guild e va batalhar pelo castelo!",22)
end
function getWinnerCastle(cid)
          CastleWalls()
          local player = getTopCreature(THRONE_POS).uid
          if getGlobalStorageValue(STORAGE_EVENT) < 0 then
                    return true
          end
          if (isPlayer(player)) then
                    if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then
                              pid = getPlayerGUID(cid)
                              setHouseOwner(100, pid)
                              doPlayerAddPremiumDays(player, 7)
                              for _, cid in ipairs(getPlayersOnline()) do
                                        setPlayerStorageValue(cid, STORAGE_PLAYER, 0)
                                        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                              end
doBroadcastMessage(getCreatureName(player) .. " da guild " ..getPlayerGuildName(player).. " ganhou o evento. ", 25)
                              doTeleportThing(player, {x = 531, y = 459, z = 7})
                              doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
                              doCreateItem(391, 1, {x = 561, y = 447, z = 5})
                    end
          else
                    doBroadcastMessage("[Castle Event] Ninguem ganhou o evento, voce tem 1 minuto para sair do castelo, ou sera eliminado pelos guardioes.", 22)
                    for _, pid in ipairs(getPlayersOnline()) do
                              setPlayerStorageValue(pid, STORAGE_PLAYER, 0)
                                    doRemoveItem(getThingFromPos({x = 541, y = 475, z = 6, stackpos = 1}).uid, 1)
                              doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
                    end
          end
          setGlobalStorageValue(STORAGE_EVENT, 0)
          return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER)
end
function CastleWalls()
          local pedra = getTileItemById({ x = 53559, y = 474, z = 7}, 1285)
          local escada = getTileItemById({ x = 53559, y = 474, z = 7}, 3687)
          if pedra.uid > 0 then
                    return doRemoveItem(pedra.uid)
          else
                    return doCreateItem(1285, 1, { x = 53559, y = 474, z = 7})
          end
          if escada.uid > 0 then
                    return doRemoveItem(escada.uid)
          else
                    return doCreateItem(3687, 1, {x = 55539, y = 474, z = 7})
          end
end
function onSay(cid, words, param, channel)
          if ((param == "abrir") and (getGlobalStorageValue(STORAGE_EVENT) == 1)) then
                    doPlayerSendTextMessage(cid, 27, "O evento já esta aberto.") return true
          elseif ((param == "fechar") and (getGlobalStorageValue(STORAGE_EVENT) == 1)) then
                    getWinnerCastle()
                    CastleWalls()
                    return true
          end
          doCreateItem(3687, 1, {x = 55539, y = 474, z = 7})
          OpenEvent()
          CastleWalls()
          addEvent(getWinnerCastle, DUR * 60 * 1000)
          return true
end
Editado por Maenilse
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...