Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-11-26, 16:23


pomaza







Wiek: 39
Na forum: 3982 dni
Posty: 79

Piwa: 2

Respekt: 50

Witam mam problem z skryptem na prace kierowcy autobusowego poniewasz jak wllanczam salon panaPrezesa i jak potem wejede do markeru pracy kierowcy autobusowego to pojazwia sie na chwile pojazd i znika oraz pisze ze zakonczylem prace.
Prosze o to kod pracy kierowcy autobusowego:
Kod:




local m1 = createMarker(125.00817108154, 1368.7432861328, 10.592546463013, "cylinder", 4.0, 255, 120, 0)
vehs = {}


function removePreviousVehicles(plr)
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
local sby = getElementData(v, "zrespilGracz")
if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
destroyElement(v)
end
end
end

addEventHandler("onMarkerHit", m1, function(el, md)
if getElementData(el, "zrespilGracz") then
outputChatBox("Praca w trakcie przygotowania.", el)
return
end

if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end

local x,y,z = getElementPosition(el)
local bus = createVehicle(593, x,y,z,0.0, 360.0, 269.9)

setElementData(bus, "zrespilGracz", el)
setElementData(bus, "pojazd_paliwo", 50)
setElementData(bus, "pojazd_przebieg", 69696969)
setElementData ( bus, "message", "Pilot DODO")

setVehicleHandling(bus,"maxVelocity", 50.00)

warpPedIntoVehicle(el, bus)
removePreviousVehicles(el)
triggerClientEvent(el, "STARTJobBus", resourceRoot, bus)
setVehicleHandling(bus,"maxVelocity", 50,00)

vehs[el] = bus
end)

addEvent("STOPJobBus", true)
addEventHandler("STOPJobBus", resourceRoot, function()
local pojazd = getPedOccupiedVehicle(localPlayer)
if pojazd then
destroyElement(pojazd)
end
end)

addEvent("destroyVeh", true)
addEventHandler("destroyVeh", getRootElement(),
function()
if vehs[source] then
if isElement(vehs[source]) then destroyElement(vehs[source]) end
end
end)

Bardzo prosze o pomoc.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 16:31


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Mo?liwe ?e w skrypcie pana prezesa marker sprzeda?y (bo chyba o ten ci chodzi) jest zdefiniowany tak? sam? nazw? jak ten w twojej pracy. Spr?buj zdefiniowa? marker jako globalny w skrypcie na pojazdy ;) albo zmieni? nazw? definicji..

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 16:36


pomaza







Wiek: 39
Na forum: 3982 dni
Posty: 79

Piwa: 2

Respekt: 50

Troche cie nie rozumiem :(

[ Dodano: 2015-11-26, 16:43 ]
dasz mi wiecej wskazowek ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 16:52


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Ehh.. Masz plik ze sprzeda?? aut w skrypcie od prezesa nie? I masz w tym pliku marker. Ten marker ma definicj?. To przed t? definicj? dopisz local. I powinno dzia?a?. Ewentualnie jak nue b?dzie dzia?a? to zmie? t? definicj? ;)

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 17:45


pomaza







Wiek: 39
Na forum: 3982 dni
Posty: 79

Piwa: 2

Respekt: 50

Kod:

local sprzedaz = createMarker(359.188, 166.193, 1008.383-0.9, "cylinder", 1, 255, 0, 0, 100)
setElementInterior ( sprzedaz, 3 )
function onSprzedazHit(hitElement, dim)
if getElementType(hitElement) == "player" then
local players = getElementsInMarker(sprzedaz)
triggerClientEvent(hitElement, "pokazGUISprzedazy", root, players)
end
end
addEventHandler("onMarkerHit", sprzedaz, onSprzedazHit)
takie cos ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-27, 13:49


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

jak nazywa sie marker w pracy kierowcy autobusu ? a jak w salonie chodzi o plik salon_s

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-27, 22:43


pomaza







Wiek: 39
Na forum: 3982 dni
Posty: 79

Piwa: 2

Respekt: 50

Kod:

local salon = createMarker(-826.093, 1440.056, 13.97, "cylinder", 1, 255, 0, 0, 100)

function onSalonHit(hitElement, dim)
if getElementType(hitElement) == "player" then
triggerClientEvent(hitElement, "pokazGUISalonu", root, salonowePojazdy)
end
end
addEventHandler("onMarkerHit", salon, onSalonHit)

To jest salon

a autobus to to
Kod:

local m1 = createMarker(-246.01370239258,1216.6114501953,19, "cylinder", 4.0, 255, 120, 0)
vehs = {}


function removePreviousVehicles(plr)
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
local sby = getElementData(v, "zrespilGracz")
if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
destroyElement(v)
end
end
end


[ Dodano: 2015-11-28, 12:08 ]
Moze ktos pomoc ?

[ Dodano: 2015-11-28, 14:53 ]
Prosz? bardzo o pomoc

[ Dodano: 2015-11-28, 17:40 ]
Moze to i dziwne ale wybralem inne miejsce i normalnie moge pracowac. Od czego to moze by? ? bo bez salonu tam mi dziala a z nim nie.

Postaw piwo autorowi tego posta
 

 
Tagi: bug
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku