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

Wysłany: 2019-05-02, 16:01


Erykos909







Wiek: 22
Na forum: 3002 dni
Posty: 16
Nick w MP: Paluszek

Piwa: 1

Respekt: 50

Witam, chce zrobic aby streetview na pysie 3.0 bylo od 50 srp a oto moj kod:

local b=createElement("text")
setElementData(b,"name","PRACA: Kierowca Street-View\nZAROBEK:\nOD 75PLN-150PLN\nOPIS: Identyfikowanie mapy")
setElementPosition(b,-1990.74957.8845.45)


local zone createColSphere(-1986.58955.0345.54,)
createBlip(-1984.40953.9245.4546,2,0,0,0,0,0,275)
local m1 createMarker(-1990.74957.8845.45-1"cylinder"1.53514235)
vehs = {}
local code "StreetView"
veh_obj = {}

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(elmd)
    if getElementData(el"vehicle_job_owner2"then
        outputChatBox("Wyst?pi? b??d #6969, zg?o? si? do CEO!"el)
        return
    end

    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
    if getElementData(el,"player:job"then return end
    if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end
    local x,y,getElementPosition(el)
    local bus createVehicle(400, -1986.58955.0345.54360.00.0179.3)
    setElementFrozen(el,true)
    setElementData(bus"vehicle_job_owner2"el)
    setElementData(bus"vehicle:fuel"100000)
    setElementData(bus"vehicle:mileage"math.random(50000,80000))
    setVehicleHandling(bus"maxVelocity"80.0)
    setElementData(el,"player:job",code)
   setTimer(warpPedIntoVehicle,200,1,el,bus)
    toggleControl(el,"enter_exit",false)
     setTimer(toggleControl,2000,1,el"enter_exit",true)
    setTimer(setElementFrozen,2000,1,elfalse)
    triggerClientEvent(el"STARTJobBus"resourceRootbus)

    vehs[el] = bus
    veh_obj[bus] = createObject(3031,0,0,0)
    attachElements(veh_obj[bus],bus,0.3,-0.9,1.6,0,0,90)
 end)

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

addEventHandler("onPlayerVehicleExit",resourceRoot,function()
destroyElement(source)
end)

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

addEventHandler("onElementDestroy",resourceRoot,function()
  if getElementType(source) == "vehicle" then
    if veh_obj[sourcethen destroyElement(veh_obj[source]); veh_obj[source] = nil end
  end
end)

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

[size=9][ [i][b]Dodano[/b]: 2019-05-0216:03[/i] ][/size]
M?g?by ktomi z tego zrobiaby to dzia?a?o lub powiedziegdzie wkleii jakelementdateWiem ,?e trzeba u?ytego tylko nie wiem gdzielocal rp getElementData(localPlayer"reputation") 
if rp =< 200 then


Ostatnio zmieniony przez DsJ3 2019-05-02, 20:34, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 16:20


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Podmie? sobie event:

addEventHandler("onMarkerHit"m1, function(elmd) 
if getElementData(el"vehicle_job_owner2"then 
outputChatBox("Wyst?pi? b??d #6969, zg?o? si? do CEO!"el) 
return 
end 
local rp getElementData(el"reputation") 
if rp =< 200 then
outputChatBox("Masz za ma?o reputacji!"el) 
return 
end 

if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end 
if getElementData(el,"player:job"then return end 
if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end 
local x,y,getElementPosition(ellocal bus createVehicle(400, -1986.58955.0345.54360.00.0179.3setElementFrozen(el,truesetElementData(bus"vehicle_job_owner2"elsetElementData(bus"vehicle:fuel"100000setElementData(bus"vehicle:mileage"math.random(50000,80000)) 
setVehicleHandling(bus"maxVelocity"80.0setElementData(el,"player:job",codesetTimer(warpPedIntoVehicle,200,1,el,bustoggleControl(el,"enter_exit",falsesetTimer(toggleControl,2000,1,el"enter_exit",truesetTimer(setElementFrozen,2000,1,elfalsetriggerClientEvent(el"STARTJobBus"resourceRootbusvehs[el] = bus 
veh_obj[bus] = createObject(3031,0,0,0attachElements(veh_obj[bus],bus,0.3,-0.9,1.6,0,0,90end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 16:22


Erykos909







Wiek: 22
Na forum: 3002 dni
Posty: 16
Nick w MP: Paluszek

Piwa: 1

Respekt: 50

Okej, juz podmieniam, tylko chce jeszcze powiedziec ze chce zrobic wiecej prac. I jak mam to zrobic?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 16:25


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Zale?y jakie prace, na czym maj? polega? i co w nich chcesz robi?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 16:26


Erykos909







Wiek: 22
Na forum: 3002 dni
Posty: 16
Nick w MP: Paluszek

Piwa: 1

Respekt: 50

Nie moge tego podmienic, cos jest nie tak. Co mam dokladnie podmienic? Znika marker. A co do prac to magazynier kosiarki itd.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 16:35


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Usu? stary event i wklej ten nowy.

Co do prac to mo?esz u?y?

Więcej informacji znajdziesz w Wikipedii MTA:

onClientMarkerHit


Więcej informacji znajdziesz w Wikipedii MTA:

createVehicle


Więcej informacji znajdziesz w Wikipedii MTA:

createMarker


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 16:37


Erykos909







Wiek: 22
Na forum: 3002 dni
Posty: 16
Nick w MP: Paluszek

Piwa: 1

Respekt: 50

Nic to nie daje, mysle ze to moze byc wina tego ze wszystko jest takjakby po lewej stronie. Markeru dalej nie ma....

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 16:39


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Poka? kod po wklejeniu tego przez Ciebie.

Tabulatory nie maj? nic do tego. Ty wys?a?e? kod w taki sam spos?b, wi?c pewnie masz tak samo w kodzie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 16:41


Erykos909







Wiek: 22
Na forum: 3002 dni
Posty: 16
Nick w MP: Paluszek

Piwa: 1

Respekt: 50

Kod:

local b=createElement("text")
setElementData(b,"name","PRACA: Kierowca Street-View\nZAROBEK:\nOD 75PLN-150PLN\nOPIS: Identyfikowanie mapy")
setElementPosition(b,-1990.74, 957.88, 45.45)


local zone = createColSphere(-1986.58, 955.03, 45.54,3 )
createBlip(-1984.40, 953.92, 45.45, 46,2,0,0,0,0,0,275)
local m1 = createMarker(-1990.74, 957.88, 45.45-1, "cylinder", 1.5, 35, 142, 35)
vehs = {}
local code = "StreetView"
veh_obj = {}

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, "vehicle_job_owner2") then
outputChatBox("Wyst?pi? b??d #6969, zg?o? si? do CEO!", el)
return
end
local rp = getElementData(el, "reputation")
if rp =< 200 then
outputChatBox("Masz za ma?o reputacji!", el)
return
end

if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
if getElementData(el,"player:job") then return end
if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end
local x,y,z = getElementPosition(el)
local bus = createVehicle(400, -1986.58, 955.03, 45.54, 360.0, 0.0, 179.3)
setElementFrozen(el,true)
setElementData(bus, "vehicle_job_owner2", el)
setElementData(bus, "vehicle:fuel", 100000)
setElementData(bus, "vehicle:mileage", math.random(50000,80000))
setVehicleHandling(bus, "maxVelocity", 80.0)
setElementData(el,"player:job",code)
setTimer(warpPedIntoVehicle,200,1,el,bus)
toggleControl(el,"enter_exit",false)
setTimer(toggleControl,2000,1,el, "enter_exit",true)
setTimer(setElementFrozen,2000,1,el, false)
triggerClientEvent(el, "STARTJobBus", resourceRoot, bus)

vehs[el] = bus
veh_obj[bus] = createObject(3031,0,0,0)
attachElements(veh_obj[bus],bus,0.3,-0.9,1.6,0,0,90)
end)


[ Dodano: 2019-05-02, 16:45 ]
W kodzie mam inaczej ...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 16:50


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Mia?e? tylko podmieni? jeden event, u Ciebie du?o ich poznika?o. Spr?buj je wklei? ponownie i daj zna?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 16:58


Erykos909







Wiek: 22
Na forum: 3002 dni
Posty: 16
Nick w MP: Paluszek

Piwa: 1

Respekt: 50

Nie wiem, nie ogarniam. ?ap to i zobacz jak to wygl?da: https://imgur.com/3mhdbE8

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 17:04


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Jakie? b??dy /debugscript 3?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 17:15


Erykos909







Wiek: 22
Na forum: 3002 dni
Posty: 16
Nick w MP: Paluszek

Piwa: 1

Respekt: 50

co? tam przy then nie pasuje : https://imgur.com/ThMzkBq

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 17:19


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Spr?buj podmieni?:

addEventHandler("onMarkerHit"m1, function(elmd) 
if getElementData(el"vehicle_job_owner2"then 
outputChatBox("Wyst?pi? b??d #6969, zg?o? si? do CEO!"el) 
return 
end 
local rp getElementData(el"reputation") 
if rp <= 200 then 
outputChatBox("Masz za ma?o reputacji!"el) 
return 
end 

if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end 
if getElementData(el,"player:job"then return end 
if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end 
local x,y,getElementPosition(ellocal bus createVehicle(400, -1986.58955.0345.54360.00.0179.3setElementFrozen(el,truesetElementData(bus"vehicle_job_owner2"elsetElementData(bus"vehicle:fuel"100000setElementData(bus"vehicle:mileage"math.random(50000,80000)) 
setVehicleHandling(bus"maxVelocity"80.0setElementData(el,"player:job",codesetTimer(warpPedIntoVehicle,200,1,el,bustoggleControl(el,"enter_exit",falsesetTimer(toggleControl,2000,1,el"enter_exit",truesetTimer(setElementFrozen,2000,1,elfalsetriggerClientEvent(el"STARTJobBus"resourceRootbusvehs[el] = bus 
veh_obj[bus] = createObject(3031,0,0,0attachElements(veh_obj[bus],bus,0.3,-0.9,1.6,0,0,90end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-05-02, 17:26


Erykos909







Wiek: 22
Na forum: 3002 dni
Posty: 16
Nick w MP: Paluszek

Piwa: 1

Respekt: 50

Teraz inny b??d, marker jest ale autko si? nie respi : https://imgur.com/QCDNqY0

Postaw piwo autorowi tego posta
 

 
Tagi: praca :: ilus :: tam :: punktów :: reputacji
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Praca od ilus tam punktów Reputacji 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