Ir para conteúdo

Featured Replies

Postado

Não chei uma área adequada para postar, então vai aqui mesmo....

http://www.youtube.com/watch?v=HoiawB4wcTQ

 

 

amigo estou usando esse sistema no meu server mais como faço para o [shop] player pode falar com mais de um player ????

 

mod \/

 

<?xml version = "1.0" encoding = "utf-8" ?>
 
<mod name = "Private Shop[ADM] Master" author = "[ADM] Master" contact = "[email protected]" version = "1.0" enabled = "yes">
<event type = "login" name = "PvShop" event = "script" value = "Private Shop/Creaturescripts.lua"/>
<event type = "logout" name = "PvShopLOGOUT" event = "script" value = "Private Shop/Creaturescripts.lua"/>
<event type = "preparedeath" name = "PvShopDEATH" event = "script" value = "Private Shop/Creaturescripts.lua"/>
 
<talkaction words = "!shop" event = "script" value = "Private Shop/Talkaction.lua"/>
</mod>
 

 

creasturescript \/

 

function onLogin(cid)

if (getPlayerStorageValue(cid, 75431) > 0) then

local playerguid = getPlayerGUIDByName(getCreatureName(cid))

local ddec = 0

for a, b in pairs(getPlayerShopLucro(playerguid)) do

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You sold ".. b[1] .. "x ".. getItemNameById(a) .. getPrefix(b[1]) ..".")

if (getPlayerStorageValue(cid, 21147) < 0) then

setPlayerStorageValue(cid, 21147, 0)

end

setPlayerStorageValue(cid, 21147, getPlayerStorageValue(cid, 21147) + b[2])

end

if (getPlayerStorageValue(cid, 21147) > 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Total Gain: ".. getPlayerStorageValue(cid, 21147) .. " gold bar" .. getPrefix(getPlayerStorageValue(cid, 21147)) .. ".")

doPlayerAddMoney(cid, getPlayerStorageValue(cid, 21147))

setPlayerStorageValue(cid, 21147, -1)

end

deleteNPCFile(getCreatureName(cid))

setPlayerShopLucro(playerguid, "{}")

setPlayerStorageValue(cid, 75431, -1)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Private Shop disabled.")

end

registerCreatureEvent(cid, "PvShopLOGOUT")

registerCreatureEvent(cid, "PvShopDEATH")

return true

end

function onLogout(cid)

if (getPlayerStorageValue(cid, 75431) > 0) then

addEvent(createNPCShop, 1, getCreatureName(cid), getCreatureOutfit(cid), getPlayerGUIDByName(getCreatureName(cid)), getThingPos(cid), getCreatureLookDir(cid))

end

return true

end

local function aol(cid)

if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid) and (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2173) then

return true

end

return false

end

function onPrepareDeath(cid, deathList)

if (not getPlayerBlessing(cid, 33)) and (not aol(cid)) then

setPlayerShopItens(getPlayerGUIDByName(getCreatureName(cid)), "{}")

end

return true

end

 

talkaction \/

 

local function tabletama(tb)
local tam = 0
 
for i, v in pairs(tb) do
tam = tam + 1
end
 
return tam
end
 
local funcs = {"on", "off", "add", "remove", "list", "help", "list"}
 
function onSay(cid, words, param)
 
local param = param:lower()
local params = string.explode(param, ",")
local param = params[1]
 
local configs = _PV_SHOP_CONFIG
 
if (configs.premmy) and not(isPremium(cid)) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must have a premium account to use this system.")
end
 
if (getPlayerLevel(cid) < configs.level) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be at least level " .. configs.level .. " to use this system.")
end
 
if not(isInArray(funcs, param)) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You typed a invalid option, to see help window type ".. words .. " help.")
end
 
if (param == "on") then
if (getCreatureCondition(cid, CONDITION_INFIGHT)) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't activate the system with your pz locked.")
end
 
local pos = getThingPos(cid)
local pos1 = {x = pos.x-5, y = pos.y-5, z = pos.z}
local pos2 = {x = pos.x+5, y = pos.y+5, z = pos.z}
local uids = getUidsInArea(pos1, pos2)
 
for _, b in pairs(uids) do
if (not(isPlayer(b)) and not (isMonster(b))) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Saia De Perto de um npc.")
end
end
 
local pikznelis = 0
for _, a in pairs(getPlayerShopItens(getPlayerGUIDByName(getCreatureName(cid)))) do
pikznelis = 1
break
end
 
if (pikznelis == 0) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must add a item to your shop before ative it.")
end
 
setPlayerStorageValue(cid, 75431, 1)
addEvent(doRemoveCreature, 1, cid)
elseif (param == "add") then
 
if not(params[4]) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You typed a invalid option, to see help window type ".. words .. " help.")
end
 
local item
if type(errors) == "function" then
errors(false)
item = getItemIdByName(params[2])
errors(true)
else
item = getItemIdByName(params[2], false)
end
 
if not (item) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, params[2] .." isn't a valid item.")
end
 
if (tabletama(getPlayerShopItens(getPlayerGUIDByName(getCreatureName(cid)))) >= configs.maxitens) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't have more than ".. configs.maxitens.." types of items in your Private Shop.")
end
 
if (isInArray(configs.notadd, item)) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't add " .. params[2] .. " to Private Shop.")
end
 
if not(tonumber(params[3])) or (tonumber(params[3]) < 1) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, params[3] .. " isn't a valid quanty.")
end
 
if (getPlayerItemCount(cid, item) < tonumber(params[3])) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You haven't ".. params[3] .." " .. params[2] .."(s).")
end
 
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You added with successful ".. params[3] .. " ".. params[2] .."(s) to your Private Shop.")
doAddItemForPlayerShop(getPlayerGUIDByName(getCreatureName(cid)), item, params[3], params[4])
doPlayerRemoveItem(cid, item, tonumber(params[3]))
elseif (param == "list") then
local itens = getPlayerShopItens(getPlayerGUIDByName(getCreatureName(cid)))
local msgiteins = "Items in your Private Shop:\n"
 
for a, b in pairs(itens) do
msgiteins = msgiteins .. "\n".. b[1] .. " " .. getItemNameById(a) .. getPrefix(b[1]) .. " - ".. b[2] .. " Gold Bars"
end
 
local msgiteins = msgiteins .. "\nX-X-X-X-X-X-X-X-X-X-X-X-X"
doShowTextDialog(cid, 2160, msgiteins)
elseif (param == "remove") then
if not(params[3]) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You typed a invalid option, to see help window type ".. words .. " help.")
end
 
if not(tonumber(params[3])) or (tonumber(params[3]) < 1) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, params[3] .. " isn't a valid quanty.")
end
 
local item = getItemIdByName(params[2])
if not (item) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, params[2] .." isn't a item.")
end
 
local shopt = getPlayerShopItens(getPlayerGUIDByName(getCreatureName(cid)))
if not(shopt[item]) or (tonumber(shopt[item][1]) < tonumber(params[3])) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You haven't ".. params[3] .." " .. params[2] .."(s) in Private Shop.")
end
 
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You removed with successful ".. params[3] .. " ".. params[2] .."(s) from your Private Shop.")
doRemoveItemFromPlayerShop(getPlayerGUIDByName(getCreatureName(cid)), item, params[3])
doPlayerAddItem(cid, item, tonumber(params[3]))
elseif (param == "help") then
local msg = "Private Shop System Help: \n \n * add - é usado para adicionar um item à sua Private Shop. \n"
local msg = msg .."     Exemplo de Uso: " .. words .. " adicionar, item quantia, preço por unidade"
local msg = msg .."\n" .. words .. " add, chakra boots, 1, 60000\n"
local msg = msg .."\n * remove - é usado para remover um item do seu Private Shop. \n"
local msg = msg .."     Exemplo de Uso: " .. words .. " remover, item quantia"
local msg = msg .."\n" .. words .. " remove, chakra boots, 1\n"
local msg = msg .."\n * on - é usado para o seu ativo Private Shop\n"
local msg = msg .. "\n * list - exibe na tela uma janela contendo todos os itens que você tem em sua Private Shop."
doShowTextDialog(cid, 2160, msg)
   end
 
   return true
end

Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas.

discord.gg/phJZeHa2k4

 

Projeto ATS (Naruto)

Informações Abaixo

Facebook

Youtube
Discord

 

Tutoriais / Conteúdos

Clique Aqui

  • Respostas 21
  • Visualizações 6.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado
  • Autor

amigo estou usando esse sistema no meu server mais como faço para o [shop] player pode falar com mais de um player ????

 

mod \/

 

<?xml version = "1.0" encoding = "utf-8" ?>
 
<mod name = "Private Shop[ADM] Master" author = "[ADM] Master" contact = "[email protected]" version = "1.0" enabled = "yes">
<event type = "login" name = "PvShop" event = "script" value = "Private Shop/Creaturescripts.lua"/>
<event type = "logout" name = "PvShopLOGOUT" event = "script" value = "Private Shop/Creaturescripts.lua"/>
<event type = "preparedeath" name = "PvShopDEATH" event = "script" value = "Private Shop/Creaturescripts.lua"/>
 
<talkaction words = "!shop" event = "script" value = "Private Shop/Talkaction.lua"/>
</mod>
 

 

creasturescript \/

 

function onLogin(cid)

if (getPlayerStorageValue(cid, 75431) > 0) then

local playerguid = getPlayerGUIDByName(getCreatureName(cid))

local ddec = 0

for a, b in pairs(getPlayerShopLucro(playerguid)) do

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You sold ".. b[1] .. "x ".. getItemNameById(a) .. getPrefix(b[1]) ..".")

if (getPlayerStorageValue(cid, 21147) < 0) then

setPlayerStorageValue(cid, 21147, 0)

end

setPlayerStorageValue(cid, 21147, getPlayerStorageValue(cid, 21147) + b[2])

end

if (getPlayerStorageValue(cid, 21147) > 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Total Gain: ".. getPlayerStorageValue(cid, 21147) .. " gold bar" .. getPrefix(getPlayerStorageValue(cid, 21147)) .. ".")

doPlayerAddMoney(cid, getPlayerStorageValue(cid, 21147))

setPlayerStorageValue(cid, 21147, -1)

end

deleteNPCFile(getCreatureName(cid))

setPlayerShopLucro(playerguid, "{}")

setPlayerStorageValue(cid, 75431, -1)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Private Shop disabled.")

end

registerCreatureEvent(cid, "PvShopLOGOUT")

registerCreatureEvent(cid, "PvShopDEATH")

return true

end

function onLogout(cid)

if (getPlayerStorageValue(cid, 75431) > 0) then

addEvent(createNPCShop, 1, getCreatureName(cid), getCreatureOutfit(cid), getPlayerGUIDByName(getCreatureName(cid)), getThingPos(cid), getCreatureLookDir(cid))

end

return true

end

local function aol(cid)

if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid) and (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2173) then

return true

end

return false

end

function onPrepareDeath(cid, deathList)

if (not getPlayerBlessing(cid, 33)) and (not aol(cid)) then

setPlayerShopItens(getPlayerGUIDByName(getCreatureName(cid)), "{}")

end

return true

end

 

talkaction \/

 

local function tabletama(tb)
local tam = 0
 
for i, v in pairs(tb) do
tam = tam + 1
end
 
return tam
end
 
local funcs = {"on", "off", "add", "remove", "list", "help", "list"}
 
function onSay(cid, words, param)
 
local param = param:lower()
local params = string.explode(param, ",")
local param = params[1]
 
local configs = _PV_SHOP_CONFIG
 
if (configs.premmy) and not(isPremium(cid)) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must have a premium account to use this system.")
end
 
if (getPlayerLevel(cid) < configs.level) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be at least level " .. configs.level .. " to use this system.")
end
 
if not(isInArray(funcs, param)) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You typed a invalid option, to see help window type ".. words .. " help.")
end
 
if (param == "on") then
if (getCreatureCondition(cid, CONDITION_INFIGHT)) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't activate the system with your pz locked.")
end
 
local pos = getThingPos(cid)
local pos1 = {x = pos.x-5, y = pos.y-5, z = pos.z}
local pos2 = {x = pos.x+5, y = pos.y+5, z = pos.z}
local uids = getUidsInArea(pos1, pos2)
 
for _, b in pairs(uids) do
if (not(isPlayer(b)) and not (isMonster(b))) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Saia De Perto de um npc.")
end
end
 
local pikznelis = 0
for _, a in pairs(getPlayerShopItens(getPlayerGUIDByName(getCreatureName(cid)))) do
pikznelis = 1
break
end
 
if (pikznelis == 0) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must add a item to your shop before ative it.")
end
 
setPlayerStorageValue(cid, 75431, 1)
addEvent(doRemoveCreature, 1, cid)
elseif (param == "add") then
 
if not(params[4]) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You typed a invalid option, to see help window type ".. words .. " help.")
end
 
local item
if type(errors) == "function" then
errors(false)
item = getItemIdByName(params[2])
errors(true)
else
item = getItemIdByName(params[2], false)
end
 
if not (item) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, params[2] .." isn't a valid item.")
end
 
if (tabletama(getPlayerShopItens(getPlayerGUIDByName(getCreatureName(cid)))) >= configs.maxitens) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't have more than ".. configs.maxitens.." types of items in your Private Shop.")
end
 
if (isInArray(configs.notadd, item)) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't add " .. params[2] .. " to Private Shop.")
end
 
if not(tonumber(params[3])) or (tonumber(params[3]) < 1) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, params[3] .. " isn't a valid quanty.")
end
 
if (getPlayerItemCount(cid, item) < tonumber(params[3])) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You haven't ".. params[3] .." " .. params[2] .."(s).")
end
 
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You added with successful ".. params[3] .. " ".. params[2] .."(s) to your Private Shop.")
doAddItemForPlayerShop(getPlayerGUIDByName(getCreatureName(cid)), item, params[3], params[4])
doPlayerRemoveItem(cid, item, tonumber(params[3]))
elseif (param == "list") then
local itens = getPlayerShopItens(getPlayerGUIDByName(getCreatureName(cid)))
local msgiteins = "Items in your Private Shop:\n"
 
for a, b in pairs(itens) do
msgiteins = msgiteins .. "\n".. b[1] .. " " .. getItemNameById(a) .. getPrefix(b[1]) .. " - ".. b[2] .. " Gold Bars"
end
 
local msgiteins = msgiteins .. "\nX-X-X-X-X-X-X-X-X-X-X-X-X"
doShowTextDialog(cid, 2160, msgiteins)
elseif (param == "remove") then
if not(params[3]) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You typed a invalid option, to see help window type ".. words .. " help.")
end
 
if not(tonumber(params[3])) or (tonumber(params[3]) < 1) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, params[3] .. " isn't a valid quanty.")
end
 
local item = getItemIdByName(params[2])
if not (item) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, params[2] .." isn't a item.")
end
 
local shopt = getPlayerShopItens(getPlayerGUIDByName(getCreatureName(cid)))
if not(shopt[item]) or (tonumber(shopt[item][1]) < tonumber(params[3])) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You haven't ".. params[3] .." " .. params[2] .."(s) in Private Shop.")
end
 
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You removed with successful ".. params[3] .. " ".. params[2] .."(s) from your Private Shop.")
doRemoveItemFromPlayerShop(getPlayerGUIDByName(getCreatureName(cid)), item, params[3])
doPlayerAddItem(cid, item, tonumber(params[3]))
elseif (param == "help") then
local msg = "Private Shop System Help: \n \n * add - é usado para adicionar um item à sua Private Shop. \n"
local msg = msg .."     Exemplo de Uso: " .. words .. " adicionar, item quantia, preço por unidade"
local msg = msg .."\n" .. words .. " add, chakra boots, 1, 60000\n"
local msg = msg .."\n * remove - é usado para remover um item do seu Private Shop. \n"
local msg = msg .."     Exemplo de Uso: " .. words .. " remover, item quantia"
local msg = msg .."\n" .. words .. " remove, chakra boots, 1\n"
local msg = msg .."\n * on - é usado para o seu ativo Private Shop\n"
local msg = msg .. "\n * list - exibe na tela uma janela contendo todos os itens que você tem em sua Private Shop."
doShowTextDialog(cid, 2160, msg)
   end
 
   return true
end

 

Simples, não pode. Já fiz assim para evitar algum bug, como comprar o mesmo item duas vezes...

-"Supra Omnes Lux Lucis"

- Acima de todos brilha a Luz -

5VGnDyBz.png

  • 1 month later...
Postado

 MaXwEllDeN cade o link do Private shop? oque eu tinha aqui deu erro e nao pega mais nao sei porque.

Conteúdos Tragos Por Mim ao Fórum:

Venda de Vocações [Modern Aac] •

• Comando !Saga 

• [Modern Aac] DragonBall 

• Esconder •

• Naruto 2018

• • •

• •

'NtoProject - Breve'

[Show OFF] Disponível

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo