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

Wysłany: 2016-03-27, 22:56


OzikGames|YT

Skrypter LUA






Wiek: 26
Na forum: 3907 dni
Posty: 53
Nick w MP: OzikGames

Piwa: 749

Respekt: 50

Ostrzeżeń: 100%
Czekam na odpowiedz macie kody

s_przecho

Kod:


local mdestroy=createMarker(-2046.85, 480.07, 35.17-1, "cylinder", 5, 50,255,250,50)
createBlipAttachedTo(mdestroy, 35)

local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","Pozostawianie pojazd?w")
setElementPosition(t,-2046.85, 480.07, 35.17)

addEvent("onParkingGetRekords", true)
addEventHandler("onParkingGetRekords", root, function()
local uid=getElementData(source,"player:uid")
if not uid then return end
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE ownedPlayer=? AND parking=1", uid)
if #result > 0 then
triggerClientEvent(source, "onParkingGetVehicles", source, result)
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(timeroddania) then return end
setElementFrozen(veh,true)
outputChatBox("* Trwa zapisywanie pojazdu.", el,255,255,255,true)
toggleControl(el,"enter_exit",false)
timeroddania=setTimer(function()
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.", el, 255, 255 ,255 ,true)
end, 3000, 1)
end
end)

addEvent("onParkingVehicleSpawn", true)
addEventHandler("onParkingVehicleSpawn", root, function(id)
if not id then return end
local spawn=exports["ogrpg-vehicles"]:onRespawnVehicles(_,id,{-2050.06, 466.38, 34.93, 359.97, 0.26, 269.81})
if spawn then
outputChatBox("* Zrespiono pojazd.", source)
end
end)








c_przecho

TUTAJ 
    Resource: OURGame v2
    Developers: Split <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c) 2015 <split.programista@gmail.com>. All rights reserved.
]]

local marker=createMarker(-2059.8466796875, 469.9189453125, 35.17-1.20, "cylinder", 2, 50,255,250,50)
local sphere=createColSphere(-2048.19, 467.72, 35.17, 6)

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

local wm={}
wm.window=guiCreateWindow(0.25, 0.26, 0.51, 0.42, "Odbieranie pojazd?w", true)
guiWindowSetSizable(wm.window, false)
guiWindowSetMovable(wm.window, false)
guiSetVisible(wm.window, false)
wm.gridlist=guiCreateGridList(0.04, 0.09, 0.92, 0.65, true, wm.window)
guiGridListAddColumn(wm.gridlist, "ID", 0.4)
guiGridListAddColumn(wm.gridlist, "Model", 0.6)
wm.submit=guiCreateButton(0.04, 0.76, 0.47, 0.19, "Wyjmij pojazd", true, wm.window)
wm.close=guiCreateButton(0.57, 0.75, 0.39, 0.20, "Zamknij", true, wm.window)

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.gridlist, row, 1, v["id"], false, false)
        guiGridListSetItemText(wm.gridlist, row, 2, getVehicleNameFromModel(v["model"]), false, false)
    end
end)

addEventHandler("onClientMarkerHit", marker, function(el,md)
    if el~=localPlayer then return end
    if isPedInVehicle(el) then return end
    if guiGetVisible(wm.window) == false then
        showCursor(true)
        guiSetVisible(wm.window,true)
        triggerServerEvent("onParkingGetRekords", localPlayer)
        setCameraMatrix(-2056.26, 468.77, 38.49, -2048.08, 467.73, 35.17)
    end
end)

addEventHandler("onClientGUIClick", resourceRoot, function()
    if source == wm.close then
        if guiGetVisible(wm.window) == true then
            showCursor(false)
            guiSetVisible(wm.window,false)
            setCameraTarget(localPlayer, localPlayer)
        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")
        if #vehicles > 0 then
            outputChatBox("* Nie ma miejsca aby wyci?gn?? pojazd.", 255, 0, 0)
            return
        end
        local id=guiGridListGetItemText(wm.gridlist, selectedRow, 1)
        guiGridListRemoveRow(wm.gridlist, selectedRow)
        triggerServerEvent("onParkingVehicleSpawn", localPlayer, tonumber(id))
    end
end)




meta.xml


[code:2]<meta>
    <script src="s_przecho.lua" type="server" />
    <script src="c_przecho.lua" type="client" />
</meta>


[ Komentarz dodany przez: Iggy: 2016-03-28, 09:41 ]
Doda?em tagi [lua]//Iggy.

Ostatnio zmieniony przez Iggy 2016-03-28, 09:41, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-28, 11:55


SWRS







Wiek: 30
Na forum: 3950 dni
Posty: 39

Piwa: 1

Respekt: 50

Ostrzeżeń: 60%
Element Daty zmie? na takie jak s? w skrypcie Pana prezesa

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-28, 21:08


Betus







Wiek: 28
Na forum: 4206 dni
Posty: 11
Nick w MP: Betus



Respekt: 50

w export zmie? na tak? nazwe jak nazwa?e? Przecho folder i zmie? elementy daty

Postaw piwo autorowi tego posta
 

 
Tagi: podępnięcie :: pod :: przechowywalnia :: pojazdów :: pan :: prezes
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Podępnięcie pod przechowywalnia pojazdów by pan prezes 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