Wysłany: 2018-12-10, 19:37
Krzemo1234
Wiek: 26 Na forum: 3751 dni Posty: 387
Nick w MP: Krzemo
Piwa : 16
Posiadam dwa b??dy [AddEventHandler] i nie wiem czym s? spowodowane
ss: https://imgur.com/a/zI8bII7
Blife-zasoby
local screenW , screenH = guiGetScreenSize ()
local czas = getTickCount ()
local rot = 0
local font = dxCreateFont ( "Fonts/font.ttf" , 11 )
function isEventHandlerAdded ( sEventName , pElementAttachedTo , func )
if
type ( sEventName ) == 'string' and
isElement ( pElementAttachedTo ) and
type ( func ) == 'function'
then
local aAttachedFunctions = getEventHandlers ( sEventName , pElementAttachedTo )
if type ( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
for i , v in ipairs ( aAttachedFunctions ) do
if v == func then
return true
end
end
end
end
return false
end
function loadingDownload ()
local Alpha = interpolateBetween ( 0 , 0 , 0 , 255 , 220 , 200 , (( getTickCount () - czas ) / 1000 ), "Linear" )
local r , g , b , a = interpolateBetween ( 0 , 150 , 255 , 255 , 255 , 255 ,( getTickCount ())/ 6500 , "SineCurve" )
local kr1 , kr2 , kr3 = interpolateBetween (- 0.2630 , 0.0368 , 0 , 0.2530 , 0 , 0 , ( getTickCount ())/ 6500 , "SineCurve" )
rot = rot + 5 > 360 and 0 or rot + 5
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0400 , screenH * 1.0000 , "Img/background.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , Alpha ), false )
dxDrawImage ( screenW * 0.4820 , screenH * 0.7710 , screenW * 0.0195 , screenH * 0.0340 , "Img/loading.png" , rot , 0 , 0 , tocolor ( 255 , 255 , 255 , Alpha ), false )
dxDrawText ( "Pobieranie zasob?w" , screenW * 0.6909 , screenH * 1.1801 , screenW * 0.2946 , screenH * 0.4596 , tocolor ( r , g , b , Alpha ), 1.00 , font , "center" , "center" , false , false , false , false , false )
end
function loadingObjects ()
local Alpha = interpolateBetween ( 0 , 0 , 0 , 255 , 220 , 200 , (( getTickCount () - czas ) / 1000 ), "Linear" )
local r , g , b , a = interpolateBetween ( 40 , 40 , 40 , 255 , 255 , 255 ,( getTickCount ())/ 6500 , "SineCurve" )
local kr1 , kr2 , kr3 = interpolateBetween (- 0.2630 , 0.0368 , 0 , 0.2530 , 0 , 0 , ( getTickCount ())/ 6500 , "SineCurve" )
rot = rot + 5 > 360 and 0 or rot + 5
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0400 , screenH * 1.0000 , "Img/background.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , Alpha ), false )
dxDrawImage ( screenW * 0.0230 , screenH * 0.0210 , screenW * 0.0195 , screenH * 0.0340 , "Img/loading.png" , rot , 0 , 0 , tocolor ( 255 , 255 , 255 , Alpha ), false )
dxDrawText ( "Wczytywanie zasob?w" , screenW * - 0.0709 , screenH * - 0.3801 , screenW * 0.2946 , screenH * 0.4596 , tocolor ( r , g , b , Alpha ), 1.00 , font , "center" , "center" , false , false , false , false , false )
end
function checkingIsDownload ()
if isTransferBoxActive () == true then
addEventHandler ( "onClientRender" , root , loadingDownload )
else
if isEventHandlerAdded ( "onClientRender" , root , loadingDownload ) then
removeEventHandler ( "onClientRender" , root , loadingDownload )
end
end
end
setTimer ( checkingIsDownload , 1000 , 0 )
function checkingIsComingObject ()
if getElementData ( root , "load:objects" ) then
addEventHandler ( "onClientRender" , root , loadingObjects )
else
if isEventHandlerAdded ( "onClientRender" , root , loadingObjects ) then
removeEventHandler ( "onClientRender" , root , loadingObjects )
end
end
end
setTimer ( checkingIsComingObject , 1000 , 0 )
addEventHandler ( "onClientRender" , root , loadingDownload )
1
local screenW , screenH = guiGetScreenSize ()
local boolLimitWiadomosci = false ;
local limitWiadomosci = 5 ;
local czasTrwaniaWiadomosci = 5000 ;
local idDzwieku = 11 ;
local czcionka = ":Blife-sweepery/foncik.ttf" ;
local dozwolonaCzcionka = false ;
local wiadomosci = {
}
function drawMessages ()
if #wiadomosci > 0 then
for i , v in ipairs ( wiadomosci ) do
messageNoHex = string . gsub ( wiadomosci [ i ], "#%x%x%x%x%x%x" , "" )
dxDrawText ( messageNoHex , ( screenW * 0.3125 ) + 1 , ( screenH * 0.9444 ) + 1 - ( i * 50 ), ( screenW * 0.6881 ) + 1 , ( screenH * 0.9667 ) + 1 , tocolor ( 0 , 0 , 0 , 255 ), 1.20 , czcionka , "center" , "center" , false , true , true , true , false )
dxDrawText ( wiadomosci [ i ], screenW * 0.3125 , screenH * 0.9444 - ( i * 50 ), screenW * 0.6881 , screenH * 0.9667 , tocolor ( 255 , 255 , 255 , 255 ), 1.20 , czcionka , "center" , "center" , false , true , true , true , false )
end
end
end
addEvent ( "addNotification" , true )
addEventHandler ( "addNotification" , localPlayer , outputNotificationBox )
addEventHandler ( "onClientResourceStart" , getRootElement ( ), checkFont )
addEventHandler ( "onClientRender" , root , drawMessages )
Podpis
Jeśli ci pomogłem zostaw zimne
Ostatnio zmieniony przez Krzemo1234 2018-12-10, 20:08, w całości zmieniany 1 raz
Wysłany: 2018-12-10, 19:40
Avenged
Młodszy Szkrypter
Wiek: 23 Na forum: 3510 dni Posty: 654
Nick w MP: Avenged
Piwa : 1570
To mo?e podaj te b??dy
Podpis
LUA, JS, PHP
Zapraszam do skorzystania z moich usług: Klik
Wysłany: 2018-12-12, 16:04
Krzemo1234
Wiek: 26 Na forum: 3751 dni Posty: 387
Nick w MP: Krzemo
Piwa : 16
Podpis
Jeśli ci pomogłem zostaw zimne
Wysłany: 2018-12-12, 20:31
mtm
</3
Wiek: 26 Na forum: 3715 dni Posty: 181
Piwa : 252
po prostu przypinasz event do funkcji kt?rej nie ma
Wysłany: 2018-12-12, 22:18
Krzemo1234
Wiek: 26 Na forum: 3751 dni Posty: 387
Nick w MP: Krzemo
Piwa : 16
lecz dalej problem tu
function checkingIsDownload ()
if isTransferBoxActive () == true then
addEventHandler ( "onClientRender" , root , loadingDownload )
else
if isEventHandlerAdded ( "onClientRender" , root , loadingDownload ) then
removeEventHandler ( "onClientRender" , root , loadingDownload )
end
end
end
setTimer ( checkingIsDownload , 1000 , 0 )
Podpis
Jeśli ci pomogłem zostaw zimne
Tagi: addenenthandler
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: