NorbiTTT
Nbi#1824
Wiek: 27 Na forum: 3207 dni Posty: 193
Nick w MP: Nbi
Piwa : 698
Siemka, chcia?bym aby po kliknieciu wyswietlalo kolejne auto z tabeli ale wyswietla wszystkie informacje na raz.
Kod wyglada tak:
Tabele
local auta = {
[ 1 ] = dxCreateTexture ( "cars/infek.png" ),
[ 2 ] = dxCreateTexture ( "cars/bullet.png" ),
}
local testtabela = {
{ "Infernus" , 1200000 , auta [ 1 ]},
{ "Bullet" , 1000000 , auta [ 2 ]},
}
Reszta kodu:
if wybor_auta then
for i , v in pairs ( testtabela ) do
model = v [ 1 ]
cena = v [ 2 ]
grafika = v [ 3 ]
alpha = interpolateBetween ( 0 , 0 , 0 , 255 , 0 , 0 , ( getTickCount ()- tick )/ 200 , "Linear" )
dxDrawImage ( 480 * px , 270 * py , 960 * px , 540 * py , grafiki [ 2 ], 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , alpha ))
dxDrawText ( text [ 7 ][ 1 ], 680 * px ,- 825 * py , 1220 * px , 1500 * py , tocolor ( 255 , 255 , 255 ), 1 * px , font [ 3 ], "center" , "center" , false , true , true , true , false )
dxDrawText ( text [ 8 ][ 1 ], 375 * px ,- 675 * py , 920 * px , 1500 * py , tocolor ( 255 , 255 , 255 ), 1 * px , font [ 4 ], "center" , "center" , false , true , true , true , false )
dxDrawText ( text [ 9 ][ 1 ], 875 * px ,- 675 * py , 1280 * px , 1500 * py , tocolor ( 255 , 255 , 255 ), 1 * px , font [ 4 ], "center" , "center" , false , true , true , true , false )
if cursorPos ( 800 * px , 650 * py , 150 * px , 120 * py ) then
dxDrawText ( text [ 11 ][ 1 ], 485 * px ,- 84 * py , 1280 * px , 1500 * py , tocolor ( 0 , 138 , 255 ), 1 * px , font [ 7 ], "center" , "center" , false , true , true , true , false )
dxDrawImage ( 798 * px , 648 * py , 152 * px , 122 * py , grafiki [ 7 ])
else
dxDrawText ( text [ 11 ][ 1 ], 485 * px ,- 80 * py , 1280 * px , 1500 * py , tocolor ( 255 , 255 , 255 ), 1 * px , font [ 6 ], "center" , "center" , false , true , true , true , false )
dxDrawImage ( 800 * px , 650 * py , 150 * px , 120 * py , grafiki [ 7 ])
end
if cursorPos ( 1250 * px , 650 * py , 150 * px , 120 * py ) then
dxDrawImage ( 1248 * px , 648 * py , 152 * px , 122 * py , grafiki [ 8 ])
dxDrawText ( text [ 12 ][ 1 ], 1345 * px ,- 84 * py , 1280 * px , 1500 * py , tocolor ( 0 , 138 , 255 ), 1 * px , font [ 7 ], "center" , "center" , false , true , true , true , false )
else
dxDrawImage ( 1250 * px , 650 * py , 150 * px , 120 * py , grafiki [ 8 ])
dxDrawText ( text [ 12 ][ 1 ], 1345 * px ,- 80 * py , 1280 * px , 1500 * py , tocolor ( 255 , 255 , 255 ), 1 * px , font [ 6 ], "center" , "center" , false , true , true , true , false )
end
dxDrawImage ( 960 * px , 520 * py , 220 * px , 170 * py , grafika , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , alpha ))
dxDrawText ( text [ 10 ][ 1 ].. " " .. model .. "#ffffff" , 880 * px ,- 550 * py , 1220 * px , 1500 * py , tocolor ( 255 , 255 , 255 ), 1 * px , font [ 7 ], "center" , "center" , false , true , true , true , false )
dxDrawText ( text [ 13 ][ 1 ].. przecinek ( cena ), 580 * px ,- 550 * py , 1020 * px , 1500 * py , tocolor ( 255 , 255 , 255 ), 1 * px , font [ 7 ], "left" , "center" , false , true , true , true , false )
end
end
end
I jak klikne to ta funkcja ma zmienic auto na kolejne w tabeli:
addEventHandler ( "onClientClick" , root , function( btn , state )
if btn == "left" and state == "down" and ds_guishow then
if cursorPos ( 1250 * px , 650 * py , 150 * px , 120 * py ) and wybor_auta then
end
end
end )