Wysłany: 2018-09-26, 21:12
warzit
Wiek: 32 Na forum: 3319 dni Posty: 71
Nick w MP: Lorson
Piwa : 1
Witam, mam problem poniewa? maszyny znajdowa?y si? w deminsionie a ja mam interior w interior 12 i zmieni?em tak i cos nie dziala, KASYNO JEST Z NP
KOD:
Kod: --[[
Autor: Malentas
]]
local maszyna = false
local komulowanie = false
local stawka = 100
local sx, sy = guiGetScreenSize()
local font = dxCreateFont("cz.ttf", 12)
local tekst = ""
function scale_x(value)
local result = (value / 1440) * sx
return result
end
function scale_y(value)
local result = (value / 900) * sy
return result
end
local maszyny = {
{1134.97, -4.36, 1000.68},
{1290.87, -1116.65, 53.51},
{1292.87, -1116.65, 53.51},
{1288.87, -1120.12, 53.51},
{1290.87, -1120.12, 53.51},
{1292.87, -1120.12, 53.51},
{1302.13, -1115.85, 53.51},
{1302.13, -1118.50, 53.52},
{1302.13, -1121.28, 53.51},
}
function hitmaszyna(gracz)
if gracz ~= localPlayer then return end
addEventHandler("onClientRender", root, maszynagui)
showCursor(true)
maszyna = true
end
for i,v in ipairs(maszyny) do
local marker = createMarker(v[1], v[2], v[3]-.95, "cylinder", 1, 0, 255, 0)
setElementInterior(marker, 12)
addEventHandler("onClientMarkerHit", marker, hitmaszyna)
end
local losy = { }
local width = scale_x(619)
local height = scale_y(182)
local maxRender = dxCreateRenderTarget(width, height, true)
function maszynagui()
dxDrawImage(scale_x(399), scale_y(256), scale_x(643), scale_y(388), ":np-gui/grafiki/tlo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
shadowText("Maszyna losuj?…ca", scale_x(400), scale_y(256), scale_x(1042), scale_y(309), tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
dxDrawRectangle(scale_x(413), scale_y(326), scale_x(619), scale_y(182), tocolor(0, 0, 0, 100), false)
shadowText("Stawka: "..stawka.." PLN", scale_x(874), scale_y(524), scale_x(1032), scale_y(577), tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
dxDrawImage(scale_x(882), scale_y(587), scale_x(140), scale_y(43), ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
shadowText("Stawka x2", scale_x(880), scale_y(586), scale_x(1022), scale_y(630), tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
dxDrawImage(scale_x(440), scale_y(549), scale_x(182), scale_y(57), ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
shadowText("Rozpocznij losowanie", scale_x(439), scale_y(548), scale_x(622), scale_y(606), tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
dxDrawImage(scale_x(1013), scale_y(264), scale_x(16), scale_y(16), ":guieditor/images/cross.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText(tekst, scale_x(413), scale_y(507), scale_x(1032), scale_y(544), tocolor(255, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
if komulowanie == true then
dxSetRenderTarget(maxRender, true)
for i, v in ipairs(losy) do
local dodatekX = (scale_x(82.5))*(i-1)
local move = interpolateBetween(scale_x(1100)-dodatekX, 0, 0, scale_x(-500)-dodatekX, 0, 0, (getTickCount() - czas)/time, "OutBack")
if v[1] == "lose" then
grafika = "lose"
elseif v[1] == 2 then
grafika = "x2"
elseif v[1] == 3 then
grafika = "x3"
elseif v[1] == 4 then
grafika = "x4"
elseif v[1] == 10 then
grafika = "x10"
end
dxDrawRectangle(scale_x(1000+adds)-dodatekX+move, scale_y(10), scale_x(162), scale_y(162), tocolor(0, 0, 0, 100), false)
dxDrawImage(scale_x(1000+adds)-dodatekX+move, scale_y(10), scale_x(162), scale_y(162), "img/"..grafika..".png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end
dxSetRenderTarget(false)
dxDrawImage(scale_x(413), scale_y(326), width, height, maxRender)
dxDrawLine(scale_x(722), scale_y(326), scale_x(722), scale_y(508), tocolor(0, 255, 0, 255), 2, false)
end
end
addEventHandler("onClientClick", root, function(btn, state)
if btn == "left" and state == "down" then
if mysz(scale_x(440), scale_y(549), scale_x(182), scale_y(57)) and maszyna == true then
if leci == true then exports["np-notyfikacje"]:noti("Aktualnie trwa losowanie, czekaj.", "error") return end
if getElementData(localPlayer, "pieniadze") < stawka then exports["np-notyfikacje"]:noti("Nie sta?‡ ci?™ aby postawi?‡ tak?… sum?™ pieni?™dzy.", "error") return end
setElementData(localPlayer, "pieniadze", getElementData(localPlayer, "pieniadze")-stawka)
losy = { }
adds = math.random(1, 120)
time = math.random(3600, 4600)
komulowanie = true
leci = true
czas = getTickCount( )
for i = 1, math.random(10,20) do
local los = math.random(1, 100)
if los >= 1 and los <= 84 then
jaki = "lose"
elseif los >= 85 and los <= 90 then
jaki = 2
elseif los >= 91 and los <= 93 then
jaki = 3
elseif los >= 94 and los <= 98 then
jaki = 4
elseif los >= 99 and los <= 100 then
jaki = 10
end
table.insert(losy, {jaki})
end
setTimer(function()
for i, v in ipairs(losy) do
if i == 3 then
leci = false
if v[1] ~= "lose" then
setElementData(localPlayer, "pieniadze", getElementData(localPlayer, "pieniadze")+stawka*(v[1]))
tekst = "Brawo, wygrywasz "..stawka*(v[1]).." PLN"
setTimer(function()
tekst = ""
end, 3000, 1)
end
end
end
end, time, 1)
elseif mysz(scale_x(882), scale_y(587), scale_x(140), scale_y(43)) and maszyna == true then
if leci == true then exports["np-notyfikacje"]:noti("Nie moĹĽesz zmieni?‡ stawki gdy trwa losowanie", "error") return end
if stawka == 25600 then
stawka = 100
else
stawka = stawka*2
end
elseif mysz(scale_x(1013), scale_y(264), scale_x(16), scale_y(16)) and maszyna == true then
if leci == true then exports["np-notyfikacje"]:noti("Nie moĹĽesz wy?‚?…czy?‡ panelu podczas losowania!", "error") return end
removeEventHandler("onClientRender", root, maszynagui)
showCursor(false)
maszyna = false
komulowanie = false
losy = { }
end
end
end)
--opcje
function shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0),size,font,xx,yy,x1,x2,x3,x4,x5)
dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
end
function mysz(psx,psy,pssx,pssy,abx,aby)
if not isCursorShowing() then return end
cx,cy=getCursorPosition()
cx,cy=cx*sx,cy*sy
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end
Wysłany: 2018-09-26, 21:41
_jvneczek
Wiek: 22 Na forum: 4326 dni Posty: 1513
Nick w MP: _jvneczek
Piwa : 3949
S? jakie? b??dy w db3?
Podpis
Support Team: 04.10.2020 - 01.09.2020
Test Moderator: 03.05.2021 - 01.09.2021
Moderator: 01.09.2021 - 23.10.2021
Wysłany: 2018-09-27, 09:55
warzit
Wiek: 32 Na forum: 3319 dni Posty: 71
Nick w MP: Lorson
Piwa : 1
Nie
Podpis
[url=https://zapodaj.net/fde922c932b9a.png.html[/img:0][/url]
Wysłany: 2018-09-27, 18:03
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Sprawd?: --[[
Autor : Malentas
]]
local maszyna = false
local komulowanie = false
local stawka = 100
local sx , sy = guiGetScreenSize ()
local font = dxCreateFont ( "cz.ttf" , 12 )
local tekst = ""
function scale_x ( value )
local result = ( value / 1440 ) * sx
return result
end
function scale_y ( value )
local result = ( value / 900 ) * sy
return result
end
local maszyny = {
{ 1134.97 , - 4.36 , 1000.68 },
{ 1290.87 , - 1116.65 , 53.51 },
{ 1292.87 , - 1116.65 , 53.51 },
{ 1288.87 , - 1120.12 , 53.51 },
{ 1290.87 , - 1120.12 , 53.51 },
{ 1292.87 , - 1120.12 , 53.51 },
{ 1302.13 , - 1115.85 , 53.51 },
{ 1302.13 , - 1118.50 , 53.52 },
{ 1302.13 , - 1121.28 , 53.51 },
}
function hitmaszyna ( gracz )
if gracz ~= localPlayer then return end
addEventHandler ( "onClientRender" , root , maszynagui )
showCursor ( true )
maszyna = true
end
for i , v in ipairs ( maszyny ) do
local marker = createMarker ( v [ 1 ], v [ 2 ], v [ 3 ]- 0.95 , "cylinder" , 1 , 0 , 255 , 0 )
setElementInterior ( marker , 12 )
addEventHandler ( "onClientMarkerHit" , marker , hitmaszyna )
end
local losy = { }
local width = scale_x ( 619 )
local height = scale_y ( 182 )
local maxRender = dxCreateRenderTarget ( width , height , true )
function maszynagui ()
dxDrawImage ( scale_x ( 399 ), scale_y ( 256 ), scale_x ( 643 ), scale_y ( 388 ), ":np-gui/grafiki/tlo.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
shadowText ( "Maszyna losuj?…ca" , scale_x ( 400 ), scale_y ( 256 ), scale_x ( 1042 ), scale_y ( 309 ), tocolor ( 255 , 255 , 255 , 255 ), 1.00 , font , "center" , "center" , false , false , false , false , false )
dxDrawRectangle ( scale_x ( 413 ), scale_y ( 326 ), scale_x ( 619 ), scale_y ( 182 ), tocolor ( 0 , 0 , 0 , 100 ), false )
shadowText ( "Stawka: " .. stawka .. " PLN" , scale_x ( 874 ), scale_y ( 524 ), scale_x ( 1032 ), scale_y ( 577 ), tocolor ( 255 , 255 , 255 , 255 ), 1.00 , font , "center" , "center" , false , false , false , false , false )
dxDrawImage ( scale_x ( 882 ), scale_y ( 587 ), scale_x ( 140 ), scale_y ( 43 ), ":np-gui/grafiki/button_off.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
shadowText ( "Stawka x2" , scale_x ( 880 ), scale_y ( 586 ), scale_x ( 1022 ), scale_y ( 630 ), tocolor ( 255 , 255 , 255 , 255 ), 1.00 , font , "center" , "center" , false , false , false , false , false )
dxDrawImage ( scale_x ( 440 ), scale_y ( 549 ), scale_x ( 182 ), scale_y ( 57 ), ":np-gui/grafiki/button_off.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
shadowText ( "Rozpocznij losowanie" , scale_x ( 439 ), scale_y ( 548 ), scale_x ( 622 ), scale_y ( 606 ), tocolor ( 255 , 255 , 255 , 255 ), 1.00 , font , "center" , "center" , false , false , false , false , false )
dxDrawImage ( scale_x ( 1013 ), scale_y ( 264 ), scale_x ( 16 ), scale_y ( 16 ), ":guieditor/images/cross.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( tekst , scale_x ( 413 ), scale_y ( 507 ), scale_x ( 1032 ), scale_y ( 544 ), tocolor ( 255 , 0 , 0 , 255 ), 1.00 , "default-bold" , "center" , "center" , false , false , false , false , false )
if komulowanie == true then
dxSetRenderTarget ( maxRender , true )
for i , v in ipairs ( losy ) do
local dodatekX = ( scale_x ( 82.5 ))*( i - 1 )
local move = interpolateBetween ( scale_x ( 1100 )- dodatekX , 0 , 0 , scale_x (- 500 )- dodatekX , 0 , 0 , ( getTickCount () - czas )/ time , "OutBack" )
if v [ 1 ] == "lose" then
grafika = "lose"
elseif v [ 1 ] == 2 then
grafika = "x2"
elseif v [ 1 ] == 3 then
grafika = "x3"
elseif v [ 1 ] == 4 then
grafika = "x4"
elseif v [ 1 ] == 10 then
grafika = "x10"
end
dxDrawRectangle ( scale_x ( 1000 + adds )- dodatekX + move , scale_y ( 10 ), scale_x ( 162 ), scale_y ( 162 ), tocolor ( 0 , 0 , 0 , 100 ), false )
dxDrawImage ( scale_x ( 1000 + adds )- dodatekX + move , scale_y ( 10 ), scale_x ( 162 ), scale_y ( 162 ), "img/" .. grafika .. ".png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
end
dxSetRenderTarget ( false )
dxDrawImage ( scale_x ( 413 ), scale_y ( 326 ), width , height , maxRender )
dxDrawLine ( scale_x ( 722 ), scale_y ( 326 ), scale_x ( 722 ), scale_y ( 508 ), tocolor ( 0 , 255 , 0 , 255 ), 2 , false )
end
end
addEventHandler ( "onClientClick" , root , function( btn , state )
if btn == "left" and state == "down" then
if mysz ( scale_x ( 440 ), scale_y ( 549 ), scale_x ( 182 ), scale_y ( 57 )) and maszyna == true then
if leci == true then exports [ "np-notyfikacje" ]: noti ( "Aktualnie trwa losowanie, czekaj." , "error" ) return end
if getElementData ( localPlayer , "pieniadze" ) < stawka then exports [ "np-notyfikacje" ]: noti ( "Nie sta?‡ ci?™ aby postawi?‡ tak?… sum?™ pieni?™dzy." , "error" ) return end
setElementData ( localPlayer , "pieniadze" , getElementData ( localPlayer , "pieniadze" )- stawka )
losy = { }
adds = math . random ( 1 , 120 )
time = math . random ( 3600 , 4600 )
komulowanie = true
leci = true
czas = getTickCount ( )
for i = 1 , math . random ( 10 , 20 ) do
local los = math . random ( 1 , 100 )
if los >= 1 and los <= 84 then
jaki = "lose"
elseif los >= 85 and los <= 90 then
jaki = 2
elseif los >= 91 and los <= 93 then
jaki = 3
elseif los >= 94 and los <= 98 then
jaki = 4
elseif los >= 99 and los <= 100 then
jaki = 10
end
table . insert ( losy , { jaki })
end
setTimer (function()
for i , v in ipairs ( losy ) do
if i == 3 then
leci = false
if v [ 1 ] ~= "lose" then
setElementData ( localPlayer , "pieniadze" , getElementData ( localPlayer , "pieniadze" )+ stawka *( v [ 1 ]))
tekst = "Brawo, wygrywasz " .. stawka *( v [ 1 ]).. " PLN"
setTimer (function()
tekst = ""
end , 3000 , 1 )
end
end
end
end , time , 1 )
elseif mysz ( scale_x ( 882 ), scale_y ( 587 ), scale_x ( 140 ), scale_y ( 43 )) and maszyna == true then
if leci == true then exports [ "np-notyfikacje" ]: noti ( "Nie moĹĽesz zmieni?‡ stawki gdy trwa losowanie" , "error" ) return end
if stawka == 25600 then
stawka = 100
else
stawka = stawka * 2
end
elseif mysz ( scale_x ( 1013 ), scale_y ( 264 ), scale_x ( 16 ), scale_y ( 16 )) and maszyna == true then
if leci == true then exports [ "np-notyfikacje" ]: noti ( "Nie moĹĽesz wy?‚?…czy?‡ panelu podczas losowania!" , "error" ) return end
removeEventHandler ( "onClientRender" , root , maszynagui )
showCursor ( false )
maszyna = false
komulowanie = false
losy = { }
end
end
end )
-- opcje
function shadowText ( text , x , y , w , h , color , size , font , xx , yy , x1 , x2 , x3 , x4 , x5 )
dxDrawText ( text , x + 1 , y + 1 , w + 1 , h + 1 , tocolor ( 0 , 0 , 0 ), size , font , xx , yy , x1 , x2 , x3 , x4 , x5 )
dxDrawText ( text , x , y , w , h , color , size , font , xx , yy , x1 , x2 , x3 , x4 , x5 )
end
function mysz ( psx , psy , pssx , pssy , abx , aby )
if not isCursorShowing () then return end
cx , cy = getCursorPosition ()
cx , cy = cx * sx , cy * sy
if cx >= psx and cx <= psx + pssx and cy >= psy and cy <= psy + pssy then
return true , cx , cy
else
return false
end
end
Marker znajduje si? w interiorze o identyfikatorze 12 .
Wysłany: 2018-10-01, 18:42
BlackSkorpion
Uczę się LUA
Wiek: 25 Na forum: 3471 dni Posty: 53
Nick w MP: Black
Piwa : 371
spr?buj w??czyc guiedytor sprawdzalem i mi zadzialalo
Podpis
Pomagam na tyle ile mogę
Tagi: kaasyno
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: