Postado Dezembro 2, 2014 10 anos Olá galera do TK, Gostaria de pedir a ajuda de vocês com este script : Seguinte, quero que ao invés de pegar 1.000.000 de gold coins do player para lhe dar uma segunda promotion através deste comando, quero que pega 5 unidades do item com ID : 7633 Tentei mudar o DoPlayerRemoveMoney por DoPlayerRemoveItem, porém deu algum erro no return.. podem arrumar o script para mim por favor? local config = { promotion = 2, -- promotion level, default = 1 . Ignore if you don't have new vocations. minLevel = 250, -- Level needed to buy promotion cost = 1000000, -- Promotion cost in gp premium = "yes" -- is premium needed to buy promotion? } local disabledVocations = {0} config.premium = getBooleanFromString(config.premium) function onSay(cid, words, param) if(isInArray(disabledVocations, getPlayerVocation(cid)) == TRUE) then doPlayerSendCancel(cid, "Your vocation cannot buy promotion.") elseif(config.premium == TRUE and isPremium(cid) == FALSE) then doPlayerSendCancel(cid, "You need a premium account.") elseif(getPlayerPromotionLevel(cid) >= config.promotion) then doPlayerSendCancel(cid, "You are already promoted.") elseif(getPlayerLevel(cid) < config.minLevel) then doPlayerSendTextMessage(cid, 21, "You need " .. config.minLevel .. " to get promotion.") elseif(doPlayerRemoveMoney(cid, config.cost) ~= TRUE) then doPlayerSendTextMessage(cid, 21, "You do not have enought money! (Promotion cost " .. config.cost .. " gp.)") else setPlayerPromotionLevel(cid, config.promotion) doPlayerSendTextMessage(cid, 25, "You have been succesful promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".") end return TRUE end REP+ Programador/Scripter/Mapper nível NOOB ?
Postado Dezembro 2, 2014 10 anos local config = { promotion = 2, -- promotion level, default = 1 . Ignore if you don't have new vocations. minLevel = 250, -- Level needed to buy promotion cost = 1000000, -- Promotion cost in gp premium = "yes", -- is premium needed to buy promotion? gold_id = 7633, -- Id do dinheiro } local disabledVocations = {0} config.premium = getBooleanFromString(config.premium) function onSay(cid, words, param) if isInArray(disabledVocations, getPlayerVocation(cid)) then doPlayerSendCancel(cid, "Your vocation cannot buy promotion.") return false end if config.premium and not isPremium(cid) then doPlayerSendCancel(cid, "You need a premium account.") return false end if getPlayerPromotionLevel(cid) >= config.promotion then doPlayerSendCancel(cid, "You are already promoted.") return false end if getPlayerLevel(cid) < config.minLevel then doPlayerSendTextMessage(cid, 21, "You need " .. config.minLevel .. " to get promotion.") return false end if not doPlayerRemoveItem(cid, config.gold_id, config.cost) then doPlayerSendTextMessage(cid, 21, "You do not have enought money! (Promotion cost " .. config.cost .. " gp.)") return false end setPlayerPromotionLevel(cid, config.promotion) doPlayerSendTextMessage(cid, 25, "You have been succesful promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".") return true end -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
Postado Dezembro 2, 2014 10 anos Autor @MaxwEllDeN valeu o script, mas não ajudou.. mas está no caminho certo! A única coisa que faltou é a quantidade de item ID : 7633 a ser removida do player, consegue me ajudar? Programador/Scripter/Mapper nível NOOB ?
Postado Dezembro 2, 2014 10 anos Solução local config = { promotion = 2, -- promotion level, default = 1 . Ignore if you don't have new vocations. minLevel = 250, -- Level needed to buy promotion count = 5, -- Quantidade premium = "yes", -- is premium needed to buy promotion? gold_id = 7633, -- Id do dinheiro } local disabledVocations = {0} config.premium = getBooleanFromString(config.premium) function onSay(cid, words, param) if isInArray(disabledVocations, getPlayerVocation(cid)) then doPlayerSendCancel(cid, "Your vocation cannot buy promotion.") return false end if config.premium and not isPremium(cid) then doPlayerSendCancel(cid, "You need a premium account.") return false end if getPlayerPromotionLevel(cid) >= config.promotion then doPlayerSendCancel(cid, "You are already promoted.") return false end if getPlayerLevel(cid) < config.minLevel then doPlayerSendTextMessage(cid, 21, "You need " .. config.minLevel .. " to get promotion.") return false end if not doPlayerRemoveItem(cid, config.gold_id, config.count) then doPlayerSendTextMessage(cid, 21, "You do not have enough item! (Promotion count " .. config.count .. " .)") return false end setPlayerPromotionLevel(cid, config.promotion) doPlayerSendTextMessage(cid, 25, "You have been succesful promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".") return true end Editado Dezembro 2, 2014 10 anos por Smart Maxx (veja o histórico de edições)
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.