• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help with Cassino!!

tuppan

New Member
Joined
Jun 27, 2008
Messages
43
Reaction score
2
what is worng with this script?


PHP:
function onUse(cid, item, frompos, item2, topos)

 pos_moeda = {x=154, y=44, z=8, stackpos= 1} -- posiçao de onde a moeda tenque estar
 pos_moeda2 = {x= 154, y= 44, z= 8, stackpos = 2} -- posiçao de onde vai apareçer os 40k
 pos1 = {x= 154, y= 43, z= 8, stackpos = 1} -- posiçao 1 das frutas
 pos2 = {x= 155, y= 43, z= 8, stackpos = 1} -- posiçao 2 das frutas
 pos3 = {x= 156, y= 43, z= 8, stackpos = 1} -- posiçao 3 das frutas


 coin=getThingfromPos(pos_moeda) -- nao mecha
 fruta1=getThingfromPos(pos1) -- nao mecha
 fruta2=getThingfromPos(pos2) -- nao mecha
 fruta3=getThingfromPos(pos3) -- nao mecha

if coin.itemid == 2160 then
doRemoveItem(coin.uid,1)
if fruta1.itemid ~= 0 then
doRemoveItem(fruta1.uid,1)
end
if fruta2.itemid ~= 0 then
doRemoveItem(fruta2.uid,1)
end
if fruta3.itemid ~= 0 then
doRemoveItem(fruta3.uid,1)
end
x1 = math.random(1,3)
x2 = math.random(1,3)
x3 = math.random(1,3)
if x1 == 1 then
doCreateItem(2674,1,pos1)
elseif x1 == 2 then
doCreateItem(2679,1,pos1)
elseif x1 == 3 then
doCreateItem(2680,1,pos1)
end
if x2 == 1 then
doCreateItem(2674,1,pos2)
elseif x2 == 2 then
doCreateItem(2679,1,pos2)
elseif x2 == 3 then
doCreateItem(2680,1,pos2)
end
if x3 == 1 then
doCreateItem(2674,1,pos3)
elseif x3 == 2 then
doCreateItem(2679,1,pos3)
elseif x3 == 3 then
doCreateItem(2680,1,pos3)
end
doSendMagicEffect(pos1,31)
doSendMagicEffect(pos2,31)
doSendMagicEffect(pos3,31) 

if fruta1.itemid == 2674 then
doSendAnimatedText(getPlayerPosition(cid),"Ganhou" ,5)
doCreateItem(2160, 4, pos_moeda)
doPlayerSendTextMessage(cid,22,"Parabens, você ganhou 40k")
doSendMagicEffect(getPlayerPosition(cid),13)
doSendMagicEffect(pos_moeda2,13)
else
doSendAnimatedText(getPlayerPosition(cid),"Perdeu" ,180)
doSendMagicEffect(getPlayerPosition(cid),3)
doPlayerSendTextMessage(cid,22,"Que azar, você perdeu")
end
else
doPlayerSendCancel(cid,"Coloque 10k no coal basin a esquerda.")
end
return TRUE
end

]some part are in portuguese but is understandable :p

some explanations, i have 3 sqm 1 lever when i use it,
each sqm will have one random fruit, but i dont
know how make it check if it have all 3 fruits
with the same id or diferent
if someone can help me! i will become glad :)
and i will give repp+++


sorry for not a really good english, but we try. :peace: :$
 
Back
Top