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

Wysłany: 2017-06-29, 11:54


Armus







Wiek: 43
Na forum: 3404 dni
Posty: 13
Nick w MP: Armus

Piwa: 1

Respekt: 50

Witam, posiadam paczke .SkyGame i mam pewien problem. Gdy robie tuning nie zale?nie czy w tunerze czy pod panelem pod p, Gdy wstawie auto do przecho i je wyciagne automatycznie ten tuning usuwa, i trzeba go montowa? jeszcze raz. Ma kto? mo?e jaki? pomys? jak to naprawi?? Z g?ry dzi?kuj? za pomoc

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
tRaweRs
Wysłany: 2017-06-29, 12:46


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4150 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Podaj kod tej przechowalni.

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-29, 12:52


Armus







Wiek: 43
Na forum: 3404 dni
Posty: 13
Nick w MP: Armus

Piwa: 1

Respekt: 50

c_parking.lua




local screenWscreenH guiGetScreenSize()
local marker=createMarker(-1785.15,793.49,24.89-1"cylinder"1.350,83,255,100)
local sphere=createColSphere(-1787.69,785.37,24.895)

local wm={} 
wm.gridlist=guiCreateGridList(0.340.390.3330.24true)
guiGridListAddColumn(wm.gridlist"ID Pojazdu"0.3)
guiGridListAddColumn(wm.gridlist"Model"0.3guiGridListAddColumn(wm.gridlist"Kierowca"0.3)
guiSetVisible(wm.gridlistfalse)

panel false

function PrzechoGUI()
local AlphaAlpha2 interpolateBetween(0002551800, ((getTickCount() - czas) / 2500), "Linear"local r2,g2,b2=interpolateBetween(255,255,255,20,250,0,(getTickCount()-czas)/1100,"SineCurve")
local r,g,b=interpolateBetween(255,255,255,255,0,0,(getTickCount()-czas)/1100,"SineCurve"dxDrawImage(screenW 0.3016screenH 0.2786screenW 0.4092screenH 0.4805"okn.png"000tocolor(000Alpha2), false)
if not cursorPosition(screenW 0.3367screenH 0.6406screenW 0.1054screenH 0.0469then --Wyjmij
dxDrawImage(screenW 0.3053screenH 0.5768screenW 0.1794screenH 0.1693"przycisk.png"000tocolor(255255255Alpha), false)
dxDrawText("Wyjmij pojazd", (screenW 0.3382) + 1, (screenH 0.6419) + 1, (screenW 0.4422) + 1, (screenH 0.6875) + 1tocolor(000Alpha), 1.14"default-bold""center""center"falsefalsefalsefalsefalse)
        
dxDrawText("Wyjmij pojazd"screenW 0.3382screenH 0.6419screenW 0.4422screenH 0.6875tocolor(244138Alpha), 1.14"default-bold""center""center"falsefalsefalsefalsefalse)
  
else 
dxDrawImage(screenW 0.3053screenH 0.5768screenW 0.1794screenH 0.1693"przycisk.png"000tocolor(r2,g2,b2255), false)
dxDrawText("Wyjmij pojazd", (screenW 0.3382) + 1, (screenH 0.6419) + 1, (screenW 0.4422) + 1, (screenH 0.6875) + 1tocolor(000255), 1.09"default-bold""center""center"falsefalsefalsefalsefalse)
        
dxDrawText("Wyjmij pojazd"screenW 0.3382screenH 0.6419screenW 0.4422screenH 0.6875tocolor(02550254), 1.09"default-bold""center""center"falsefalsefalsefalsefalse)
  
end 

if not cursorPosition(screenW 0.5688screenH 0.6432screenW 0.1054screenH 0.0469then --Wyjmij
dxDrawImage(screenW 0.5351screenH 0.5768screenW 0.1794screenH 0.1693"przycisk.png"000tocolor(255255255Alpha), false)
dxDrawText("Zamknij okno", (screenW 0.5688) + 1, (screenH 0.6432) + 1, (screenW 0.6728) + 1, (screenH 0.6888) + 1tocolor(000Alpha), 1.14"default-bold""center""center"falsefalsefalsefalsefalse)
        
dxDrawText("Zamknij okno"screenW 0.5688screenH 0.6432screenW 0.6728screenH 0.6888tocolor(244138Alpha), 1.14"default-bold""center""center"falsefalsefalsefalsefalse)
else 
dxDrawImage(screenW 0.5351screenH 0.5768screenW 0.1794screenH 0.1693"przycisk.png"000tocolor(r2,g2,b2255), false)
dxDrawText("Zamknij okno", (screenW 0.5688) + 1, (screenH 0.6432) + 1, (screenW 0.6728) + 1, (screenH 0.6888) + 1tocolor(000255), 1.09"default-bold""center""center"falsefalsefalsefalsefalse)
        
dxDrawText("Zamknij okno"screenW 0.5688screenH 0.6432screenW 0.6728screenH 0.6888tocolor(02550254), 1.09"default-bold""center""center"falsefalsefalsefalsefalse)  
end 

dxDrawText("Przechowalnia Pojazd?w!", (screenW 0.3375) + 1, (screenH 0.3503) + 1, (screenW 0.6728) + 1, (screenH 0.3893) + 1tocolor(000Alpha), 1.50"default-bold""center""center"falsefalsefalsefalsefalse)
dxDrawText("Przechowalnia Pojazd?w!"screenW 0.3375screenH 0.3503screenW 0.6728screenH 0.3893tocolor(r,g,bAlpha), 1.50"default-bold""center""center"falsefalsefalsefalsefalse)
       
end

addEvent("onParkingGetVehicles"true)
addEventHandler("onParkingGetVehicles"root, function(result)
    guiGridListClear(wm.gridlist)
    if not result then return end
    for i,v in pairs(result) do
        local row=guiGridListAddRow(wm.gridlist)
        guiGridListSetItemText(wm.gridlistrow1v["id"], falsefalse)
        guiGridListSetItemText(wm.gridlistrow2getVehicleNameFromModel(v["model"]), falsefalse)
        guiGridListSetItemText(wm.gridlistrow3v["driver"]:gsub("#%x%x%x%x%x%x",""), falsefalse)
    end
end)

addEventHandler("onClientMarkerHit"marker, function(el,md)
    if el~=localPlayer then return end
    if isPedInVehicle(elthen return end
    if guiGetVisible(wm.gridlist) == false then
                if panel == false then
                  addEventHandler("onClientRender",root,PrzechoGUI)
                  czas getTickCount()
        panel true
        showCursor(true)
        guiSetVisible(wm.gridlist,true)
        triggerServerEvent("onParkingGetRekords"localPlayer)
        --etCameraMatrix(-2056.26468.7738.49, -2048.08467.7335.17)
    end
       end
end)

function Przechowyjmij(buttonstate)
if panel and button == "left" and state == "down" then
           if cursorPosition(screenW 0.3367screenH 0.6406screenW 0.1054screenH 0.0469then
        local selectedRow=guiGridListGetSelectedItem(wm.gridlist) or -1
        if selectedRow 0 then return end
                        local vehicles=getElementsWithinColShape(sphere,"vehicle")
        if #vehicles > 0 then
                                                 outputChatBox("* Nie ma miejsca aby wyciagnac pojazd!"25500)
            return
        end
        local id=guiGridListGetItemText(wm.gridlistselectedRow1)
        guiGridListRemoveRow(wm.gridlistselectedRow)
        triggerServerEvent("onParkingVehicleSpawn"localPlayertonumber(id))
    end
   end
end
addEventHandler("onClientClick"getRootElement(), Przechowyjmij)

function Zamknij(buttonstate)
    if panel and button == "left" and state == "down" then
           if cursorPosition(screenW 0.5688screenH 0.6432screenW 0.1054screenH 0.0469then
                panel false 
                removeEventHandler ("onClientRender"rootPrzechoGUI)
                showCursor(false)
                guiSetVisible(wm.gridlistfalse)
         end
    end
end
addEventHandler("onClientClick"getRootElement(), Zamknij)

function cursorPosition(xywh)
    if (not isCursorShowing()) then
        return false
    end
    local mxmy getCursorPosition()
    local fullxfully guiGetScreenSize()
    cursorxcursory mx*fullxmy*fully
    if cursorx and cursorx and cursory and cursory h then
        return true
    else
        return false
    end
end

function filedelet ()
if fileExists("c_parking.lua"then
   fileDelete("c_parking.lua")
 end
end
addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), filedelet)
addEventHandler("onClientPlayerQuit"getRootElement(), filedelet)
addEventHandler("onClientPlayerJoin"getRootElement(), filedelet)



s_parking.lua


local marker=createMarker(-1787.69,785.37,24.89-5.0"cylinder"5143,0,255,100)
createBlip(-1800.91,802.22,24.8935,2,0,0,0,0,0,250)
local mdestroy createMarker(-1787.59,801.46,24.89-5.0"cylinder"5143,0,255,100)
local t=createElement("text")
setElementData(t,"scale",1)
setElementData(t,"name","Pozostawianie pojazd?w")
setElementPosition(t,-1787.59,801.46,24.89+1.3)
local tt=createElement("text")
setElementData(tt,"scale",1)
setElementData(tt,"name","Odbi?r pojazd?w")
setElementPosition(tt,-1787.69,785.37,24.89+1.3)

addEvent("onParkingGetRekords"true)
addEventHandler("onParkingGetRekords"root, function()
    local uid=getElementData(source,"player:uid")
    if not uid then return end
    local org getElementData(source,"player:organization")
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE (ownedPlayer=? OR ownedGroup=?) AND parking=1",uid,org or "Brak")
    if #result > 0 then
        triggerClientEvent(source"onParkingGetVehicles"sourceresult)
    end
end)

addEventHandler("onMarkerHit"mdestroy, function(el,md)
    if getElementType(el) == "player" then
        local veh=getPedOccupiedVehicle(el)
        if not veh then return end
        if getVehicleController(veh) ~= el then return end
        local id=getElementData(veh,"vehicle:id")
        if not id then return end
        if isTimer(timeroddaniathen return end
        setElementFrozen(veh,true)
        outputChatBox("* Trwa oddawanie  pojazdu do przechowalni..."el,255,255,255,true)
        toggleControl(el,"enter_exit",false)
        timeroddania=setTimer(function()
            setElementFrozen(veh,false)
            local id=getElementData(veh,"vehicle:id")
            if not id then return end
            exports["ogrpg-vehicles"]:onSaveVehicle(veh)
            destroyElement(veh)
            exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1 WHERE id=?"id)
            toggleControl(el,"enter_exit",true)
            outputChatBox("* Pomy?lnie zapisano pojazd."el255255 ,255 ,true)
        end30001)
    elseif getElementType(el) == "vehicle" then
        local pedsgetVehicleOccupants(el)
        if #peds > 0 then return end
        local id=getElementData(el,"vehicle:id")
        if not id then return end
        if isTimer(timeroddaniathen return end
        timeroddania=setTimer(function()
            setElementFrozen(el,false)
            local id=getElementData(el,"vehicle:id")
            if not id then return end
            exports["ogrpg-vehicles"]:onSaveVehicle(el)
            destroyElement(el)
            exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1 WHERE id=?"id)
        end30001)
        setElementFrozen(el,true)
        setVehicleLocked(el,true)
    end
end)

addEvent("onParkingVehicleSpawn"true)
addEventHandler("onParkingVehicleSpawn"root, function(id)
    if not id then return end
    local spawn=exports["ogrpg-vehicles"]:onRespawnVehicles(_,id,{-1787.88,785.32,24.67,0.0,360.0,89.5})
       outputChatBox("* Pomy?lnie przywr?cono pojazd."source255255 ,255 ,true)
    if spawn then
    end
end)


Komentarz marcin778 dodany 2017-06-29, 13:42[lua][/lua] Czytelniejesze ;)
Ostatnio zmieniony przez marcin778 2017-06-29, 13:42, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-29, 19:46


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

nie przecho a funkcji kt?ra zapisuje pojazd

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-29, 22:41


DylemaT929

Nikt






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

Piwa: 3195

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

Raczej w bazie danych zobacz czy jest zapis tuningu lub wpisz debugscript 3 ulepsz auto i wrzu? do przecho

Postaw piwo autorowi tego posta
 

 
Tagi: przecho :: usuwa :: tuningi. :: paczka :: skygame
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