Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2021-03-02, 22:29


K4n33







Wiek: 22
Na forum: 1982 dni
Posty: 11
Nick w MP: ZwyklyChlopak

Piwa: 4

Respekt: 50

Witam mam problem z kasynem mianowice nie wiem jaka jest element data na wygrane bety poniewaz mam tak lecz jak ktos wygra to daje caly hajs x2 ale nie tylko ten co postawil
c.lua

--Autorpkpk#7539 (Kuks)
--kuksssyt@gmail.com

local markers = {
    {1731.31, -1644.8820.23-1270},
    {1731.39, -1650.1520.23-1270},
    {1731.44, -1653.1820.24-1270},
    {1731.49, -1657.5520.24-1270},
    {1730.84, -1660.8020.24-1230},
    {1712.22, -1653.2520.22-190},
    {1712.18, -1650.8420.22-190},
    {1712.23, -1648.5320.22-190},
}

for iv in ipairs(markers) do
    local m createMarker(v[1], v[2], v[3], "corona"22552552550)
    setElementInterior(m18)
    setElementData(m"kasyno"true)
    setElementInterior(createObject(2640v[1], v[2], v[3]+0.900v[4]), 18)
end

local xguiGetScreenSize()
local pxpy = (x/1024), (y/768)

local edit guiCreateEdit(457*px400*py110*px30*py"Kwota"false)
guiSetVisible(editfalse)

