Wysłany: 2018-10-01, 19:54
czlowiekjaja
Wiek: 20 Na forum: 2850 dni Posty: 76
Nick w MP: czlowiekjaja
Piwa : 324
Mam taki kod:
-- tworzenie colsphere
local colshape = createColSphere (- 138.17485 , 1079.58557 , 19.15291 , 5 )
addEventHandler ( "onClientGUIClick" , resourceRoot , function()
local pojazdy = getElementsWithinColShape ( colshape , "vehicle" )
if source == RH1 . btncloseactive then
guiSetVisible ( RH1 . win , false )
elseif source == RH1 . btnclosetxtactive then
guiSetVisible ( RH1 . win , false )
elseif source == RH1 . btnmntactive then
setElementData ( pojazdy , "RH1MOUNTED" , true )
elseif source == RH1 . btnmnttxtactive then
setElementData ( pojazdy , "RH1MOUNTED" , true )
elseif source == RH1 . btndemntactive then
setElementData ( pojazdy , "RH1MOUNTED" , false )
elseif source == RH1 . btndemnttxtactive then
setElementData ( pojazdy , "RH1MOUNTED" , false )
end
end )
i jak nada? t? element date dla pojazdu w tym colsphere?
Wysłany: 2018-10-01, 21:18
Avenged
Młodszy Szkrypter
Wiek: 23 Na forum: 3510 dni Posty: 654
Nick w MP: Avenged
Piwa : 1570
Returns a table containing all the elements inside the colshape, of the specified type. Returns an empty table if there are no elements inside. Returns false if the colshape is invalid.
Ta funkcja zwraca Ci tabel?, wi?c w p?tle zr?b i nadajesz p??niej na auto normalnie z p?tli
Podpis
LUA, JS, PHP
Zapraszam do skorzystania z moich usług: Klik
Wysłany: 2018-10-02, 21:28
Eitho
Wiek: 24 Na forum: 3489 dni Posty: 330
Nick w MP: Eitho
Piwa : 746
-- tworzenie colsphere
local colshape = createColSphere (- 138.17485 , 1079.58557 , 19.15291 , 5 )
addEventHandler ( "onClientGUIClick" , resourceRoot , function()
local tab = getElementsWithinColShape ( colshape , "vehicle" ) -- tabela
if source == RH1 . btncloseactive then
guiSetVisible ( RH1 . win , false )
elseif source == RH1 . btnclosetxtactive then
guiSetVisible ( RH1 . win , false )
elseif source == RH1 . btnmntactive then
for _ , pojazdy in pairs ( tab ) do
setElementData ( pojazdy , "RH1MOUNTED" , true )
end
elseif source == RH1 . btnmnttxtactive then
for _ , pojazdy in pairs ( tab ) do
setElementData ( pojazdy , "RH1MOUNTED" , true )
end
elseif source == RH1 . btndemntactive then
for _ , pojazdy in pairs ( tab ) do
setElementData ( pojazdy , "RH1MOUNTED" , false )
end
elseif source == RH1 . btndemnttxtactive then
for _ , pojazdy in pairs ( tab ) do
setElementData ( pojazdy , "RH1MOUNTED" , false )
end
end
end )
Mo?na te? tak, ale pierwszy spos?b jest bardziej optymalny
-- tworzenie colsphere
local colshape = createColSphere (- 138.17485 , 1079.58557 , 19.15291 , 5 )
addEventHandler ( "onClientGUIClick" , resourceRoot , function()
local tab = getElementsWithinColShape ( colshape , "vehicle" ) -- tabela
for _ , pojazdy in pairs ( tab ) do
if source == RH1 . btncloseactive then
guiSetVisible ( RH1 . win , false )
elseif source == RH1 . btnclosetxtactive then
guiSetVisible ( RH1 . win , false )
elseif source == RH1 . btnmntactive then
setElementData ( pojazdy , "RH1MOUNTED" , true )
elseif source == RH1 . btnmnttxtactive then
setElementData ( pojazdy , "RH1MOUNTED" , true )
elseif source == RH1 . btndemntactive then
setElementData ( pojazdy , "RH1MOUNTED" , false )
elseif source == RH1 . btndemnttxtactive then
setElementData ( pojazdy , "RH1MOUNTED" , false )
end
end
end )
Tagi: ustawienie :: element :: daty :: dla :: pojazdu :: colsphere
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: