Não consigo arrumar um ja procurei e dois que achei tava errados. Se alguém tiver um e explicar como adiciono pra eu garantir que não fiz nada errado agradeço.
@Edit e um !promotion seria bem útil também hehehe
Não consigo arrumar um ja procurei e dois que achei tava errados. Se alguém tiver um e explicar como adiciono pra eu garantir que não fiz nada errado agradeço.
@Edit e um !promotion seria bem útil também hehehe
Opa, esta área é para postagem de códigos prontos. Quando você quiser fazer algum pedido, ou dúvida, opte por postar na área de Pedidos e dúvidas - Scripting. Já quando for relacionado à servidores derivados (naruto, pokémon, etc), Pedidos e dúvidas - Servidores derivados.
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.
Bom, comando !aol e !bless eu tenho..
Aqui esta:
em talkactions/scripts crie um arquivo lua e cole isto:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 10000) == TRUE thenlocal bp = doPlayerAddItem(cid, 2173, 1)doSendMagicEffect(getCreaturePosition(cid),13)doCreatureSay(cid, "Voce comprou um Amulet of Loss", TALKTYPE_ORANGE_1)elsedoCreatureSay(cid, "Voce nao tem dinheiro suficiente", TALKTYPE_ORANGE_1)doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)endend
<talkaction words="!aol" script="buyaol.lua"/>
Crie um arquivo lua em script e adicione isto:
local bless = {1, 2, 3, 4, 5}
local cost = 50000
function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless)) then
doPlayerSendCancel(cid, "You have already all blessings.")
return TRUE
end
end
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless)
end
doCreatureSay(cid, "You are now blessed by the GOD Reconnect!" ,19)
doSendMagicEffect(getPlayerPosition(cid), 49)
else
doPlayerSendCancel(cid, "Voce precisa de 50k para a bless")
end
return TRUE
end
Configurando:
em talkactions.xml adicione:
<talkaction words="!bless" event="script" value="bless.lua"/>
@Edit
Crie um arquivo .lua chamado promotion e em talkactions/script e cole isso dentro
local config = {
promotion = 1, -- promotion level, default = 1 . Ignore if you don't have new vocations.
minLevel = 20, --Level Para Promotion
cost = 20000, -- Preço em GPS
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, MESSAGE_STATUS_CONSOLE_ORANGE, "You need " .. config.minLevel .. " to get promotion.")
elseif(doPlayerRemoveMoney(cid, config.cost) ~= TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You do not have enought money! (Promotion cost " .. config.cost .. " gp.")
else
setPlayerPromotionLevel(cid, config.promotion)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been succesful promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
end
return TRUE
end
depois em talkactions.xml cole isto:
<talkaction words="!buypromotion" script="promotion.lua"/>
Obrigado mesmo e desculpe por postar na seção errada.