Postado Junho 8, 2016 9 anos Olá galerinha do TK, tenho o seguinte script de teleport por talkaction: function onSay(cid, words, param) local config = { pz = false, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = false, -- se os teleport irão custa (true or false) need_level = false, -- se os teleport irão precisar de level (true or false) premium = false -- se precisa ser premium account (true or false) } --[[ Config lugares]]-- local lugar = { ["element"] = { -- nome do lugar pos = {x=221, y=891, z=8},level = 1,price = 0}, ["draconia"] = { -- nome do lugar pos = {x=2242, y=788, z=4},level = 1,price = 0}, ["eme"] = { -- nome do lugar pos = {x=1978, y=995, z=7},level = 1,price = 0}, } local a = lugar[param] if not(a) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Os lugares que você pode ir são: lugar1, lugar2") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Os lugares que PREMIUM que você pode ir são: lugar3") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.premium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas premium podem se teleportar para esse lugar.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return TRUE end doSendMagicEffect(getPlayerPosition(cid),27) doTeleportThing(cid, a.pos) doSendMagicEffect(getPlayerPosition(cid),40) return TRUE end Como vocês puderam notar, o script somente verifica se o player tem premium para usar a talkaction, eu quero que fique como se checasse a premium para determinado local EX:element e draconia são free e eme só premium pode ir. Alguém consegue ? agradeço desde já ! Editado Junho 8, 2016 9 anos por sanf (veja o histórico de edições)
Postado Junho 8, 2016 9 anos script antigo kkk de 2010 acho kkk eu q fiz esse código... enfim, não é mais fácil colocar então uma tabela de lugares para free e outra para premium? porque ai abre uma lista de lugares que cada um poderá ir... [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Junho 14, 2016 9 anos Aqui está amigo, não testei, mas acho que se souber configurar, dá certinho... Estou na escola agora, dps vejo direito caso tenha bugs... Apenas usei um pouco da noção de programação, procuro entender mais o script, muitas vezes pessoas não dão nada na mão assim, ainda mais coisas simples.... Vlws @sanf Mostrar conteúdo oculto local config = { pz = false, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = false, -- se os teleport irão custa (true or false) need_level = false, -- se os teleport irão precisar de level (true or false) CaveFree = false -- se precisa ser premium account (true or false) CavePremium = true -- se precisa ser premium account (true or false) --[[ Config lugares]]-- local lugarFree = { ["element"] = { -- nome do lugar pos = {x=221, y=891, z=8},level = 1,price = 0}, ["draconia"] = { -- nome do lugar pos = {x=2242, y=788, z=4},level = 1,price = 0}, ["eme"] = { -- nome do lugar pos = {x=1978, y=995, z=7},level = 1,price = 0}, } local lugarPremium = { ["element"] = { -- nome do lugar pos = {x=221, y=891, z=8},level = 1,price = 0}, ["draconia"] = { -- nome do lugar pos = {x=2242, y=788, z=4},level = 1,price = 0}, ["eme"] = { -- nome do lugar pos = {x=1978, y=995, z=7},level = 1,price = 0}, } local a = lugarFree[param] if not(a) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Os lugares Free que você pode ir são: lugar1, lugar2") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.CaveFree == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas premium podem se teleportar para esse lugar.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return TRUE end doSendMagicEffect(getPlayerPosition(cid),27) doTeleportThing(cid, a.pos) doSendMagicEffect(getPlayerPosition(cid),40) return TRUE end local b = lugarPremium[param] if not(b) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Os lugares Premium que você pode ir são: lugar1, lugar2") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return TRUE elseif config.CavePremium == true and not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas premium podem se teleportar para esse lugar.") return TRUE elseif config.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return TRUE end doSendMagicEffect(getPlayerPosition(cid),27) doTeleportThing(cid, b.pos) doSendMagicEffect(getPlayerPosition(cid),40) 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.