Ir para conteúdo

Featured Replies

Postado

Salve galera, no meu serv possui alguns comando de castle sendo eles esses !pushmembers;!gocastle;!castlepush.

So que ao usar esses comandos mostra uma mensagem " [CoH] Você deve estar dentro do castle".

E quando eu to no castle e uso o comando e mostra essa mesma mensagem.

Alguem poderia me ajudar nisso Por Favor Valendo 3 REP+.

Meu Script:

Citar

 


function onSay(cid, words, param)

 if getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER then
  if getPlayerStorageValue(cid, COH_PUSHSTOR) < os.time() then
   if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then
    if isInArea(getThingPos(cid), COH_AREA[1], COH_AREA[2]) then
     if #getMembersOnline(getPlayerGuildId(cid)) > 0 then
      for index, creature in ipairs(getMembersOnline(getPlayerGuildId(cid))) do
       if (getTileInfo(getThingPos(creature)).protection ~= true) then
        return doPlayerSendCancel(cid, "[CoH] Os membros devem estar em área PZ.")
       end
       doTeleportThing(creature, getThingPos(cid))
      end
      setPlayerStorageValue(cid, COH_PUSHSTOR, os.time() + COH_PUSHTIME) 
      doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "[Castle of Honor] Você teleportou seus membros, comando pode ser usado a cada "..tostring(COH_PUSHTIME / 60).." minuto(s).")
     else
      doPlayerSendCancel(cid, "[CoH] Para executar isso, sua guild deve ter 2 ou mais membros online.") 
     end
    else
     doPlayerSendCancel(cid, "[CoH] Você deve estar no castelo.")
    end
   else
    doPlayerSendCancel(cid, "[CoH] Sua guild não é dona do castelo.")
   end
  else
   doPlayerSendCancel(cid, "[CoH] Você deve aguardar "..tostring(math.ceil((getPlayerStorageValue(cid, COH_PUSHSTOR) - os.time()) / 60)).." minuto(s) para usar este comando.")
  end
 else
  doPlayerSendCancel(cid, "[CoH] Você deve ser líder de uma guild para executar este comando.")
 end
 return true
end

function getMembersOnline(id)
 local mbr = {}

 for index, creature in ipairs(getPlayersOnline()) do
  if getPlayerGuildId(creature) == id then
   if getCreatureSkullType(creature) < 3 then
    table.insert(mbr, creature)
   end
  end                      
 end
 return mbr or #mbr
end

 

 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.3k

Informação Importante

Confirmação de Termo