Wysłany: 2017-11-17, 17:18
RodzyneQ
Wiek: 25 Na forum: 3594 dni Posty: 87
Nick w MP: RodzyneQ
Piwa : 196
Czesc, mam taki problem, nie wiem co zrobic, by wysylalo pm do druhow osp po uruchomieniu syreny alarmowej, w sensie uruchamia dyspozytor i przychodzi /pm do druhow o tym powiadomienie.
KOD:
marker = createMarker (- 2332.94 , - 149.42 , 40.90 - 1 , "cylinder" , 1 , 0 , 100 , 255 )
mojeW , mojeH = 640 , 480
sW , sH = guiGetScreenSize ()
width , height = ( sW / mojeW ), ( sH / mojeH )
GUIEditor = {
button = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
monitor = guiCreateStaticImage ( 112 * width , 68 * height , 426 * width , 339 * height , "images/monitor.png" , false )
guiSetVisible ( monitor , false )
zamknij = guiCreateButton ( 283 * width , 278 * height , 119 * width , 29 * height , "Zamknij system" , false , monitor )
alarm2 = guiCreateButton ( 254 * width , 141 * height , 119 * width , 29 * height , "Alarm PSP" , false , monitor )
-- monitoring = guiCreateLabel ( 21 * width , 25 * height , 203 * width , 33 * height , "PSP:" , false , monitor )
guiSetFont ( monitoring , "sa-header" )
guiLabelSetColor ( monitoring , 0 , 0 , 0 )
guiLabelSetHorizontalAlign ( monitoring , "left" , true )
--[[ kamera2 = guiCreateButton ( 24 * width , 102 * height , 119 * width , 29 * height , "Gara? 2" , false , monitor )
kamera3 = guiCreateButton ( 24 * width , 141 * height , 119 * width , 29 * height , "Gara? 3" , false , monitor )
kamera4 = guiCreateButton ( 24 * width , 180 * height , 119 * width , 29 * height , "Gara? 4" , false , monitor )
kamera5 = guiCreateButton ( 24 * width , 219 * height , 119 * width , 29 * height , "Przed budynkiem" , false , monitor )
kamera6 = guiCreateButton ( 24 * width , 258 * height , 119 * width , 29 * height , "W ?rodku jednostki" , false , monitor )]]
alarm = guiCreateButton ( 254 * width , 102 * height , 119 * width , 29 * height , "Syrena OSP" , false , monitor )
-- wezwanie = guiCreateButton ( 254 * width , 141 * height , 119 * width , 29 * height , "Wezwij OSP" , false , monitor )
alarm3 = guiCreateButton ( 254 * width , 183 * height , 119 * width , 29 * height , "DSP-50 OSP" , false , monitor )
-- napisAlarm = guiCreateLabel ( 231 * width , 26 * height , 166 * width , 32 * height , "OSP:" , false , monitor )
guiSetFont ( napisAlarm , "sa-header" )
guiLabelSetColor ( napisAlarm , 0 , 0 , 0 )
guiLabelSetHorizontalAlign ( napisAlarm , "left" , true )
wylacz = guiCreateButton ( 418 * width , 403 * height , 212 * width , 44 * height , "Wy??cz podgl?d z kamery" , false )
guiSetVisible ( wylacz , false )
wezwij = guiCreateWindow ( 92 * width , 163 * height , 470 * width , 155 * height , "Komputer PSP" , false )
guiWindowSetSizable ( wezwij , false )
guiSetAlpha ( wezwij , 1.00 )
guiSetVisible ( wezwij , false )
wyslij = guiCreateButton ( 10 * width , 98 * height , 185 * width , 47 * height , "Wyslij" , false , wezwij )
anuluj = guiCreateButton ( 275 * width , 98 * height , 185 * width , 47 * height , "Anuluj" , false , wezwij )
tekst = guiCreateEdit ( 10 * width , 26 * height , 450 * width , 51 * height , "" , false , wezwij )
end
)
function otworz ( el )
if el ~= localPlayer then return end
guiSetVisible ( monitor , true )
showCursor ( true )
outputChatBox ( "Zalogowa?e? si? do komputeru PSP" )
end
addEventHandler ( "onClientMarkerHit" , marker , otworz )
function zamknij ()
if source == zamknij then
guiSetVisible ( monitor , false )
showCursor ( false )
outputChatBox ( "Wylogowa?e? si? z systemu." )
end
end
addEventHandler ( "onClientGUIClick" , root , zamknij )
-- kamery + off kamer
--[[function kameraJeden ()
if source == kamera1 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 114.7031 , 1016.1692 , 23.8511 , - 119.90000152588 , 1021 , 21 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 1." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraJeden )
function kameraDwa ()
if source == kamera2 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 114.8578 , 1007.6431 , 23.9889 , - 122.59999847412 , 1013.0999755859 , 20.39999961853 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 2." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraDwa )
function kameraTrzy ()
if source == kamera3 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 114.6912 , 998.3926 , 23.9341 , - 123.40000152588 , 1004.4000244141 , 20.39999961853 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 3." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraTrzy )
function kameraCztery ()
if source == kamera4 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 115.7143 , 989.5533 , 23.6280 , - 124.90000152588 , 995.09997558594 , 20.39999961853 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 4." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraCztery )
function kameraPiec ()
if source == kamera5 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 114.0060 , 989.8550 , 23.8644 , - 103.59999847412 , 1004.299987793 , 19.799999237061 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 5." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraPiec )
function kameraSzesc ()
if source == kamera6 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 129.8901 , 1023.9247 , 27.9543 , - 122.40000152588 , 1018.299987793 , 26 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 6." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraSzesc )
function kameraOff ( thePlayer )
if source == wylacz then
guiSetVisible ( wylacz , false )
guiSetVisible ( monitor , true )
setCameraTarget ( localPlayer )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraOff )]]
-- syrena alarmowa OSP
function syrenaOSP ()
if source == alarm then
local syrena = playSound3D ( "syrena.mp3" , - 321.01 , 1202.86 , 24.66 , false )
setSoundVolume ( syrena , 300 )
setSoundMaxDistance ( syrena , 3000 )
outputChatBox ( "Uruchomi?e? syren? alarmow? OSP." )
end
end
addEventHandler ( "onClientGUIClick" , root , syrenaOSP )
-- panel alarmowy OSP
function wezwanie ()
if source == wezwanie then
guiSetVisible ( monitor , false )
guiSetVisible ( wezwij , true )
showChat ( false )
end
end
addEventHandler ( "onClientGUIClick" , root , wezwanie )
function anulujWezwanie ()
if source == anuluj then
guiSetVisible ( monitor , true )
guiSetVisible ( wezwij , false )
showChat ( true )
end
end
addEventHandler ( "onClientGUIClick" , root , anulujWezwanie )
function ST ()
if source == wyslij then
local text = guiGetText ( tekst )
triggerServerEvent ( "NAOT" , getLocalPlayer (), text )
showChat ( true )
guiSetVisible ( monitor , true )
guiSetVisible ( wezwij , false )
end
end
addEventHandler ( "onClientGUIClick" , root , ST )
--- ALARM PSP
function syrenaOSP ()
if source == alarm2 then
local syrena = playSound3D ( "syrena2.mp3" ,- 2270.59 , - 174.23 , 40.90 , false )
setSoundVolume ( syrena , 700 )
setSoundMaxDistance ( syrena , 600 )
outputChatBox ( "Uruchomi?e? alarm PSP" )
end
end
addEventHandler ( "onClientGUIClick" , root , syrenaOSP )
-- dsp
function syrenaOSP ()
if source == alarm3 then
local syrena = playSound3D ( "dsp.wav" ,- 334.85 , 1207.23 , 21.15 , false )
setSoundVolume ( syrena , 700 )
setSoundMaxDistance ( syrena , 300 )
outputChatBox ( "Uruchomi?e? DSP-50 OSP" )
end
end
addEventHandler ( "onClientGUIClick" , root , syrenaOSP )
Prosze o pomoc! Nagradzam i
Wysłany: 2017-11-18, 14:58
Malentas
Koder mirofali w lua
Wiek: 24 Na forum: 3681 dni Posty: 146
Nick w MP: Malentas
Piwa : 1626
marker = createMarker (- 2332.94 , - 149.42 , 40.90 - 1 , "cylinder" , 1 , 0 , 100 , 255 )
mojeW , mojeH = 640 , 480
sW , sH = guiGetScreenSize ()
width , height = ( sW / mojeW ), ( sH / mojeH )
GUIEditor = {
button = {}
}
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
monitor = guiCreateStaticImage ( 112 * width , 68 * height , 426 * width , 339 * height , "images/monitor.png" , false )
guiSetVisible ( monitor , false )
zamknij = guiCreateButton ( 283 * width , 278 * height , 119 * width , 29 * height , "Zamknij system" , false , monitor )
alarm2 = guiCreateButton ( 254 * width , 141 * height , 119 * width , 29 * height , "Alarm PSP" , false , monitor )
-- monitoring = guiCreateLabel ( 21 * width , 25 * height , 203 * width , 33 * height , "PSP:" , false , monitor )
guiSetFont ( monitoring , "sa-header" )
guiLabelSetColor ( monitoring , 0 , 0 , 0 )
guiLabelSetHorizontalAlign ( monitoring , "left" , true )
--[[ kamera2 = guiCreateButton ( 24 * width , 102 * height , 119 * width , 29 * height , "Gara? 2" , false , monitor )
kamera3 = guiCreateButton ( 24 * width , 141 * height , 119 * width , 29 * height , "Gara? 3" , false , monitor )
kamera4 = guiCreateButton ( 24 * width , 180 * height , 119 * width , 29 * height , "Gara? 4" , false , monitor )
kamera5 = guiCreateButton ( 24 * width , 219 * height , 119 * width , 29 * height , "Przed budynkiem" , false , monitor )
kamera6 = guiCreateButton ( 24 * width , 258 * height , 119 * width , 29 * height , "W ?rodku jednostki" , false , monitor )]]
alarm = guiCreateButton ( 254 * width , 102 * height , 119 * width , 29 * height , "Syrena OSP" , false , monitor )
-- wezwanie = guiCreateButton ( 254 * width , 141 * height , 119 * width , 29 * height , "Wezwij OSP" , false , monitor )
alarm3 = guiCreateButton ( 254 * width , 183 * height , 119 * width , 29 * height , "DSP-50 OSP" , false , monitor )
-- napisAlarm = guiCreateLabel ( 231 * width , 26 * height , 166 * width , 32 * height , "OSP:" , false , monitor )
guiSetFont ( napisAlarm , "sa-header" )
guiLabelSetColor ( napisAlarm , 0 , 0 , 0 )
guiLabelSetHorizontalAlign ( napisAlarm , "left" , true )
wylacz = guiCreateButton ( 418 * width , 403 * height , 212 * width , 44 * height , "Wy??cz podgl?d z kamery" , false )
guiSetVisible ( wylacz , false )
wezwij = guiCreateWindow ( 92 * width , 163 * height , 470 * width , 155 * height , "Komputer PSP" , false )
guiWindowSetSizable ( wezwij , false )
guiSetAlpha ( wezwij , 1.00 )
guiSetVisible ( wezwij , false )
wyslij = guiCreateButton ( 10 * width , 98 * height , 185 * width , 47 * height , "Wyslij" , false , wezwij )
anuluj = guiCreateButton ( 275 * width , 98 * height , 185 * width , 47 * height , "Anuluj" , false , wezwij )
tekst = guiCreateEdit ( 10 * width , 26 * height , 450 * width , 51 * height , "" , false , wezwij )
end
)
function otworz ( el )
if el ~= localPlayer then return end
guiSetVisible ( monitor , true )
showCursor ( true )
outputChatBox ( "Zalogowa?e? si? do komputeru PSP" )
end
addEventHandler ( "onClientMarkerHit" , marker , otworz )
function zamknij ()
if source == zamknij then
guiSetVisible ( monitor , false )
showCursor ( false )
outputChatBox ( "Wylogowa?e? si? z systemu." )
end
end
addEventHandler ( "onClientGUIClick" , root , zamknij )
-- kamery + off kamer
--[[function kameraJeden ()
if source == kamera1 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 114.7031 , 1016.1692 , 23.8511 , - 119.90000152588 , 1021 , 21 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 1." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraJeden )
function kameraDwa ()
if source == kamera2 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 114.8578 , 1007.6431 , 23.9889 , - 122.59999847412 , 1013.0999755859 , 20.39999961853 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 2." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraDwa )
function kameraTrzy ()
if source == kamera3 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 114.6912 , 998.3926 , 23.9341 , - 123.40000152588 , 1004.4000244141 , 20.39999961853 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 3." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraTrzy )
function kameraCztery ()
if source == kamera4 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 115.7143 , 989.5533 , 23.6280 , - 124.90000152588 , 995.09997558594 , 20.39999961853 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 4." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraCztery )
function kameraPiec ()
if source == kamera5 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 114.0060 , 989.8550 , 23.8644 , - 103.59999847412 , 1004.299987793 , 19.799999237061 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 5." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraPiec )
function kameraSzesc ()
if source == kamera6 then
guiSetVisible ( monitor , false )
setCameraMatrix (- 129.8901 , 1023.9247 , 27.9543 , - 122.40000152588 , 1018.299987793 , 26 )
guiSetVisible ( wylacz , true )
showCursor ( true )
outputChatBox ( "**Podgl?d z kamery nr 6." )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraSzesc )
function kameraOff ( thePlayer )
if source == wylacz then
guiSetVisible ( wylacz , false )
guiSetVisible ( monitor , true )
setCameraTarget ( localPlayer )
end
end
addEventHandler ( "onClientGUIClick" , root , kameraOff )]]
function wzywanie ()
if source ~= wyslij then return end
for i , gracz ipairs ( getElementsByType ( "player" )) do
if getElementData ( gracz , "elementdatafrakcji" ) == "OSP" then
outputChatBox ( "Posiadasz wezwanie do remizy!!!!!!!!!!" , 255 , 0 , 0 )
end
end
end
addEventHandler ( "onClientGUIClick" , root , wzywanie )
-- syrena alarmowa OSP
function syrenaOSP ()
if source == alarm then
local syrena = playSound3D ( "syrena.mp3" , - 321.01 , 1202.86 , 24.66 , false )
setSoundVolume ( syrena , 300 )
setSoundMaxDistance ( syrena , 3000 )
outputChatBox ( "Uruchomi?e? syren? alarmow? OSP." )
end
end
addEventHandler ( "onClientGUIClick" , root , syrenaOSP )
-- panel alarmowy OSP
function wezwanie ()
if source == wezwanie then
guiSetVisible ( monitor , false )
guiSetVisible ( wezwij , true )
showChat ( false )
end
end
addEventHandler ( "onClientGUIClick" , root , wezwanie )
function anulujWezwanie ()
if source == anuluj then
guiSetVisible ( monitor , true )
guiSetVisible ( wezwij , false )
showChat ( true )
end
end
addEventHandler ( "onClientGUIClick" , root , anulujWezwanie )
function ST ()
if source == wyslij then
local text = guiGetText ( tekst )
triggerServerEvent ( "NAOT" , getLocalPlayer (), text )
showChat ( true )
guiSetVisible ( monitor , true )
guiSetVisible ( wezwij , false )
end
end
addEventHandler ( "onClientGUIClick" , root , ST )
--- ALARM PSP
function syrenaOSP ()
if source == alarm2 then
local syrena = playSound3D ( "syrena2.mp3" ,- 2270.59 , - 174.23 , 40.90 , false )
setSoundVolume ( syrena , 700 )
setSoundMaxDistance ( syrena , 600 )
outputChatBox ( "Uruchomi?e? alarm PSP" )
end
end
addEventHandler ( "onClientGUIClick" , root , syrenaOSP )
-- dsp
function syrenaOSP ()
if source == alarm3 then
local syrena = playSound3D ( "dsp.wav" ,- 334.85 , 1207.23 , 21.15 , false )
setSoundVolume ( syrena , 700 )
setSoundMaxDistance ( syrena , 300 )
outputChatBox ( "Uruchomi?e? DSP-50 OSP" )
end
end
addEventHandler ( "onClientGUIClick" , root , syrenaOSP )
Wysłany: 2017-11-18, 20:09
RodzyneQ
Wiek: 25 Na forum: 3594 dni Posty: 87
Nick w MP: RodzyneQ
Piwa : 196
Wysłany: 2017-11-18, 20:13
Atroth
Wiek: 23 Na forum: 3677 dni Posty: 1089
Nick w MP: Atroth
Piwa : 4808
RodzyneQ ,
for i , gracz in ipairs ( getElementsByType ( "player" )) do
Podpis
Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018
Wysłany: 2017-11-18, 20:45
RodzyneQ
Wiek: 25 Na forum: 3594 dni Posty: 87
Nick w MP: RodzyneQ
Piwa : 196
_Mike , nie ma ?adnego b??du w DB3, aczkolwiek nie ma tekstu. Ja to zrobi?em tak:
I nie dzia?a. Pod najnowsz? paczk? IYW.
Wysłany: 2017-11-18, 20:49
Atroth
Wiek: 23 Na forum: 3677 dni Posty: 1089
Nick w MP: Atroth
Piwa : 4808
RodzyneQ , W sumie nie dziwi? si? bo zabrak?o znaku " przy outputChatBoxie...
Podpis
Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018
Wysłany: 2017-11-18, 21:18
RodzyneQ
Wiek: 25 Na forum: 3594 dni Posty: 87
Nick w MP: RodzyneQ
Piwa : 196
_Mike , Poprawione, ale dalej nie dziala.
Wysłany: 2017-11-18, 21:26
Atroth
Wiek: 23 Na forum: 3677 dni Posty: 1089
Nick w MP: Atroth
Piwa : 4808
RodzyneQ , Nie b?d? za ka?dym razem poprawia? kodu Ci. Za du?o end'?w.
Podpis
Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018
Wysłany: 2017-11-18, 21:28
Eitho
Wiek: 24 Na forum: 3489 dni Posty: 330
Nick w MP: Eitho
Piwa : 746
function wzywanie ()
if source ~= wyslij then return end
for i , gracz in ipairs ( getElementsByType ( "player" )) do
if getElementData ( gracz , "player:duty" ) == "OSP" then
outputChatBox ( ">> (x)Rufus: Syrena OSP! Udaj si? do remizy!" , gracz , 255 , 0 , 0 )
end
end
end
addEventHandler ( "onClientGUIClick" , root , wzywanie )
[ Dodano : 2017-11-18, 21:30 ]
"_Mike" napisał/a :RodzyneQ , Nie b?d? za ka?dym razem poprawia? kodu Ci. Za du?o end'?w.
Odpowiednio du?o end?w.
Wysłany: 2017-11-18, 22:02
RodzyneQ
Wiek: 25 Na forum: 3594 dni Posty: 87
Nick w MP: RodzyneQ
Piwa : 196
Nie dziala, mozna zamyka?.
Tagi: zrobic :: wysylalo :: druhow :: osp :: uruchomieniu :: syre
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: