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

Wysłany: 2019-01-27, 12:56


anzle1337







Wiek: 26
Na forum: 2701 dni
Posty: 7
Nick w MP: Anzle1337



Respekt: 50

witam mam problem z przecho , sa blipy ale jak w nie wjezdzam to nic sie nie dzieje prosze o pomoc

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-27, 23:17


anzle1337







Wiek: 26
Na forum: 2701 dni
Posty: 7
Nick w MP: Anzle1337



Respekt: 50

parking c local screenWscreenH guiGetScreenSize()

local mdestroy=createMarker(313.32, -186.201.60-1"cylinder",3,200,25,25,0)
local marker=createMarker(307.75, -185.751.58-1.20"cylinder",1.5,0,50,205,50)

local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","Odbi?r pojazd?w")
setElementPosition(t,307.75, -185.751.58)

local wm={}
wm.window guiCreateWindow(321168719386"Przechowalnia!"false)
guiWindowSetSizable(wm.windowfalse)
wm.submit guiCreateButton(0.010.840.410.13"Wyci?gnij pojazd"truewm.window)
guiSetFont(wm.submit"default-bold-small")
wm.close guiCreateButton(0.580.840.410.13"Zamknij okno"truewm.window)
guiSetFont(wm.close"default-bold-small")
wm.gridlist guiCreateGridList(0.030.260.930.51truewm.window)
guiGridListAddColumn(wm.gridlist"ID"0.4)
guiGridListAddColumn(wm.gridlist"Model"0.6)
wm.label guiCreateLabel(0.070.080.930.18"Przechowalnia pojazd?w.\nAby w?o?y? pojazd wjedz w pozostawianie pojazd?w i kliknij 'W??? Pojazd'\nAby wyci?gna? pojazd kliknij Wyjmij pojazd"truewm.window)
guiSetFont(wm.label"default-bold-small")    
guiSetVisible(wm.windowfalse)

local w={}
w.window guiCreateWindow(421208519286"Przechowalnia!"false)
guiWindowSetSizable(w.windowfalse)
w.submit guiCreateButton(0.010.840.410.13"W??? pojazd"truew.window)
guiSetFont(w.submit"default-bold-small")
w.close guiCreateButton(0.580.840.410.13"Zamknij okno"truew.window)
guiSetFont(w.close"default-bold-small")
w.label guiCreateLabel(0.170.380.930.18"Aby w?o?y? pojazd do przechowywalni kliknij 'W??? pojazd'\nAby zamkn?? okno przechowywalni kliknij 'Zamknij okno'"truew.window)
guiSetFont(w.label"default-bold-small")    
guiSetVisible(w.windowfalse)

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)
    end
end)

function czychceszoddac(el,md)
if not md or getElementType(el) ~= "player" then return end
if el ~= localPlayer then return end
local veh getPedOccupiedVehicle(el)
if getVehicleController(veh) ~= localPlayer then return end
if not isPedInVehicle(elthen return end

    setElementFrozen(veh,true)
    guiSetVisible(w.windowtrue)
    showCursor(true)
end
addEventHandler('onClientMarkerHit',mdestroy,czychceszoddac)

function wloz (plr)
triggerServerEvent("wjedzAutemNaParking"localPlayer)
guiSetVisible(w.windowfalse)
showCursor(false)
end
addEventHandler("onClientGUIClick"w.submitwloz)

function zamknij ()
local veh getPedOccupiedVehicle(localPlayer)
guiSetVisible(w.windowfalse)
showCursor(false)
setElementFrozen(veh,false)
end
addEventHandler("onClientGUIClick"w.closezamknij)

addEventHandler("onClientMarkerHit"marker, function(el,md)
if not md or getElementType(el) ~= "player" then return end
if el ~= localPlayer then return end
    if isPedInVehicle(elthen return end
    if guiGetVisible(wm.window) == false then
        showCursor(true)
        guiSetVisible(wm.windowtrue)
        triggerServerEvent("onParkingGetRekords"localPlayer)
    end
end)

addEventHandler("onClientGUIClick"resourceRoot, function()
    if source == wm.close then
        if guiGetVisible(wm.close) == true then
            showCursor(false)
guiSetVisible(wm.windowfalse)
        end
    end
    if source == wm.submit then
        local selectedRow=guiGridListGetSelectedItem(wm.gridlist) or -1
        if selectedRow 0 then return end
        local vehicles=getElementsWithinColShape(sphere,"vehicle")
        local id=guiGridListGetItemText(wm.gridlistselectedRow1)
        guiGridListRemoveRow(wm.gridlistselectedRow)
guiSetVisible(wm.windowfalse)
        showCursor(false)
        setElementPosition(localPlayer,302.40, -191.541.60)
        triggerServerEvent("onParkingVehicleSpawn"localPlayertonumber(id))
    end
end)

function filedelet ()
if fileExists("c_parking.lua"then
   fileDelete("c_parking.lua")
 end
end
addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), filedelet)
Parking -s

local zone createColSphere(302.42, -187.461.69,4)

local t=createElement("text")
setElementData(t,"scale",1.5)
createBlipAttachedTo(t35)
setElementData(t,"name","Pozostawianie pojazd?w")
setElementPosition(t,313.32, -186.201.60)


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

addEvent("wjedzAutemNaParking"true)
addEventHandler("wjedzAutemNaParking"root, function(el,md)
        local veh=getPedOccupiedVehicle(source)
        if not veh then return end
        if getVehicleController(veh) ~= source then return end
        local id=getElementData(veh,"vehicle:id")
        if not id then return end
        if isTimer(timeroddaniathen return end
        setElementFrozen(veh,true)
        setControlState source"enter_exit"true )
        triggerClientEvent(source"dodaj:powiadomienie"root"* Pojazd wje?dza do przechowywalni...")
        timeroddania=setTimer(function()
            exports["rs-pojazdy"]:onSaveVehicle(veh)
            destroyElement(veh)
            exports["rs-db"]:dbSet("UPDATE rs_pojazdy SET parking=1 WHERE id=?"id)
            triggerClientEvent(source"dodaj:powiadomienie"root"* Pojazd zosta? zapisany w przechowywalni.")
    end30001)
end)

addEvent("onParkingVehicleSpawn"true)
addEventHandler("onParkingVehicleSpawn"root, function(id)
    if not id then return end
    if #getElementsWithinColShape(zone,"vehicle") >= 1 then 
    outputChatBox("* Spawn pojazdu zastawiony...",source,255,0,0) 
    return
    end
    local spawn=exports["rs-pojazdy"]:onRespawnVehicles(_,id,{302.42, -187.461.690.10.0180.1})
    if spawn then
    end
end)


Komentarz DsJ3 dodany 2019-01-29, 09:58Następnym razem dodaj załącznik[BBCode] [lua]Kod[./lua] bez kropki
Ostatnio zmieniony przez DsJ3 2019-01-29, 09:58, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-28, 09:13


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Jakie? b??dy /debugscript 3?
U?ywaj znacznik?w [.lua] [./lua] bez kropek i popraw swoj? odpowied?.

Postaw piwo autorowi tego posta
 

 
Tagi: jak :: podlaczyć :: przecho :: pod :: mysql
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » jak podlaczyć przecho pod mysql 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