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: 25
Na forum: 3766 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 
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

local marker=createMarker(-2059.8466796875469.918945312535.17-1.20"cylinder"250,255,250,50)
local sphere=createColSphere(-2048.19467.7235.176)

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

local wm={}
wm.window=guiCreateWindow(0.250.260.510.42"Odbieranie pojazd?w"true)
guiWindowSetSizable(wm.windowfalse)
guiWindowSetMovable(wm.windowfalse)
guiSetVisible(wm.windowfalse)
wm.gridlist=guiCreateGridList(0.040.090.920.65truewm.window)
guiGridListAddColumn(wm.gridlist"ID"0.4)
guiGridListAddColumn(wm.gridlist"Model"0.6)
wm.submit=guiCreateButton(0.040.760.470.19"Wyjmij pojazd"truewm.window)
wm.close=guiCreateButton(0.570.750.390.20"Zamknij"truewm.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.gridlistrow1v["id"], falsefalse)
        guiGridListSetItemText(wm.gridlistrow2getVehicleNameFromModel(v["model"]), falsefalse)
    end
end)

addEventHandler("onClientMarkerHit"marker, function(el,md)
    if el~=localPlayer then return end
    if isPedInVehicle(elthen return end
    if guiGetVisible(wm.window) == false then
        showCursor(true)
        guiSetVisible(wm.window,true)
        triggerServerEvent("onParkingGetRekords"localPlayer)
        setCameraMatrix(-2056.26468.7738.49, -2048.08467.7335.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(localPlayerlocalPlayer)
        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."25500)
            return
        end
        local id=guiGridListGetItemText(wm.gridlistselectedRow1)
        guiGridListRemoveRow(wm.gridlistselectedRow)
        triggerServerEvent("onParkingVehicleSpawn"localPlayertonumber(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: 3809 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: 4065 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 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