Ir para conteúdo
  • 0

Bug Cassino


brendoonh

Pergunta

Boa noite comunidade xTibiana...

 

Estou com um problema em um sistema de cassino...

Quando o cara coloca o dinheiro la e puxa a alavanca e aparece a mensagem que ele ganhou, o dinheiro que teria que aparecer em dobro no local , some.. Peguei esse sistema de outro server, mais no meu não funciona saberiam me explicar o por quê desse bug? Pois n dá nenhum erro distro.

 

E se tiver como arrumar, se souber por gentileza.. Eu ficaria mt grato!!!

 

REP+ pra quem conseguir me ajudar ou tentar!! Valeu

 

@, esqueci de por o script icon2.gifhuh.png

 

 

--[ Script written and published by Orzeleagle/Collocorpus ]--

function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
chance = math.random(1, 100), --losowanie
win_chance = 45, --chance to win a percentage of
multi = 2, --how many times you win more (eg 2 or 1cc bet, win and get 2cc)
items = {2160, 2152}, --id items whom you can play
min_count = 1, --Minimum Number of items (1 = least 1cc)
max_count = 100 --maximum number of objects (10 = maximum 10cc)
}
local positions = {
[7010] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7011] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7012] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7013] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7014] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7015] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7016] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7017] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7018] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7019] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}
}
local itemplay = getThingfromPos(positions[item.actionid])
local storage, exh = 56500, 5 --storage id, time exh
if (item.itemid == 1945) then
doTransformItem(item.uid, 1946)
if (getPlayerStorageValue(cid, storage)-os.time(t) < 1) then
doPlayerSetStorageValue(cid, storage, os.time(t)+exh)
if (isInArray(config.items, itemplay.itemid)) then
if (itemplay.type >= config.min_count) and (itemplay.type <= config.max_count) then
if (config.chance <= config.win_chance) then
doRemoveItem(itemplay.uid, itemplay.type)
doCreateItem(itemplay.itemid, (itemplay.type*config.multi), positions[item.actionid])
doSendMagicEffect(positions[item.actionid], 31)
doSendMagicEffect(getCreaturePosition(cid), 27)
doPlayerSendCancel(cid, "Parabéns, você acaba de ganhar em nosso cassino!")
doSendAnimatedText(getCreaturePosition(cid), "~!Winner!~", TEXTCOLOR_YELLOW)
return true
else
doRemoveItem(itemplay.uid, itemplay.type)
doSendMagicEffect(positions[item.actionid], 31)
doSendMagicEffect(getCreaturePosition(cid), 13)
doPlayerSendCancel(cid, "É o seu dia de azar! você perdeu.")
doSendAnimatedText(getCreaturePosition(cid), "~!Loser!~", TEXTCOLOR_LIGHTBLUE)
return true
end
else
doPlayerSendCancel(cid, "You can play only with amount from ".. config.min_count .." to ".. config.max_count ..".")
doSendMagicEffect(fromPosition, 2)
return true
end
else
doPlayerSendCancel(cid, "You cannot play with this item.")
doSendMagicEffect(fromPosition, 2)
return true
end
else
doPlayerSendCancel(cid, "You must wait another ".. getPlayerStorageValue(cid, storage)-os.time(t) .." seconds.")
doSendMagicEffect(fromPosition, 2)
return true
end
else
doTransformItem(item.uid, 1945)
doSendMagicEffect(fromPosition, 2)
return true
end
end

 

Editado por brendoonh
Link para o comentário
Compartilhar em outros sites

9 respostass a esta questão

Posts Recomendados

  • 0

Testei e o code funciona perfeitamente.

 

Verifica se a tag esta correta:

 

<action actionid="7010-7019" event="script" value="nomedoscript.lua" />

 

E tambem a posiçao do dinheiro eh relativa a alavanca entao ele vai ficar 1 sqm pra esquerda e o id da alavanca tem que ser 1945

Link para o comentário
Compartilhar em outros sites

  • 0

@Mkalo

 

Sim, no server que eu testei(peguei) funfa perfeitamente, eu copiei e colei o cassino do cara no mapa tambem na mesma posição tudo certinho...

Tag certa, tudo certinho nenhum erro.

 

 

@@valakas

 

O dinheiro que ele deixo encima do sqm, some. Ele ganhando ou não...

Link para o comentário
Compartilhar em outros sites

  • 0

Não existe isso, se funciona pra mim tem que funcionar pra voce ou dar erro.

 

Como eu disse o motivo eh que o codigo provavelmente nem esta sendo executado, verifique o actionid das alavancas se sao de 7010 a 7019 e verifique se o id delas sao 1945.

 

Qual sua versão do TFS?

 

Editado por MatheusMkalo
Link para o comentário
Compartilhar em outros sites

  • 0

Hmm tenta retirar esse tile e essa mesa do lugar onde fica o dinheiro, se não funcionar usa isso:

 

 


--[ Script written and published by Orzeleagle/Collocorpus ]--
function addTileItem(itemid, amount, pos)
    if amount%100 > 0 then
        local iuid = doCreateItemEx(itemid, amount%100)
        doTileAddItemEx(pos, iuid)
    end
    for i = 1, math.floor(amount/100) do
        iuid = doCreateItemEx(itemid, 100)
        doTileAddItemEx(pos, iuid)
    end
    return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
chance = math.random(1, 100), --losowanie
win_chance = 80, --chance to win a percentage of
multi = 3, --how many times you win more (eg 2 or 1cc bet, win and get 2cc)
items = {2160, 2152}, --id items whom you can play
min_count = 1, --Minimum Number of items (1 = least 1cc)
max_count = 100 --maximum number of objects (10 = maximum 10cc)
}
local positions = {
[7010] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7011] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7012] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7013] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7014] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7015] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7016] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7017] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
                [7018] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},
[7019] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}
}
local itemplay = getThingfromPos(positions[item.actionid])
local storage, exh = 56500, 5 --storage id, time exh
if (item.itemid == 1945) then
doTransformItem(item.uid, 1946)
if (getPlayerStorageValue(cid, storage)-os.time(t) < 1) then
doPlayerSetStorageValue(cid, storage, os.time(t)+exh)
if (isInArray(config.items, itemplay.itemid)) then
if (itemplay.type >= config.min_count) and (itemplay.type <= config.max_count) then
if (config.chance <= config.win_chance) then
doRemoveItem(itemplay.uid, itemplay.type)
positions[item.actionid].stackpos = nil
addTileItem(itemplay.itemid, (itemplay.type*config.multi), positions[item.actionid])
doSendMagicEffect(positions[item.actionid], 31)
doSendMagicEffect(getCreaturePosition(cid), 27)
doPlayerSendCancel(cid, "Parabéns, você acaba de ganhar em nosso cassino!")
doSendAnimatedText(getCreaturePosition(cid), "~!Winner!~", TEXTCOLOR_YELLOW)
return true
else
doRemoveItem(itemplay.uid, itemplay.type)
doSendMagicEffect(positions[item.actionid], 31)
doSendMagicEffect(getCreaturePosition(cid), 13)
doPlayerSendCancel(cid, "É o seu dia de azar! você perdeu.")
doSendAnimatedText(getCreaturePosition(cid), "~!Loser!~", TEXTCOLOR_LIGHTBLUE)
return true
end
else
doPlayerSendCancel(cid, "You can play only with amount from ".. config.min_count .." to ".. config.max_count ..".")
doSendMagicEffect(fromPosition, 2)
return true
end
else
doPlayerSendCancel(cid, "You cannot play with this item.")
doSendMagicEffect(fromPosition, 2)
return true
end
else
doPlayerSendCancel(cid, "You must wait another ".. getPlayerStorageValue(cid, storage)-os.time(t) .." seconds.")
doSendMagicEffect(fromPosition, 2)
return true
end
else
doTransformItem(item.uid, 1945)
doSendMagicEffect(fromPosition, 2)
return true
end
end

Se não funcionar o jeito vai ser adicionar o dinheiro direto na backpack do player.

Editado por MatheusMkalo
Link para o comentário
Compartilhar em outros sites

  • 0

Primeiro teste: Remover tile e a mesa::: Agora o dinheiro nao some quando ganha, os 1kk continua em vez de 2kk

 

Segundo teste: Trocando a script::: Ficou da mesma forma, com a mesa e o tile o dinheiro some, sem a mesa e o tile, quando ganha nao aparece o premio em dobro, fica somente o que apostamos..


up

Link para o comentário
Compartilhar em outros sites

  • 1


--[ Script written and published by Orzeleagle/Collocorpus ]--

function addPlayerItem(itemid, amount, cid)

if amount%100 > 0 then

local iuid = doCreateItemEx(itemid, amount%100)

doPlayerAddItemEx(cid, iuid)

end

for i = 1, math.floor(amount/100) do

iuid = doCreateItemEx(itemid, 100)

doPlayerAddItemEx(cid, iuid)

end

return true

end

function onUse(cid, item, fromPosition, itemEx, toPosition)

local config = {

chance = math.random(1, 100), --losowanie

win_chance = 80, --chance to win a percentage of

multi = 3, --how many times you win more (eg 2 or 1cc bet, win and get 2cc)

items = {2160, 2152}, --id items whom you can play

min_count = 1, --Minimum Number of items (1 = least 1cc)

max_count = 100 --maximum number of objects (10 = maximum 10cc)

}

local positions = {

[7010] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},

[7011] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},

[7012] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},

[7013] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},

[7014] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},

[7015] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},

[7016] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},

[7017] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},

[7018] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},

[7019] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}

}

local itemplay = getThingfromPos(positions[item.actionid])

local storage, exh = 56500, 5 --storage id, time exh

if (item.itemid == 1945) then

doTransformItem(item.uid, 1946)

if (getPlayerStorageValue(cid, storage)-os.time(t) < 1) then

doPlayerSetStorageValue(cid, storage, os.time(t)+exh)

if (isInArray(config.items, itemplay.itemid)) then

if (itemplay.type >= config.min_count) and (itemplay.type <= config.max_count) then

if (config.chance <= config.win_chance) then

doRemoveItem(itemplay.uid, itemplay.type)

positions[item.actionid].stackpos = nil

addPlayerItem(itemplay.itemid, (itemplay.type*config.multi), cid)

doSendMagicEffect(positions[item.actionid], 31)

doSendMagicEffect(getCreaturePosition(cid), 27)

doPlayerSendCancel(cid, "Parabéns, você acaba de ganhar em nosso cassino!")

doSendAnimatedText(getCreaturePosition(cid), "~!Winner!~", TEXTCOLOR_YELLOW)

return true

else

doRemoveItem(itemplay.uid, itemplay.type)

doSendMagicEffect(positions[item.actionid], 31)

doSendMagicEffect(getCreaturePosition(cid), 13)

doPlayerSendCancel(cid, "É o seu dia de azar! você perdeu.")

doSendAnimatedText(getCreaturePosition(cid), "~!Loser!~", TEXTCOLOR_LIGHTBLUE)

return true

end

else

doPlayerSendCancel(cid, "You can play only with amount from ".. config.min_count .." to ".. config.max_count ..".")

doSendMagicEffect(fromPosition, 2)

return true

end

else

doPlayerSendCancel(cid, "You cannot play with this item.")

doSendMagicEffect(fromPosition, 2)

return true

end

else

doPlayerSendCancel(cid, "You must wait another ".. getPlayerStorageValue(cid, storage)-os.time(t) .." seconds.")

doSendMagicEffect(fromPosition, 2)

return true

end

else

doTransformItem(item.uid, 1945)

doSendMagicEffect(fromPosition, 2)

return true

end

end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0
Em 02/12/2015 at 19:18, MatheusGlad disse:
--[ Script written and published by Orzeleagle/Collocorpus ]--function addPlayerItem(itemid, amount, cid)    if amount%100 > 0 then        local iuid = doCreateItemEx(itemid, amount%100)        doPlayerAddItemEx(cid, iuid)    end    for i = 1, math.floor(amount/100) do        iuid = doCreateItemEx(itemid, 100)        doPlayerAddItemEx(cid, iuid)    end    return trueendfunction onUse(cid, item, fromPosition, itemEx, toPosition)local config = {chance = math.random(1, 100), --losowaniewin_chance = 80, --chance to win a percentage ofmulti = 3, --how many times you win more (eg 2 or 1cc bet, win and get 2cc)items = {2160, 2152}, --id items whom you can playmin_count = 1, --Minimum Number of items (1 = least 1cc)max_count = 100 --maximum number of objects (10 = maximum 10cc)}local positions = {[7010] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},[7011] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},[7012] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},[7013] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},[7014] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},[7015] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},[7016] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},[7017] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},                [7018] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255},[7019] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}}local itemplay = getThingfromPos(positions[item.actionid])local storage, exh = 56500, 5 --storage id, time exhif (item.itemid == 1945) thendoTransformItem(item.uid, 1946)if (getPlayerStorageValue(cid, storage)-os.time(t) < 1) thendoPlayerSetStorageValue(cid, storage, os.time(t)+exh)if (isInArray(config.items, itemplay.itemid)) thenif (itemplay.type >= config.min_count) and (itemplay.type <= config.max_count) thenif (config.chance <= config.win_chance) thendoRemoveItem(itemplay.uid, itemplay.type)positions[item.actionid].stackpos = niladdPlayerItem(itemplay.itemid, (itemplay.type*config.multi), cid)doSendMagicEffect(positions[item.actionid], 31)doSendMagicEffect(getCreaturePosition(cid), 27)doPlayerSendCancel(cid, "Parabéns, você acaba de ganhar em nosso cassino!")doSendAnimatedText(getCreaturePosition(cid), "~!Winner!~", TEXTCOLOR_YELLOW)return trueelsedoRemoveItem(itemplay.uid, itemplay.type)doSendMagicEffect(positions[item.actionid], 31)doSendMagicEffect(getCreaturePosition(cid), 13)doPlayerSendCancel(cid, "É o seu dia de azar! você perdeu.")doSendAnimatedText(getCreaturePosition(cid), "~!Loser!~", TEXTCOLOR_LIGHTBLUE)return trueendelsedoPlayerSendCancel(cid, "You can play only with amount from ".. config.min_count .." to ".. config.max_count ..".")doSendMagicEffect(fromPosition, 2)return trueendelsedoPlayerSendCancel(cid, "You cannot play with this item.")doSendMagicEffect(fromPosition, 2)return trueendelsedoPlayerSendCancel(cid, "You must wait another ".. getPlayerStorageValue(cid, storage)-os.time(t) .." seconds.")doSendMagicEffect(fromPosition, 2)return trueendelsedoTransformItem(item.uid, 1945)doSendMagicEffect(fromPosition, 2)return trueendend

Funfou.. valeu!

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...