NoKill1997
Online
Wiek: 28 Na forum: 3224 dni Posty: 183
Nick w MP: Mefedroniarz.PDW
Piwa : 778
Witam mam problem z bramkami, mianowicie nie wczytuje mi kodu. Jestem osoba zielona w LUA, wiec mam problemy w wykonaniu tego kodu :V
local screenW , screenH = guiGetScreenSize ()
panel = false
local object = createObject ( 2000 , - 1371.53 , 866.27 , 46.88 , 0 , 270 , - 90 ),
local marker = createMarker (- 1371.53 , 866.27 , 46.88 - 1 , "cylinder" , 9 , 0 , 0 , 0 , 0 ),
setElementData ( object , "zamknieta" , true )
function Okienko ()
end
addEvent ( "Gbrama" , true )
addEventHandler ( "Gbrama" , resourceRoot , function()
if panel == false then
addEventHandler ( "onClientRender" , root , Okienko )
tick = getTickCount ()
panel = true
showCursor ( true )
end
end )
function zamknij ()
if getElementData ( object , "otwarta" ) then
moveObject ( object , 1000 , 1655.64 , - 25.45 , 36.25 + 0.25 ,- 0.00 , - 90 , 0 )
setElementData ( object , "zamknieta" , true )
setElementData ( object , "otwarta" , false )
end
end
function ZamknijOkno ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( screenW * 0.5508 , screenH * 0.5482 , screenW * 0.1426 , screenH * 0.0495 ) then
removeEventHandler ( "onClientRender" , root , Okienko )
panel = false
showCursor ( false )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), ZamknijOkno )
function Otworzbrame ( button , state )
if panel and button == "left" and state == "down" then
if cursorPosition ( screenW * 0.3018 , screenH * 0.5495 , screenW * 0.1426 , screenH * 0.0495 ) then
moveObject ( object , 1000 , 2000 , - 22.01 , 2338.95 , 24.14 ,+ 0.25 , 0 , 90 , 0 )
setElementData ( object , "zamknieta" , false )
setElementData ( object , "otwarta" , true )
setTimer ( zamknij , 6000 , 1 )
removeEventHandler ( "onClientRender" , root , Okienko )
panel = false
showCursor ( false )
end
end
end
addEventHandler ( "onClientClick" , getRootElement (), Otworzbrame )
function cursorPosition ( x , y , w , h )
if ( not isCursorShowing ()) then
return false
end
local mx , my = getCursorPosition ()
local fullx , fully = guiGetScreenSize ()
cursorx , cursory = mx * fullx , my * fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end
Za pomoc oczywiscie nagrodze zimniutkim piwerkiem i
Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak