Wysłany: 2016-05-01, 08:07
Odważny
Początki LUA :P
Wiek: 25 Na forum: 3739 dni Posty: 140
Nick w MP: ReseT_
Piwa : 166
mam taki db3;
[2016-05-01 08:04] ERROR: Loading script failed: dsrpg-kamerySAPD/server.lua:50: 'end' expected (to close 'function' at line 1) near ''
[2016-05-01 08:04] SCRIPT ERROR: dsrpg-kamerySAPD/server.lua:50: 'end' expected (to close 'function' at line 1) near ''
oraz:
[2016-05-01 08:04] ERROR: Client (tester) triggered serverside event sprawdz:acl:kamery, but event is not added serverside [DUP x2]
[2016-05-01 08:04] ERROR: Client (tester) triggered serverside event sprawdz:acl:kamery, but event is not added serverside
kod:
local marker_kamery = createMarker ( 618.00 , - 584.82 , 17.23 - 1 , "cylinder" , 1 , 255 , 0 , 0 , 255 )
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
local screenW , screenH = guiGetScreenSize ()
okno_glowne = guiCreateWindow (( screenW - 569 ) / 2 , ( screenH - 426 ) / 2 , 569 , 426 , "System kamer dla Policji" , false )
guiWindowSetMovable ( okno_glowne , false )
guiWindowSetSizable ( okno_glowne , false )
guiSetAlpha ( okno_glowne , 0.85 )
guiSetProperty ( okno_glowne , "CaptionColour" , "FFFE0000" )
kam_6 = guiCreateButton ( 10 , 363 , 227 , 53 , "Kamera: SPAWN PC" , false , okno_glowne )
guiSetFont ( kam_6 , "default-bold-small" )
guiSetProperty ( kam_6 , "NormalTextColour" , "FFFE0000" )
kam_5 = guiCreateButton ( 10 , 300 , 227 , 53 , "Kamera: SAMC LV" , false , okno_glowne )
guiSetFont ( kam_5 , "default-bold-small" )
guiSetProperty ( kam_5 , "NormalTextColour" , "FFFE0000" )
kam_4 = guiCreateButton ( 10 , 237 , 227 , 53 , "KAMERA: MECHANIK PC" , false , okno_glowne )
guiSetFont ( kam_4 , "default-bold-small" )
guiSetProperty ( kam_4 , "NormalTextColour" , "FFFE0000" )
kam_3 = guiCreateButton ( 10 , 174 , 227 , 53 , "Kamera: TUNER LV" , false , okno_glowne )
guiSetFont ( kam_3 , "default-bold-small" )
guiSetProperty ( kam_3 , "NormalTextColour" , "FFFE0000" )
kam_2 = guiCreateButton ( 10 , 111 , 227 , 53 , "Kamera: URZ?D PC" , false , okno_glowne )
guiSetFont ( kam_2 , "default-bold-small" )
guiSetProperty ( kam_2 , "NormalTextColour" , "FFFE0000" )
kam_1 = guiCreateButton ( 10 , 48 , 227 , 53 , "Kamera: KOMIS PC" , false , okno_glowne )
guiSetFont ( kam_1 , "default-bold-small" )
guiSetProperty ( kam_1 , "NormalTextColour" , "FFFE0000" )
clo = guiCreateButton ( 400 , 369 , 159 , 47 , "Zamknij" , false , okno_glowne )
guiSetFont ( clo , "default-bold-small" )
guiSetProperty ( clo , "NormalTextColour" , "FFFE0000" )
end
)
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
local screenW , screenH = guiGetScreenSize ()
zamknij_kamera = guiCreateButton ( 956 , 679 , 314 , 47 , "ZAMKNIJ" , false )
guiSetFont ( zamknij_kamera , "default-bold-small" )
guiSetProperty ( zamknij_kamera , "NormalTextColour" , "FFFF0000" )
end
)
function onStart ()
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , false )
end
addEventHandler ( "onClientResourceStart" , root , onStart )
function sprawdz ( el , md )
if source == marker_kamery then
if el == getLocalPlayer () then
player = getLocalPlayer ()
local grupa_acl = "Policja"
triggerServerEvent ( "sprawdz:acl:kamery" , root , player , grupa_acl )
end
end
end
addEventHandler ( "onClientMarkerHit" , root , sprawdz )
function openGUI ( player )
if player == getLocalPlayer () then
showCursor ( true )
guiSetVisible ( okno_glowne , true )
else return end
end
addEvent ( "open:gui:kamery" , true )
addEventHandler ( "open:gui:kamery" , root , openGUI )
function closeGUI ( player )
if source == clo then
showCursor ( false )
guiSetVisible ( okno_glowne , false )
else return end
end
addEventHandler ( "onClientGUIClick" , root , closeGUI )
function powrot ()
if source == zamknij_kamera then
triggerServerEvent ( "kameraoff" , root , player )
guiSetVisible ( okno_glowne , true )
guiSetVisible ( zamknij_kamera , false )
end
end
addEventHandler ( "onClientGUIClick" , root , powrot )
function kamera_1 ()
if source == kam_1 then
triggerServerEvent ( "kam_1" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_1 )
function kamera_2 ()
if source == kam_2 then
triggerServerEvent ( "kam_2" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_2 )
function kamera_3 ()
if source == kam_3 then
triggerServerEvent ( "kam_3" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_3 )
function kamera_4 ()
if source == kam_4 then
triggerServerEvent ( "kam_4" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_4 )
function kamera_5 ()
if source == kam_5 then
triggerServerEvent ( "kam_5" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_5 )
function kamera_6 ()
if source == kam_6 then
triggerServerEvent ( "kam_6" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_6 )
stawiam piwo i respekt za poprawe kodu
Podpis
[you]
, pomogłem Ci? Wynagrodź mnie
Wysłany: 2016-05-01, 09:16
Emm
***** ***
Wiek: 32 Na forum: 3880 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Poka? kod c-side oraz 50 linijk? s-side.
Musia?e? wnosi? jakie? poprawki czy co? i zrobi? b??d, bo w oryginale kod mi dzia?a?.
Podpis
Użytkownik : 20.10.2015r
GTAO Member : 06.03.2016r
Support-Team : 20.01.2016r
Moderator : 30.03.2016r
Mod-Team : 08.10.2016r
Vice Admin : 04.05.2018r
Administrator : 03.05.2022r
[you]
! Koniecznie zapoznaj się z
regulaminem forum .
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również
regulaminy działów , w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez
Administrację , przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w
tym dziale .
Najważniejsze informacje od
Administracji możesz przeczytać
tutaj oraz
tutaj .
Wysłany: 2016-05-01, 09:40
Odważny
Początki LUA :P
Wiek: 25 Na forum: 3739 dni Posty: 140
Nick w MP: ReseT_
Piwa : 166
Emm , c-side:
local marker_kamery = createMarker ( 618.00 , - 584.82 , 17.23 - 1 , "cylinder" , 1 , 255 , 0 , 0 , 255 )
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
local screenW , screenH = guiGetScreenSize ()
okno_glowne = guiCreateWindow (( screenW - 569 ) / 2 , ( screenH - 426 ) / 2 , 569 , 426 , "System kamer dla Policji" , false )
guiWindowSetMovable ( okno_glowne , false )
guiWindowSetSizable ( okno_glowne , false )
guiSetAlpha ( okno_glowne , 0.85 )
guiSetProperty ( okno_glowne , "CaptionColour" , "FFFE0000" )
kam_6 = guiCreateButton ( 10 , 363 , 227 , 53 , "Kamera: SPAWN PC" , false , okno_glowne )
guiSetFont ( kam_6 , "default-bold-small" )
guiSetProperty ( kam_6 , "NormalTextColour" , "FFFE0000" )
kam_5 = guiCreateButton ( 10 , 300 , 227 , 53 , "Kamera: SAMC LV" , false , okno_glowne )
guiSetFont ( kam_5 , "default-bold-small" )
guiSetProperty ( kam_5 , "NormalTextColour" , "FFFE0000" )
kam_4 = guiCreateButton ( 10 , 237 , 227 , 53 , "KAMERA: MECHANIK PC" , false , okno_glowne )
guiSetFont ( kam_4 , "default-bold-small" )
guiSetProperty ( kam_4 , "NormalTextColour" , "FFFE0000" )
kam_3 = guiCreateButton ( 10 , 174 , 227 , 53 , "Kamera: TUNER LV" , false , okno_glowne )
guiSetFont ( kam_3 , "default-bold-small" )
guiSetProperty ( kam_3 , "NormalTextColour" , "FFFE0000" )
kam_2 = guiCreateButton ( 10 , 111 , 227 , 53 , "Kamera: URZ?D PC" , false , okno_glowne )
guiSetFont ( kam_2 , "default-bold-small" )
guiSetProperty ( kam_2 , "NormalTextColour" , "FFFE0000" )
kam_1 = guiCreateButton ( 10 , 48 , 227 , 53 , "Kamera: KOMIS PC" , false , okno_glowne )
guiSetFont ( kam_1 , "default-bold-small" )
guiSetProperty ( kam_1 , "NormalTextColour" , "FFFE0000" )
clo = guiCreateButton ( 400 , 369 , 159 , 47 , "Zamknij" , false , okno_glowne )
guiSetFont ( clo , "default-bold-small" )
guiSetProperty ( clo , "NormalTextColour" , "FFFE0000" )
end
)
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
local screenW , screenH = guiGetScreenSize ()
zamknij_kamera = guiCreateButton ( 956 , 679 , 314 , 47 , "ZAMKNIJ" , false )
guiSetFont ( zamknij_kamera , "default-bold-small" )
guiSetProperty ( zamknij_kamera , "NormalTextColour" , "FFFF0000" )
end
)
function onStart ()
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , false )
end
addEventHandler ( "onClientResourceStart" , root , onStart )
function sprawdz ( el , md )
if source == marker_kamery then
if el == getLocalPlayer () then
player = getLocalPlayer ()
local grupa_acl = "Policja"
triggerServerEvent ( "sprawdz:acl:kamery" , root , player , grupa_acl )
end
end
end
addEventHandler ( "onClientMarkerHit" , root , sprawdz )
function openGUI ( player )
if player == getLocalPlayer () then
showCursor ( true )
guiSetVisible ( okno_glowne , true )
else return end
end
addEvent ( "open:gui:kamery" , true )
addEventHandler ( "open:gui:kamery" , root , openGUI )
function closeGUI ( player )
if source == clo then
showCursor ( false )
guiSetVisible ( okno_glowne , false )
else return end
end
addEventHandler ( "onClientGUIClick" , root , closeGUI )
function powrot ()
if source == zamknij_kamera then
triggerServerEvent ( "kameraoff" , root , player )
guiSetVisible ( okno_glowne , true )
guiSetVisible ( zamknij_kamera , false )
end
end
addEventHandler ( "onClientGUIClick" , root , powrot )
function kamera_1 ()
if source == kam_1 then
triggerServerEvent ( "kam_1" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_1 )
function kamera_2 ()
if source == kam_2 then
triggerServerEvent ( "kam_2" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_2 )
function kamera_3 ()
if source == kam_3 then
triggerServerEvent ( "kam_3" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_3 )
function kamera_4 ()
if source == kam_4 then
triggerServerEvent ( "kam_4" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_4 )
function kamera_5 ()
if source == kam_5 then
triggerServerEvent ( "kam_5" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_5 )
function kamera_6 ()
if source == kam_6 then
triggerServerEvent ( "kam_6" , root , player )
guiSetVisible ( okno_glowne , false )
guiSetVisible ( zamknij_kamera , true )
else return end
end
addEventHandler ( "onClientGUIClick" , root , kamera_6 )
-------------------------------
s-side:
function sprawdzACL ( player , grupa_acl )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player )), aclGetGroup ( "Policja" )) then
triggerClientEvent ( "open:gui:kamery" , root , player )
end
addEvent ( "sprawdz:acl:kamery" , true )
addEventHandler ( "sprawdz:acl:kamery" , root , sprawdzACL )
function kameraoff ( player )
setCameraTarget ( player , player )
end
addEvent ( "kameraoff" , true )
addEventHandler ( "kameraoff" , root , kameraoff )
function kamera1 ( player )
setCameraMatrix ( player , 1294.63 , 192.00 , 26 , 2340 , 2400 , 2 , 0 , 0 )
end
addEvent ( "kam_1" , true )
addEventHandler ( "kam_1" , root , kamera1 )
function kamera2 ( player )
setCameraMatrix ( player , 2283.56 , - 88.52 , 39 , 2330 , 2450 , 12 , 0 , 0 )
end
addEvent ( "kam_2" , true )
addEventHandler ( "kam_2" , root , kamera2 )
function kamera3 ( player )
setCameraMatrix ( player , 1385.73 , 685.40 , 21.37 , 1200.11743 , 2430.49487 , - 180 , 0 , 0 )
end
addEvent ( "kam_3" , true )
addEventHandler ( "kam_3" , root , kamera3 )
function kamera4 ( player )
setCameraMatrix ( player , 2449.01 , 109.26 , 36 , 2350.59741 , 2430.00195 , - 60 , 0 , 0 )
end
addEvent ( "kam_4" , true )
addEventHandler ( "kam_4" , root , kamera4 )
function kamera5 ( player )
setCameraMatrix ( player , 1585.15 , 1819.28 , 21.57 , 2420.41943 , 14 , 0 , 0 )
end
addEvent ( "kam_5" , true )
addEventHandler ( "kam_5" , root , kamera5 )
function kamera6 ( player )
setCameraMatrix ( player , 2474.15 , - 35.02 , 32 , 2280.99731 , 2430.14453 , 11 , 0 , 0 )
end
addEvent ( "kam_6" , true )
addEventHandler ( "kam_6" , root , kamera6 )
Podpis
[you]
, pomogłem Ci? Wynagrodź mnie
Tagi: kamery
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: