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

Wysłany: 2019-01-23, 22:37


smigi







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

Piwa: 2

Respekt: 50

Witam chcia?bym doda? do pracy np. wymagane 150rp jak dodac takie cos paczka pys3.0

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-23, 22:42


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

dodajesz to po stronie serwera w evencie onMarkerHit czyli marker rozpocz?cia pracy.


if getElementData(el"player:reputation") < 100 then triggerClientEvent(el'onClientAddNotification'el'Nie posiadasz 100 RP''error') return end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-23, 22:44


smigi







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

Piwa: 2

Respekt: 50

DylemaT929,
nadal dzia?a jak mam mniej ni? 100rp

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-23, 22:51


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

"smigi" napisał/a:

DylemaT929,
nadal dzia?a jak mam mniej ni? 100rp


daj mi ca?y kod w .[lua] [/lua.] (bez kropek a w ?rodku kod) po stronie serwera.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-23, 22:52


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Sprawd?, czy zmienna gracza w evencie zgadza si? z t?, co wys?a? DylemaT929.

Poka? kod pracy, w kt?rej chcesz doda? pr?g RP.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-23, 23:04


smigi







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

Piwa: 2

Respekt: 50

&#65279;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(-2461.83,133.49,35.1746,2,0,0,0,0,0,275)
local m1 createMarker(-2461.83133.4935.17"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, -2460.92152.3234.96360.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"150.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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-23, 23:54


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Jak ma dzia?a?, je?li nawet tego nigdzie nie wklei?e?, pozdro.

Sprawd?, czy elementData reputacji si? zgadza ("player:reputation"),
sprawd? r?wnie? czy posiadasz event "onClientAddNotification", kt?rym dodajesz notyfikacje i errory.

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(-2461.83,133.49,35.1746,2,0,0,0,0,0,275)
local m1 createMarker(-2461.83133.4935.17"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 getElementData(el"player:reputation") < 100 then 
        triggerClientEvent(el'onClientAddNotification'el'Nie posiadasz 100 RP''error') 
        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, -2460.92152.3234.96360.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"150.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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-24, 11:33


kuba43







Wiek: 45
Na forum: 3225 dni
Posty: 166
Nick w MP: definitly

Piwa: 17

Respekt: 30,5

masz gotowca licze na piwko

&#65279;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(-2461.83,133.49,35.1746,2,0,0,0,0,0,275)
local m1 createMarker(-2461.83133.4935.17"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 srp getElementData(el"player:srp")
    local wymagania 150 --  tu wpisujesz liczbe rp
    if srp => wymagania then
    local x,y,getElementPosition(el)
    local bus createVehicle(400, -2460.92152.3234.96360.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"150.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)


Podpis
„(…) wystarczy, że odpowiesz sobie na jedno zajebiście, ale to zajebiście, ważne pytanie: co lubię w życiu robić. A potem zacznij to robić.”.
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