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

Wysłany: 2018-11-24, 22:00


Kakatus







Wiek: 26
Na forum: 2891 dni
Posty: 8
Nick w MP: kakatus



Respekt: 50

Cze??, natkn??em si? na problem z przechowalni?. Kto? wie o co chodzi?
[18-11-24 21:52] ERROR: [Zasoby]/rpg_garage/przecho_server.lua:166: attempt to get length of global 'q' (a boolean value)

ta linijka:
if #q > 0 then


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:05


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Poka? ca?y kod.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:07


Kakatus







Wiek: 26
Na forum: 2891 dni
Posty: 8
Nick w MP: kakatus



Respekt: 50

------------------------------------------------ PulsLife ------------------------------------------------
--                                       Skrypt serwera PulsLife                                        --
--                                                                                                      --
--                            U?YWANIE TYCH SKRYPT?W, MAP I MODELI ZABRONIONE                           --
----------------------------------------------------------------------------------------------------------
local respawnedVehs = {}
local przechowalnie = {
{ped_przecho={1612.650390625, -1560.6572265625, 14.170525550842},ped_name="Andrei Bruton",marker_wyjscie={1618.046875, -1554.3974609375, 13.662183189392, 0},marker_wejscie={1607.7978515625, -1554.431640625, 15.58208656311},collNoCollision={1600.796875, -1561.7890625, 12.04783763885, 22.4, 20, 8}},
--{ped_przecho={-2418.3095703125, 1029.162109375, 50.39062,0},colider_ped={-2418.35546875, 1030.1201171875, 50.390625},marker_wyjscie={-2426.41015625, 1031.78125, 50.390625, 358.21194458008},marker_wejscie={-2436.794921875, 1031.017578125, 50.390625},brama={-2424.1728515625, 1028.4375, 50.390625, 90}}
}

addEventHandler("onColShapeHit", root, function(el,md)
    if getElementType(el) ~= "player" then return end
    if getElementData(source, "przecho:wyjazd") then
        if isPedInVehicle(el) then return end
         bindKey(el, "e", "down", rozmowaStart)
        exports.rpg_noti:createNotification(el, "info", "Aby porazmawia? z NPC naci?nij E")
        setElementData(el, "przecho:wyjazd", getElementData(source, "przecho:wyjazd"))
        setElementData(el, "przecho:rotacja", getElementData(source, "przecho:rotacja"))
        setElementData(el, "ped:name", getElementData(source, "ped:name"))
    end
end)


function usunRozmowe ( thePlayer )
    if getElementData(source, "przecho:wyjazd") then
       unbindKey(thePlayer, "e", "down", rozmowaStart)
       setElementData(thePlayer, "hud:blockOpen", false)
       setElementData(thePlayer, "przecho:wyjazd", false)
       setElementData(thePlayer, "przecho:rotacja", false)
         setElementData(thePlayer, "ped:name", false)
   end
end
addEventHandler ( "onColShapeLeave", resourceRoot, usunRozmowe )

function rozmowaStart(thePlayer)
    if getElementData(thePlayer, "hud:blockOpen") then return end
    if isPedInVehicle(thePlayer) then return end

    local responseArray = { "Dzie? dobry", "Czym si? zajmujesz?", "Chcia?bym skorzysta? z waszych us?ug", "Musz? ju? i??" }
    local event = "SFPrzecho"
    setElementData(thePlayer, "hud:blockOpen", true)
    triggerClientEvent( thePlayer, "npc:talk", thePlayer, responseArray, event, 1)
end

