guixap 60 Postado Agosto 31, 2009 Share Postado Agosto 31, 2009 (editado) Eu keria saber se é possivel a existencia de um script que, a pessoa compra tal item, se ouver um dinheiro unico do ot por um comando ex: !buy super divine axe E SE ALGUEM TIVER AE COMO ME AJUDA POSTA SCRIPT OU LINK DAONDE TEM TAL SCRIPT Editado Agosto 31, 2009 por XaPiNhAl Link para o comentário https://xtibia.com/forum/topic/119460-resolvido-quase-um-sistem-vip/ Compartilhar em outros sites More sharing options...
kkk111 8 Postado Agosto 31, 2009 Share Postado Agosto 31, 2009 (editado) Eu keria saber se é possivel a existencia de um script que, a pessoa compra tal item, se ouver um dinheiro unico do ot por um comando ex: !buy super divine axe consertesa talkactions/scripts/buyaxe.lua function onSay(cid, words, param, channel) local crystalCoins = getPlayerItemCount(cid, 2160) local platinumCoins = getPlayerItemCount(cid, 2152) local goldCoins = getPlayerItemCount(cid, 2148) player_money = crystalCoins * 10000 + platinumCoins * 100 + goldCoins local money = 4000 -- dinheiro local axe = 2150 -- numero do axe if player_money >= money then doPlayerRemoveMoney(cid,money) doPlayerAddItem(cid, axe, 1) doCreatureSay(cid, "Thanks!", TALKTYPE_ORANGE_1) else doCreatureSay(cid, "Você não tem "..money.." gps!", TALKTYPE_ORANGE_1) end return TRUE end talkactions.xml <talkaction words="!buy super axe" script="buyaxe.lua"/> Editado Agosto 31, 2009 por kkk11111 Link para o comentário https://xtibia.com/forum/topic/119460-resolvido-quase-um-sistem-vip/#findComment-785873 Compartilhar em outros sites More sharing options...
guixap 60 Postado Agosto 31, 2009 Autor Share Postado Agosto 31, 2009 TA MASI COMO É ESSE SCRIPT ? Link para o comentário https://xtibia.com/forum/topic/119460-resolvido-quase-um-sistem-vip/#findComment-785923 Compartilhar em outros sites More sharing options...
kkk111 8 Postado Agosto 31, 2009 Share Postado Agosto 31, 2009 aah.. agora que eu vi esse negosio de "dinheiro unico" ai... passa o id do "dinheiro unico" que eu ja ageito em script aqui se quiser algo de expecial ja fala tambem ou é so !buy axe ja compra ? Link para o comentário https://xtibia.com/forum/topic/119460-resolvido-quase-um-sistem-vip/#findComment-785933 Compartilhar em outros sites More sharing options...
guixap 60 Postado Agosto 31, 2009 Autor Share Postado Agosto 31, 2009 aah.. agora que eu vi esse negosio de "dinheiro unico" ai... passa o id do "dinheiro unico" que eu ja ageito em script aqui se quiser algo de expecial ja fala tambem ou é so !buy axe ja compra ? É O MONEY É, O GOLD INGOT ID: 9971 DAE EU GOSTARIA QEU OS PLAYERS TIVESSE ACESSO PRA COMPRAR, ALGUMS ITEMS QUE EU CREI NO SERVER, E TAMBEM SE FOR POSSIVEL PODER SER VIP PELO !VIP E PRA COMPRAR ITEMS VIPS PELO COMANDO !BUY {TAL ITEM} SEM AS CHAVES CLARO SE AJUDAR VLWS AE Link para o comentário https://xtibia.com/forum/topic/119460-resolvido-quase-um-sistem-vip/#findComment-785994 Compartilhar em outros sites More sharing options...
kkk111 8 Postado Agosto 31, 2009 Share Postado Agosto 31, 2009 (editado) Ve ai function onSay(cid, words, param, channel) local money = 4000 -- o preço do item em gold ingot local items = 2150 -- numero do item que vai comprar local StorageVip = 1111 -- numero da storage dos vips if getPlayerStorageValue(cid,StorageVip) >= 1 then if getPlayerItemCount(cid, 9971) >= money then doPlayerRemoveItem(cid, 9971, money) doPlayerAddItem(cid, items, 1) doSendMagicEffect(getCreaturePosition(cid),13) doCreatureSay(cid, "Thanks!", TALKTYPE_ORANGE_1) else doCreatureSay(cid, "Você não tem "..money.." gold ingot!", TALKTYPE_ORANGE_1) end else doCreatureSay(cid, "Você não é VIP!", TALKTYPE_ORANGE_1) end return TRUE end <talkaction words="XXXX" script="buyitems.lua"/> XXXX = !buy nome do item Editado Agosto 31, 2009 por kkk11111 Link para o comentário https://xtibia.com/forum/topic/119460-resolvido-quase-um-sistem-vip/#findComment-786000 Compartilhar em outros sites More sharing options...
guixap 60 Postado Agosto 31, 2009 Autor Share Postado Agosto 31, 2009 Ve ai function onSay(cid, words, param, channel) local money = 4000 -- o preço do item em gold ingot local items = 2150 -- numero do item que vai comprar local StorageVip = 1111 -- numero da storage dos vips if getPlayerStorageValue(cid,StorageVip) >= 1 then if getPlayerItemCount(cid, 9971) >= money then doPlayerRemoveItem(cid, 9971, money) doPlayerAddItem(cid, items, 1) doSendMagicEffect(getCreaturePosition(cid),13) doCreatureSay(cid, "Thanks!", TALKTYPE_ORANGE_1) else doCreatureSay(cid, "Você não tem "..money.." gold ingot!", TALKTYPE_ORANGE_1) end else doCreatureSay(cid, "Você não é VIP!", TALKTYPE_ORANGE_1) end return TRUE end <talkaction words="XXXX" script="buyitems.lua"/> XXXX = !buy nome do item OK PEGOU AGORA SO KERIA SABER COMO RETIRA QEU É SO PRA PRA VIP É PRA ALL PLAYERS EU QUIS DISSER COMO ADD VIP POR ESSE COMANDO RSRSRS MASI VLWS LEK Link para o comentário https://xtibia.com/forum/topic/119460-resolvido-quase-um-sistem-vip/#findComment-786002 Compartilhar em outros sites More sharing options...
rockstar96 4 Postado Agosto 31, 2009 Share Postado Agosto 31, 2009 (editado) XaPiNhAl, por favor, desligue o caps lock, dá a sensação que está gritando... kkk11111, o seu script não faz diferença o nome do item, ele não checa parâmetros... Aqui há um script do Mazen, da ot****: local items = { {1, 6500, 10000}, -- {item type, item id, price} there are two item types, single items(1) and containers(2). {2, 1998, "backpack of demonic essences;bpde", 20, 6500, 1, 10000} -- {item type, container id, item names, items, items id, charges, price per item} } function onSay(cid, words, param) par = string.explode(param, " ") if param == "" then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Please write what item you wish to buy.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end if param == "info" then if items == {} then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There are no buyable items.") return true end local text = "List of Items:\n" for i, lineItem in ipairs(items) do local first_word = string.gsub(getItemNameById(lineItem[2]), "%a", string.upper, 1) if lineItem[1] == 1 then text = text .. first_word .. " - " .. lineItem[3] .. " gp\n" elseif lineItem[1] == 2 then text = text .. first_word .. " of " .. lineItem[6] * lineItem[4] .. " " .. getItemNameById(lineItem[5]) .. "s - " .. lineItem[6] * lineItem[4] * lineItem[7] .. "gp\n" end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text) return true end for i, item in ipairs(items) do par = getFullParam(par) if item[1] == 1 then titem = par[1] if isNumber(par[1]) == true then titem = par[2] if tonumber(par[1]) > 100 or tonumber(par[1]) == 0 then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end end count = 1 if titem == par[2] then count = tonumber(par[1]) end if count > 1 then _, _, string_enter = string.find(titem, '(.*)s') if getItemIdByName(string_enter, false) ~= false then titem = string_enter elseif getItemIdByName(titem, false) ~= false then titem = titem else doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end end if titem == getItemNameById(item[2]) then if doPlayerRemoveMoney(cid, item[3]) == true then sItem = doPlayerAddItem(cid, item[2], count) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) if tonumber(count) == 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have succefully bought ".. getItemDescriptions(sItem).article .." ".. getItemDescriptions(sItem).name ..". ".. getItemDescriptions(sItem).special) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have succefully bought ".. count .." ".. getItemDescriptions(sItem).name .."s. ".. getItemDescriptions(sItem).special) end return true else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don\'t have enough money to buy that.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end end elseif item[1] == 2 then ItemName = string.explode(item[3], ";") for i = 1, #ItemName do if par[1] == ItemName[i] then if doPlayerRemoveMoney(cid, item[7]*item[4]) == true then itemSelect = doPlayerAddItem(cid, item[2], 1) for s = 1, item[4] do doAddContainerItem(itemSelect, item[5], item[6]) end doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have succefully bought ".. getItemDescriptions(itemSelect).article .." ".. getItemDescriptions(itemSelect).name .." with ".. item[4]*item[6] .." ".. getItemNameById(item[5]) .."s.") return true else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don\'t have enough money to buy that.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end end end end if i == #items then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can\'t buy that.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end end return true end function getFullParam(param) local s = "" if isNumber(param[1]) == FALSE then for i = 1, #param do if i ~= #param then s = s .. param[i] .. " " else s = s .. param[i] end end return {s} else for i = 2, #param do if i ~= #param then s = s .. param[i] .. " " else s = s .. param[i] end end return {param[1], s} end end Para comprar coisas, diga algo do tipo: !buy 3 magic swords -- To buy 3 magic swords. !buy magic sword -- Comprar uma única magic sword !buy bpsd -- Comprar uma BP de SDs !buy info -- Vai exibir uma lista de tudo o que pode ser comprado. Não esqueça de fazer a tag no talkactions.xml O script é auto explicável, adeus. Editado Agosto 31, 2009 por iRockStar Link para o comentário https://xtibia.com/forum/topic/119460-resolvido-quase-um-sistem-vip/#findComment-786299 Compartilhar em outros sites More sharing options...
Posts Recomendados