Wysłany: 2016-02-18, 23:16
Snapig
Amator LUA
Wiek: 28 Na forum: 3793 dni Posty: 43
Nick w MP: Rother
Piwa : 129
Witam
chcialbym poprosic o pomoc w skrypcie. b?ad polega na tym ze jezeli wgralem plik na serwer on nie che sie uruchomic, nie chce dzilac(ten plik)
serwer
vehiclePos = {
{- 1630.98 , 1289.13 , 6.96 },
{- 1634.79 , 1292.91 , 6.95 },
{- 1637.81 , 1296.43 , 6.97 },
{- 1641.56 , 1299.86 , 6.96 },
{- 1644.98 , 1303.36 , 6.96 },
{- 1648.80 , 1306.83 , 6.96 },
{- 1652.01 , 1310.65 , 6.97 },
{- 1655.40 , 1314.80 , 6.97 },
}
for k , v in pairs ( vehiclePos ) do
car = createVehicle ( 408 , v [ 1 ], v [ 2 ], v [ 3 ])
setElementFrozen ( car , true )
setElementData ( car , "pojazd_paliwo" , 100 )
setElementData ( car , "przebieg" , math . random ( 100 , 300 ))
setElementData ( car , "pojazd_opis" , "Ladunek : 0%" )
setVehicleEngineState ( car , false )
end
addEventHandler ( "onVehicleEnter" , resourceRoot , function( plr , seat )
if seat == 0 then
if getElementData ( plr , "graczPraca" ) == false then
setElementData ( plr , "graczPraca" , true )
setElementFrozen ( source , false )
outputChatBox ( "Rozpoczo?es/a? prac? jako Kurier!!" , plr )
triggerClientEvent ( plr , "courier_job" , resourceRoot )
else
outputChatBox ( "Aktualnie posiadasz inna prac?. Zako?cz j? i wr??!" , plr )
end
end
end )
function checkVeh ()
for k , v in pairs ( getElementsByType ( "vehicle" , resourceRoot )) do
if not getVehicleController ( v ) then
respawnVehicle ( v )
setElementFrozen ( v , true )
setElementData ( car , "pojazd_opis" , "Ladunek : 0%" )
end
end
end
addEvent ( "checkCars" , true )
addEventHandler ( "checkCars" , resourceRoot , checkVeh )
addEvent ( "givePlayerMoney" , true )
addEventHandler ( "givePlayerMoney" , resourceRoot , function( ile )
givePlayerMoney ( client , ile )
end )
client
destinationMarker = nil
destBlip = nil
reloadMarker = createMarker (- 1610.806640625 , 1284.33984375 , 7.2229170799255 , "cylinder" , 5.0 , 255 , 0 , 0 , 130 )
unloadingPos = {
{- 1953.91 , 1341.64 , 5.09 },
{- 2016.65 , 970.11 , 45.56 },
{- 1955.51 , 1188.48 , 45.45 },
{- 1617.51 , 1074.92 , 7.19 },
{- 1581.15 , 865.56 , 7.60 },
{- 2624.97 , 1407.72 , 6.49 },
{- 2901.76 , 1169.55 , 10.82 },
{- 2757.74 , 793.66 , 50.82 },
}
function endOfWork ()
if destinationMarker and isElement ( destinationMarker ) then
destroyElement ( destinationMarker )
destinationMarker = nil
end
if destBlip and isElement ( destBlip ) then
destroyElement ( destBlip )
destBlip = nil
end
end
function takeFurniture ( he , md )
if he ~= localPlayer then return end
if not getPedOccupiedVehicle ( he ) then return end
local car = getPedOccupiedVehicle ( he )
if getElementData ( car , "pojazd_opis" ) == "Ladunek : 0%" then
setElementData ( car , "pojazd_opis" , "Ladunek : 100%" )
outputChatBox ( "Za?adowa?e?/a? pojazd przesy?kami. Jedz w miejsce oznaczone C na mapie" )
showDestination ()
end
end
addEventHandler ( "onClientMarkerHit" , reloadMarker , takeFurniture )
function showDestination ()
local rand = math . random ( 1 , #unloadingPos)
local destMarker = unloadingPos [ rand ]
destinationMarker = createMarker ( destMarker [ 1 ], destMarker [ 2 ], destMarker [ 3 ], "cylinder" , 2.5 , 255 , 0 , 0 , 130 )
destBlip = createBlipAttachedTo ( destinationMarker , 12 )
addEventHandler ( "onClientMarkerHit" , destinationMarker , unloadFurniture )
end
function unloadFurniture ( he , md )
if he ~= localPlayer then return end
if not getPedOccupiedVehicle ( he ) then return end
local cash = math . random ( 10 , 30 )
local carr = getPedOccupiedVehicle ( he )
if getElementData ( carr , "pojazd_opis" ) == "Ladunek : 100%" then
outputChatBox ( "Dotar?e?/a? do celu!. Jedz do miejsca rozpoczecia pracy po now? przesy?ke!" )
setElementData ( carr , "pojazd_opis" , "Ladunek : 0%" )
triggerServerEvent ( "givePlayerMoney" , resourceRoot , cash )
endOfWork ()
else
outputChatBox ( "Twoje auto niezosta?o za?adowane!!" )
end
end
addEvent ( "courier_job" , true )
addEventHandler ( "courier_job" , resourceRoot , function()
takeFurniture ( he , md )
end )
addEventHandler ( "onClientVehicleExit" , resourceRoot , function( plr , seat )
if seat == 0 then
if getElementData ( source , "pojazd_opis" ) == "Ladunek : 0%" or getElementData ( source , "pojazd_opis" ) == "Ladunek : 100%" then
endOfWork ()
setElementData ( plr , "graczPraca" , false )
triggerServerEvent ( "checkCars" , resourceRoot )
outputChatBox ( "Zakonczyles prace jako kurier!" )
end
end
end )
addEventHandler ( "onClientPlayerQuit" , resourceRoot , function()
setElementData ( source , "graczPraca" , false )
end )
addEventHandler ( "onClientPlayerWasted" , resourceRoot , function()
setElementData ( source , "graczPraca" , false )
outputChatBox ( "Zginales podczas dorywczej pracy! Musisz zaczac od nowa!" )
end )
addEventHandler ( "onClientResourceStop" , resourceRoot , function()
setElementData ( localPlayer , "graczPraca" , false )
end )
za pomoc daje piwo xD
Wysłany: 2016-02-19, 09:33
AteX
Wiek: 26 Na forum: 4015 dni Posty: 927
Nick w MP: #AteX
Piwa : 8360
Jakie? b??dy w db3? Pliki dodane do mety?
Wysłany: 2016-02-19, 12:33
Snapig
Amator LUA
Wiek: 28 Na forum: 3793 dni Posty: 43
Nick w MP: Rother
Piwa : 129
Wszystkie kordy sa napisane rozpoczecia i aut ale jak juz sie wgraly i chce uruchomic poprostu niedzialaja :<. Do mety sa podloczone. Jeszcze raz mowie z gory dzieki i
Podpis
[you]
Jeżeli Ci pomogłem daj Piwko ;piwo;
Wysłany: 2016-02-19, 12:45
AteX
Wiek: 26 Na forum: 4015 dni Posty: 927
Nick w MP: #AteX
Piwa : 8360
Poka? zawarto?? mety albo b??dy db3, bo nie widz? b??du w kodzie.
Wysłany: 2016-02-19, 12:50
Snapig
Amator LUA
Wiek: 28 Na forum: 3793 dni Posty: 43
Nick w MP: Rother
Piwa : 129
Ja mysle ze blad jest przy pierwszym w serwerze jest takie cos
A niepowinno byc takie cos
Tu macie SS (mam 2 ekrany wiec tak wyszlo :<)
http://imgur.com/N12HYf7
A tu dam napisana :>
< meta >
< script src = "job_c.lua" type = "client" />
< script src = "job_s.lua" type = "server" />
</ meta >
Ostatnio zmieniony przez Snapig 2016-02-19, 12:54, w całości zmieniany 1 raz
Wysłany: 2016-02-19, 12:52
AteX
Wiek: 26 Na forum: 4015 dni Posty: 927
Nick w MP: #AteX
Piwa : 8360
Nie, nie musi tak by?, mo?e ale nie musi. Je?eli chcesz t? tablice tylko w tym pliku to dajesz local, a je?eli chcesz mie? tzw. "globaln?", czyli bez local to wszystkie pliki w skrypcie b?d? widzie? t? tabel?.
W dalszym ci?gu podaj mete lub b??dy db3.
No dobra, meta jest ok. To w takim razie poka? b??dy db3.
Wysłany: 2016-02-19, 12:58
Snapig
Amator LUA
Wiek: 28 Na forum: 3793 dni Posty: 43
Nick w MP: Rother
Piwa : 129
Z db3 bedzie ci??ko bo ja FTP nie mam a ja takimi sprawami serverowymi niezajmuje ale wlascciela poprosze (jak umie)
EDIT:
Zapytam sie jeszcze cos czy to ma znaczenie
Serwer (praca Kuriera)
addEvent ( "givePlayerMoney" , true )
addEventHandler ( "givePlayerMoney" , resourceRoot , function( ile )
givePlayerMoney ( client , ile )
end )
Serwer (Inna praca)
addEvent ( "givePlayerMoney" , true )
addEventHandler ( "givePlayerMoney" , getRootElement (),function( ile )
givePlayerMoney ( source , tonumber ( ile ))
end )
Sa zmienione pomiedzy ta praca a inna tylko te kodziki
Inna Praca
givePlayerMoney ( source , tonumber ( ile ))
Praca Kurier
givePlayerMoney ( client , ile )
Z tego co chyba wiem to nw moze ze givePlayerMoney wyciaga dane o ilosci kasy z clienta a source to jest z "zrodla" ale nw jestem Amatorem LUA ^^
Ostatnio zmieniony przez Snapig 2016-02-19, 13:04, w całości zmieniany 1 raz
Wysłany: 2016-02-19, 13:02
AteX
Wiek: 26 Na forum: 4015 dni Posty: 927
Nick w MP: #AteX
Piwa : 8360
"Snapig" napisał/a :Z db3 bedzie ci??ko bo ja FTP nie mam a ja takimi sprawami serverowymi niezajmuje ale wlascciela poprosze (jak umie)
Nie potrzebujesz FTP. Masz admina na serwerze? To w konsoli(F8) wpisz debugscript 3 i uruchom skrypt.
Wysłany: 2016-02-19, 13:04
Snapig
Amator LUA
Wiek: 28 Na forum: 3793 dni Posty: 43
Nick w MP: Rother
Piwa : 129
"AteX" napisał/a : "Snapig" napisał/a :Z db3 bedzie ci??ko bo ja FTP nie mam a ja takimi sprawami serverowymi niezajmuje ale wlascciela poprosze (jak umie)
Nie potrzebujesz FTP. Masz admina na serwerze? To w konsoli(F8) wpisz debugscript 3 i uruchom skrypt.
Okej juz sie robi xd wchodze i zobacze xd
EDIT:
http://imgur.com/TH6RHq7
Ss zrobilem tak uruchomilem db 3 potem srkypt a potem inaczej pierw skrypt a potem db 3 i to pisze :>
Tagi: skrypt :: nie :: dziala
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: