Wysłany: 2018-11-01, 17:23
VenturasRPG
Wiek: 32 Na forum: 2774 dni Posty: 2
Nick w MP: Kangaroo
DB3:
attempt to perform arithmetic on upvalue 'tick' (a function value)
Nie pokazuje gui.
linijka w kt?rej wyskakuje to:
local alph = interpolateBetween ( 0 , 0 , 0 , 0 , 250 , 0 , ( getTickCount () - tick )/ 2000 , "OutQuad" )
Wysłany: 2018-11-01, 17:31
Avenged
Młodszy Szkrypter
Wiek: 23 Na forum: 3510 dni Posty: 654
Nick w MP: Avenged
Piwa : 1570
posiadasz gdzie? w kodzie funkcje o nazwie 'tick' ?
PS. Czytanie ze zrozumieniem nie boli, wszystko masz opisane w tym b??dzie co jest nie tak
Podpis
LUA, JS, PHP
Zapraszam do skorzystania z moich usług: Klik
Wysłany: 2018-11-01, 17:37
VenturasRPG
Wiek: 32 Na forum: 2774 dni Posty: 2
Nick w MP: Kangaroo
BarteQ03 ,
Dodawa?em animacje, doda?em aczkolwiek no nie pokazuje logowania, tzn pokazuje ale gui si? nie wy?wietla tylko editboxy i kamera leci.
if getElementData ( localPlayer , "player:uid" ) then return end
local root = getRootElement ()
local blur = exports [ 'blur' ]
local czcionka = dxCreateFont ( "font/1.ttf" , 25 )
local czcionka2 = dxCreateFont ( "font/1.ttf" , 16 )
local czcionka3 = dxCreateFont ( "font/1.ttf" , 12 )
local czcionka4 = dxCreateFont ( "font/1.ttf" , 10 )
tick = getTickCount ()
local resourceRoot = getResourceRootElement ( getThisResource ())
local screenWidth , screenHeight = guiGetScreenSize ()
ogloszenie =[[ Witaj na serwerze It 's Your World!
Adres forum; mta-its.pl
Adres ts3; iy-w.pl
Wersja serwera; 1.0
W?a?ciciele serwera;
- Rusek
- Shaman
- Kurianusz
- CrosRoad95
CREDITS;
Graphic; © Maker
Copyright © It' s Your World
Wszelkie prawa zastrze ? one !
]]
local blurStrength = 2
local myScreenSource = dxCreateScreenSource ( screenWidth , screenHeight )
blurShader , blurTec = dxCreateShader ( "shaders/BlurShader.fx" )
function renderblur ()
if blur == true then
dxUpdateScreenSource ( myScreenSource )
dxSetShaderValue ( blurShader , "ScreenSource" , myScreenSource );
dxSetShaderValue ( blurShader , "BlurStrength" , blurStrength );
dxSetShaderValue ( blurShader , "UVSize" , screenWidth , screenHeight );
dxDrawImage ( 0 , 0 , screenWidth , screenHeight , blurShader )
end
end
addEventHandler ( "onClientRender" , root , renderblur )
addEventHandler ( "onClientResourceStop" , resourceRoot ,
function()
if ( blurShader ) and blur then
destroyElement ( blurShader )
blurShader = nil
end
end )
-- x , y = 2075.74 ,- 1187.70 -- my width
-- intro_step = math . random ( 0 , 850 )
local sx , sy = guiGetScreenSize ()
local data ={ showed = nil , button ={}, info = nil , misc = nil , tick2 = getTickCount () }
function isMouseIn ( 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
local dist = 400
local angler = 0
function getPointFromDistanceRotation ( x , y , dist , angler )
local a = math . rad ( 270 - angler )
local dx = math . cos ( a ) * dist ;
local dy = math . sin ( a ) * dist ;
return x + dx , y + dy ;
end
function getCenter ( sx , sy )
local screenW , screenH = guiGetScreenSize ()
local x , y = ( screenW - sx ) / 2 ,( screenH - sy ) / 2
return x , y
end
posx , posy = getCenter ( 740 , 462 )
function getCenter ( sx , sy )
local screenW , screenH = guiGetScreenSize ()
local x , y = ( screenW - sx ) / 2 ,( screenH - sy ) / 2
return x , y
end
posxx , posyy = getCenter ( 365 , 30 )
mojeW , mojeH = 1366 , 768
sW , sH = guiGetScreenSize ()
w , h = ( sW / mojeW ), ( sH / mojeH )
local x , y = guiGetScreenSize ()
local f = x / 1324
local nY = y * f
function roundedRectangle ( x , y , w , h , color )
dxDrawRectangle ( x , y , w , h , color , false )
dxDrawRectangle ( x + 2 , y - 1 , w - 4 , 1 , color , false )
dxDrawRectangle ( x + 2 , y + h , w - 4 , 1 , color , false )
dxDrawRectangle ( x - 1 , y + 2 , 1 , h - 4 , color , false )
dxDrawRectangle ( x + w , y + 2 , 1 , h - 4 , color , false )
end
aktualnie = "logowanie"
function renderLoginBox ()
setTime ( 6 , 0 )
blur = false
local alph = interpolateBetween ( 0 , 0 , 0 , 0 , 250 , 0 , ( getTickCount () - tick )/ 2000 , "OutQuad" )
if aktualnie == "logowanie" then
dxDrawImage ( 0 * w , 0 * h , 1280 * w , 800 * h , "logowaniep.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , alph ), false )
elseif aktualnie == "rejestracja" then
dxDrawImage ( 0 * w , 0 * h , 1280 * w , 800 * h , "rejestracjap.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , alph ), false )
end
if getTickCount ()< data . tick2 then
dxDrawText ( data . info , 1130 * w , 330 * h , 350 * w , 175 * h , tocolor ( 255 , 0 , 0 , 255 ), 1.00 , czcionka4 , "center" , "center" , false , true , false , false , false )
end
local x , y = getPointFromDistanceRotation (- 1351.51 , 514.52 , dist , angler )
setCameraMatrix ( x , y , 80 + 0.9 , 1207.76 , - 1249.49 , 80 + 0.9 )
angler =( angler + 0.1 )
end
addEventHandler ( "onClientClick" , root , function( btn , state )
if btn == "left" and state == "down" then
if isMouseIn ( 618 * w , 435 * h , 172 * w , 60 * h ) and data . showed then
if aktualnie == "logowanie" then
local login = guiGetText ( data . button [ 1 ])
local pass = guiGetText ( data . button [ 2 ])
if string . len ( login ) > 22 or string . len ( pass ) > 22 and string . len ( login ) < 3 or string . len ( pass ) < 3 then
data . info = "Login/haslo musza miec od 3 do 22 znakow."
data . tick2 = getTickCount ()+ 5000
return
end
triggerServerEvent ( "logging:checkAccount" , resourceRoot , login , pass )
end
if aktualnie == "rejestracja" then
local login = guiGetText ( data . button [ 1 ])
local pass = guiGetText ( data . button [ 2 ])
if string . len ( login ) > 22 or string . len ( pass ) > 22 and string . len ( login ) < 3 or string . len ( pass ) < 3 then
data . info = "Login/haslo musza miec od 3 do 22 znakow."
data . tick2 = getTickCount ()+ 5000
return
end
triggerServerEvent ( "logging:newAccount" , resourceRoot , login , pass )
end
elseif isMouseIn ( 783 * w , 260 * h , 172 * w , 60 * h ) then
aktualnie = "rejestracja"
tick = getTickCount ()
elseif isMouseIn ( 545 * w , 260 * h , 172 * w , 60 * h ) then
aktualnie = "logowanie"
tick = getTickCount ()
end
end
end )
addEvent ( "logging:result" , true )
addEventHandler ( "logging:result" , resourceRoot , function( value , info )
if not info then info = "" end
if value then
data . showed = false
showZones ( data . misc )
-- Usuwamy elementy
local time = getRealTime ()
setTime ( time . hour , time . minute )
destroyElement ( data . button [ 1 ])
destroyElement ( data . button [ 2 ])
removeEventHandler ( "onClientRender" , root , renderLoginBox )
else
data . info = info
data . tick2 = getTickCount ()+ 5000
tick = getTickCount ()
end
end )
addEventHandler ( "onClientResourceStart" , resourceRoot , function()
showChat ( false )
showCursor ( true )
fadeCamera ( true )
data . showed = true
setElementAlpha ( localPlayer , 0 )
data . misc = playSound ( "misc/intro.mp3" , true )
setSoundVolume ( data . misc , 0.5 )
tick = getTickCount ()
showPlayerHudComponent ( "all" , false )
guiSetInputMode ( "no_binds_when_editing" )
setElementData ( localPlayer , "status" , "Loguje si?" )
-- setElementData ( localPlayer , "player:logged" , false )
data . button [ 1 ]= guiCreateEdit ( 552 * w , 350 * h , 157 * w , 27 * h , "" , false )
data . button [ 2 ]= guiCreateEdit ( 752 * w , 350 * h , 157 * w , 27 * h , "" , false )
guiEditSetMasked ( data . button [ 2 ], true )
addEventHandler ( "onClientRender" , root , renderLoginBox )
end )
Tagi: animacja :: nie :: działa
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: