Ir para conteúdo

L3K0T

Membro
  • Registro em

  • Última visita

Tudo que L3K0T postou

  1. local tab = { [4] = 10, -- [vocationID] = número da cor do texto animado [5] = 30, [6] = 50, [7] = 70 } function ariseText(cid) local texts = {"' . ,", ". ' ,", "' . ,", ", ' ."} doSendAnimatedText(getCreaturePosition(cid), texts[math.random(1, #texts)], tab[getPlayerVocation(cid)]) if isPlayer(cid) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW) addEvent(ariseText, 1000, cid) end return true end function getPlayerByGUID(guid) for _, pid in ipairs(getPlayers()) do if getPlayerGUID(pid) == guid then return pid end end return nil end function onLogin(cid) local player = getPlayerByGUID(cid) if player then if tab[player:getVocation():getId()] then ariseText(cid) end end return true end
  2. local templePosition = {x = 100, y = 200, z = 7} -- Coordenadas do templo para onde o jogador será teleportado function onLogin(cid) local player = getPlayerByGUID(cid) if player then if not player:isPremium() and getPlayerStorageValue(cid, 18956) ~= 1 then setPlayerStorageValue(cid, 18956, 1) -- Define o valor de armazenamento para indicar que a conta premium expirou doTeleportThing(cid, templePosition) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua conta premium expirou. Você foi teleportado para o templo.") end end return true end
  3. Troca o efeito local tab = { [4] = 10, -- [vocationID] = número da cor do texto animado [5] = 30, [6] = 50, [7] = 70 } function ariseText(cid) local texts = {"' . ,", ". ' ,", "' . ,", ", ' ."} doSendAnimatedText(getThingPos(cid), texts[math.random(1, #texts)], tab[getPlayerVocation(cid)]) if isPlayer(cid) then doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW) addEvent(ariseText, 1000, cid) end return true end function getPlayerByGUID(guid) for _, pid in ipairs(getPlayersOnline()) do if getPlayerGUID(pid) == guid then return pid end end return nil end function onLogin(cid) local player = getPlayerByGUID(cid) if player then if tab[player:getVocation():getId()] then ariseText(cid) end end return true end
  4. local tab = { [4] = 10, -- [vocationID] = número da cor do texto animado [5] = 30, [6] = 50, [7] = 70 } function ariseText(cid) local texts = {"' . ,", ". ' ,", "' . ,", ", ' ."} doSendAnimatedText(getThingPos(cid), texts[math.random(1, #texts)], tab[getPlayerVocation(cid)]) if isPlayer(cid) then addEvent(ariseText, 1000, cid) end return true end function onLogin(cid) local player = getPlayerByGUID(cid) if player then if tab[player:getVocation():getId()] then ariseText(cid) end end return true end
  5. <?php $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); echo '<div class="message"><div class="title">Pontuação das Principais Guildas</div> <div class="content">'; echo '<table border="0" cellspacing="3" cellpadding="4" width="100%"> <tr>'; $i = 0; $query = ' SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, SUM(`p`.`graduacao_points`) AS `points`, COUNT(`p`.`name`) AS `player_count` FROM `players` p LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `g`.`id` = `g`.`id` GROUP BY `g`.`id`, `g`.`name` ORDER BY `points` DESC LIMIT 3'; foreach ($SQL->query($query) as $guild) { echo '<td style="padding-right:20px;padding-top:3px" align="center"> Pontuação Principal: <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">' . $guild['points'] . '</p> <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">Jogadores: ' . $guild['player_count'] . '</p>'; // Obter a quantidade total de pontos de graduação dos jogadores $subQuery = ' SELECT SUM(`graduacao_points`) AS `total_points` FROM `players` WHERE `rank_id` IN ( SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild['id'] . ' )'; $graduacaoPoints = $SQL->query($subQuery)->fetch(PDO::FETCH_ASSOC)['total_points']; echo '<p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">Pontos de Graduação: ' . $graduacaoPoints . '</p>'; echo '<a href="' . WEBSITE . '/index.php/guilds/view/' . $guild['id'] . '"><img src="' . WEBSITE . '/public/images/gp/' . ($i + 1) . '.png" width="60" height="60" border="0"/><br /> <b>' . $guild['name'] . '</b></a><br /> </td>'; $i++; } echo '</tr> </table>'; if (empty($i)) { echo "<center><font color='red'>Ainda não há guildas.</font></center>"; } echo "</div>"; echo "</div><br/>"; ?>
  6. local tab = { [4] = 10, -- [vocationID] = número da cor do texto animado [5] = 30, [6] = 50, [7] = 70 } function ariseText(cid) local texts = {"' . ,", ". ' ,", "' . ,", ", ' ."} doSendAnimatedText(getThingPos(cid), texts[math.random(1, #texts)], tab[getPlayerVocation(cid)]) if isPlayer(cid) then addEvent(ariseText, 1000, cid) end return true end function onLogin(cid) local player = Player(cid) -- Use a função Player() para obter o objeto do jogador if player then if tab[player:getVocation():getId()] then -- Use player:getVocation():getId() para obter o ID da vocação ariseText(cid) end end return true end
  7. Esse erro é por causa a função MC, o codigo acima deverá resolver.
  8. O account manager está no login.lua manda ai o login.lua apenas o script
  9. <?php $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); echo '<div class="message"><div class="title">Top Guild Points</div> <div class="content">'; echo '<table border="0" cellspacing="3" cellpadding="4" width="100%"> <tr>'; $i = 0; foreach ($SQL->query(' SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, SUM(`p`.`graduacao_points`) AS `points`, COUNT(`p`.`name`) AS `player_count`, `p`.`graduacao_points` AS `graduacao_points` FROM `players` p LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `g`.`id` = `g`.`id` GROUP BY `g`.`id`, `g`.`name` ORDER BY `points` DESC LIMIT 3 ') as $guild) { echo '<td style="padding-right:20px;padding-top:3px" align="center"> Top Rating: <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">' . $guild['points'] . '</p> <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">Players: ' . $guild['player_count'] . '</p> <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">Graduação Points: ' . $guild['graduacao_points'] . '</p> <a href="' . WEBSITE . '/index.php/guilds/view/' . $guild['id'] . '"><img src="' . WEBSITE . '/public/images/gp/' . ($i + 1) . '.png" width="60" height="60" border="0"/><br /> <b>' . $guild['name'] . '</b></a><br /> </td>'; $i++; } echo '</tr> </table>'; if (empty($i)) { echo "<center><font color='red'>There are no guilds yet.</font></center>"; } echo "</div>"; echo "</div><br/>"; ?> Ou esse <?php $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); echo '<div class="message"><div class="title">Top Guild Points</div> <div class="content">'; echo '<table border="0" cellspacing="3" cellpadding="4" width="100%"> <tr>'; $i = 0; foreach ($SQL->query(' SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, SUM(`p`.`graduacao_points`) AS `points`, COUNT(`p`.`name`) AS `player_count` FROM `players` p LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `g`.`id` = `g`.`id` GROUP BY `g`.`id`, `g`.`name` ORDER BY `points` DESC LIMIT 3 ') as $guild) { echo '<td style="padding-right:20px;padding-top:3px" align="center"> Top Rating: <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">' . $guild['points'] . '</p> <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">Players: ' . $guild['player_count'] . '</p>'; // Obter a quantidade de pontos de graduação dos jogadores $graduacaoPoints = $SQL->query(' SELECT SUM(`graduacao_points`) AS `total_points` FROM `players` WHERE `rank_id` IN ( SELECT `id` FROM `guild_ranks` WHERE `guild_id` = ' . $guild['id'] . ' ) ')->fetch(PDO::FETCH_ASSOC)['total_points']; echo '<p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">Graduação Points: ' . $graduacaoPoints . '</p>'; echo '<a href="' . WEBSITE . '/index.php/guilds/view/' . $guild['id'] . '"><img src="' . WEBSITE . '/public/images/gp/' . ($i + 1) . '.png" width="60" height="60" border="0"/><br /> <b>' . $guild['name'] . '</b></a><br /> </td>'; $i++; } echo '</tr> </table>'; if (empty($i)) { echo "<center><font color='red'>There are no guilds yet.</font></center>"; } echo "</div>"; echo "</div><br/>"; ?>
  10. $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); echo '<div class="message"><div class="title">Top Guild Points</div> <div class="content">'; echo '<table border="0" cellspacing="3" cellpadding="4" width="100%"> <tr>'; $i = 0; foreach ($SQL->query(' SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, SUM(`p`.`graduacao_points`) AS `points`, COUNT(`p`.`name`) AS `player_count` FROM `players` p LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `g`.`id` = `g`.`id` GROUP BY `name` ORDER BY `points` DESC LIMIT 3 ') as $guild) { echo ' <td style="padding-right:20px;padding-top:3px" align="center"> Top Rating : <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">' . $guild['points'] . '</p> <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">Players: ' . $guild['player_count'] . '</p> <a href="' . WEBSITE . '/index.php/guilds/view/' . $guild['id'] . '"><img src="' . WEBSITE . '/public/images/gp/' . $i = $i + 1 . '.png" width="60" height="60" border="0"/> <br /><b>' . $guild['name'] . '</b></a><br /> </td>'; } echo '</tr> </table>'; if (empty($i)) { echo "<center><font color='red'>There are no guilds yet.</font></center>"; } echo "</div>"; echo "</div><br/>";
  11. Vc fez o sistema para `graduacao_points dentro do jogo? Para dar pontos de graduação?
  12. <?php $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); echo '<div class="message"><div class="title">Top Guild Points</div> <div class="content">'; echo '<table border="0" cellspacing="3" cellpadding="4" width="100%"> <tr>'; $i = 0; foreach ($SQL->query(' SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, SUM(`p`.`graduacao_points`) AS `points` FROM `players` p LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `g`.`id` = `g`.`id` GROUP BY `name` ORDER BY `points` DESC LIMIT 3 ') as $guild) { echo ' <td style="padding-right:20px;padding-top:3px" align="center"> Top Rating : <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">' . $guild['points'] . '</p> <a href="' . WEBSITE . '/index.php/guilds/view/' . $guild['id'] . '"><img src="' . WEBSITE . '/public/images/gp/' . $i = $i + 1 . '.png" width="60" height="60" border="0"/> <br /><b>' . $guild['name'] . '</b></a><br /> </td>'; } echo '</tr> </table>'; if (empty($i)) { echo "<center><font color='red'>There are no guilds yet.</font></center>"; } echo "</div>"; echo "</div><br/>"; ?>
  13. Testa o outro é porque ja tem a coluna então não precisa adicionar só pega o php acima
  14. <?php $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); echo '<div class="message"><div class="title">Top Guild Points</div> <div class="content">'; echo '<table border="0" cellspacing="3" cellpadding="4" width="100%"> <tr>'; $i = 0; foreach ($SQL->query(' SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, SUM(`p`.`graduacao_points`) AS `points` FROM `players` p LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `g`.`id` = `g`.`id` GROUP BY `name` ORDER BY `points` DESC LIMIT 3 ') as $guild) { echo ' <td style="padding-right:20px;padding-top:3px" align="center"> Top Rating : <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">' . $guild['points'] . '</p> <a href="' . WEBSITE . '/index.php/guilds/view/' . $guild['id'] . '"><img src="' . WEBSITE . '/public/images/gp/' . $i = $i + 1 . '.png" width="60" height="60" border="0"/> <br /><b>' . $guild['name'] . '</b></a><br /> </td>'; } echo '</tr> </table>'; if (empty($i)) { echo "<center><font color='red'>There are no guilds yet.</font></center>"; } echo "</div>"; echo "</div><br/>"; ?> Importe pro MySQL ALTER TABLE players ADD graduacao_points INT; Certifique-se de ter substituído POT::getInstance(), POT::DB_MYSQL e connection() pelos valores corretos para sua configuração de banco de dados.
  15. <?php $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); echo '<div class="message"><div class="title">Top Guild Points</div> <div class="content">'; echo '<table border="0" cellspacing="3" cellpadding="4" width="100%"> <tr>'; $i = 0; foreach($SQL->query(' SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, SUM(`p`.`graduacao_points`) AS `points` FROM `players` p LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `g`.`id` = `g`.`id` GROUP BY `name` ORDER BY `points` DESC LIMIT 3 ') as $guild) { echo ' <td style="padding-right:20px;padding-top:3px" align="center"> Top Rating : <p style="color:#336600;display:inline;padding: 0 0 3px 0;font-weight: bold;">'.$guild['points'].'</p> <a href="'.WEBSITE.'/index.php/guilds/view/' . $guild['id'] . '"><img src="'.WEBSITE.'/public/images/gp/'. $i = $i + 1 .'.png" width="60" height="60" border="0"/> <br /><b>' . $guild['name'] . '</b></a><br /> </td>'; } echo '</tr> </table>'; if(empty($i)) { echo "<center><font color='red'>There are no guilds yet.</font></center>"; } echo "</div>"; echo "</div><br/>"; ?> Importe pro MySQL ALTER TABLE players ADD graduacao_points INT;
  16. Pensei nisso complexo local function getPlayerKills(player) local killsStorage = 1000 -- StorageValue para armazenar as mortes do jogador return player:getStorageValue(killsStorage) end local function setPlayerKills(player, kills) local killsStorage = 1000 -- StorageValue para armazenar as mortes do jogador player:setStorageValue(killsStorage, kills) end function onGainExp(player, exp, fromPlayer) local maxKills = 10 -- Número máximo de kills permitidas antes de zerar a experiência local expStorage = 2000 -- StorageValue para armazenar a experiência do jogador local fragid = 3000 -- StorageValue para armazenar o contador de frags local timeFrag = 4000 -- StorageValue para armazenar o tempo do último frag local requiredFrags = 3 -- Número mínimo de frags necessários para ativar o evento -- Verifica se o jogador possui frags suficientes e se a experiência é maior que zero if player:getStorageValue(fragid) >= requiredFrags and exp > 0 then local currentExp = player:getStorageValue(expStorage) local currentKills = getPlayerKills(player) -- Verifica se o jogador atingiu o limite de kills if currentKills >= maxKills then return 0 -- Retorna 0 para zerar a experiência ganha else -- Atualiza o número de kills e a experiência do jogador setPlayerKills(player, currentKills + 1) player:setStorageValue(expStorage, currentExp + exp) end end return exp -- Retorna a experiência atualizada end function onLogin(player) local resetInterval = 4 * 60 * 60 -- Intervalo de reset em segundos (4 horas) local lastResetStorage = 3000 -- StorageValue para armazenar o último reset local fragid = 3000 -- StorageValue para armazenar o contador de frags local timeFrag = 4000 -- StorageValue para armazenar o tempo do último frag local timeThreshold = 2 * 60 * 60 -- Tempo em segundos para reiniciar o contador de frags local requiredFrags = 3 -- Número mínimo de frags necessários para ativar o evento -- Verifica se já passou o intervalo de reset desde o último login local lastReset = player:getStorageValue(lastResetStorage) local currentTime = os.time() if lastReset ~= nil and currentTime - lastReset >= resetInterval then -- Realiza o reset do número de kills e a experiência do jogador setPlayerKills(player, 0) player:setStorageValue(expStorage, 0) player:setStorageValue(lastResetStorage, currentTime) end -- Verifica se já passaram 2 horas desde o último frag local lastFrag = player:getStorageValue(timeFrag) if lastFrag ~= nil and currentTime - lastFrag >= timeThreshold then player:setStorageValue(fragid, 0) -- Reinicia o contador de frags end -- Verifica se o jogador possui frags suficientes ao fazer o login if player:getStorageValue(fragid) < requiredFrags then player:setStorageValue(fragid, 0) -- Zera o contador de frags end end -- Registra os eventos registerCreatureEvent(cid, "onGainExp") registerCreatureEvent(cid, "onLogin") <event type="gainExperience" name="onGainExp" event="script" value="scripts/gainexp.lua"/> <event type="login" name="onLogin" event="script" value="scripts/login.lua"/>
  17. L3K0T postou uma resposta no tópico em Suporte Tibia OTServer
    Na pasta mod crie um arquivo .xml ou copie um de lá de dentro e adicione isso <command name="autoloot"> <event type="login"> <script> <![CDATA[ function onLogin(cid) local autolootStorage = 12345 -- Storage para guardar o estado do autoloot local autolootEnabled = getCreatureStorage(cid, autolootStorage) == 1 -- Verifica se o autoloot está ativado para o jogador if autolootEnabled then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Autoloot ativado.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Autoloot desativado.") end return true end ]]> </script> </event> <event type="creaturedeath"> <script> <![CDATA[ function onCreatureDeath(cid, corpse, killer) local autolootEnabledStorage = 12345 -- Storage para guardar o estado do autoloot local autolootEnabled = getCreatureStorage(cid, autolootEnabledStorage) == 1 -- Verifica se o autoloot está ativado para o jogador if autolootEnabled and isPlayer(killer) then for _, item in ipairs(getContainerItems(corpse.uid)) do if item.type > 0 and item.type < 100 and registeredItems[item.itemid] then local playerCap = getPlayerFreeCap(killer) local itemWeight = getItemWeightById(item.itemid) if playerCap >= itemWeight then doPlayerAddItem(killer, item.itemid, item.type, item.count, item.actionid, item.attrib, item.description) doRemoveItem(item.uid) doPlayerSendTextMessage(killer, MESSAGE_EVENT_ADVANCE, "Você autolootou um item.") end end end end return true end ]]> </script> </event> <event type="channel" name="autoloot"> </event> </command> Explicando: /autoloot on: Ativa o autoloot, permitindo que o jogador colete automaticamente os itens registrados. /autoloot off: Desativa o autoloot, impedindo que o jogador colete automaticamente os itens registrados. /autoloot register <id do item>: Registra um item específico para ser coletado pelo autoloot. Substitua <id do item> pelo ID numérico do item que deseja registrar.
  18. O erro ocorre devido a uma asserção falha onde BufferSize não é igual a zero. Verifique o código no Network.cpp e verifique onde o BufferSize é definido. Considere aumentar o tamanho do buffer para acomodar um número maior de jogadores. const int BufferSize = 16384; // Definido com o valor atual Para const int BufferSize = 32768; // Novo valor aumentado Espero ter ajudado!
  19. function onUse(cid, item, fromPosition, itemEx, toPosition) local time = 30 -- em segundos local item_id = 1543 -- ID da parede local requiredItemCount = 100 -- Quantidade necessária do item ID 4848 local wallPositions = { {x = 186, y = 54, z = 7}, {x = 187, y = 54, z = 7}, {x = 186, y = 55, z = 7}, {x = 187, y = 55, z = 7}, -- Adicione mais posições de paredes aqui conforme necessário {x = 188, y = 55, z = 7}, {x = 189, y = 55, z = 7}, -- Adicione mais posições de paredes aqui conforme necessário -- Continue adicionando mais 100 posições de paredes } -- Verifica se o jogador possui a quantidade necessária do item if getPlayerItemCount(cid, 4848) < requiredItemCount then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa ter 100 itens do ID 4848 para usar esta alavanca.") return true end local removedCount = 0 for i = 1, #wallPositions do local wallpos = wallPositions[i] local tile = getTileItemById(wallpos, item_id) if tile and tile.uid > 0 then doRemoveItem(tile.uid) doSendMagicEffect(wallpos, CONST_ME_POFF) addEvent(doCreateItem, time * 1000, item_id, 1, wallpos) removedCount = removedCount + 1 end end if removedCount > 0 then -- Remove os 100 itens do ID 4848 do inventário do jogador doPlayerRemoveItem(cid, 4848, requiredItemCount) return true else return false end end Foi removido o erro que você citou e adicionado verificação do item que você pediu
  20. Esse sisteminha é legal, eu pretendo usar pra acabar com spam
  21. Se a parede for outro id cópia e faça com outro id, só seguir esse codigo function onUse(cid, item, fromPosition, itemEx, toPosition) local time = 30 -- em segundos local item_id = 1543 -- ID da parede local wallPositions = { {x = 186, y = 54, z = 7}, {x = 187, y = 54, z = 7}, {x = 186, y = 55, z = 7}, {x = 187, y = 55, z = 7}, -- Adicione mais posições de paredes aqui conforme necessário {x = 188, y = 55, z = 7}, {x = 189, y = 55, z = 7}, -- Adicione mais posições de paredes aqui conforme necessário -- Continue adicionando mais 100 posições de paredes } for i = 1, #wallPositions do local wallpos = wallPositions[i] local tile = getTileItemById(wallpos, item_id) if tile then doRemoveItem(tile.uid) doSendMagicEffect(wallpos, CONST_ME_POFF) addEvent(doCreateItem, time * 1000, item_id, 1, wallpos) end end return true end
  22. local playerPos = getCreaturePosition(cid) -- Obter a posição do jogador local playersOnScreen = getSpectators(playerPos, 7, 5, false, true) -- Obter os jogadores na área de 7x5 tiles em torno do jogador for _, player in ipairs(playersOnScreen) do doPlayerSendChannelMessage(player, TALKTYPE_CHANNEL_O, CHANNEL_TESTE, "Teste", MESSAGE_STATUS_CONSOLE_YELLOW) end Esse é por distância, ele obtém a posição do jogador (getPlayerPosition(cid)) e, em seguida, busca os jogadores na área ao redor usando getPlayersInArea(playerPos, 7, 5). Em seguida, um loop é usado para enviar a mensagem para cada jogador encontrado na área.
  23. Segue que eu disse amigo, first atack é o primeiro dano do player, se ele não foi configurado corretamente, todos os outros danos vão buga quando o player estiver sem arma.

Informação Importante

Confirmação de Termo