Postado Junho 28, 2017 7 anos Versão 8.60 TFS 0.4 1 modificação: Remover desse script a possibilidade de identificar se o player esta pz ou não. Pois no meu server bugado, mesmo sem pz, diz que esta pz. function onUse(cid, item, frompos, item2, topos) local needPos = {x=1011, y=1025, z=7} -- pos que precisa está para usar o item local myPos = getPlayerPosition(cid) if myPos.x == needPos.x and myPos.y == needPos.y and myPos.z == needPos.z then if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then if getHouseByPlayerGUID(getPlayerGUID(cid)) then doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid,22,"Voce foi teleportado até sua house!") else doPlayerSendTextMessage(cid,22,"Você ainda não tem uma house, compre uma falando '!buyhouse' em frente a porta dela.") end else doPlayerSendTextMessage(cid,22,"Você deve esperar seu battle sair para usar a alavanca") end doPlayerSendTextMessage(cid,22,"Você precisa estár em cima do trono para usar a alavanca.") end return true end 2 modificação: Fazer aparecer uma lista pop up, onde estara escrito os comandos correto quando o player usar incorretamente algum comando desse fly. (tipo de um rank que ja vi) --[[Script By Vodkart]]-- function onSay(cid, words, param) local config = { pz = true, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = true, -- se os teleport irão custa (true or false) need_level = true, -- se os teleport irão precisar de level (true or false) premium = true -- se precisa ser premium account (true or false) } --[[ Config lugares]]-- local lugar = { ["depot"] = { -- nome do lugar pos = {x=937, y=1002, z=7},level = 8,price = 10000}, ["templo"] = { -- nome do lugar pos = {x=969, y=1003, z=7},level = 8, price = 10000}, ["arena"] = { -- nome do lugar pos = {x=932, y=983, z=9},level = 8,price = 10000}, ["bau"] = { -- nome do lugar pos = {x=965, y=929, z=7},level = 8,price = 10000}, ["trainers"] = { -- nome do lugar pos = {x=977, y=1003, z=9},level = 8,price = 10000}, ["equip"] = { -- nome do lugar pos = {x=977, y=1003, z=8},level = 8,price = 10000}, ["hunts"] = { -- nome do lugar pos = {x=1000, y=929, z=7},level = 8,price = 10000}, ["cassino"] = { -- nome do lugar pos = {x=986, y=1003, z=7},level = 8,price = 10000}, ["exclusiva"] = { -- nome do lugar pos = {x=1226, y=926, z=7},level = 8,price = 10000}, ["marvel"] = { -- nome do lugar pos = {x=1120, y=921, z=7},level = 8,price = 10000}, ["donate"] = { -- nome do lugar pos = {x=1410, y=914, z=7},level = 8,price = 10000}, ["quests"] = { -- nome do lugar pos = {x=849, y=922, z=7},level = 8,price = 10000} } --[[ Lista de Viagem (Não mexa) ]]-- if (param == "lista") then local str = "" str = str .. "lista de viagem :\n\n" for name, pos in pairs(lugar) do str = str..name.."\n" end str = str .. "" doShowTextDialog(cid, 6579, str) return TRUE end local a = lugar[param] if not(a) then doPlayerSendTextMessage(cid, 22, "desculpe,este lugar não existe") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com premium account podem se teleportar.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler para poder se teleportar.") return TRUE elseif config.need_level == true and getPlayerLevel(cid) < a.level then doPlayerSendTextMessage(cid, 22, "Desculpe, você não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE then doPlayerSendTextMessage(cid, 22, "Desculpe, você nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE end doTeleportThing(cid, a.pos) doSendMagicEffect(a.pos, CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para: \n " .. param .. ".") return TRUE end Editado Julho 14, 2017 7 anos por JcA (veja o histórico de edições)
Postado Julho 16, 2017 7 anos Solução Não testei nenhum deles, mas.. function onUse(cid, item, frompos, item2, topos) local needPos = {x=1011, y=1025, z=7} -- pos que precisa está para usar o item local myPos = getPlayerPosition(cid) if myPos.x == needPos.x and myPos.y == needPos.y and myPos.z == needPos.z then if getHouseByPlayerGUID(getPlayerGUID(cid)) then doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid,22,"Voce foi teleportado até sua house!") else doPlayerSendTextMessage(cid,22,"Você ainda não tem uma house, compre uma falando '!buyhouse' em frente a porta dela.") end doPlayerSendTextMessage(cid,22,"Você precisa estár em cima do trono para usar a alavanca.") end return true end --[[Script By Vodkart]]-- function onSay(cid, words, param) local config = { pz = true, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = true, -- se os teleport irão custa (true or false) need_level = true, -- se os teleport irão precisar de level (true or false) premium = true -- se precisa ser premium account (true or false) } --[[ Config lugares]]-- local lugar = { ["depot"] = { -- nome do lugar pos = {x=937, y=1002, z=7},level = 8,price = 10000}, ["templo"] = { -- nome do lugar pos = {x=969, y=1003, z=7},level = 8, price = 10000}, ["arena"] = { -- nome do lugar pos = {x=932, y=983, z=9},level = 8,price = 10000}, ["bau"] = { -- nome do lugar pos = {x=965, y=929, z=7},level = 8,price = 10000}, ["trainers"] = { -- nome do lugar pos = {x=977, y=1003, z=9},level = 8,price = 10000}, ["equip"] = { -- nome do lugar pos = {x=977, y=1003, z=8},level = 8,price = 10000}, ["hunts"] = { -- nome do lugar pos = {x=1000, y=929, z=7},level = 8,price = 10000}, ["cassino"] = { -- nome do lugar pos = {x=986, y=1003, z=7},level = 8,price = 10000}, ["exclusiva"] = { -- nome do lugar pos = {x=1226, y=926, z=7},level = 8,price = 10000}, ["marvel"] = { -- nome do lugar pos = {x=1120, y=921, z=7},level = 8,price = 10000}, ["donate"] = { -- nome do lugar pos = {x=1410, y=914, z=7},level = 8,price = 10000}, ["quests"] = { -- nome do lugar pos = {x=849, y=922, z=7},level = 8,price = 10000} } --[[ Lista de Viagem (Não mexa) ]]-- if (param == "lista") then local str = "" str = str .. "lista de viagem :\n\n" for name, pos in pairs(lugar) do str = str..name.."\n" end str = str .. "" doShowTextDialog(cid, 6579, str) return TRUE end local a = lugar[param] if not(a) then local txt = "" for v,k in pairs(lugar) do txt = (txt == "") and "Os lugares são: "..v..", " or txt..v..", " end doPlayerPopupFYI(cid, txt) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.") return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com premium account podem se teleportar.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battler para poder se teleportar.") return TRUE elseif config.need_level == true and getPlayerLevel(cid) < a.level then doPlayerSendTextMessage(cid, 22, "Desculpe, você não tem level. voce precisa "..a.level.." level ou mais para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.custo == true and doPlayerRemoveMoney(cid, a.price) == FALSE then doPlayerSendTextMessage(cid, 22, "Desculpe, você nao tem dinheiro suficiente. Voce precisa "..a.price.." gp para ser teleportado.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE end doTeleportThing(cid, a.pos) doSendMagicEffect(a.pos, CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, 22, "" .. getPlayerName(cid) .. " foi teleportado para: \n " .. param .. ".") return TRUE 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.