function SFPrzecho(thePlayer, state, odp)
    local pedName = getElementData(thePlayer, "ped:name")
    if state == 1 then
        if odp == 1 then
        outputChatBox( "#9E9E9E"..pedName..": #ffffffMamy du?o klient?w. Prosz? si? pospieszy?", thePlayer, 255, 255, 255, true )
        setElementData(thePlayer, "hud:blockOpen", false)
        elseif odp == 2 then
            outputChatBox( "#9E9E9E"..pedName..": #ffffffMo?esz u mnie zostawi? samoch?d na przechowanie. Nasze siedziby znajduj? si? wsz?dzie. Zawsze mo?esz odebra? sw?j pojazd w jednej z nich.", thePlayer, 255, 255, 255, true )
            setElementData(thePlayer, "hud:blockOpen", false)
        elseif odp == 3 then
            outputChatBox( "#9E9E9E"..pedName..": #ffffffCzego potrzeba?", thePlayer, 255, 255, 255, true )
            local responseArray = {"Chcia?bym odebra? specjalny pojazd", "Chcia?bym odebra? sw?j pojazd", "Dzi?kuj? za po?wi?cony czas", "Do widzenia" }
            local event = "SFPrzecho"
            setElementData(thePlayer, "hud:blockOpen", true)
            triggerClientEvent( thePlayer, "npc:talk", thePlayer, responseArray, event, 2)
        elseif odp == 4 then
            outputChatBox( "#9E9E9E"..pedName..": #ffffffDo zobaczenia.", thePlayer, 255, 255, 255, true )
            setElementData(thePlayer, "hud:blockOpen", false)
        end

    elseif state == 2 then
        if odp == 1 then
            pokazListeForSpecialCars(thePlayer)
            setElementData(thePlayer, "hud:blockOpen", false)
        elseif odp == 2 then
            pokazListe(thePlayer)
        elseif odp == 3 then
            outputChatBox( "#9E9E9E"..pedName..": #ffffffProsz? mi nie zawraca? bezsensownie czasu nast?pnym razem dobrze?", thePlayer, 255, 255, 255, true )
            setElementData(thePlayer, "hud:blockOpen", false)
        elseif odp == 4 then
            outputChatBox( "#9E9E9E"..pedName..": #ffffffDo zobaczenia.", thePlayer, 255, 255, 255, true )
            setElementData(thePlayer, "hud:blockOpen", false)
        end
    end
end
addEvent("SFPrzecho",true)
addEventHandler("SFPrzecho",root,SFPrzecho)


addEventHandler("onResourceStart", resourceRoot, function ()
    for i,v in ipairs(przechowalnie) do
        local ped_x,ped_y,ped_z, ped_rot = unpack(v["ped_przecho"])
        local ped = createPed(120, ped_x, ped_y, ped_z, ped_rot)
        createBlip( ped_x, ped_y, ped_z, 14, 2, 255, 255, 255 , 255, 0, 370)
        setElementData(ped, "name", v["ped_name"])
        setElementData(ped, "role", "[Obs?uga przechowalni]")
        setPedFrozen( ped, true)

        local x2,y2,z2 = unpack(v["marker_wyjscie"])
        cs_wyjazd = createColSphere(x2, y2, z2, 3)

        local x,y,z, w,d,h = unpack(v["collNoCollision"])
        local csCol = createColCuboid (x,y,z, w,d,h)

        addEventHandler("onColShapeHit",csCol, function(plr)
            if getElementType ( plr ) == "player" then
                if getPedOccupiedVehicle(plr) then
                    triggerClientEvent( plr, "addGhostMode", plr, getPedOccupiedVehicle(plr))
                end
            end
        end)

        addEventHandler("onColShapeLeave",csCol, function(plr)
            if getElementType ( plr ) == "player" then
                if getPedOccupiedVehicle(plr) then
                    triggerClientEvent( plr, "removeGhostMode", plr, getPedOccupiedVehicle(plr))
                end
            end
        end)


        addEventHandler("onColShapeLeave",cs_wyjazd,killTimerShape)

        local colX,colY,colZ = getPositionInfrontOfElement(ped, 1)
        colider_ped = createColSphere(colX, colY, colZ, 1 )
        setElementData(colider_ped, "przecho:wyjazd", cs_wyjazd)
        setElementData(colider_ped, "przecho:rotacja", v["marker_wyjscie"][4])
        setElementData(colider_ped, "ped:name", v["ped_name"])

        local wjaX,wjaY,wjaZ = unpack(v["marker_wejscie"])
        cs_wjazd = createMarker(wjaX, wjaY, wjaZ-2.98, "cylinder", 5, 11, 177, 206, 0)
        setElementData(cs_wjazd, "isMarkerCustom", true)
        setElementData(cs_wjazd, "customMarker:img", "parking")
        setElementData(cs_wjazd, "przecho:marker",true)

        addEventHandler("onMarkerHit", cs_wjazd, oddajPojazd)
        addEventHandler("onColShapeLeave", colider_ped, usunListe)
    end
end)

function killTimerShape(hit,dim)
    if not hit or not isElement(hit) then return end
    if getElementType(hit) == "vehicle" then
        if isTimer(getElementData(hit, "onSpawnParkingTimer")) then
            killTimer(getElementData(hit, "onSpawnParkingTimer"))
        end
    end
end

function pokazListeForSpecialCars(plr)
    local q = exports.rpg_mysql:mysql_query("SELECT id FROM rpg_vehiclesSpecial WHERE parking=1 AND owner=? LIMIT 1", getElementData(plr, "user:uid"))
    if #q > 0 then
        odbierzPojazd(plr, q[1].id, 2)
    else
        local pedName = getElementData(plr, "ped:name")
        if getElementData(plr, "user:plec") == 1 then
            outputChatBox( "#9E9E9E"..pedName..": #ffffffNie posiadamy ?adnego pa?skiego pojazdu.", plr, 255, 255, 255, true )
        else
            outputChatBox( "#9E9E9E"..pedName..": #ffffffNie zostawi?a pani u nas ?adnego pojazdu.", plr, 255, 255, 255, true )
        end
    end
end

function pokazListe(hit)
    if getElementType(hit) ~= "player" then return end
    if isPedInVehicle(hit) then return end
    local rent = tostring("%"..getElementData(hit, "user:imie").." "..getElementData(hit, "user:nazwisko").."%")

    q = exports.rpg_mysql:mysql_query("SELECT * FROM rpg_vehicles WHERE (ownedPlayer=? AND parking=1) OR (rent LIKE ? AND parking=1)", getElementData(hit, "user:uid"), rent)

    if #q > 0 then
        outputChatBox( "#9E9E9E[Parkingowy] #ffffffKt?ry pojazd sobie ?yczysz?", hit, 255, 255, 255, true )

        setElementData(hit ,"hud:blockOpen", true)
        setElementData(hit, "hud:enabled", false)

        triggerClientEvent(hit, "createLoadingWindow", hit, "Wczytywanie pojazd?w w gara?u")
        setTimer(function() triggerClientEvent(hit, "removeLoadingWindow", hit) end, 2000, 1 )
        setTimer(function() triggerClientEvent(hit, "showPrzechoWindow", hit, q, q2) end, 1000, 1 )
    else
        local pedName = getElementData(hit, "ped:name")
        if getElementData(hit, "user:plec") == 1 then
            outputChatBox( "#9E9E9E"..pedName..": #ffffffNie posiadamy ?adnego pa?skiego pojazdu.", hit, 255, 255, 255, true )
        else
            outputChatBox( "#9E9E9E"..pedName..": #ffffffNie zostawi?a pani u nas ?adnego pojazdu.", hit, 255, 255, 255, true )
        end
    return end
end

function usunListe(hit, dim)
    setElementData(hit, "przecho:wyjazd", false)
    setElementData(hit, "przecho:rotacja", false)
end

