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

Wysłany: 2019-02-09, 17:17


smigi







Wiek: 23
Na forum: 3508 dni
Posty: 60
Nick w MP: smigi

Piwa: 2

Respekt: 50

 local b=createElement("text")
setElementData(b,"name","PRACA: Kierowca Street-View\nZAROBEK:OD 40k DO 50k\nWymagania:Prawo Jazdy Kat B")
setElementPosition(b,160.86,-169.90,1.58)


local zone = createColSphere(-1986.58, 955.03, 45.54,3 )
createBlip(160.86,-169.90,1.58, 46,2,0,0,0,0,0,275)
local m1 = createMarker(160.86,-169.90,1.58-1, "cylinder", 1, 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
if getElementData(el,"player:license:pjB") ~= 1 then
        outputChatBox("* Aby tu pracowa? musisz mie? prawo jazdy kat. B!", el, 255, 0, 0)
        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, 159.76,-164.67,1.58, 360.0, 0.0, 90)
    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)

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[client] then
          if isElement(vehs[client]) then destroyElement(vehs[client]) end
     end
end)

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

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



Chcia?bym dodac zeby by?o wymaane 150rp

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-09, 17:32


BlueCry

ŚĆRIPTER LUJA






Wiek: 25
Na forum: 4147 dni
Posty: 78
Nick w MP: BlueCry

Piwa: 2178

Respekt: 110
Respekt: 110

Je?li tworzysz na pys 3.0 to masz tutaj poprawiony kod:

 local b=createElement("text")
setElementData(b,"name","PRACA: Kierowca Street-View\nZAROBEK:OD 40k DO 50k\nWymagania:Prawo Jazdy Kat B")
setElementPosition(b,160.86,-169.90,1.58)


local zone = createColSphere(-1986.58, 955.03, 45.54,3 )
createBlip(160.86,-169.90,1.58, 46,2,0,0,0,0,0,275)
local m1 = createMarker(160.86,-169.90,1.58-1, "cylinder", 1, 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
if getElementData(el,"player:license:pjB") ~= 1 then
        outputChatBox("* Aby tu pracowa? musisz mie? prawo jazdy kat. B!", el, 255, 0, 0)
        return
    end
if getElementData(el,"player:srp") < 150 then
        outputChatBox("* Aby tu pracowa? musisz mie? 150 Reputacji!", el, 255, 0, 0)
        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, 159.76,-164.67,1.58, 360.0, 0.0, 90)
    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)

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[client] then
          if isElement(vehs[client]) then destroyElement(vehs[client]) end
     end
end)

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

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


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
smigi
Wysłany: 2019-02-09, 17:49


smigi







Wiek: 23
Na forum: 3508 dni
Posty: 60
Nick w MP: smigi

Piwa: 2

Respekt: 50

muciu2404,
Dzi?ki dzia?a za to dostaniesz piwko

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-09, 21:59


Adis.exe

LUA Developer






Wiek: 24
Na forum: 3639 dni
Posty: 292
Nick w MP: Adiś.exe

Piwa: 996

Respekt: 110,3
Respekt: 110,3

[clo]

Podpis

KONTAKT:
GG: 60968224
Discord: Adiś.exe#3828

Użytkownik: 05.11.2016
GTAO Member: 20.02.2019
Support-Team: 25.07.2018
Support-Team: 19.01.2019
Test Mod: 08.02.2019

Postaw piwo autorowi tego posta
 

 
Tagi: praca
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