Wysłany: 2016-01-27, 19:48
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
ehhh... guiSetVisible ( GUIEditor . window [ 1 ], true )
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-01-27, 19:53
venzikk
LUA, MODELER
Wiek: 24 Na forum: 3823 dni Posty: 235
Nick w MP: VenZ
Piwa : 3158
Test.lua:21: <name> expected near (
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
guiSetVisible ( GUIEditor . window [ 1 ], false )
end
)
function()
guiSetVisible ( GUIEditor . button [ 3 ], false )
end
[ Dodano : 2016-01-27, 19:57 ]
Dobra naprawi?em sam
[ Dodano : 2016-01-27, 20:05 ]
[lua]
function mk()
local velocity = 500.0
local acceleration = 15.0
setVehicleHandling(pojazd, "maxVelocity", velocity)
setVehicleHandling(pojazd, "engineAcceleration", acceleration )
end[lua]
setVehicleHandling a nil value
Podpis
Hej
[you]
,Tak ty! Pomogłem ci? zostaw
Pomagam w miarę możliwości
Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Wysłany: 2016-01-27, 20:46
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
venzikk ,
Musisz pobra? pojazd, bo go nie ma.
Albo je?eli chcesz dok?adniej to udziel informacji czy to jest na komend? czy na event, je?eli event to go dodaj.
Wysłany: 2016-01-27, 21:50
venzikk
LUA, MODELER
Wiek: 24 Na forum: 3823 dni Posty: 235
Nick w MP: VenZ
Piwa : 3158
A te getPedOccupiedVehicle na server czy client ?
Podpis
Hej
[you]
,Tak ty! Pomogłem ci? zostaw
Pomagam w miarę możliwości
Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Wysłany: 2016-01-27, 21:53
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
venzikk , na wiki po prawej stronie od nazwy masz kategori? funkcji/eventu
server function - po stronie serwera (funkcja)
client function - po stronie clienta (funkcja)
shader function - dostepne po obu stronach
usefull function - wymaga dodania kodu funkcji do pliku w kt?rym jej u?yjesz
server event - event po stronie serwera
client event - event po stronie clienta
Wysłany: 2016-01-27, 21:54
venzikk
LUA, MODELER
Wiek: 24 Na forum: 3823 dni Posty: 235
Nick w MP: VenZ
Piwa : 3158
pyknie to :
pojazd = getPedOccupiedVehicle ( player )
function hit ()
guiSetVisible ( GUIEditor . window [ 1 ], true )
showCursor ( true )
end
addEventHandler ( "onClientMarkerHit" , marker , hit )
function hit ( he , md )
if not md then return end
guiSetVisible ( GUIEditor . window [ 1 ], true )
showCursor ( true , false )
end
addEventHandler ( "onClientMarkerHit" , marker , hit )
function mk ()
local velocity = 500.0
local acceleration = 15.0
setVehicleHandling ( pojazd , "maxVelocity" , velocity )
setVehicleHandling ( pojazd , "engineAcceleration" , acceleration )
Podpis
Hej
[you]
,Tak ty! Pomogłem ci? zostaw
Pomagam w miarę możliwości
Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Wysłany: 2016-01-27, 21:56
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
venzikk , nie, funkcje od handlingu s? po stronie serwera, dodatkowo auto pobierasz w funkcji, nie gdzie? poza ni?.
Musisz u?y? tzw triggerowania z clienta do serwer czyli przeniesienie pomi?dzy dwoma plikami
Wysłany: 2016-01-27, 22:00
venzikk
LUA, MODELER
Wiek: 24 Na forum: 3823 dni Posty: 235
Nick w MP: VenZ
Piwa : 3158
Nie rozumiem troch? m?g?by? mi troszk? to wyt?umaczy? lub jaki? wz?r ?
Podpis
Hej
[you]
,Tak ty! Pomogłem ci? zostaw
Pomagam w miarę możliwości
Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Wysłany: 2016-01-27, 22:04
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
-- Do clienta podmie ?
function mk ( button , state )
triggerServerEvent ( "ZmienHandling" , localPlayer )
end
-- Do pliku serwer
addEventHandler ( "ZmienHandling" , root , function()
-- gracz to "source"
pojazd = -- tutaj pobierz pojazd gracza
if not pojazd then return end -- jezeli nie bedzie pojazdu funkcja sie zatrzyma
-- nadaj handling 1
-- nadaj handling 2
end
)
Wysłany: 2016-01-27, 22:06
venzikk
LUA, MODELER
Wiek: 24 Na forum: 3823 dni Posty: 235
Nick w MP: VenZ
Piwa : 3158
Czyli w mecie mog?oby wygl?da? to tak:
<export function="mk" type="server" />
gdy kod wygl?da tak:
function mk ()
pojazd = getPedOccupiedVehicle ( player )
local velocity = 500.0
local acceleration = 15.0
setVehicleHandling ( pojazd , "maxVelocity" , velocity )
setVehicleHandling ( pojazd , "engineAcceleration" , acceleration )
end
[ Dodano : 2016-01-27, 22:07 ]
w client
Podpis
Hej
[you]
,Tak ty! Pomogłem ci? zostaw
Pomagam w miarę możliwości
Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Wysłany: 2016-01-27, 22:07
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
venzikk , nie, exportowanie funkcji to udost?pnianie jej innym skryptom, ale nadal po tej samej stronie, aby przenie?? co? na inn? stron? jedynym wyj?ciem jest triggerowanie.
Wysłany: 2016-01-27, 22:19
venzikk
LUA, MODELER
Wiek: 24 Na forum: 3823 dni Posty: 235
Nick w MP: VenZ
Piwa : 3158
triggered serverside event zmienhandlinh, but event is nod added serverside
s-side
-- Do pliku serwer
addEventHandler ( "ZmienHandling" , root , function()
-- gracz to "source"
pojazd = getPedOccupiedVehicle ( player )
if not pojazd then return end
local velocity = 500.0
local acceleration = 15.0
setVehicleHandling ( pojazd , "maxVelocity" , velocity )
setVehicleHandling ( pojazd , "engineAcceleration" , acceleration )
end
)
c-side
GUIEditor = {
button = {},
window = {}
}
GUIEditor . window [ 1 ] = guiCreateWindow ( 334 , 143 , 392 , 357 , "" , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
GUIEditor . button [ 1 ] = guiCreateButton ( 57 , 95 , 122 , 64 , "MK1" , false , GUIEditor . window [ 1 ])
guiSetProperty ( GUIEditor . button [ 1 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 2 ] = guiCreateButton ( 238 , 104 , 127 , 55 , "MK2" , false , GUIEditor . window [ 1 ])
guiSetProperty ( GUIEditor . button [ 2 ], "NormalTextColour" , "FFAAAAAA" )
GUIEditor . button [ 3 ]= guiCreateButton ( 450 , 400 , 150 , 49 , "Zamknij" , false , kwindow )
guiSetProperty ( GUIEditor . button [ 3 ], "Zamknij" , "Text" )
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
guiSetVisible ( GUIEditor . window [ 1 ], false )
end
)
marker = createMarker ( 2486.84595 , - 1665.70776 , 13.34375 , 'cylinder' , 2.0 , 255 , 170 , 0 , 150 )
function hit ()
guiSetVisible ( GUIEditor . window [ 1 ], true )
showCursor ( true )
end
addEventHandler ( "onClientMarkerHit" , marker , hit )
function hit ( he , md )
if not md then return end
guiSetVisible ( GUIEditor . window [ 1 ], true )
showCursor ( true , false )
end
addEventHandler ( "onClientMarkerHit" , marker , hit )
function mk ( button , state )
triggerServerEvent ( "ZmienHandling" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , GUIEditor . button [ 1 ], mk )
function zamknij ( player )
guiSetVisible ( GUIEditor . window [ 3 ], true )
showCursor ( false )
end
addEventHandler ( "onClientGUIClick" , GUIEditor . button [ 3 ], zamknij )
Podpis
Hej
[you]
,Tak ty! Pomogłem ci? zostaw
Pomagam w miarę możliwości
Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Wysłany: 2016-01-27, 22:24
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
venzikk , a doda?e? do mety ten plik po stronie serwera ?
edit: sorka, moje lekkie przeoczenie
-- Do pliku serwer
addEvent ( "ZmienHandling" , true )
addEventHandler ( "ZmienHandling" , root , function()
-- gracz to "source"
pojazd = getPedOccupiedVehicle ( player )
if not pojazd then return end
local velocity = 500.0
local acceleration = 15.0
setVehicleHandling ( pojazd , "maxVelocity" , velocity )
setVehicleHandling ( pojazd , "engineAcceleration" , acceleration )
end
Wysłany: 2016-01-27, 22:32
venzikk
LUA, MODELER
Wiek: 24 Na forum: 3823 dni Posty: 235
Nick w MP: VenZ
Piwa : 3158
addEvent ( "ZmienHandling" , true )
addEventHandler ( "ZmienHandling" , root , function()
pojazd = getPedOccupiedVehicle ( player )
if not pojazd then return
end
local velocity = 500.0
local acceleration = 15.0
setVehicleHandling ( pojazd , "maxVelocity" , velocity )
setVehicleHandling ( pojazd , "engineAcceleration" , acceleration )
end
unexpected symbol near )
6 linijka
Podpis
Hej
[you]
,Tak ty! Pomogłem ci? zostaw
Pomagam w miarę możliwości
Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Wysłany: 2016-01-27, 22:35
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
venzikk , takie co? bardziej:
addEvent ( "ZmienHandling" , true )
addEventHandler ( "ZmienHandling" , root , function()
pojazd = getPedOccupiedVehicle ( source )
if not pojazd then return end
setVehicleHandling ( pojazd , "maxVelocity" , 500.0 )
setVehicleHandling ( pojazd , "engineAcceleration" , 15.0 )
end
)
1 - Je?eli event ma tak? form? jakiej u?y?em na ko?cu musi by? nawias zamykaj?cy.
2 - Musisz uwa?niej czyta?, nie zrozum mnie ?le, pisa?em, ?e gracz tutaj jest zdeklarowany jako source, po prostu player Ci nie odnajdzie.
Tagi: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: