Galera alguém me ajuda com esse script? como eu adiciono level nesse script?
quero que possa ser usado apenas 1x.
caso for usado de novo tem que pagar 10 diamonds.
e também os players estao usando antes do lvl 120.. como arrumo isso?
function onSay(cid, words, param, channel)
if param == "" then return sendMsgToPlayer(cid, 20, "Estao faltam os parametros! [clan name], [rank]") end local t = string.explode(param, ",") local clans = {'Volcanic', 'Seavell', 'Orebound', 'Wingeon', 'Malefic', 'Gardestrike', 'Psycraft', 'Naturia', 'Raibolt', 'IronHard'} if not isInArray(clans, t[1]) then return sendMsgToPlayer(cid, 20, t[1].." nao é uma clan valido!") elseif not tonumber(t[2]) then return sendMsgToPlayer(cid, 20, "Parametros errados! [clan name], [rank].") end
local rank = tonumber(t[2]) local clan = t[1]
if getPlayerStorageValue(cid, 92823) < 1 then -- 7575 -- 92823 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Essa é sua primeira vez mudando de clan. Nas próximas, terá o custo de 10 diamonds.") doPlayerSendTextMessage(cid, 27, "Agora você pertence ao clan "..clan..", rank: "..rank.."") setPlayerClan(cid, clan) setPlayerClanRank(cid, rank) else if getPlayerItemCount(cid, 2145) < 10 then return doPlayerSendCancel(cid, "Você precisa de 10 diamonds para mudar de clan.") else return doPlayerSendCancel(cid, "Sorry, not possible.") end if(getPlayerLevel(cid) < 120) then return doPlayerSendCancel(cid, "Você estar no level 120.") else return doPlayerSendCancel(cid, "Sorry, not possible.") end doPlayerSendTextMessage(cid, 27, "Agora você pertence ao clan "..clan..", rank: "..rank.."") doPlayerRemoveItem(cid, 2145, 10) setPlayerClan(cid, clan) setPlayerClanRank(cid, rank) end return true
end
EDIT:
Galera ja consegui aqui.. achei esse script e funfou blz.
if param == "" then return doPlayerSendCancel(cid, "Estão faltando os parâmetros!") end
local ta = { [2] = {level = 90}, [3] = {level = 100}, [4] = {level = 120}, [5] = {level = 150}, } local money = 2160 local qntt = 15
local levels = ta[(getPlayerStorageValue(cid, 862281) + 1)] local lv = levels.level
if getPlayerStorageValue(cid, 862281) >= tonumber(t[1]) then return doPlayerSendCancel(cid, "Você já passou desse rank.") end
if tonumber(t[1]) >= tonumber((getPlayerStorageValue(cid, 862281)) + 2) then return doPlayerSendCancel(cid, "Você não pode fazer isso!") end
if getPlayerStorageValue(cid, 86228) < 1 then return doPlayerSendCancel(cid, "Você não pertence a algum clan!") end
if getPlayerLevel(cid) < lv then return doPlayerSendCancel(cid, "Você não possui o level necessário.") end
if getPlayerItemCount(cid, money) >= qntt then doPlayerRemoveItem(cid, money, qntt) else return doPlayerSendTextMessage(cid, 19,"[Clan] Você não Tem [15] Thousand Dollars (150k) Para Avançar de Rank!.") end setPlayerClanRank(cid, getPlayerStorageValue(cid, 862281) + 1) doPlayerSendTextMessage(cid, 27, "Você avançou de rank! Rank atual: "..getPlayerStorageValue(cid, 862281)..".")
elseif words == "!trocarclan" then
local item = 2160 --ID do item. local qnt = 100 --Quantidade do item. local to_go = t[1]
if param == "" then return doPlayerSendCancel(cid, "Estão faltando os parâmetros!") end
if not isInArray(clans, t[1]) then return doPlayerSendCancel(cid, ""..t[1].." não é um clan válido.") end
if getPlayerStorageValue(cid, 86228) < 1 then return doPlayerSendCancel(cid, "Você não pertence a clan algum!") end
if getPlayerItemCount(cid, item) >= qnt then doPlayerRemoveItem(cid, item, qnt) doPlayerSendTextMessage(cid, 27, "Você trocou de clan, pertencendo agora ao clan: "..t[1]..".") setPlayerClan(cid, to_go) setPlayerClanRank(cid, 1) else return doPlayerSendCancel(cid, "Você não tem o dinheiro necessário! (1kk)") end end return true
info
Grupo: Campones
Registrado: 27/05/10
Posts: 69
Reputação: +5
Char no Tibia: Pedro
Galera alguém me ajuda com esse script? como eu adiciono level nesse script?
quero que possa ser usado apenas 1x.
caso for usado de novo tem que pagar 10 diamonds.
e também os players estao usando antes do lvl 120.. como arrumo isso?
function onSay(cid, words, param, channel)
if param == "" then
return sendMsgToPlayer(cid, 20, "Estao faltam os parametros! [clan name], [rank]")
end
local t = string.explode(param, ",")
local clans = {'Volcanic', 'Seavell', 'Orebound', 'Wingeon', 'Malefic', 'Gardestrike', 'Psycraft', 'Naturia', 'Raibolt', 'IronHard'}
if not isInArray(clans, t[1]) then
return sendMsgToPlayer(cid, 20, t[1].." nao é uma clan valido!")
elseif not tonumber(t[2]) then
return sendMsgToPlayer(cid, 20, "Parametros errados! [clan name], [rank].")
end
local rank = tonumber(t[2])
local clan = t[1]
if getPlayerStorageValue(cid, 92823) < 1 then -- 7575 -- 92823
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Essa é sua primeira vez mudando de clan. Nas próximas, terá o custo de 10 diamonds.")
doPlayerSendTextMessage(cid, 27, "Agora você pertence ao clan "..clan..", rank: "..rank.."")
setPlayerClan(cid, clan)
setPlayerClanRank(cid, rank)
else
if getPlayerItemCount(cid, 2145) < 10 then
return doPlayerSendCancel(cid, "Você precisa de 10 diamonds para mudar de clan.")
else
return doPlayerSendCancel(cid, "Sorry, not possible.")
end
if(getPlayerLevel(cid) < 120) then
return doPlayerSendCancel(cid, "Você estar no level 120.")
else
return doPlayerSendCancel(cid, "Sorry, not possible.")
end
doPlayerSendTextMessage(cid, 27, "Agora você pertence ao clan "..clan..", rank: "..rank.."")
doPlayerRemoveItem(cid, 2145, 10)
setPlayerClan(cid, clan)
setPlayerClanRank(cid, rank)
end
return true
end
EDIT:
Galera ja consegui aqui.. achei esse script e funfou blz.
function onSay(cid, words, param)
local clans = {"Volcanic", "Seavell", "Orebound", "Wingeon", "Malefic", "Gardestrike", "Psycraft", "Naturia", "Raibolt"}
local t = string.explode(param, ",")
if words == "!entrarclan" then
if param == "" then
return doPlayerSendCancel(cid, "Estão faltando os parâmetros!")
end
local clan = t[1]
if getPlayerLevel(cid) < 80 then
return doPlayerSendCancel(cid, "Você precisa ser level 80 para entrar em um clan.")
end
if not isInArray(clans, t[1]) then
return doPlayerSendCancel(cid, ""..clan.." não é um clan válido.")
end
if getPlayerStorageValue(cid, 86228) >= 1 then
return doPlayerSendCancel(cid, "Você já está em um clan.")
end
setPlayerClan(cid, clan)
doPlayerSendTextMessage(cid, 27, "Agora você pertence ao Clan "..clan..", rank: 1")
setPlayerClanRank(cid, 1)
elseif words == "!rankclan" then
if param == "" then
return doPlayerSendCancel(cid, "Estão faltando os parâmetros!")
end
local ta = {
[2] = {level = 90},
[3] = {level = 100},
[4] = {level = 120},
[5] = {level = 150},
}
local money = 2160
local qntt = 15
local levels = ta[(getPlayerStorageValue(cid, 862281) + 1)]
local lv = levels.level
if getPlayerStorageValue(cid, 862281) >= tonumber(t[1]) then
return doPlayerSendCancel(cid, "Você já passou desse rank.")
end
if tonumber(t[1]) >= tonumber((getPlayerStorageValue(cid, 862281)) + 2) then
return doPlayerSendCancel(cid, "Você não pode fazer isso!")
end
if getPlayerStorageValue(cid, 86228) < 1 then
return doPlayerSendCancel(cid, "Você não pertence a algum clan!")
end
if getPlayerLevel(cid) < lv then
return doPlayerSendCancel(cid, "Você não possui o level necessário.")
end
if getPlayerItemCount(cid, money) >= qntt then
doPlayerRemoveItem(cid, money, qntt)
else
return doPlayerSendTextMessage(cid, 19,"[Clan] Você não Tem [15] Thousand Dollars (150k) Para Avançar de Rank!.")
end
setPlayerClanRank(cid, getPlayerStorageValue(cid, 862281) + 1)
doPlayerSendTextMessage(cid, 27, "Você avançou de rank! Rank atual: "..getPlayerStorageValue(cid, 862281)..".")
elseif words == "!trocarclan" then
local item = 2160 --ID do item.
local qnt = 100 --Quantidade do item.
local to_go = t[1]
if param == "" then
return doPlayerSendCancel(cid, "Estão faltando os parâmetros!")
end
if not isInArray(clans, t[1]) then
return doPlayerSendCancel(cid, ""..t[1].." não é um clan válido.")
end
if getPlayerStorageValue(cid, 86228) < 1 then
return doPlayerSendCancel(cid, "Você não pertence a clan algum!")
end
if getPlayerItemCount(cid, item) >= qnt then
doPlayerRemoveItem(cid, item, qnt)
doPlayerSendTextMessage(cid, 27, "Você trocou de clan, pertencendo agora ao clan: "..t[1]..".")
setPlayerClan(cid, to_go)
setPlayerClanRank(cid, 1)
else
return doPlayerSendCancel(cid, "Você não tem o dinheiro necessário! (1kk)")
end
end
return true
end
Editado Outubro 5 por Pedro19