Fala ae galera, a um tempo eu pedi para que alguem fizesse um comando de clan para mim e o amigo Zipter98 criou esse comando para mim, entao vim posta-lo aqui para vcs. Talkaction.xml tag: <talkaction log="yes" words="!entrarclan;!rankclan;!trocarclan" event="script" value="clan.lua"/> Clan.lua talk
info
Grupo: Infante
Registrado: 28/01/12
Posts: 1.6k
Reputação: +262
Gênero: Masculino
Fala ae galera, a um tempo eu pedi para que alguem fizesse um comando de clan para mim e o amigo Zipter98 criou esse comando para mim, entao vim posta-lo aqui para vcs.
Talkaction.xml tag:
Clan.lua talkactions/scripts:
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 = 110},
[5] = {level = 120},
}
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
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 = 50 --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 item necessário! ITEM: "..item.." QUANTIDADE: "..qnt..".")
end
end
return true
end
Comando funciona da seguinta forma:
FAQ:
Aonde que eu edito para trocar a quantidade de dinheiro que precisa pra trocar de clan ?
R: Só procurar por essa parte no script:
local item = 2160 --ID do item. local qnt = 50 --Quantidade do item.2160 = Ten Thousand Dollar
50 = Quantidade ( 500k )
Creditos:
Zipter98