function odbierzPojazd(player, uid, type)
    if type == 1 then
        local przecho_wyjazd = getElementData(player, "przecho:wyjazd")
        local x2,y2,z2 = getElementPosition(przecho_wyjazd)
        local rz = getElementData(player, "przecho:rotacja")
        q = exports.rpg_mysql:mysql_query("SELECT parking FROM rpg_vehicles WHERE id = ?", uid)
        if tonumber(q[1].parking) == 0 then return end

        veh = exports.rpg_vehicles:onRespawnVehicles(_,uid, {x2,y2,z2-20,0,0,rz}, true)
        exports.rpg_mysql:mysql_query("UPDATE rpg_vehicles SET parking=0 WHERE id=?", uid)

        setTimer(function()
            local x2,y2,z2 = getElementPosition(przecho_wyjazd)
            setElementPosition(veh,x2,y2,z2)
            setElementRotation(veh, 0,0,rz)

            warpPedIntoVehicle(player, veh)

            triggerClientEvent( player, "addGhostMode", player, veh)
        end, 1000, 1)

        local timer = setTimer(function()
            exports.rpg_vehicles:onSaveVehicle(veh)
            destroyElement(veh)
            local q = exports.rpg_mysql:mysql_query("UPDATE rpg_vehicles SET parking=1 WHERE id=?", uid)
        end, 15000, 1)

        setElementData(veh, "onSpawnParkingTimer", timer)
        usunListe(player)

    else
        local przecho_wyjazd = getElementData(player, "przecho:wyjazd")
        local x2,y2,z2 = getElementPosition(przecho_wyjazd)
        local rz = getElementData(player, "przecho:rotacja")
        q = exports.rpg_mysql:mysql_query("SELECT parking, model, date FROM rpg_vehiclesSpecial WHERE id = ? AND time > NOW()", uid)
        if tonumber(q[1].parking) == 0 then return end

        veh = createVehicle(q[1].model, x2,y2,z2-20,0,0,rz)
        blip = createBlipAttachedTo(veh, 0, 2, 255, 255, 255, 255, 0, 9999, player)
        respawnedVehs[player] = {veh, blip}
        setVehicleColor(respawnedVehs[player][1], 255, 184, 53, 255, 184, 53, 255, 184, 53, 255, 184, 53)
        setElementData(respawnedVehs[player][1], "vehicle:spawnSpecial", true)
        setElementData(respawnedVehs[player][1], "vehicle:idSpecial", uid)
        setElementData(respawnedVehs[player][1], "vehicle:ownedPlayer", getElementData(player, "user:uid"))
        setElementData(respawnedVehs[player][1], "vehicle:capacity", 50)
        setElementData(respawnedVehs[player][1], "vehicle:fuel", 50)
        setElementData(respawnedVehs[player][1], "vehicle:milage", 0)
        setElementData(respawnedVehs[player][1], "vehicle:date", q[1].date)
        setElementData(respawnedVehs[player][1], "vehicle:respawned", getTickCount())

        exports.rpg_mysql:mysql_query("UPDATE rpg_vehiclesSpecial SET parking=0 WHERE id=?", uid)

        setTimer(function()
            local x2,y2,z2 = getElementPosition(przecho_wyjazd)
            setElementPosition(respawnedVehs[player][1],x2,y2,z2)
            setElementRotation(respawnedVehs[player][1],0,0,rz)
            warpPedIntoVehicle(player, respawnedVehs[player][1])

            triggerClientEvent( player, "addGhostMode", player, respawnedVehs[player][1])
        end, 1000, 1)

        usunListe(player)
    end
end
addEvent("odbierzPojazd", true)
addEventHandler("odbierzPojazd", getRootElement(), odbierzPojazd)

function oddajPojazd(hit, dim)
    if not hit or not isElement(hit) then return end
    if getElementType(hit) ~= "player" then return end
    if not isPedInVehicle(hit) then return end
    local veh = getPedOccupiedVehicle(hit)
    local uid = getElementData(veh, "vehicle:id")
    if not uid then exports.rpg_noti:createNotification(hit, "error", "Nie mo?nesz odda? tego pojazdu do przechowywalni") return end
    local t1 = setTimer(function()

        fadeCamera(hit, false)
        t2 = setTimer(
        function()
            fadeCamera(hit, true)
            exports.rpg_vehicles:onSaveVehicle(veh)
            local q,n,i = exports.rpg_mysql:mysql_query("UPDATE rpg_vehicles SET parking=1 WHERE id=?", uid)
            if q then
                removePedFromVehicle(hit)
                destroyElement(veh)
                exports.rpg_noti:createNotification(hit, "success", "Oddajesz sw?j pojazd do przechowywalni.")
            else
                exports.rpg_noti:createNotification(hit, "error", "Wystapi? problem podczas oddawania pojazdu do przechowywalni [ERR13]")
            end
        end, 2000, 1)

    end,2000,1)
    setElementData(veh, "przecho:timer", t1)
    setElementData(veh, "przecho:timer2", t2)
end

function killTimerr(hit,dim)
    if not hit or not isElement(hit) then return end
    if getElementData(source, "przecho:marker") then
        if getElementType(hit) == "vehicle" then
            if isTimer(getElementData(hit, "przecho:timer")) then killTimer(getElementData(hit, "przecho:timer")) end
            if isTimer(getElementData(hit, "przecho:timer2")) then killTimer(getElementData(hit, "przecho:timer2")) end
        end
    end
end
addEventHandler("onMarkerLeave",root,killTimerr)

function getPositionInfrontOfElement(element, meters)
    if (not element or not isElement(element)) then return false end
    local meters = (type(meters) == "number" and meters) or 3
    local posX, posY, posZ = getElementPosition(element)
    local _, _, rotation = getElementRotation(element)
    posX = posX - math.sin(math.rad(rotation)) * meters
    posY = posY + math.cos(math.rad(rotation)) * meters
    rot = rotation + math.cos(math.rad(rotation))
    return posX, posY, posZ , rot
