Wysłany: 2017-03-18, 19:21
Adwokat1PA
Uczeń LUA
Wiek: 26 Na forum: 3621 dni Posty: 59
Nick w MP: Adwokat
Witam mam problem ot?? chce ?eby po 3 sekundach usuwa? sie ten trigger cos jak removeEventHandler tylko niestety nie dzia?a prosi?bym o pomoc w nagrode
Kod: function remove()
cancelEvent()
end
triggerClientEvent ( "onInformacja",root,informacja1)
setTimer(remove,3000,1)
Wysłany: 2017-03-18, 19:40
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
function cos ()
setTimer (function()
triggerClientEvent ( "onInformacja" , root , informacja1 )
setTimer (function()
-- tutaj cos moze sie wykonac po tamtym triggerze
end , 3000 , 1 )
end , 100 , 1 )
end
Podpis
"amited" napisał/a :
Wysłany: 2017-03-18, 19:58
Adwokat1PA
Uczeń LUA
Wiek: 26 Na forum: 3621 dni Posty: 59
Nick w MP: Adwokat
"amited" napisał/a :
function cos ()
setTimer (function()
triggerClientEvent ( "onInformacja" , root , informacja1 )
setTimer (function()
-- tutaj cos moze sie wykonac po tamtym triggerze
end , 3000 , 1 )
end , 100 , 1 )
end
Chodzi mi o to zeby po 3 sekundach usun?l sie ten trigger ,nie wiem jak to zrobic
Wysłany: 2017-03-18, 20:01
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
aaaa nie ogarn??em xd daj kod tego eventu onInformacja
Podpis
"amited" napisał/a :
Wysłany: 2017-03-18, 20:06
Adwokat1PA
Uczeń LUA
Wiek: 26 Na forum: 3621 dni Posty: 59
Nick w MP: Adwokat
"amited" napisał/a :aaaa nie ogarn??em xd daj kod tego eventu onInformacja
Client:
Kod:
addEvent ( "onInformacja", true )
function informacja1()
dxDrawText("Nie jestes pracownikiem Policji", 814, 900, 1151, 543, tocolor(230, 230, 230, 255), 1.50, "bankgothic")
end
addEventHandler("onInformacja",getRootElement(),informacja1)
Server: Kod:
politeamx = createTeam ( "Policja", 0, 100, 255 )
function Policja ( thePlayer )
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Policja" ) ) then
setPlayerTeam ( thePlayer, politeamx )
giveWeapon ( thePlayer, 25, 5000 )
giveWeapon ( thePlayer, 22, 5000 )
giveWeapon ( thePlayer, 3, 5000 )
setElementModel ( thePlayer, math.random(280,281) )
setElementPosition ( thePlayer, -1616.0999755859, 683.29998779297, 7.1999998092651 )
else
setTimer(function()
triggerClientEvent ( "onInformacja",root,informacja1)
setTimer(function()
cancelEvent()
end,3000,1)
end,100,1)
end
end
addCommandHandler ( "loginpolicja", Policja )
Chodzi o to zeby informacja znikala po 3 sekundach
Wysłany: 2017-03-18, 20:09
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
addEvent ( "onInformacja" , true )
function informacja1 ()
setTimer (function()
dxDrawText ( "Nie jestes pracownikiem Policji" , 814 , 900 , 1151 , 543 , tocolor ( 230 , 230 , 230 , 255 ), 1.50 , "bankgothic" )
setTimer (function()
end , 3000 , 1 )
end , 100 , 1 )
end
addEventHandler ( "onInformacja" , getRootElement (), informacja1 )
zobacz cos takiego
Podpis
"amited" napisał/a :
Wysłany: 2017-03-18, 20:10
R3fr3Sh
Wiek: 27 Na forum: 4800 dni Posty: 70
Piwa : 60
Doda? do timera triggerClientEvent kt?ry wy??cza informacje po stronie gracza b?d? gdy tworzysz informacje po stronie gracza nadawa? jej timer do jej znikni?cia.
EDIT: Pisa?em t? wiadomo?? zanim zobaczy?em wasze odpowiedzi.
Ostatnio zmieniony przez R3fr3Sh 2017-03-18, 20:15, w całości zmieniany 1 raz
Wysłany: 2017-03-18, 20:13
Adwokat1PA
Uczeń LUA
Wiek: 26 Na forum: 3621 dni Posty: 59
Nick w MP: Adwokat
"amited" napisał/a :
addEvent ( "onInformacja" , true )
function informacja1 ()
setTimer (function()
dxDrawText ( "Nie jestes pracownikiem Policji" , 814 , 900 , 1151 , 543 , tocolor ( 230 , 230 , 230 , 255 ), 1.50 , "bankgothic" )
setTimer (function()
end , 3000 , 1 )
end , 100 , 1 )
end
addEventHandler ( "onInformacja" , getRootElement (), informacja1 )
zobacz cos takiego
Nie dzia?a
[ Dodano : 2017-03-18, 20:16 ]
"R3fr3Sh" napisał/a :Doda? do timera triggerClientEvent kt?ry wy??cza informacje po stronie gracza b?d? gdy tworzysz informacje po stronie gracza nadawa? jej timer do jej znikni?cia.
EDIT: Pisa?em t? wiadomo?? zanim zobaczy?em wasze odpowiedzi.
M?g?by? to rozja?ni??
Wysłany: 2017-03-18, 20:24
R3fr3Sh
Wiek: 27 Na forum: 4800 dni Posty: 70
Piwa : 60
addEvent ( "onInformacja" , true )
function informacja1 ()
setTimer (function()
dxDrawText ( "Nie jestes pracownikiem Policji" , 814 , 900 , 1151 , 543 , tocolor ( 230 , 230 , 230 , 255 ), 1.50 , "bankgothic" )
setTimer (function()
removeEventHandler ( "onInformacja" , root , informacja1 ) -- ko ? czenie renderu po 3 sekundach
end , 3000 , 1 )
end , 100 , 1 )
end
addEventHandler ( "onInformacja" , getRootElement (), informacja1 )
Wysłany: 2017-03-18, 20:33
Adwokat1PA
Uczeń LUA
Wiek: 26 Na forum: 3621 dni Posty: 59
Nick w MP: Adwokat
"R3fr3Sh" napisał/a :
addEvent ( "onInformacja" , true )
function informacja1 ()
setTimer (function()
dxDrawText ( "Nie jestes pracownikiem Policji" , 814 , 900 , 1151 , 543 , tocolor ( 230 , 230 , 230 , 255 ), 1.50 , "bankgothic" )
setTimer (function()
removeEventHandler ( "onInformacja" , root , informacja1 ) -- ko ? czenie renderu po 3 sekundach
end , 3000 , 1 )
end , 100 , 1 )
end
addEventHandler ( "onInformacja" , getRootElement (), informacja1 )
Nie dziala
Wysłany: 2017-03-18, 20:42
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Adwokat1PA , tak zobacz:
function trigger ()
triggerClientEvent ( "onInformacja" , root , informacja1 )
end
function cos ()
setTimer (function()
trigger ()
setTimer (function()
destroyElement ( trigger )
end , 3000 , 1 )
end , 100 , 1 )
end
Tak wgl nie rozumiem po co to usuwa? jak to tylko si? wykonuje raz i sam si? wy??cza.
Wysłany: 2017-03-18, 20:53
R3fr3Sh
Wiek: 27 Na forum: 4800 dni Posty: 70
Piwa : 60
Faktycznie, nie dzia?a bo si? zagapi?em. Musia?em ca?kowicie przepisa? skrypty
-- client
local text = ""
local function drawText ()
dxDrawText ( text , 814 , 900 , 1151 , 543 , tocolor ( 230 , 230 , 230 , 255 ), 1.50 , "bankgothic" )
end
addEvent ( "onInformacja" , true )
function informacja1 ( informacja )
text = informacja
addEventHandler ( "onClientRender" , root , drawText )
setTimer (function()
removeEventHandler ( "onClientRender" , root , drawText ) -- ko ? czenie renderu po 3 sekundach
end , 3000 , 1 )
end
addEventHandler ( "onInformacja" , localPlayer , informacja1 )
-- server
politeamx = createTeam ( "Policja" , 0 , 100 , 255 )
function Policja ( thePlayer )
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. playerName , aclGetGroup ( "Policja" ) ) then
setPlayerTeam ( thePlayer , politeamx )
giveWeapon ( thePlayer , 25 , 5000 )
giveWeapon ( thePlayer , 22 , 5000 )
giveWeapon ( thePlayer , 3 , 5000 )
setElementModel ( thePlayer , math . random ( 280 , 281 ) )
setElementPosition ( thePlayer , - 1616.0999755859 , 683.29998779297 , 7.1999998092651 )
else
setTimer (function()
triggerClientEvent ( thePlayer , "onInformacja" , thePlayer , "Nie jestes pracownikiem Policji" )
setTimer (function()
cancelEvent ()
end , 3000 , 1 )
end , 100 , 1 )
end
end
addCommandHandler ( "loginpolicja" , Policja )
Więcej szczegółów
Wystawiono 1 piw(a):Adwokat1PA
Wysłany: 2017-03-18, 20:55
Adwokat1PA
Uczeń LUA
Wiek: 26 Na forum: 3621 dni Posty: 59
Nick w MP: Adwokat
"R3fr3Sh" napisał/a :Faktycznie, nie dzia?a bo si? zagapi?em. Musia?em ca?kowicie przepisa? skrypty
-- client
local text = ""
local function drawText ()
dxDrawText ( text , 814 , 900 , 1151 , 543 , tocolor ( 230 , 230 , 230 , 255 ), 1.50 , "bankgothic" )
end
addEvent ( "onInformacja" , true )
function informacja1 ( informacja )
text = informacja
addEventHandler ( "onClientRender" , root , drawText )
setTimer (function()
removeEventHandler ( "onClientRender" , root , drawText ) -- ko ? czenie renderu po 3 sekundach
end , 3000 , 1 )
end
addEventHandler ( "onInformacja" , localPlayer , informacja1 )
-- server
politeamx = createTeam ( "Policja" , 0 , 100 , 255 )
function Policja ( thePlayer )
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( "user." .. playerName , aclGetGroup ( "Policja" ) ) then
setPlayerTeam ( thePlayer , politeamx )
giveWeapon ( thePlayer , 25 , 5000 )
giveWeapon ( thePlayer , 22 , 5000 )
giveWeapon ( thePlayer , 3 , 5000 )
setElementModel ( thePlayer , math . random ( 280 , 281 ) )
setElementPosition ( thePlayer , - 1616.0999755859 , 683.29998779297 , 7.1999998092651 )
else
setTimer (function()
triggerClientEvent ( thePlayer , "onInformacja" , thePlayer , "Nie jestes pracownikiem Policji" )
setTimer (function()
cancelEvent ()
end , 3000 , 1 )
end , 100 , 1 )
end
end
addCommandHandler ( "loginpolicja" , Policja )
Wielkie dzi?ki
Tagi: usuniecie :: triggera
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: