Ir para conteúdo

joaohd

Visconde
  • Total de itens

    361
  • Registro em

  • Última visita

  • Dias Ganhos

    10

Tudo que joaohd postou

  1. Este script serve para o monitoramento dos jogadores online no servidor, mostrando suas informações e criando um log com elas. Primeiramente, abra a pasta data/logs do seu servidor e crie uma nova pasta chamada 'Players'. Agora, vá em data/creaturescripts/scripts e crie o arquivo chamado log.lua, contendo isto: function onLogin(cid) local logs = { "Character informations at " .. os.date("%d/%m/%y - %H:%M:%S - ") .. ":\n", "Nome : " .. getCreatureName(cid) .. "\n", "Ip : " .. doConvertIntegerToIp(getPlayerIp(cid)) .. "\n", "Level : " .. getPlayerLevel(cid) .. "\n", "Experience : " .. getPlayerExperience(cid) .. "\n", "Health now : " .. getCreatureHealth(cid) .. "\n", "Mana now : " .. getCreatureMana(cid) .. "\n", "Citizen from : " .. getTownName(getPlayerTown(cid)) .. "\n\n\n" } setPlayerStorageValue(cid, 35789, os.time()) registerCreatureEvent(cid, "LogLogin") registerCreatureEvent(cid, "LogLogout") arq = io.open(getDataDir() .."/logs/Players/".. getCreatureName(cid) ..".txt", "a+") arq:write(unpack(logs)) arq:close() return TRUE end function onLogout(cid) local logs = { "Character informations at " .. os.date("%d/%m/%y - %H:%M:%S - ") .. ":\n", "Nome : " .. getCreatureName(cid) .. "\n", "Ip : " .. doConvertIntegerToIp(getPlayerIp(cid)) .. "\n", "Level : " .. getPlayerLevel(cid) .. "\n", "Experience : " .. getPlayerExperience(cid) .. "\n", "Health now : " .. getCreatureHealth(cid) .. "\n", "Mana now : " .. getCreatureMana(cid) .. "\n", "Citizen from : " .. getTownName(getPlayerTown(cid)) .. "\n", "Online time : " .. math.floor(os.time()-getPlayerStorageValue(cid, 35789)) .. " seconds\n\n\n", } setPlayerStorageValue(cid, 35789, 0) arq = io.open(getDataDir() .."/logs/Players/".. getCreatureName(cid) ..".txt", "a+") arq:write(unpack(logs)) arq:close() return TRUE end Salve e feche. Abra o arquivo creaturescripts.xml e adicione as seguintes tags: <event type="logout" name="LogLogin" event="script" value="log.lua"/> <event type="logout" name="LogLogout" event="script" value="log.lua"/> Salve e feche. Pronto. Sempre que um jogador entrar/abandonar seu servidor, este será monitorado. Para visualizar os logs, vá até data/logs/Players e escolha o arquivo que deseja visualizar. Os arquivos terão os nomes dos respectivos jogadores. Caso necessite de adicionar mais parâmetros, basta ter conhecimento mínimo de tabelas. Favor não postar em outros fóruns flw
  2. Isto já existe. Vá até seu config.lua e localize: idleWarningTime = 14 * 60 * 1000 idleKickTime = 15 * 60 * 1000 Substitua por idleWarningTime = 4 * 60 * 1000 idleKickTime = 5 * 60 * 1000 flw
  3. joaohd

    Duvida

    Bom, eu estou na escola neste momento, logo, ajudarei somente no primeiro script. O segundo eu faço á tarde. Veja se funciona: function onUse(cid, item, fromPosition) return doRemoveItem(item.uid, 1), doPlayerAddItem(cid,2415,1) end flw
  4. Siga este tutorial: Fazendo casas no RME Ele te ajudará. flw
  5. Elas não poderão ser compradas/vendidas. flw
  6. Isto é porque você não designou a saída/entrada das casas especificadas. Não causará problema algum ao seu servidor. flw
  7. Sem a explicação do problema e um pouco mais de educação, será difícil ajudá-lo. Meu script possui segurança, uma vez que o seu se usado incorretamente acarretará erros ao console. Peço para que verifique se meu script resolveu seu problema. flw
  8. Creio que seja isto: DROP TRIGGER IF EXISTS `oncreate_players`; DROP TRIGGER IF EXISTS `oncreate_guilds`; DROP TRIGGER IF EXISTS `ondelete_players`; DROP TRIGGER IF EXISTS `ondelete_guilds`; DROP TRIGGER IF EXISTS `ondelete_accounts`; DROP TABLE IF EXISTS `player_depotitems`; DROP TABLE IF EXISTS `tile_items`; DROP TABLE IF EXISTS `tiles`; DROP TABLE IF EXISTS `bans`; DROP TABLE IF EXISTS `house_lists`; DROP TABLE IF EXISTS `houses`; DROP TABLE IF EXISTS `player_items`; DROP TABLE IF EXISTS `player_namelocks`; DROP TABLE IF EXISTS `player_skills`; DROP TABLE IF EXISTS `player_storage`; DROP TABLE IF EXISTS `player_viplist`; DROP TABLE IF EXISTS `player_spells`; DROP TABLE IF EXISTS `player_deaths`; DROP TABLE IF EXISTS `killers`; DROP TABLE IF EXISTS `environment_killers`; DROP TABLE IF EXISTS `player_killers`; DROP TABLE IF EXISTS `guild_ranks`; DROP TABLE IF EXISTS `guilds`; DROP TABLE IF EXISTS `guild_invites`; DROP TABLE IF EXISTS `global_storage`; DROP TABLE IF EXISTS `players`; DROP TABLE IF EXISTS `accounts`; DROP TABLE IF EXISTS `server_record`; DROP TABLE IF EXISTS `server_motd`; DROP TABLE IF EXISTS `server_reports`; DROP TABLE IF EXISTS `server_config`; DROP TABLE IF EXISTS `account_viplist`; CREATE TABLE `accounts` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(32) NOT NULL DEFAULT '', `password` VARCHAR(255) NOT NULL/* VARCHAR(32) NOT NULL COMMENT 'MD5'*//* VARCHAR(40) NOT NULL COMMENT 'SHA1'*/, `premdays` INT NOT NULL DEFAULT 0, `lastday` INT UNSIGNED NOT NULL DEFAULT 0, `email` VARCHAR(255) NOT NULL DEFAULT '', `key` VARCHAR(20) NOT NULL DEFAULT '0', `blocked` TINYINT(1) NOT NULL DEFAULT FALSE COMMENT 'internal usage', `warnings` INT NOT NULL DEFAULT 0, `group_id` INT NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE (`name`) ) ENGINE = InnoDB; INSERT INTO `accounts` VALUES (1, '1', '1', 65535, 0, '', '0', 0, 0, 1); CREATE TABLE `players` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `group_id` INT NOT NULL DEFAULT 1, `account_id` INT NOT NULL DEFAULT 0, `level` INT NOT NULL DEFAULT 1, `vocation` INT NOT NULL DEFAULT 0, `health` INT NOT NULL DEFAULT 150, `healthmax` INT NOT NULL DEFAULT 150, `experience` BIGINT NOT NULL DEFAULT 0, `lookbody` INT NOT NULL DEFAULT 0, `lookfeet` INT NOT NULL DEFAULT 0, `lookhead` INT NOT NULL DEFAULT 0, `looklegs` INT NOT NULL DEFAULT 0, `looktype` INT NOT NULL DEFAULT 136, `lookaddons` INT NOT NULL DEFAULT 0, `maglevel` INT NOT NULL DEFAULT 0, `mana` INT NOT NULL DEFAULT 0, `manamax` INT NOT NULL DEFAULT 0, `manaspent` INT NOT NULL DEFAULT 0, `soul` INT UNSIGNED NOT NULL DEFAULT 0, `town_id` INT NOT NULL DEFAULT 0, `posx` INT NOT NULL DEFAULT 0, `posy` INT NOT NULL DEFAULT 0, `posz` INT NOT NULL DEFAULT 0, `conditions` BLOB NOT NULL, `cap` INT NOT NULL DEFAULT 0, `sex` INT NOT NULL DEFAULT 0, `lastlogin` BIGINT UNSIGNED NOT NULL DEFAULT 0, `lastip` INT UNSIGNED NOT NULL DEFAULT 0, `save` TINYINT(1) NOT NULL DEFAULT 1, `skull` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, `skulltime` INT NOT NULL DEFAULT 0, `rank_id` INT NOT NULL DEFAULT 0, `guildnick` VARCHAR(255) NOT NULL DEFAULT '', `lastlogout` BIGINT UNSIGNED NOT NULL DEFAULT 0, `blessings` TINYINT(2) NOT NULL DEFAULT 0, `balance` BIGINT NOT NULL DEFAULT 0, `stamina` BIGINT NOT NULL DEFAULT 151200000 COMMENT 'stored in miliseconds', `direction` INT NOT NULL DEFAULT 2, `loss_experience` INT NOT NULL DEFAULT 100, `loss_mana` INT NOT NULL DEFAULT 100, `loss_skills` INT NOT NULL DEFAULT 100, `loss_containers` INT NOT NULL DEFAULT 100, `loss_items` INT NOT NULL DEFAULT 100, `premend` INT NOT NULL DEFAULT 0 COMMENT 'NOT IN USE BY THE SERVER', `online` TINYINT(1) NOT NULL DEFAULT 0, `marriage` INT UNSIGNED NOT NULL DEFAULT 0, `promotion` INT NOT NULL DEFAULT 0, `deleted` TINYINT(1) NOT NULL DEFAULT FALSE, `description` VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE (`name`, `deleted`), KEY (`account_id`), KEY (`group_id`), KEY (`online`), KEY (`deleted`), FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; INSERT INTO `players` VALUES (1, 'Account Manager', 0, 1, 1, 1, 0, 150, 150, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, '', 400, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, ''); CREATE TABLE `account_viplist` ( `account_id` INT NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `player_id` INT NOT NULL, KEY (`account_id`), KEY (`player_id`), KEY (`world_id`), UNIQUE (`account_id`, `player_id`), FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE, FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_deaths` ( `id` INT NOT NULL AUTO_INCREMENT, `player_id` INT NOT NULL, `date` BIGINT UNSIGNED NOT NULL, `level` INT UNSIGNED NOT NULL, PRIMARY KEY (`id`), INDEX (`date`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_depotitems` ( `player_id` INT NOT NULL, `sid` INT NOT NULL COMMENT 'any given range, eg. 0-100 is reserved for depot lockers and all above 100 will be normal items inside depots', `pid` INT NOT NULL DEFAULT 0, `itemtype` INT NOT NULL, `count` INT NOT NULL DEFAULT 0, `attributes` BLOB NOT NULL, KEY (`player_id`), UNIQUE (`player_id`, `sid`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_items` ( `player_id` INT NOT NULL DEFAULT 0, `pid` INT NOT NULL DEFAULT 0, `sid` INT NOT NULL DEFAULT 0, `itemtype` INT NOT NULL DEFAULT 0, `count` INT NOT NULL DEFAULT 0, `attributes` BLOB NOT NULL, KEY (`player_id`), UNIQUE (`player_id`, `sid`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_namelocks` ( `player_id` INT NOT NULL DEFAULT 0, `name` VARCHAR(255) NOT NULL, `new_name` VARCHAR(255) NOT NULL, `date` BIGINT NOT NULL DEFAULT 0, KEY (`player_id`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_skills` ( `player_id` INT NOT NULL DEFAULT 0, `skillid` TINYINT(2) NOT NULL DEFAULT 0, `value` INT UNSIGNED NOT NULL DEFAULT 0, `count` INT UNSIGNED NOT NULL DEFAULT 0, KEY (`player_id`), UNIQUE (`player_id`, `skillid`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_spells` ( `player_id` INT NOT NULL, `name` VARCHAR(255) NOT NULL, KEY (`player_id`), UNIQUE (`player_id`, `name`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_storage` ( `player_id` INT NOT NULL DEFAULT 0, `key` INT UNSIGNED NOT NULL DEFAULT 0, `value` VARCHAR(255) NOT NULL DEFAULT '0', KEY (`player_id`), UNIQUE (`player_id`, `key`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_viplist` ( `player_id` INT NOT NULL, `vip_id` INT NOT NULL, KEY (`player_id`), KEY (`vip_id`), UNIQUE (`player_id`, `vip_id`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE, FOREIGN KEY (`vip_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `killers` ( `id` INT NOT NULL AUTO_INCREMENT, `death_id` INT NOT NULL, `final_hit` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE, `unjustified` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE, PRIMARY KEY (`id`), FOREIGN KEY (`death_id`) REFERENCES `player_deaths`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `player_killers` ( `kill_id` INT NOT NULL, `player_id` INT NOT NULL, FOREIGN KEY (`kill_id`) REFERENCES `killers`(`id`) ON DELETE CASCADE, FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `environment_killers` ( `kill_id` INT NOT NULL, `name` VARCHAR(255) NOT NULL, FOREIGN KEY (`kill_id`) REFERENCES `killers`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `houses` ( `id` INT UNSIGNED NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `owner` INT NOT NULL, `paid` INT UNSIGNED NOT NULL DEFAULT 0, `warnings` INT NOT NULL DEFAULT 0, `lastwarning` INT UNSIGNED NOT NULL DEFAULT 0, `name` VARCHAR(255) NOT NULL, `town` INT UNSIGNED NOT NULL DEFAULT 0, `size` INT UNSIGNED NOT NULL DEFAULT 0, `price` INT UNSIGNED NOT NULL DEFAULT 0, `rent` INT UNSIGNED NOT NULL DEFAULT 0, `doors` INT UNSIGNED NOT NULL DEFAULT 0, `beds` INT UNSIGNED NOT NULL DEFAULT 0, `tiles` INT UNSIGNED NOT NULL DEFAULT 0, `guild` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE, `clear` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE, UNIQUE (`id`, `world_id`) ) ENGINE = InnoDB; CREATE TABLE `house_auctions` ( `house_id` INT UNSIGNED NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `player_id` INT NOT NULL, `bid` INT UNSIGNED NOT NULL DEFAULT 0, `limit` INT UNSIGNED NOT NULL DEFAULT 0, `endtime` BIGINT UNSIGNED NOT NULL DEFAULT 0, UNIQUE (`house_id`, `world_id`), FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE, FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `house_lists` ( `house_id` INT UNSIGNED NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `listid` INT NOT NULL, `list` TEXT NOT NULL, UNIQUE (`house_id`, `world_id`, `listid`), FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `house_data` ( `house_id` INT UNSIGNED NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `data` LONGBLOB NOT NULL, UNIQUE (`house_id`, `world_id`), FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `tiles` ( `id` INT UNSIGNED NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `house_id` INT UNSIGNED NOT NULL, `x` INT(5) UNSIGNED NOT NULL, `y` INT(5) UNSIGNED NOT NULL, `z` TINYINT(2) UNSIGNED NOT NULL, UNIQUE (`id`, `world_id`), KEY (`x`, `y`, `z`), FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `tile_items` ( `tile_id` INT UNSIGNED NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `sid` INT NOT NULL, `pid` INT NOT NULL DEFAULT 0, `itemtype` INT NOT NULL, `count` INT NOT NULL DEFAULT 0, `attributes` BLOB NOT NULL, UNIQUE (`tile_id`, `world_id`, `sid`), KEY (`sid`), FOREIGN KEY (`tile_id`) REFERENCES `tiles`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `guilds` ( `id` INT NOT NULL AUTO_INCREMENT, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `name` VARCHAR(255) NOT NULL, `ownerid` INT NOT NULL, `creationdata` INT NOT NULL, `motd` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE (`name`, `world_id`) ) ENGINE = InnoDB; CREATE TABLE `guild_invites` ( `player_id` INT NOT NULL DEFAULT 0, `guild_id` INT NOT NULL DEFAULT 0, UNIQUE (`player_id`, `guild_id`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE, FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `guild_ranks` ( `id` INT NOT NULL AUTO_INCREMENT, `guild_id` INT NOT NULL, `name` VARCHAR(255) NOT NULL, `level` INT NOT NULL COMMENT '1 - leader, 2 - vice leader, 3 - member', PRIMARY KEY (`id`), FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; CREATE TABLE `bans` ( `id` INT UNSIGNED NOT NULL auto_increment, `type` TINYINT(1) NOT NULL COMMENT '1 - ip banishment, 2 - namelock, 3 - account banishment, 4 - notation, 5 - deletion', `value` INT UNSIGNED NOT NULL COMMENT 'ip address (integer), player guid or account number', `param` INT UNSIGNED NOT NULL DEFAULT 4294967295 COMMENT 'used only for ip banishment mask (integer)', `active` TINYINT(1) NOT NULL DEFAULT TRUE, `expires` INT NOT NULL, `added` INT UNSIGNED NOT NULL, `admin_id` INT UNSIGNED NOT NULL DEFAULT 0, `comment` TEXT NOT NULL, `reason` INT UNSIGNED NOT NULL DEFAULT 0, `action` INT UNSIGNED NOT NULL DEFAULT 0, `statement` VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `type` (`type`, `value`), KEY `active` (`active`) ) ENGINE = InnoDB; CREATE TABLE `global_storage` ( `key` INT UNSIGNED NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `value` VARCHAR(255) NOT NULL DEFAULT '0', UNIQUE (`key`, `world_id`) ) ENGINE = InnoDB; CREATE TABLE `server_config` ( `config` VARCHAR(35) NOT NULL DEFAULT '', `value` INT NOT NULL, UNIQUE (`config`) ) ENGINE = InnoDB; INSERT INTO `server_config` VALUES ('db_version', 23); CREATE TABLE `server_motd` ( `id` INT UNSIGNED NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `text` TEXT NOT NULL, UNIQUE (`id`, `world_id`) ) ENGINE = InnoDB; INSERT INTO `server_motd` VALUES (1, 0, 'Welcome to The Forgotten Server!'); CREATE TABLE `server_record` ( `record` INT NOT NULL, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `timestamp` BIGINT NOT NULL, UNIQUE (`record`, `world_id`, `timestamp`) ) ENGINE = InnoDB; INSERT INTO `server_record` VALUES (0, 0, 0); CREATE TABLE `server_reports` ( `id` INT NOT NULL AUTO_INCREMENT, `world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `player_id` INT NOT NULL DEFAULT 1, `posx` INT NOT NULL DEFAULT 0, `posy` INT NOT NULL DEFAULT 0, `posz` INT NOT NULL DEFAULT 0, `timestamp` BIGINT NOT NULL DEFAULT 0, `report` TEXT NOT NULL, `reads` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY (`world_id`), KEY (`reads`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB; DELIMITER | CREATE TRIGGER `ondelete_accounts` BEFORE DELETE ON `accounts` FOR EACH ROW BEGIN DELETE FROM `bans` WHERE `type` IN (3, 4) AND `value` = OLD.`id`; END| CREATE TRIGGER `oncreate_guilds` AFTER INSERT ON `guilds` FOR EACH ROW BEGIN INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Leader', 3, NEW.`id`); INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Vice-Leader', 2, NEW.`id`); INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Member', 1, NEW.`id`); END| CREATE TRIGGER `ondelete_guilds` BEFORE DELETE ON `guilds` FOR EACH ROW BEGIN UPDATE `players` SET `guildnick` = '', `rank_id` = 0 WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = OLD.`id`); END| CREATE TRIGGER `oncreate_players` AFTER INSERT ON `players` FOR EACH ROW BEGIN INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 0, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 1, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 2, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 3, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 4, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 5, 10); INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 6, 10); END| CREATE TRIGGER `ondelete_players` BEFORE DELETE ON `players` FOR EACH ROW BEGIN DELETE FROM `bans` WHERE `type` IN (2, 5) AND `value` = OLD.`id`; UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`; END| DELIMITER ; flw
  9. Não entendi muito bem seu problema. Tente usar este script: local rcPos = { {x=52, y=386, z=7, stackpos=1}, {x=57, y=387, z=7, stackpos=1} } function onUse(cid, item, frompos, item2, topos) for i = 1, #rcPos do if getThingfromPos(rcPos[i]) ~= LUA_ERROR then if getThingfromPos(rcPos[1]).itemid == 1285 then if getThingfromPos(rcPos[2]).itemid == 1304 then doRemoveItem(getThingfromPos(rcPos[i]).uid, -1) doSummonCreature("Morgaroth", frompos) addEvent(onTime, 10*60*1000, {cid=cid}) else doPlayerSendCancel(cid, "Error") end else doPlayerSendCancel(cid, "Error") end end end return TRUE end function onTime() for i = 1, #rcPos do if getThingfromPos(rcPos[i]) ~= LUA_ERROR then if getThingfromPos(rcPos[i]).itemid == 0 then doCreateItem(1285, 1, rcPos[1]) doSetItemActionId(doCreateItem(1304, 1, rcPos[2]), 9917) end end end return TRUE end flw
  10. Ótimas imagens, sinceramente. Ainda não tinha visto algo sequer do mapa, mas pelo visto está bem elaborado. Vamo que vamo! flw
  11. joaohd

    Function

    Tente isto: function onSay(cid, words, param, channel) flyoutfit = {lookType = 34, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0} if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, "Sorry, you are in battle.") return TRUE end if getTilePzInfo(getCreaturePosition(cid)) then doPlayerSendCancel(cid, "Você nao pode voar aqui.") return TRUE end if getPlayerStorageValue(cid,1234) >= 1 then doPlayerSendCancel(cid, "Você já está voando.") return TRUE end if getCreatureMana(cid) >= 200 then doSendMagicEffect(getCreaturePosition(cid), 10) doSetCreatureOutfit(cid, flyoutfit, -1) doCreatureAddMana(cid,-200) setPlayerStorageValue(cid,1234,1) doChangeSpeed(cid, getCreatureBaseSpeed(cid)+1500) else doPlayerSendCancel(cid, "Você não tem mana suficiente.") end return TRUE end function onSay(cid, words, param, channel) if getTileItemById(getCreaturePosition(cid, 11154)) then doPlayerSendCancel(cid, "Você nao pode descer aqui.") return TRUE end if getPlayerStorageValue(cid,1234) >= 1 then doSendMagicEffect(getCreaturePosition(cid), 10) doRemoveCondition(cid, CONDITION_OUTFIT) doChangeSpeed(cid, getCreatureSpeed(cid)-1500) setPlayerStorageValue(cid,1234,0) else doPlayerSendCancel(cid, "você não pode fazer isso.") end return TRUE end flw
  12. Tente fazer como eu expliquei. Caso não dê certo, partiremos para outra abordagem do problema. flw
  13. Se seu servidor for crystal server, tente usando o comando '/town NOME DA CIDADE'. flw
  14. Tira a attribute key charges do seu aol. Fica assim: <item id="2173" article="an" name="amulet of loss"> <attribute key="weight" value="420" /> <attribute key="slotType" value="necklace" /> <attribute key="preventDrop" value="1" /> </item> flw
  15. joaohd

    Function

    Tente usar a função getCreatureBaseSpeed(cid), ficando assim: doChangeSpeed(cid, getCreatureBaseSpeed(cid)) flw
  16. joaohd

    If, Itemid E Ifnot (~=)

    Em LUA, o sinal de diferença é '~='. flw
  17. Primeiro, troque a Bunny Slippers do seu items.xml por esta: <item id="2644" article="a" name="bunny slippers"> <attribute key="weight" value="1200" /> <attribute key="slotType" value="feet" /> <attribute key="healthGain" value="1" /> <attribute key="healthTicks" value="2000" /> <attribute key="manaGain" value="2" /> <attribute key="manaTicks" value="1000" /> </item> Depois, adicione as seguintes tags ao seu movements.xml: <movevent type="Equip" itemid="2644" slot="feet" event="function" value="onEquipItem"/> <movevent type="DeEquip" itemid="2644" slot="feet" event="function" value="onDeEquipItem"/> Tente agora. flw
  18. Em movements/scripts: function onStepIn(cid, item, pos) local newPos = {x=160, y=54, z=7} if isPlayer(cid) then doTeleportThing(cid, newPos) end return TRUE end em movements.xml: <movement type="StepIn" uniqueid="60001" event="script" value="NOME DO SCRIPT.lua"/> Não esqueça de editar o newPos, colocando o destino do jogador. flw
  19. joaohd

    Alavanca Para 4 Pessoas

    Tente usar este ( não sei se funciona, fiz às pressas na escola ): function onUse(cid, item, frompos, item2, topos) local pPos = { {x=960, y=1130, z=13, stackpos=253}, {x=962, y=1130, z=13, stackpos=253}, {x=964, y=1130, z=13, stackpos=253}, {x=966, y=1130, z=13, stackpos=253} } local nPos = { {x=949, y=1122, z=13}, {x=958, y=1122, z=13}, {x=967, y=1122, z=13}, {x=975, y=1122, z=13} } if item.itemid == 1945 then for i = 1, #pPos do if getThingfromPos(pPos[i]) ~= LUA_ERROR then if getThingfromPos(pPos[i]).itemid ~= 0 then if getPlayerStorageValue(getThingfromPos(pPos[i]).uid, 70006) <= 0 then for x = 1,#nPos do doTeleportThing(getThingfromPos(pPos[i]).uid, nPos[x]) doSendMagicEffect(pPos[i], 2) doSendMagicEffect(nPos[x], 10) doTransformItem(item.uid,item.itemid+1) end else doPlayerSendCancel(cid,"Someone in your team has already done this quest.") end else doPlayerSendCancel(cid,"This quest need be done with 4 players.") end end end elseif item.itemid == 1946 then doTransformItem(item.uid,item.itemid-1) end return TRUE end flw
  20. joaohd

    Tabelas

    Dois tutoriais aprovados em 1 semana =D. Valeu ae LorDz. Você também pode pedir seu tutorial: Clique aqui flw
  21. Aqui estão os links das imagens: Imagem 1: http://img85.imageshack.us/img85/3786/1passo.png Imagem 2: http://img690.imageshack.us/img690/2653/2passow.png Outra dica: Mude as cores dos títulos. O verde ficou muito apagado. flw
  22. Tente colocar o link das imagens entre as tags [img= e ] Local incorreto. Reportado. flw
  23. Verifique em items.xml se seu aol está como no modelo: <item id="2173" article="an" name="amulet of loss"> <attribute key="weight" value="420" /> <attribute key="slotType" value="necklace" /> <attribute key="preventDrop" value="1" /> </item> E... seção errada. Reportado. flw
  24. Quando sua duvida for resolvida, reporte o tópico para que o mesmo seja fechado. flw
  25. joaohd

    [Pedido] Sign

    Nada não pow. Ficou bem legal. Obrigado e ... Rep ++ flw
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...