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

Wysłany: 2018-09-26, 21:12


warzit







Wiek: 32
Na forum: 3319 dni
Posty: 71
Nick w MP: Lorson

Piwa: 1

Respekt: 40

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


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-26, 21:41


_jvneczek







Wiek: 22
Na forum: 4326 dni
Posty: 1513
Nick w MP: _jvneczek

Piwa: 3949

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

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

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-27, 09:55


warzit







Wiek: 32
Na forum: 3319 dni
Posty: 71
Nick w MP: Lorson

Piwa: 1

Respekt: 40

Nie

Podpis


[url=https://zapodaj.net/fde922c932b9a.png.html[/img:0][/url]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-27, 18:03


Kalizman







Wiek: 23
Na forum: 3652 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Sprawd?:
--[[ 
AutorMalentas 
]] 

local maszyna false 
local komulowanie false 
local stawka 100 
local sxsy guiGetScreenSize() 
local font dxCreateFont("cz.ttf"12local tekst "" 

function scale_x(valuelocal result = (value 1440) * sx 

return result 
end 

function scale_y(valuelocal result = (value 900) * sy 

return result 
end 

local maszyny = { 
{1134.97, -4.361000.68}, 
{1290.87, -1116.6553.51}, 
{1292.87, -1116.6553.51}, 
{1288.87, -1120.1253.51}, 
{1290.87, -1120.1253.51}, 
{1292.87, -1120.1253.51}, 
{1302.13, -1115.8553.51}, 
{1302.13, -1118.5053.52}, 
{1302.13, -1121.2853.51}, 
} 

function hitmaszyna(gracz) 
if gracz ~= localPlayer then return end 
addEventHandler("onClientRender"rootmaszynaguishowCursor(truemaszyna true 
end 

for i,v in ipairs(maszyny) do 
local marker createMarker(v[1], v[2], v[3]-0.95"cylinder"102550setElementInterior(marker12addEventHandler("onClientMarkerHit"markerhitmaszynaend 

local losy = { } 

local width scale_x(619local height scale_y(182local maxRender dxCreateRenderTarget(widthheighttrue) 


function maszynagui() 
dxDrawImage(scale_x(399), scale_y(256), scale_x(643), scale_y(388), ":np-gui/grafiki/tlo.png"000tocolor(255255255255), falseshadowText("Maszyna losuj?&#8230;ca"scale_x(400), scale_y(256), scale_x(1042), scale_y(309), tocolor(255255255255), 1.00font"center""center"falsefalsefalsefalsefalsedxDrawRectangle(scale_x(413), scale_y(326), scale_x(619), scale_y(182), tocolor(000100), falseshadowText("Stawka: "..stawka.." PLN"scale_x(874), scale_y(524), scale_x(1032), scale_y(577), tocolor(255255255255), 1.00font"center""center"falsefalsefalsefalsefalsedxDrawImage(scale_x(882), scale_y(587), scale_x(140), scale_y(43), ":np-gui/grafiki/button_off.png"000tocolor(255255255255), falseshadowText("Stawka x2"scale_x(880), scale_y(586), scale_x(1022), scale_y(630), tocolor(255255255255), 1.00font"center""center"falsefalsefalsefalsefalsedxDrawImage(scale_x(440), scale_y(549), scale_x(182), scale_y(57), ":np-gui/grafiki/button_off.png"000tocolor(255255255255), falseshadowText("Rozpocznij losowanie"scale_x(439), scale_y(548), scale_x(622), scale_y(606), tocolor(255255255255), 1.00font"center""center"falsefalsefalsefalsefalsedxDrawImage(scale_x(1013), scale_y(264), scale_x(16), scale_y(16), ":guieditor/images/cross.png"000tocolor(255255255255), falsedxDrawText(tekstscale_x(413), scale_y(507), scale_x(1032), scale_y(544), tocolor(25500255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse) 
if komulowanie == true then 
dxSetRenderTarget(maxRendertrue) 
for iv in ipairs(losy) do 
local dodatekX = (scale_x(82.5))*(i-1local move interpolateBetween(scale_x(1100)-dodatekX00scale_x(-500)-dodatekX00, (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+movescale_y(10), scale_x(162), scale_y(162), tocolor(000100), false)
dxDrawImage(scale_x(1000+adds)-dodatekX+movescale_y(10), scale_x(162), scale_y(162), "img/"..grafika..".png"000tocolor(255255255255), falseend 
dxSetRenderTarget(falsedxDrawImage(scale_x(413), scale_y(326), widthheightmaxRenderdxDrawLine(scale_x(722), scale_y(326), scale_x(722), scale_y(508), tocolor(02550255), 2falseend 
end 

addEventHandler("onClientClick"root, function(btnstate) 
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?&#8225; ci?&#8482; aby postawi?&#8225; tak?&#8230; sum?&#8482; pieni?&#8482;dzy.""error") return end 
setElementData(localPlayer"pieniadze"getElementData(localPlayer"pieniadze")-stawkalosy = { } 
adds math.random(1120time math.random(36004600komulowanie true 
leci true 
czas getTickCount( ) 
for 1math.random(10,20) do 
local los math.random(1100) 
if los >= and los <= 84 then 
jaki "lose" 
elseif los >= 85 and los <= 90 then 
jaki elseif los >= 91 and los <= 93 then 
jaki elseif los >= 94 and los <= 98 then 
jaki elseif los >= 99 and los <= 100 then 
jaki 10 
end 
table.insert(losy, {jaki}) 
end 
setTimer(function() 
for iv in ipairs(losy) do 
if == 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 "" 
end30001end 
end 
end 
endtime1) 
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?&#8225; 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?&#8218;?&#8230;czy?&#8225; panelu podczas losowania!""error") return end 
removeEventHandler("onClientRender"rootmaszynaguishowCursor(falsemaszyna false 
komulowanie false 
losy = { } 
end 
end 
end) 

--opcje 

function shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0),size,font,xx,yy,x1,x2,x3,x4,x5dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5end 

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.

Postaw piwo autorowi tego posta
 

 
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

Respekt: 50

spr?buj w??czyc guiedytor sprawdzalem i mi zadzialalo

Podpis
Pomagam na tyle ile mogę :D
Postaw piwo autorowi tego posta
 

 
Tagi: kaasyno
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Kaasyno NP 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