Boa tarde,
Queria 1 sistema parecido com bank, mais usando talkaction, e usando o item 9971 inves de gold coins,
Obrigado
Boa tarde,
Queria 1 sistema parecido com bank, mais usando talkaction, e usando o item 9971 inves de gold coins,
Obrigado
Fiz aqui rapidinho
function onSay(cid, words, param) local item = 9971 local storage = 39010 local sto = getPlayerStorageValue(cid, storage) == -1 and 0 or getPlayerStorageValue(cid, storage) if words ~= "!balance" and isNumber(tonumber(param)) == FALSE then return doPlayerSendCancel(cid, "Diga a quantidade que você quer adicionar do item.") end local quanti = tonumber(param) if words == "!deposit" then if getPlayerItemCount(cid, item) >= quanti then doPlayerRemoveItem(cid, item, quanti) setPlayerStorageValue(cid, storage, sto + quanti) doPlayerSendTextMessage(cid, 22, "Deposito efetuado com sucesso. Valor depositado: " .. quanti) else doPlayerSendCancel(cid, "Você não tem essa quantidade.") end elseif words == "!withdraw" then if getPlayerStorageValue(cid, storage) >= quanti then setPlayerStorageValue(cid, storage, sto - quanti) doPlayerAddItem(cid, item, quanti) doPlayerSendTextMessage(cid, 22, "Saque efetuado com sucesso. Valor sacado: " .. quanti) else doPlayerSendCancel(cid, "Você não tem isso no banco.") end elseif words == "!balance" then doPlayerSendTextMessage(cid, 22, "Você tem " .. sto .. " itens no banco.") end return TRUE end
Tag:
<talkaction words="!deposit;!balance;!withdraw" script="NomeDoArquivo.lua" />
Até.
Oie :D
e se eu quizer colocar mais de 1 item para ser adicionado ao banco como faço??
tentei por assim onde tem o numero do item q via pro banco
function onSay(cid, words, param)
local item = 2148, 2152, 2160
talfiz assim pra pode adicionar gold platinum e crystal
MAIS NAO DEU CERTO =/
oque faço???