Wysłany: 2018-10-30, 15:57
Query
SyndicateMTA
Wiek: 24 Na forum: 3072 dni Posty: 319
Nick w MP: Query
Piwa : 5257
Hejka, mam kod na frakcje. I chcia?em zmieni? outputChatBox na notyfikacje. No i kod na wywo?anie notyfikacji wyglada tak :
triggerClientEvent ( "createAlert" , el , "error" , "Nie jeste? zatrudniony w LSPD!" )
Notyfikacje pojawiaj? si? normalnie ale dla ka?dego gracza..
Wysłany: 2018-10-30, 15:59
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
podaj kod od notyfikacji i sprawdz czy sie zgadza zmienna gracza z t? co jest w kodzie
Wysłany: 2018-10-30, 16:33
Query
SyndicateMTA
Wiek: 24 Na forum: 3072 dni Posty: 319
Nick w MP: Query
Piwa : 5257
local sw , sh = guiGetScreenSize ()
function sx ( po )
return ( po / 1680 )* sw
end
function sy ( po )
return ( po / 1050 )* sh
end
local font = exports [ "ac-gui" ]: czcionka ( sx ( 11 ))
local tick = getTickCount ()
notyfikacje ={}
time_noti = 5000
addEventHandler ( "onClientRender" , getRootElement (), function()
for i , v in ipairs ( notyfikacje ) do
if getTickCount () > v [ 3 ]+ time_noti then
table . remove ( notyfikacje , 1 )
end
local offsetY =( sy ( 78 ))*( i - 1 )
dxDrawImage ( sx ( 1287 ), sy ( 145 )+ offsetY , sx ( 393 ), sy ( 73 ), "i/" .. v [ 1 ].. ".png" , 0 , 0 , 0 , tocolor ( 245 , 245 , 245 , 245 ), true )
dxDrawText ( v [ 2 ], sx ( 1358 ), sy ( 145 )+( offsetY * 2 ), sx ( 1680 ), sy ( 213 ), tocolor ( 255 , 255 , 255 , 255 ), 1.00 , font , "center" , "center" , false , true , true , false , false )
end
end )
function createAlert ( typ , text , _ )
if not typ then
typ = "info"
end
table . insert ( notyfikacje , { typ , text , getTickCount ()})
playSound ( "s/" .. typ .. ".mp3" )
outputConsole ( "[" .. typ .. "] " .. text )
if #notyfikacje > 4 then
tick = getTickCount ()
table . remove ( notyfikacje , 1 )
end
end
addEvent ( "createAlert" , true )
addEventHandler ( "createAlert" , root , createAlert )
Tak, zmienna gracza sie zgada.
Wysłany: 2018-10-31, 16:22
neku^
Wiek: 24 Na forum: 3521 dni Posty: 461
Nick w MP: neku^
Piwa : 1186
triggerClientEvent ( el , "createAlert" , el , "error" , "Nie jeste? zatrudniony w LSPD!" )
Więcej szczegółów
Wystawiono 1 piw(a):Query
Wysłany: 2018-10-31, 17:46
Query
SyndicateMTA
Wiek: 24 Na forum: 3072 dni Posty: 319
Nick w MP: Query
Piwa : 5257
"dbn69" napisał/a :
triggerClientEvent ( el , "createAlert" , el , "error" , "Nie jeste? zatrudniony w LSPD!" )
Dziekuje dzia?a! Do zamkniecia
Tagi: triggerclientevent
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: