Wysłany: 2020-06-24, 12:51
Matikmontana
Modern Stories
Wiek: 22 Na forum: 2473 dni Posty: 423
Nick w MP: Mazeusz*
Piwa : 1015
Siemaneczko, problemik ze skrypcikiem a dok?adnie
addCommandHandler ( "opona" , function( _ , r , g , b )
local veh = getPedOccupiedVehicle ( localPlayer );
if( not veh ) then return end ;
local tune = getVehicleUpgrades ( veh );
for i , v in pairs ( tune ) do
if( names [ v ]) then
setWheelColor ( veh , v , r , g , b );
end ;
end ;
end );
local vehs = {};
function setWheelColor ( veh , id , r , g , b )
if( r and g and b ) then
setElementData ( veh , "vehicle:wheel" , { id , r , g , b });
else
local v = vehs [ veh ];
if( v ) then
engineRemoveShaderFromWorldTexture ( v [ 2 ], v [ 3 ], veh );
destroyElement ( v [ 1 ]);
destroyElement ( v [ 2 ]);
vehs [ veh ] = nil ;
end ;
setElementData ( veh , "vehicle:wheel" , false );
end ;
end ;
addEventHandler ( "onClientRender" , root , function()
for i , v in pairs ( getElementsByType ( "vehicle" , true )) do
local wheel = getElementData ( v , "vehicle:wheel" );
if( not vehs [ v ] and wheel ) then
vehs [ v ] = {};
vehs [ v ][ 1 ] = dxCreateRenderTarget ( 256 , 256 , true );
vehs [ v ][ 2 ] = dxCreateShader ( "s/shader.fx" );
vehs [ v ][ 3 ] = names [ wheel [ 1 ]][ 1 ];
dxSetRenderTarget ( vehs [ v ][ 1 ], true );
dxDrawRectangle ( 0 , 0 , 256 , 256 , tocolor ( wheel [ 2 ], wheel [ 3 ], wheel [ 4 ]));
dxDrawImage ( 0 , 0 , 256 , 256 , names [ wheel [ 1 ]][ 2 ]);
dxSetRenderTarget ();
dxSetShaderValue ( vehs [ v ][ 2 ], "shader" , vehs [ v ][ 1 ]);
engineApplyShaderToWorldTexture ( vehs [ v ][ 2 ], names [ wheel [ 1 ]][ 1 ], v );
end ;
end ;
end );
Wysłany: 2020-06-24, 12:52
TheSebaPL
Mod-team
Wiek: 21 Na forum: 3098 dni Posty: 964
Piwa : 3102
Matikmontana , poka? jeszcze kt?ra to 105 linijka.
Wysłany: 2020-06-24, 12:54
Matikmontana
Modern Stories
Wiek: 22 Na forum: 2473 dni Posty: 423
Nick w MP: Mazeusz*
Piwa : 1015
vehs [ v ][ 3 ] = names [ wheel [ 1 ]][ 1 ]; this
Wysłany: 2020-06-24, 13:45
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Najwyra?niej tabela 'names' nie zawiera element?w, kt?re s? pobierane z tabeli wheel.
Musisz doda? odpowiednie elementy, kt?re chcesz u?y? do tej tabeli 'names'.
Wysłany: 2020-06-24, 17:31
Matikmontana
Modern Stories
Wiek: 22 Na forum: 2473 dni Posty: 423
Nick w MP: Mazeusz*
Piwa : 1015
Jaki? przyk?ad, albo co? bo nie wiem od czego zacz??
Wysłany: 2020-06-24, 19:04
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Po prostu nie masz tabeli 'names', musisz j? stworzy? - co w niej ma by? to musisz przeanalizowa? ten kod, gdzie te tabele wykorzystujesz.
Wysłany: 2020-06-24, 19:12
Matikmontana
Modern Stories
Wiek: 22 Na forum: 2473 dni Posty: 423
Nick w MP: Mazeusz*
Piwa : 1015
Wy?ej pokazana jest cz??? skryptu. To reszta
local names = {
[ 1078 ] = { "5zigen 3" , "i/twist.png" }, -- twisty
[ 1074 ] = { "BSS_STYLE03" , "i/mega.png" }, -- megi
[ 1073 ] = { "RACINGHART_STYLE02" , "i/shadow.png" }, -- shadowy
[ 1080 ] = { "BSS_STYLE05" , "i/switch.png" }, -- switch
[ 1096 ] = { "ROJA_STYLE03" , "i/ahab.png" }, -- ahaby
[ 1097 ] = { "VOLK_STYLE01" , "i/virtuale.png" }, -- virutale
[ 1077 ] = { "KONIG_STYLE03" , "i/classic.png" }, -- classici
[ 1076 ] = { "OZ_STYLE02" , "i/wiresy.png" }, -- wiresy
[ 1079 ] = { "BSS_STYLE04" , "i/cutter.png" }, -- cuttery
[ 1081 ] = { "OZ_STYLE04" , "i/grove.png" }, -- grove
[ 1083 ] = { "OZ_STYLE01" , "i/dollar.png" }, -- dolary
[ 1075 ] = { "RACINGHART_STYLE01" , "i/rimki.png" }, -- rimki
[ 1098 ] = { "KONIG_STYLE01" , "i/access.png" }, -- accessy
[ 1084 ] = { "ADR_STYLE04" , "i/trance.png" }, -- trance
[ 1082 ] = { "LOWENHART_STYLE03" , "i/import.png" }, -- importy
}
[ Dodano : 2020-06-24, 19:43 ]
Niby dobrze chyba
[ Dodano : 2020-06-24, 20:06 ]
Ale nadal jest b??d z linijka 105
[ Dodano : 2020-06-24, 23:19 ]
"Wilq" napisał/a :Po prostu nie masz tabeli 'names', musisz j? stworzy? - co w niej ma by? to musisz przeanalizowa? ten kod, gdzie te tabele wykorzystujesz.
Wiesz co tu dalej. Bo nie ogarniam...
Tagi: attempt :: index :: field
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: