Jump to content

Slot Machine Casino


Dolinho

Recommended Posts

Can anyone help me to tell me how I can create a slot system for casino?

I have a script with me, but it does not work well.

what should I use?

:oops:

i tried create this but it has a lot of bugs:

local screenWidth, screenHeight = guiGetScreenSize() 
windowWidth, windowHeight = 200, 200 
windowX, windowY = (screenWidth / 2) - (windowWidth / 2), (screenHeight / 2) - (windowHeight / 2) 
lostmachine = guiCreateWindow(windowX, windowY, windowWidth, windowHeight, "Guia do Fazendeiro", false) 
guiSetAlpha(lostmachine, 0.2) 
guiSetVisible(lostmachine, false) 
  
Comprar = guiCreateButton(1,80,100,31,"Comprar",false,lostmachine) 
--stop = guiCreateButton(1,120,100,31,"Parar",false,lostmachine) 
  
  
  
  
  
  
addEventHandler ("onClientGUIClick", getRootElement(),  
function() 
if (source == Comprar) then 
addEventHandler("onClientRender", root, novasweapon) 
  
  
setTimer(function() 
stop() 
end,2000,1) 
end 
end  
) 
  
function stop() 
removeEventHandler("onClientRender", root, novasweapon) 
addEventHandler("onClientRender", root, novasweapons) 
end 
  
  
  
  
  
local text1 = {  
{"images/apple"}, 
{"images/grape_01.png"}, 
{"images/orange.png"}, 
{"images/strawberry_01.png"}, 
} 
  
  
  
local text2 = {  
{"images/apple"}, 
{"images/grape_01.png"}, 
{"images/orange.png"}, 
{"images/strawberry_01.png"}, 
} 
  
  
local text3 = {  
{"images/apple"}, 
{"images/grape_01.png"}, 
{"images/orange.png"}, 
{"images/strawberry_01.png"}, 
} 
  
  
  
function novasweapon( ) 
local x,y = guiGetScreenSize(); 
  
texto = unpack(text1[math.random(#text1)]) 
setElementData(localPlayer,"Slotmachineon", texto) 
dxDrawImage(( x - 1000)+39, (y/-25.0)+39,120,120,texto) 
  
  
texto2 = unpack(text2[math.random(#text2)]) 
setElementData(localPlayer,"Slotmachineon2", texto2) 
dxDrawImage(( x - 870)+39, (y/-25.0)+39,120,120,texto2) 
  
texto3 = unpack(text3[math.random(#text3)]) 
setElementData(localPlayer,"Slotmachineon3", texto3) 
dxDrawImage(( x - 740)+39, (y/-25.0)+39,120,120,texto3) 
end 
  
  
function novasweapons( ) 
local x,y = guiGetScreenSize(); 
tes1 = getElementData(localPlayer,"Slotmachineon") 
dxDrawImage(( x - 1000)+39, (y/-25.0)+39,120,120,tes1) 
tes2 = getElementData(localPlayer,"Slotmachineon2") 
dxDrawImage(( x - 870)+39, (y/-25.0)+39,120,120,tes2) 
tes3 = getElementData(localPlayer,"Slotmachineon3") 
dxDrawImage(( x - 740)+39, (y/-25.0)+39,120,120,tes3 or "images/strawberry_01.png" ) 
end 
  
  
  
function PanelShow (hitElement) 
getVisible = guiGetVisible (lostmachine) 
if (getVisible == true) then 
guiSetVisible (lostmachine, false) 
showCursor (false) 
elseif (getVisible == false) then 
showCursor (true) 
guiSetVisible (lostmachine, true) 
end 
end 
bindKey("n","down",PanelShow) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...