end


addEventHandler("onResourceStop", resourceRoot, function(resource)
    exports.rpg_mysql:mysql_query("UPDATE rpg_vehiclesSpecial SET parking=1")

    for i, v in pairs(respawnedVehs) do
        if isElement(v[1]) then
            local uid = getElementData(v[1], "vehicle:idSpecial")
            local date = getElementData(v[1], "vehicle:date") - (getTickCount() - (getElementData(v[1], "vehicle:respawned"))/1000)
            if date > 0 then
                exports.rpg_mysql:mysql_query("UPDATE rpg_vehiclesSpecial SET date=? WHERE id = ?", date, uid)
            else
                exports.rpg_mysql:mysql_query("DELETE FROM `rpg_vehiclesSpecial` WHERE id = ?", uid)
            end
            destroyElement(v[1])
        end
        if isElement(v[2]) then destroyElement(v[2]) end
    end
end)



function checkCarTime()
    for i, v in pairs(respawnedVehs) do
        if isElement(v[1]) then
            local uid = getElementData(v[1], "vehicle:idSpecial")
            local date = getElementData(v[1], "vehicle:date") - (getTickCount() - (getElementData(v[1], "vehicle:respawned"))/1000)
            if date <= 0 then
                exports.rpg_mysql:mysql_query("DELETE FROM `rpg_vehiclesSpecial` WHERE id = ?", uid)
                if isElement(v[1]) then destroyElement(v[1]) end
                if isElement(v[2]) then destroyElement(v[2]) end
            end
        end
    end

    exports.rpg_mysql:mysql_query("DELETE FROM `rpg_vehiclesSpecial` WHERE `time` < NOW()")
end
checkCarTime()
setTimer(checkCarTime, 60000, 0)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:13


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Czy mo?esz wys?a? funkcj? 'mysql_query' ze skryptu 'rpg_mysql'?
Chcia?bym zobaczy? w jaki spos?b zwracane s? dane z bazy danych MySQL.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:15


Kakatus







Wiek: 26
Na forum: 2891 dni
Posty: 8
Nick w MP: kakatus



Respekt: 50

------------------------------------------------ PulsLife ------------------------------------------------
--                                       Skrypt serwera PulsLife                                        --
--                                                                                                      --
--                            U?YWANIE TYCH SKRYPT?W, MAP I MODELI ZABRONIONE                           --
----------------------------------------------------------------------------------------------------------
local mysql
function mysql_connect()
    mysql = dbConnect("mysql", "dbname=db_37291;host=94.23.90.14", "db_32791", "taelqvtastasdsx", "share=1")
    if not mysql then
        outputDebugString("[rpg_mysql] Connection: false")
    else
        outputDebugString("[rpg_mysql] Connection: true")
        setNames()
    end
end
addEventHandler("onResourceStart", resourceRoot, mysql_connect)


function mysql_query(...)
    if string.find(table.concat({...}, " "), "DROP") then return end
    local qh = dbQuery(mysql,  ...)
    if not qh then return false end
    local result, num_affected_rows, last_insert_id = dbPoll(qh, -1)
    return result, num_affected_rows, last_insert_id
end

function setNames()
    if mysql then
        mysql_query("SET NAMES utf8")
    end
end


[ Dodano: 2018-11-24, 22:16 ]
Discord posiadasz? jesli tak to prosilbym o kontakt.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:19


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Spr?buj jedn? z dw?ch opcji poni?ej:

if q then


lub

if q[1] then


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:25


Kakatus







Wiek: 26
Na forum: 2891 dni
Posty: 8
Nick w MP: kakatus



Respekt: 50

Pojawia sie wyciaganie z pojazdu lecz pojawia sie rowniez blad


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:29


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Wy?lij kod z pliku 'przecho_client.luac' ze skryptu 'rpg_garage'.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:30


Kakatus







Wiek: 26
Na forum: 2891 dni
Posty: 8
Nick w MP: kakatus



Respekt: 50

if guiGetScreenSize() < 1400 then
end
function isMouseInPosition(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_)
  if not isCursorShowing() then
    return false
  end
  if _ARG_0_ <= getCursorPosition() * guiGetScreenSize() and getCursorPosition() * guiGetScreenSize() <= _ARG_0_ + _ARG_2_ and _ARG_1_ <= getCursorPosition() * guiGetScreenSize() and getCursorPosition() * guiGetScreenSize() <= _ARG_1_ + _ARG_3_ then
    return true
  else
    return false
  end
end
function openPrzechoWindow(_ARG_0_, _ARG_1_)
  vehicles1 = {}
  vehicles1 = _ARG_0_
  _UPVALUE0_ = 1
  _UPVALUE1_ = createVehicle(vehicles1[1].model, 1600.671875, -1573.107421875, 14.804800987244, 0, 0, 307)
  ped = createPed(getElementModel(localPlayer), 1595.9453125, -1578.0234375, 15.863374710083, 305.9382019043, false)
  showChat(false)
  setTimer(function()
    if vehicles1[1].tuning ~= false and vehicles1[1].tuning ~= "" and vehicles1[1].tuning ~= nil then
      for _FORV_3_, _FORV_4_ in ipairs(split(vehicles1[1].tuning, ",")) do
        addVehicleUpgrade(_UPVALUE0_, _FORV_4_)
      end
    end
    setElementData(_UPVALUE0_, "vehicle:neon", split(vehicles1[1].neon, ","))
    setVehiclePaintjob(_UPVALUE0_, vehicles1[1].paintjob)
    setVehicleOverrideLights(_UPVALUE0_, 2)
    setElementHealth(_UPVALUE0_, vehicles1[1].health)
    setVehicleHeadLightColor(_UPVALUE0_, split(vehicles1[1].headlights, ",")[1], split(vehicles1[1].headlights, ",")[2], split(vehicles1[1].headlights, ",")[3])
    setVehicleColor(_UPVALUE0_, split(vehicles1[1].color, ",")[1], split(vehicles1[1].color, ",")[2], split(vehicles1[1].color, ",")[3], split(vehicles1[1].color, ",")[4], split(vehicles1[1].color, ",")[5], split(vehicles1[1].color, ",")[6], split(vehicles1[1].color, ",")[7], split(vehicles1[1].color, ",")[8], split(vehicles1[1].color, ",")[9], split(vehicles1[1].color, ",")[10], split(vehicles1[1].color, ",")[11], split(vehicles1[1].color, ",")[12])
    setElementFrozen(localPlayer, true)
    addEventHandler("onClientRender", getRootElement(), render)
    setElementData(localPlayer, "user:blockFP", true)
  end, 200, 1)
  setTimer(function()
    addEventHandler("onClientKey", root, click)
  end, 1000, 1)
end
addEvent("showPrzechoWindow", true)
addEventHandler("showPrzechoWindow", getRootElement(), openPrzechoWindow)
function clickAccept(_ARG_0_)
  if not _ARG_0_ then
    return
  end
  triggerServerEvent("odbierzPojazd", root, localPlayer, _ARG_0_, 1)
  closePrzechoWindow()
end
addEvent("clickAccept", true)
addEventHandler("clickAccept", getRootElement(), clickAccept)
function closePrzechoWindow()
  removeEventHandler("onClientKey", root, click)
  setTimer(function()
    removeEventHandler("onClientRender", getRootElement(), render)
    setCameraTarget(localPlayer)
    destroyElement(_UPVALUE0_)
    destroyElement(ped)
    setElementData(localPlayer, "user:blockFP", false)
  end, 1000, 1)
  triggerEvent("createLoadingWindow", localPlayer, "Wczytywanie mapy 75wiata")
  setTimer(function()
    triggerEvent("removeLoadingWindow", localPlayer)
  end, 1400, 1)
  setTimer(function()
    setElementFrozen(localPlayer, false)
    setElementData(localPlayer, "hud:blockOpen", false)
    setElementData(localPlayer, "hud:enabled", true)
    hudSettings = split(getElementData(localPlayer, "hud:settings"), ",")
    if tonumber(hudSettings[4]) == 1 then
      showChat(true)
    end
  end, 1600, 1)
end
addEvent("destroyPrzechoWindow", true)
addEventHandler("destroyPrzechoWindow", getRootElement(), closePrzechoWindow)
function render()
  setCameraMatrix(1608.9638671875, -1569.7646484375, 16.383062362671, 1595.0498046875, -1575.71484375, 15.018062591553)
  dxDrawText(getVehicleName(_UPVALUE0_) or "ERROR", 0, _UPVALUE1_ - 40 / _UPVALUE2_, _UPVALUE3_, _UPVALUE1_ - 40 / _UPVALUE2_, tocolor(220, 220, 220, 220), 1, _UPVALUE4_, "center", "bottom")
  dxDrawImage(0, 0, 520 / _UPVALUE2_, 273 / _UPVALUE2_, "files/legend.png")
end
function click(_ARG_0_, _ARG_1_)
  if _ARG_0_ == "arrow_r" and _ARG_1_ then
    if _UPVALUE0_ + 1 > #vehicles1 then
      return
    end
    _UPVALUE0_ = _UPVALUE0_ + 1
    fadeCamera(false, 0.3)
    if isTimer(timerOff) then
      killTimer(timerOff)
    end
    timerOff = setTimer(function()
      fadeCamera(true, 0.5)
    end, 500, 1)
    setTimer(function()
      setElementModel(_UPVALUE0_, vehicles1[_UPVALUE1_].model)
      if vehicles1[_UPVALUE1_].tuning ~= false and vehicles1[_UPVALUE1_].tuning ~= "" and vehicles1[_UPVALUE1_].tuning ~= nil then
        for _FORV_3_, _FORV_4_ in ipairs(split(vehicles1[_UPVALUE1_].tuning, ",")) do
          addVehicleUpgrade(_UPVALUE0_, _FORV_4_)
        end
      end
      setElementData(_UPVALUE0_, "vehicle:neon", (split(vehicles1[_UPVALUE1_].neon, ",")))
      setVehicleOverrideLights(_UPVALUE0_, 2)
      setElementHealth(_UPVALUE0_, vehicles1[_UPVALUE1_].health)
      setVehicleHeadLightColor(_UPVALUE0_, split(vehicles1[_UPVALUE1_].headlights, ",")[1], split(vehicles1[_UPVALUE1_].headlights, ",")[2], split(vehicles1[_UPVALUE1_].headlights, ",")[3])
      setVehicleColor(_UPVALUE0_, split(vehicles1[_UPVALUE1_].color, ",")[1], split(vehicles1[_UPVALUE1_].color, ",")[2], split(vehicles1[_UPVALUE1_].color, ",")[3], split(vehicles1[_UPVALUE1_].color, ",")[4], split(vehicles1[_UPVALUE1_].color, ",")[5], split(vehicles1[_UPVALUE1_].color, ",")[6], split(vehicles1[_UPVALUE1_].color, ",")[7], split(vehicles1[_UPVALUE1_].color, ",")[8], split(vehicles1[_UPVALUE1_].color, ",")[9], split(vehicles1[_UPVALUE1_].color, ",")[10], split(vehicles1[_UPVALUE1_].color, ",")[11], split(vehicles1[_UPVALUE1_].color, ",")[12])
    end, 400, 1)
  elseif _ARG_0_ == "arrow_l" and _ARG_1_ then
    if _UPVALUE0_ == 1 then
      return
    end
    _UPVALUE0_ = _UPVALUE0_ - 1
    fadeCamera(false, 0.3)
    if isTimer(timerOff) then
      killTimer(timerOff)
    end
    timerOff = setTimer(function()
      fadeCamera(true, 0.5)
    end, 500, 1)
    setTimer(function()
      setElementModel(_UPVALUE0_, vehicles1[_UPVALUE1_].model)
      if vehicles1[_UPVALUE1_].tuning ~= false and vehicles1[_UPVALUE1_].tuning ~= "" and vehicles1[_UPVALUE1_].tuning ~= nil then
        for _FORV_3_, _FORV_4_ in ipairs(split(vehicles1[_UPVALUE1_].tuning, ",")) do
          addVehicleUpgrade(_UPVALUE0_, _FORV_4_)
        end
      end
      setElementData(_UPVALUE0_, "vehicle:neon", (split(vehicles1[_UPVALUE1_].neon, ",")))
      setVehicleOverrideLights(_UPVALUE0_, 2)
      setElementHealth(_UPVALUE0_, vehicles1[_UPVALUE1_].health)
      setVehicleHeadLightColor(_UPVALUE0_, split(vehicles1[_UPVALUE1_].headlights, ",")[1], split(vehicles1[_UPVALUE1_].headlights, ",")[2], split(vehicles1[_UPVALUE1_].headlights, ",")[3])
      setVehicleColor(_UPVALUE0_, split(vehicles1[_UPVALUE1_].color, ",")[1], split(vehicles1[_UPVALUE1_].color, ",")[2], split(vehicles1[_UPVALUE1_].color, ",")[3], split(vehicles1[_UPVALUE1_].color, ",")[4], split(vehicles1[_UPVALUE1_].color, ",")[5], split(vehicles1[_UPVALUE1_].color, ",")[6], split(vehicles1[_UPVALUE1_].color, ",")[7], split(vehicles1[_UPVALUE1_].color, ",")[8], split(vehicles1[_UPVALUE1_].color, ",")[9], split(vehicles1[_UPVALUE1_].color, ",")[10], split(vehicles1[_UPVALUE1_].color, ",")[11], split(vehicles1[_UPVALUE1_].color, ",")[12])
    end, 400, 1)
  elseif _ARG_0_ == "enter" and _ARG_1_ then
    clickAccept(vehicles1[_UPVALUE0_].id)
  elseif _ARG_0_ == "backspace" and _ARG_1_ then
    closePrzechoWindow()
  end
end
function dxDrawBorder(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_, _ARG_6_)
  _ARG_4_ = _ARG_4_ or 2
  dxDrawRectangle(_ARG_0_ - _ARG_4_, _ARG_1_, _ARG_4_, _ARG_3_, _ARG_5_ or tocolor(0, 0, 0, 180), _ARG_6_)
  dxDrawRectangle(_ARG_0_ + _ARG_2_, _ARG_1_, _ARG_4_, _ARG_3_, _ARG_5_ or tocolor(0, 0, 0, 180), _ARG_6_)
  dxDrawRectangle(_ARG_0_ - _ARG_4_, _ARG_1_ - _ARG_4_, _ARG_2_ + _ARG_4_ * 2, _ARG_4_, _ARG_5_ or tocolor(0, 0, 0, 180), _ARG_6_)
  dxDrawRectangle(_ARG_0_ - _ARG_4_, _ARG_1_ + _ARG_3_, _ARG_2_ + _ARG_4_ * 2, _ARG_4_, _ARG_5_ or tocolor(0, 0, 0, 180), _ARG_6_)
end
function ghostmode_on(_ARG_0_)
  for _FORV_4_, _FORV_5_ in ipairs(getElementsByType("vehicle")) do
    setElementCollidableWith(_ARG_0_, _FORV_5_, false)
    setElementCollidableWith(localPlayer, _FORV_5_, false)
  end
  _UPVALUE0_ = setTimer(function()
    if isElement(_UPVALUE0_) then
      for _FORV_3_, _FORV_4_ in ipairs(getElementsByType("vehicle")) do
        setElementCollidableWith(_UPVALUE0_, _FORV_4_, false)
        setElementCollidableWith(localPlayer, _FORV_4_, false)
      end
    end
  end, 10000, 0)
end
addEvent("addGhostMode", true)
addEventHandler("addGhostMode", getRootElement(), ghostmode_on)
function ghostmode_off(_ARG_0_)
  if isTimer(_UPVALUE0_) then
    killTimer(_UPVALUE0_)
  end
  for _FORV_4_, _FORV_5_ in ipairs(getElementsByType("vehicle")) do
    if isElement(_ARG_0_) then
      setElementCollidableWith(_ARG_0_, _FORV_5_, true)
    end
    setElementCollidableWith(localPlayer, _FORV_5_, true)
  end
end
addEvent("removeGhostMode", true)
addEventHandler("removeGhostMode", getRootElement(), ghostmode_off)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:34


Kakatus







Wiek: 26
Na forum: 2891 dni
Posty: 8
Nick w MP: kakatus



Respekt: 50

44 linijka w c lua .
return

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:46


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Czy auto normalnie si? pojawia podczas wyci?gania go z przechowalni? (mam na my?li podgl?d, chyba tak zosta?o to tutaj wykonane)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:47


Kakatus







Wiek: 26
Na forum: 2891 dni
Posty: 8
Nick w MP: kakatus



Respekt: 50

Do zamkniecia naprawilem.

Postaw piwo autorowi tego posta
 

 
Tagi: przechowalnia
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Przechowalnia 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