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

Wysłany: 2015-02-05, 21:31


Shogo12345

LuA






Wiek: 31
Na forum: 4181 dni
Posty: 48
Nick w MP: Artux

Piwa: 504

Respekt: 70

Ostrzeżeń: 100%
Witam mam List? prywatnych pojazd?w lecz on jest dostepny tylko w urzedzie jak wejd? w marker, a ja chce zrobi? zeby on by? dostepny pod komend? np vmoje.

Za Pomoc :piwo:

Kod

Kod:

--[[
Lista prywatnych pojazd??w.

@copyright 2013-2014 Split <split@go-life.pl>
@author Split <split@go-life.pl>
@version 1.0 beta

Nie masz prawa u??ywac tego kodu bez mojej zgody.
Napisz do mnie by?‡ mo??e si?™ zgodz?™ na u??ycie kodu.
--]]


sx,sy = guiGetScreenSize()

addCommandHandler ( "vmoje", function ( plr, cmd,

lp_okno = guiCreateWindow(205/1280*sx, 157/720*sy, 852/1280*sx, 404/720*sy, "Panel pojazd??w", false)
guiWindowSetSizable(lp_okno, false)
guiSetVisible(lp_okno, false)

lp_gridlist = guiCreateGridList(10/1280*sx, 26/720*sy, 832/1280*sx, 324/720*sy, false, lp_okno)
guiSetAlpha(lp_gridlist, 0.87)

guiGridListAddColumn(lp_gridlist, "ID", 0.2)
guiGridListAddColumn(lp_gridlist, "Nazwa", 0.2)
guiGridListAddColumn(lp_gridlist, "Przebieg", 0.2)
guiGridListAddColumn(lp_gridlist, "Paliwo", 0.5)

lp_namierz = guiCreateButton(11/1280*sx, 357/720*sy, 252/1280*sx, 33/720*sy, "Namierz pojazd", false, lp_okno)
lp_anuluj = guiCreateButton(590/1280*sx, 360/720*sy, 252/1280*sx, 33/720*sy, "Anuluj", false, lp_okno)

addEventHandler("onClientMarkerHit", pojazdy, function(el, md)
if el ~= localPlayer then return end
if guiGetVisible(lp_okno) == false then
showCursor(true, false)
guiSetVisible(lp_okno, true)

for k,v in ipairs(getElementsByType("vehicle")) do
if getElementData(v, "pojazd_zrespiony") then
if getElementData(v, "pojazd_wlasciciel") == getElementData(el, "gracz_id") then
local row = guiGridListAddRow(lp_gridlist)

local gridname = getVehicleName(v)
local gridid = getElementData(v, "pojazd_id")
local paliwo = getElementData(v, "pojazd_paliwo")
local przebieg = getElementData(v, "pojazd_przebieg")

guiGridListSetItemText(lp_gridlist, row, 1, ""..gridid.."", false, false)
guiGridListSetItemText(lp_gridlist, row, 2, ""..gridname.."", false, false)
guiGridListSetItemText(lp_gridlist, row, 3, ""..string.format("%0.0f", przebieg).."KM", false, false)
guiGridListSetItemText(lp_gridlist, row, 4, ""..string.format("%0.0f", paliwo).."L", false, false)
end
end
end
end
end)

addEventHandler("onClientMarkerLeave", pojazdy, function(el, md)
if el ~= localPlayer then return end
if guiGetVisible(lp_okno) == true then
showCursor(false)
guiGridListClear(lp_gridlist)
guiSetVisible(lp_okno, false)
end
end)

addEventHandler("onClientGUIClick", lp_namierz, function()
if guiGetVisible(lp_okno) == true then
for k,v in ipairs(getElementsByType("vehicle")) do
if getElementData(v, "pojazd_zrespiony") then
if getElementData(v, "pojazd_wlasciciel") == getElementData(localPlayer, "gracz_id") then
local wybor = guiGridListGetItemText(lp_gridlist, guiGridListGetSelectedItem(lp_gridlist), 1)
if tonumber(wybor) == getElementData(v, "pojazd_id") then
local x,y,z = getElementPosition(v)
local lokalizacja = getZoneName(x,y,z)
local miasto = getZoneName(x,y,z, true)
outputChatBox("* Pojazd znajduje si?™ w mie?›cie: "..miasto..", ulica: "..lokalizacja.."")

showCursor(false)
guiGridListClear(lp_gridlist)
guiSetVisible(lp_okno, false)
end
end
end
end
end
end)

addEventHandler("onClientGUIClick", lp_anuluj, function()
if guiGetVisible(lp_okno) == true then
showCursor(false)
guiGridListClear(lp_gridlist)
guiSetVisible(lp_okno, false)
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-02-05, 22:54


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

--[[ 
Lista prywatnych pojazd??w. 

@copyright 2013-2014 Split <split@go-life.pl> 
@author Split <split@go-life.pl> 
@version 1.0 beta 

Nie masz prawa u??ywac tego kodu bez mojej zgodyNapisz do mnie by?&#8225; mo??e si?&#8482; zgodz?&#8482; na u??ycie kodu. 
--]] 


sx,sy guiGetScreenSize() 

lp_okno guiCreateWindow(205/1280*sx157/720*sy852/1280*sx404/720*sy"Panel pojazd??w"falseguiWindowSetSizable(lp_oknofalseguiSetVisible(lp_oknofalselp_gridlist guiCreateGridList(10/1280*sx26/720*sy832/1280*sx324/720*syfalselp_oknoguiSetAlpha(lp_gridlist0.87guiGridListAddColumn(lp_gridlist"ID"0.2guiGridListAddColumn(lp_gridlist"Nazwa"0.2guiGridListAddColumn(lp_gridlist"Przebieg"0.2guiGridListAddColumn(lp_gridlist"Paliwo"0.5lp_namierz guiCreateButton(11/1280*sx357/720*sy252/1280*sx33/720*sy"Namierz pojazd"falselp_oknolp_anuluj guiCreateButton(590/1280*sx360/720*sy252/1280*sx33/720*sy"Anuluj"falselp_okno) 

function open()
if guiGetVisible(lp_okno) == false then 
showCursor(truefalseguiSetVisible(lp_oknotrue) 

for k,v in ipairs(getElementsByType("vehicle")) do 
if getElementData(v"pojazd_zrespiony"then 
if getElementData(v"pojazd_wlasciciel") == getElementData(el"gracz_id"then 
local row guiGridListAddRow(lp_gridlistlocal gridname getVehicleName(vlocal gridid getElementData(v"pojazd_id"local paliwo getElementData(v"pojazd_paliwo"local przebieg getElementData(v"pojazd_przebieg"guiGridListSetItemText(lp_gridlistrow1""..gridid..""falsefalseguiGridListSetItemText(lp_gridlistrow2""..gridname..""falsefalseguiGridListSetItemText(lp_gridlistrow3""..string.format("%0.0f"przebieg).."KM"falsefalseguiGridListSetItemText(lp_gridlistrow4""..string.format("%0.0f"paliwo).."L"falsefalseend 
end 
end
end
end
addCommandHandler "vmoje"open )

addEventHandler("onClientGUIClick"lp_namierz, function() 
if guiGetVisible(lp_okno) == true then 
for k,v in ipairs(getElementsByType("vehicle")) do 
if getElementData(v"pojazd_zrespiony"then 
if getElementData(v"pojazd_wlasciciel") == getElementData(localPlayer"gracz_id"then 
local wybor guiGridListGetItemText(lp_gridlistguiGridListGetSelectedItem(lp_gridlist), 1) 
if tonumber(wybor) == getElementData(v"pojazd_id"then 
local x,y,getElementPosition(vlocal lokalizacja getZoneName(x,y,zlocal miasto getZoneName(x,y,ztrueoutputChatBox("* Pojazd znajduje si?&#8482; w mie?&#8250;cie: "..miasto..", ulica: "..lokalizacja..""showCursor(falseguiGridListClear(lp_gridlistguiSetVisible(lp_oknofalseend 
end 
end 
end 
end 
endaddEventHandler("onClientGUIClick"lp_anuluj, function() 
if guiGetVisible(lp_okno) == true then 
showCursor(falseguiGridListClear(lp_gridlistguiSetVisible(lp_oknofalseend 
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-02-06, 08:57


Shogo12345

LuA






Wiek: 31
Na forum: 4181 dni
Posty: 48
Nick w MP: Artux

Piwa: 504

Respekt: 70

Ostrzeżeń: 100%
Dzieki

[ Dodano: 2015-02-06, 13:24 ]
Temat do zamkni?cia.

Postaw piwo autorowi tego posta
 

 
Tagi: system :: prywatnych :: pojazdów
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