addEventHandler("onClientMarkerHit"resourceRoot, function(plr)
    if plr ~= localPlayer then return end
    if not getElementData(source"kasyno") == true then return end
    if not isEventHandlerAdded("onClientRender"rootrenderthen
        addEventHandler("onClientRender"rootrender)
        showCursor(true)
        guiSetVisible(edittrue)
        triggerServerEvent("casino_balance"localPlayer)
    end
end)

int 0

local rt dxCreateRenderTarget(5001500true)

last_bets = {0000000000}

bety_red = {}
bety_black = {}
bety_green = {}

for 1do
    for 1do --czerwone bety
        local offset 80 * (i-1)
        local off2 = (k-1) * 560
        if off2+offset+int ~= 560 and off2+offset+int ~= (560*2) and off2+offset+int ~= (560*3) and off2+offset+int ~= (560*4) and off2+offset+int ~= (560*5) and off2+offset+int ~= (560*6then
            table.insert(bety_red, {off2+offset+inti})
        end
    end
    for 814 do --czarne bety
        local offset 80 * (i-8)
        local off2 = (k-1) * 560
        table.insert(bety_black, {off2+(offset+40+int), i})
    end
end

table.insert(bety_green, {560+int0})
table.insert(bety_green, {(560*2)+int0})
table.insert(bety_green, {(560*3)+int0})
table.insert(bety_green, {(560*4)+int0})
table.insert(bety_green, {(560*5)+int0})
table.insert(bety_green, {(560*6)+int0})

function removeHex(textdigits)
    assert (type (text) == "string""Bad argument 1 @ removeHex [String expected, got "..tostring(text).."]")
    assert (digits == nil or (type (digits) == "number" and digits 0), "Bad argument 2 @ removeHex [Number greater than zero expected, got "..tostring (digits).."]")
    return string.gsub (text"#"..(digits and string.rep("%x"digits) or "%x+"), "")
end

local colors_textures = {
    red dxCreateTexture("files/red.png""argb"false),
    green dxCreateTexture("files/green.png""argb"false),
    black dxCreateTexture("files/black.png""argb"false)
}

setElementData(localPlayer"bet"nil)


addEvent("kasyno_setBet1"true)
addEventHandler("kasyno_setBet1"root, function()
    players_red = {}
    players_green = {}
    players_black = {}
end)

addEvent("casino_addPlayer"true)
addEventHandler("casino_addPlayer"root, function(namekwotakolor)
    if kolor == 'red' then
        if not getElementData(source"bet"then
            setElementData(source"bet"'red')
            table.insert(players_red, {namekwota})
        end
    elseif kolor == 'green' then
        setElementData(source"bet"'green')
        table.insert(players_green, {namekwota})
    elseif kolor == 'black' then
        if not getElementData(source"bet"then
            setElementData(source"bet"'black')
            table.insert(players_black, {namekwota})
        end
    end
    --setElementData(source"bet"kolor)
end)

addEvent("casino_clearList"true)
addEventHandler("casino_clearList"root, function(namekwotakolor)
    if smgs then return end
    smgs true
    players_red = {}
    players_green = {}
    players_black = {}
end)

function sprawdz(ile)
    for iv in ipairs(bety_red) do
        if (v[1]-250) <= ile and (v[1]-210) >= ile then
            table.remove(last_bets1)
            table.insert(last_betsv[2])
            triggerServerEvent("money_casino"localPlayer'red')
            return
        end
    end
    
    for iv in ipairs(bety_black) do
        if (v[1]-250) <= ile and (v[1]-210) >= ile then
            table.remove(last_bets1)
            table.insert(last_betsv[2])
            triggerServerEvent("money_casino"localPlayer'black')
            return
        end
    end
    
    for iv in ipairs(bety_green) do
        if (v[1]-250) <= ile and (v[1]-210) >= ile then
            table.remove(last_bets1)
            table.insert(last_betsv[2])
            triggerServerEvent("money_casino"localPlayer'green')
            return
        end
    end
end

function krec()
    int interpolateBetween(000, -liczba00, (getTickCount()-tick)/5000"OutQuad")
    if int <= -liczba then
        smgs nil
        removeEventHandler("onClientRender"rootkrec)
        sprawdz(liczba)
        roluje nil
    end
end

function krecenie(rnd)
    if rnd then
        liczba rnd
        tick getTickCount()
        addEventHandler("onClientRender"rootkrec)
        roluje true
    end
end
addEvent("kasyno_krecenie"true)
addEventHandler("kasyno_krecenie"rootkrecenie)

timeToEnd 15

addEvent("odlicz_kasyno"true)
addEventHandler("odlicz_kasyno"root, function(ile)
    timeToEnd ile
end)

function render()
    dxDrawImage(262*px184*py500*px400*py"files/gui.png")
    dxDrawImage(287*px450*py130*px43*pycolors_textures.red)
    dxDrawImage(447*px450*py130*px43*pycolors_textures.green)
    dxDrawImage(607*px450*py130*px43*pycolors_textures.black)
    local balans getElementData(localPlayer,'player:b_money') or 0
    dxDrawText(przecinki(balans).." PLN"270*px190*py00tocolor(255255255), 0.6*px"default-black")
    if not roluje then
        dxDrawText("Nast?pne losowanie za: "..timeToEnd.."s"470*px230*py00tocolor(255255255), 0.6*px"default-black")
    else
        dxDrawText("Losowanie..."496*px230*py00tocolor(255255255), 0.6*px"default-black")
    end
    dxDrawText("1 - 7\nX2"287*px450*py417*px493*pytocolor(255255255), 1*px"default-bold""center""center")
    dxDrawText("0\nX14"447*px450*py577*px493*pytocolor(255255255), 1*px"default-bold""center""center")
    dxDrawText("8 - 14\nX2"607*px450*py737*px493*pytocolor(255255255), 1*px"default-bold""center""center")
    dxDrawText("Zak?ady: "..(#players_red), 336*px, 435*py, 0, 0, tocolor(255, 255, 255), 0.6*px, "default-black")
    dxDrawText("Zak?ady: "..(#players_green), 496*px, 435*py, 0, 0, tocolor(255, 255, 255), 0.6*px, "default-black")
    dxDrawText("Zak?ady: "..(#players_black), 656*px, 435*py, 0, 0, tocolor(255, 255, 255), 0.6*px, "default-black")
    dxSetRenderTarget(rttrue)
    for 1do
        for 1do
            local offset 80 * (i-1)
            local off2 = (k-1) * 560
            dxDrawRectangle(off2+offset+int040100tocolor(25500))
            --dxDrawText(ioff2+offset+int+153900tocolor(255255255), 1.5"default-bold")
        end
        for 814 do
            local offset 80 * (i-8)
            local off2 = (k-1) * 560
            dxDrawRectangle(off2+(offset+40+int), 040100tocolor(000))
            --dxDrawText(ioff2+(offset+40+int)+103900tocolor(255255255), 1.5"default-bold")
        end
    end
    dxDrawRectangle(560+int040100tocolor(02550))
    dxDrawRectangle((560*2)+int040100tocolor(02550))
    dxDrawRectangle((560*3)+int040100tocolor(02550))
    dxDrawRectangle((560*4)+int040100tocolor(02550))
    dxDrawRectangle((560*5)+int040100tocolor(02550))
    dxDrawRectangle((560*6)+int040100tocolor(02550))
    --[[dxDrawText(0560+int+153940100tocolor(255255255), 1.5"default-bold")
    dxDrawText(0, (560*2)+int+153940100tocolor(255255255), 1.5"default-bold")
    dxDrawText(0, (560*3)+int+153940100tocolor(255255255), 1.5"default-bold")
    dxDrawText(0, (560*4)+int+153940100tocolor(255255255), 1.5"default-bold")
    dxDrawText(0, (560*5)+int+153940100tocolor(255255255), 1.5"default-bold")
    dxDrawText(0, (560*6)+int+153940100tocolor(255255255), 1.5"default-bold")]]
    dxSetRenderTarget()
    dxDrawImage(263*px252*py498*px663*pyrt)
    dxDrawRectangle(511*px252*py3*px44*py)
    for iv in ipairs(players_red) do
        if 5 then
            local offset 20 * (i-1)
            dxDrawText(removeHex(v[1]).." "..przecinki(v[2]).." PLN"287*px, (497+offset)*py417*px, (580+offset)*pytocolor(255255255), 0.7*px"default-bold""center""top")
        end
    end
    for iv in ipairs(players_green) do
        if 5 then
            local offset 20 * (i-1)
            dxDrawText(removeHex(v[1]).." "..przecinki(v[2]).." PLN"532*px, (497+offset)*py497*px, (580+offset)*pytocolor(255255255), 0.7*px"default-bold""center""top")
        end
    end
    for iv in ipairs(players_black) do
        if 5 then
            local offset 20 * (i-1)
            dxDrawText(removeHex(v[1]).." "..przecinki(v[2]).." PLN"672*px, (497+offset)*py677*px, (580+offset)*pytocolor(255255255), 0.7*px"default-bold""center""top")
        end
    end
    for 110 do
        local offset 35 * (i-1)
        if last_bets[i] == 0 then
            dxDrawRectangle((343+offset)*px354*py24*px28*pytocolor(02550))
        elseif last_bets[i] == or last_bets[i] == or last_bets[i] == or last_bets[i] == or last_bets[i] == or last_bets[i] == or last_bets[i] == 7 then
            dxDrawRectangle((343+offset)*px354*py24*px28*pytocolor(25500))
        elseif last_bets[i] == or last_bets[i] == or last_bets[i] == 10 or last_bets[i] == 11 or last_bets[i] == 12 or last_bets[i] == 13 or last_bets[i] == 14 then
            dxDrawRectangle((343+offset)*px354*py24*px28*pytocolor(000))
        end
        dxDrawText(last_bets[i], (343+offset)*px354*py, (367+offset)*px382*pytocolor(255255255), 1*px"default-bold""center""center")
    end
end

addEventHandler("onClientClick"root, function(btnstate)
    if btn ~= "left" or state ~= "down" then return end
    if not isEventHandlerAdded("onClientRender"rootrenderthen return end
    if isMouseIn(730*px186*py30*px35*pythen
        removeEventHandler("onClientRender"rootrender)
        showCursor(false)
        guiSetVisible(editfalse)
    end
    
    --BETOWANIE:
    if isMouseIn(287*px450*py130*px43*pythen --red
        if roluje then
            outputChatBox("Poczekaj na koniec losowania"25500)
            return
        end
        if not getElementData(localPlayer"bet"then
            triggerServerEvent("addBet_casino"localPlayer'red'guiGetText(edit))
        end
    end
    
    if isMouseIn(447*px450*py130*px43*pythen --green
        if roluje then
            outputChatBox("Poczekaj na koniec losowania"25500)
            return
        end
        if getElementData(localPlayer"bet") ~= "green" then
            triggerServerEvent("addBet_casino"localPlayer'green'guiGetText(edit))
        end 
    end
    
    if isMouseIn(607*px450*py130*px43*pythen --black
        if roluje then
            outputChatBox("Poczekaj na koniec losowania"25500)
            return
        end
        if not getElementData(localPlayer"bet"then
            triggerServerEvent("addBet_casino"localPlayer'black'guiGetText(edit))
        end
    end
end)

function isEventHandlerAddedsEventNamepElementAttachedTofunc )
     if typesEventName ) == 'string' and isElementpElementAttachedTo ) and typefunc ) == 'function' then
          local aAttachedFunctions getEventHandlerssEventNamepElementAttachedTo )
          if typeaAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
               for iv in ipairsaAttachedFunctions ) do
                    if == func then
                     return true
                end
           end
      end
     end
     return false
end

function isMouseIn(xywidthheight)
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    
    return ( ( cx >= and cx <= width ) and ( cy >= and cy <= height ) )
end

function przecinki(amount) 
    local formatted amount 
    while true do   
      formattedstring.gsub(formatted"^(-?%d+)(%d%d%d)"'%1,%2') 
      if (k==0then 
        break 
      end 
    end 
    return formatted 
end


s.lua

--Autorpkpk#7539 (Kuks)
--kuksssyt@gmail.com

bets = {}
ile 15

setTimer(function()
    ile ile 1
    triggerClientEvent(root"odlicz_kasyno"rootile)
    if ile <= 0 then
        ile 20
        local rand math.random(10002900)
        triggerClientEvent(root"kasyno_krecenie"rootrand)
    end
end10000)

setTimer(function()
    triggerClientEvent(root'kasyno_setBet1'root)
end5001)

addEvent("addBet_casino"true)
addEventHandler("addBet_casino"root, function(kolorkasa)
    if getElementData(source"bet") and kolor ~= "green" then return end
    if getElementData(source"bet") == "green" and kolor == "green" then return end
    if not tonumber(kasathen
        outputChatBox("Podaj liczb?"source25500)
        return
    end
    if tonumber(kasa) < 1 then
        outputChatBox("Minimalny bet to 1,000,000 PLN"source25500)
        return
    end
    if tonumber(kasa) > 99999999999999999999 then
        outputChatBox("Maksymalny bet to 4,000,000,000 PLN"source25500)
        return
    end
    local sid getElementData(source"player:sid")
    if getElementData(source,'player:b_money') < tonumber(kasathen
        outputChatBox("Nie masz tyle pieni?dzy"source25500)
        return
    end
    --takePlayerMoney(sourcetonumber(kasa))
    table.insert(bets, {player sourcecolor kolormoney tonumber(kasa)})
    triggerClientEvent(root"casino_addPlayer"sourcegetPlayerName(source), kasakolor)
    local balans getElementData(source"player:b_money") or 0
    setElementData(source,'player:b_money',getElementData(source,'player:b_money') - tonumber(kasa))

end)

addEvent("money_casino"true)
addEventHandler("money_casino"root, function(kolor)
    if ile 16 then return end
    triggerClientEvent(root"casino_clearList"sourcegetPlayerName(source), kasakolor)
    for iv in ipairs(bets) do
        setElementData(v.player"bet"nil)
        if v.color == kolor then
            if kolor == "red" then
                --givePlayerMoney(v.playerv.money 2)
                local sid getElementData(v.player"player:sid")
                    setElementData(source,'player:b_money',getElementData(source,'player:b_money')*2)

            elseif kolor == "black" then
                --givePlayerMoney(v.playerv.money 2)
                local sid getElementData(v.player"player:sid")
                        setElementData(source,'player:b_money',getElementData(source,'player:b_money')*2)

            elseif kolor == "green" then
                --givePlayerMoney(v.playerv.money 14)
                local sid getElementData(v.player"player:sid")
                    setElementData(source,'player:b_money',getElementData(source,'player:b_money')*2)

            end
        end
    end
    bets = {}
    for iv in ipairs(getElementsByType("player")) do
        setElementData(v"bet"nil)
    end
end)

--[[setTimer(function()
    if ile <= 0 then
        ile 20
        local rand math.random(10002900)
        triggerClientEvent(root"kasyno_krecenie"rootrand)
    end
end10000)]]




Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2021-03-03, 08:46


xyzzzikk

.gg






Wiek: 18
Na forum: 2774 dni
Posty: 175
Nick w MP: aspyk

Piwa: 6499

Respekt: 30,5

masz na my?li, ?e nie daje kasy x2?

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2021-03-07, 19:44


K4n33







Wiek: 22
Na forum: 1982 dni
Posty: 11
Nick w MP: ZwyklyChlopak

Piwa: 4

Respekt: 50

NoToR, daje kase x2 ale cala przy sobie nie zbetowana

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2021-03-08, 22:20


vAnimo

Zielony w luła






Wiek: 19
Na forum: 2312 dni
Posty: 165
Nick w MP: vAnimo

Piwa: 882

Respekt: 70

Kod:

elseif kolor == "green" then
--givePlayerMoney(v.player, v.money * 14)
local sid = getElementData(v.player, "player:sid") setElementData(source,'player:b_money',getElementData(source,'player:b_money')*2)
end
tu masz b??d mno?ysz pieni?dze kogo?, ci??ko popatrzy? na kod?

u?yj
Kod:

setElementData(source,'player:b_money',getElementData(source,'player:b_money')+(v.money*2))

licze na :piwo: :piwo: :piwo:

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2021-03-12, 17:03


K4n33







Wiek: 22
Na forum: 1982 dni
Posty: 11
Nick w MP: ZwyklyChlopak

Piwa: 4

Respekt: 50

vAnimo, nie dzia?a

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2021-03-12, 20:35


vAnimo

Zielony w luła






Wiek: 19
Na forum: 2312 dni
Posty: 165
Nick w MP: vAnimo

Piwa: 882

Respekt: 70

Kod:

setElementData(source,'player:b_money',getElementData(source,'player:b_money')+tonumber(v.money*2))


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2021-03-14, 20:12


K4n33







Wiek: 22
Na forum: 1982 dni
Posty: 11
Nick w MP: ZwyklyChlopak

Piwa: 4

Respekt: 50

Zamykam wystarczylo z source zmienic na v.player

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Tagi: kasynko
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » kasynko Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku