Wysłany: 2015-02-05, 21:31
Shogo12345
LuA
Wiek: 31 Na forum: 4182 dni Posty: 48
Nick w MP: Artux
Piwa : 504
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
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)
Wysłany: 2015-02-05, 22:54
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
--[[
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 ?& #8225; mo??e si?™ zgodz?™ na u??ycie kodu.
--]]
sx , sy = guiGetScreenSize ()
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 )
function open ()
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
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_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 )
Wysłany: 2015-02-06, 08:57
Shogo12345
LuA
Wiek: 31 Na forum: 4182 dni Posty: 48
Nick w MP: Artux
Piwa : 504
Dzieki
[ Dodano : 2015-02-06, 13:24 ]
Temat do zamkni?cia.
Tagi: system :: prywatnych :: pojazdów
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: