Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
2 minutos atrás, pablobion disse:


Na verdade não :hum: coloquei o script original agora pra ver, se eu fui tão burro a ponto disso kkkkkk
mas no original ele mandava broadcast pra todos do servidor, e com as alterações suas, do enzo e do talesigorvr ele manda mensagem apenas pra quem é dono do castelo...
não sei dizer quem conseguiu fazer isso hahahahah mas conseguimos chegar onde eu queria... vou dar +rep pros 3 ja que os 3 ajudaram ;D 

agora só preciso saber como enviar o broadcast para todos da guild que é dona do castelo, em vez de mandar só para o lider da guild dona do castelo :hum:

 

Vou pegar a função aqui, perai!

Agora que vi, o script não é feito em metatable.. então não sei a função exata :\

 

Mas, se quiser dar uma olhada ai, aqui está o link dos metatables do tfs.

  • Respostas 23
  • Visualizações 1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

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

  • Bodak Reborn
    Bodak Reborn

    Peguei uma função que o Vodkart criou e modifiquei. Não testei, espero que funcione.   local function getGuildLeaderId(name) local leader = db.getResult("SELECT `ownerid` FROM `guilds` W

  • 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

Postado

ah ta, agora você explicou, você quer que manda a mensagem para todos daquela guild? no caso a que está sendo dominada né?

 

me manda seu script com as modificações que você fez!

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor
2 minutos atrás, Vodkart disse:

ah ta, agora você explicou, você quer que manda a mensagem para todos daquela guild? no caso a que está sendo dominada né?

 

me manda seu script com as modificações que você fez!


asuhdusahdasu simm!! no momento está mandando apenas para o lider da guild que está sendo dominada.
 

Spoiler

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))
   

   
   -- primeiro tile --
   if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) then
    local leader = getGuildLeaderName(getGlobalStorageValue(COH_STATUS))
    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_STATUS))
    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

 

Scriptszinhos:

 

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
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))
   
   
   -- primeiro tile --
   if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) then
    	for _, cid in pairs(getPlayersOnline()) do
	if getPlayerGuildId(cid) > 0 and getPlayerGuildName(cid) == getGlobalStorageValue(COH_STATUS) then
    	doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "[Castle of Honor] Atencao! A guild "..getPlayerGuildName(cid).." esta tentando dominar o castelo, preparem-se!")
 	end
	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
	for _, cid in pairs(getPlayersOnline()) do
	if getPlayerGuildId(cid) > 0 and getPlayerGuildName(cid) == getGlobalStorageValue(COH_STATUS) then
    	doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "[Castle of Honor] Atençao! A guild "..getPlayerGuildName(cid).." esta muito proxima do domíinio, ataquem!")
	end
	end
   setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid))
  end
 end
 return true
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor

@Vodkart  Funcionou direitinho :grin: muito obrigado cara!! +rep

Scriptszinhos:

 

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.

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.6k

Informação Importante

Confirmação de Termo