JanKy Posted April 12, 2017 Share Posted April 12, 2017 Hi guys, i really need help on this one. I get an error that makes my shader resource really buggy "WARNING: UNION_SHAIDER\c_night.lua:197 Bad argument @ 'dxSetShaderValue' [Expected material at argument 1, got boolean] " Here is the script, i hope you can help me, i really need help on this one ^^ . Ty in advance. --By Fanbox local maxDarkness = 0.4 -- [1] = lightest || [0] = darkest 1-- 0.05 2-- 0.1 3-- 0.5 4-- 0.3 5-- 0.4 local speed = 0.0001 -- 0.001 local b = 1 local shaderList = {} local fading = false local clone local nightShader InselMapStart = function() for i1 = 4212, 4222 do removeWorldModel(i1, 10000, 0, 0, 0) end for i2 = 4715, 4717 do removeWorldModel(i2, 10000, 0, 0, 0) end for i3 = 4720, 4725 do removeWorldModel(i3, 10000, 0, 0, 0) end for i4 = 4739, 4752 do removeWorldModel(i4, 10000, 0, 0, 0) end for i5 = 5057, 5059 do removeWorldModel(i5, 10000, 0, 0, 0) end for i6 = 5661, 5665 do removeWorldModel(i6, 10000, 0, 0, 0) end for i7 = 5990, 5992 do removeWorldModel(i7, 10000, 0, 0, 0) end for i8 = 6192, 6196 do removeWorldModel(i8, 10000, 0, 0, 0) end for i9 = 7072, 7097 do removeWorldModel(i9, 10000, 0, 0, 0) end for j1 = 7206, 7208 do removeWorldModel(j1, 10000, 0, 0, 0) end for j2 = 7221, 7226 do removeWorldModel(j2, 10000, 0, 0, 0) end for j3 = 7280, 7280 do removeWorldModel(j3, 10000, 0, 0, 0) end for j4 = 7331, 7333 do removeWorldModel(j4, 10000, 0, 0, 0) end for j5 = 7892, 7892 do removeWorldModel(j5, 10000, 0, 0, 0) end for j6 = 7942, 7944 do removeWorldModel(j6, 10000, 0, 0, 0) end for j7 = 8372, 8372 do removeWorldModel(j7, 10000, 0, 0, 0) end for j8 = 9088, 9089 do removeWorldModel(j8, 10000, 0, 0, 0) end for j9 = 9121, 9129 do removeWorldModel(j9, 10000, 0, 0, 0) end for k1 = 9154, 9159 do removeWorldModel(k1, 10000, 0, 0, 0) end for k2 = 9277, 9283 do removeWorldModel(k2, 10000, 0, 0, 0) end for k3 = 9285, 9286 do removeWorldModel(k3, 10000, 0, 0, 0) end for k4 = 9885, 9886 do removeWorldModel(k4, 10000, 0, 0, 0) end for k5 = 9932, 9934 do removeWorldModel(k5, 10000, 0, 0, 0) end for k6 = 10057, 10058 do removeWorldModel(k6, 10000, 0, 0, 0) end for k7 = 10146, 10147 do removeWorldModel(k7, 10000, 0, 0, 0) end for k8 = 11410, 11412 do removeWorldModel(k8, 10000, 0, 0, 0) end for k9 = 13461, 13461 do removeWorldModel(k9, 10000, 0, 0, 0) end for t1 = 13461, 13461 do removeWorldModel(t1, 10000, 0, 0, 0) end for t2 = 13484, 13485 do removeWorldModel(t2, 10000, 0, 0, 0) end for t3 = 13493, 13493 do removeWorldModel(t3, 10000, 0, 0, 0) end for t4 = 17954, 17957 do removeWorldModel(t4, 10000, 0, 0, 0) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), InselMapStart) local removables = { 'tx*', --'coronastar', --'shad_exp*', 'radar*', '*icon', 'font*', 'lampost_16clr', 'headlight', 'vehiclegeneric256', 'skybox_tex', 'siteM16' } function night_init() if getVersion ().sortable < '1.1.0' then return false end local testShader, tec = dxCreateShader('night.fx') if not testShader then outputChatBox('Could not create night shader. Please use debugscript 3') else nightShader = dxCreateShader('night.fx', 0, 0, false, "all") for c=48,122 do engineApplyShaderToWorldTexture(nightShader, string.format('%c*', c)) end for i,v in pairs(removables) do engineRemoveShaderFromWorldTexture(nightShader, v) end table.insert(shaderList, nightShader) end addEventHandler('onClientHUDRender', root, night_render) nightTimer = setTimer(night_check, 1000, 0) end function night_check() local hours, minutes = getTime() setSkyGradient(65,80,83,65,80,84) setFarClipDistance(200)-----Расстояник до тумана днём setFogDistance(15) if hours >= 5 and hours < 12 then fading = false setSkyGradient(65,80,83,65,80,84) setWeather (9) elseif hours >= 12 and hours < 18 then fading = false setSkyGradient(65,80,83,65,60,64) setWeather (15) elseif hours >= 18 and hours < 21 then fading = false setSkyGradient(65,80,83,55,70,74) setWeather (14) elseif hours >= 21 and hours < 5 then fading = false setSkyGradient(65,80,83,35,40,44) setWeather (12) else fading = true setSkyGradient( 0, 0, 0, 10, 10, 10 ) setFarClipDistance(100)--1000 setFogDistance(35)--100 end end function night_render() local int, dim = getElementInterior(localPlayer), getElementDimension(localPlayer) if fading then if b > maxDarkness then b = b - speed elseif b <= maxDarkness then b = maxDarkness end else if b < 1.0 then b = b + speed elseif b >= 1.0 then b = 1.0 end end for _,shader in ipairs(shaderList) do if int == 0 and dim == 0 then dxSetShaderValue(shader, 'NIGHT', b, b, b) else dxSetShaderValue(shader, 'NIGHT', 1.0, 1.0, 1.0) end end end night_init() local shaderMap = { ['img/1.union'] = { --'metalflooring4', 'forestfloorblendb', 'con2sand1c', 'sjmhoodlawn42b', 'venturas_fwend', 'pavemiddirt_law', 'hiway2sand1a', 'des_dam_conc', 'forestfloor3', 'grasstype4_forestblend', 'forestfloor_sones256', 'cw2_mounttrailblank', 'cw2_mounttrail', 'sw_sandgrass' , 'desertstones256forestmix', 'bow_abpave_gen', 'desgreengrassmix', 'grasstype4blndtomud', 'grasstype4blndtodirt', 'des_dirtgrassmix_grass4', 'grasstype10_4blend', 'rocktq128_forestblend2', 'forestfloor3_forest', 'dirtkb_64hv', 'trainground1', 'des_dirt2stones', 'sjmscorclawn', 'scumtiles3_lae', 'backalley1_lae', 'desertgravelgrassroad' , 'sw_sandgrass', 'desclifftypebsmix', 'desertgravelgrassroad', 'sw_grassb01', 'sw_crops', 'cos_hiwayins_256', 'cos_hiwayout_256', 'hiwayoutside_256', 'hiwaygravel1_256', 'hiwayinside2_256', 'bow_grass_gryard', 'con2sand1b', 'con2sand1a', 'grasslawnfade_256', 'tenniscourt1_256', 'golf_heavygrass', 'golf_fairway3', 'golf_fairway1', 'golf_fairway2', 'golf_greengrass', 'des_dirt1_glfhvy', 'seabed', 'concretedust2_256128', 'des_dirt1_grass', 'vgsroadirt2_256', 'brngrss2stonesb', 'dirtblendlit', 'cw2_mountdirt2grass', 'cw2_mountdirt', 'des_dirt2grass', 'cw2_mountrock', 'desmudgrass', 'desmud', 'des_dirtgrassmixbmp', 'des_dirtgrassmixb', 'des_dirtgrassmixc', 'concretemanky', 'grassdeep256', 'grass_lawn_128hv', 'sw_sandgrass4', 'mountainskree_stones256', 'grasstype4_mudblend', 'grass4dirtytrans', 'bow_church_dirt', 'newcrop3', 'des_ripplsand', 'des_dirt1', 'des_rocky1_dirt1', 'des_scrub1_dirt1', 'des_scrub1', 'desstones_dirt1', 'des_dirt2dedgrass', 'des_dirt2', 'des_dirtgravel', 'des_dirt2blend', 'des_rocky1', 'des_roadedge1', 'des_roadedge2', 'des_panelconc', 'des_oldrunwayblend', 'desertstones256', 'grasstype5', 'grasstype5_dirt', 'grasslong256', 'desgreengrass', 'sw_grass01', 'sw_grass01a', 'yardgrass1', 'grasstype7', 'grassdeadbrn256', 'desgreengrassmix', 'desertgryard256', 'desgrassbrn', 'des_grass2scrub', 'des_scrub1_dirt1b', 'des_scrub1_dirt1a', 'bow_church_grass_gen', 'grifnewtex1x_las', 'grassdead1', 'forestfloor256', 'forestfloorblendded', 'forestfloor256_blenddirt', 'grasstype10', 'grass4_des_dirt2', 'grasstype4_10', 'des_dirt2grgrass', 'grass10_stones256', 'grass10des_dirt2', 'grasstype510', 'grasstype510_10', 'cs_rockdetail', 'forestfloorbranch256', 'ffbranch_mountdirt', 'forestfloorblend', 'desmud2forstfloor', 'forestfloor4', 'grasstype4_staw', 'grassshort2long256', 'grass10forest', 'grass10dirt', 'forestfloor256mudblend', 'ws_patchygravel', 'grasstype4', 'ws_traingravelblend', 'forestfloorgrass', 'des_dirt1grass', 'grasstype5_desdirt', 'des_dirt1', 'des_grass2dirt1', 'blendrock2grgrass', 'sfn_rocktbrn128', 'sfn_rockhole', 'sfn_grass1', 'grass_128hv', 'grassdead1blnd', 'desertgravelgrass256', 'grass4dirty', 'cw2_mountdirt2forest', 'grasstype3', 'grassdry_128hv', 'obhilltex1', 'grasstype4-3', 'cst_rock_coast_sfw', 'newrockgrass_sfw', 'sf_garden3', 'dt_road2grasstype4', 'grassbrn2rockbrn', 'greyground2sand', 'grassgrnbrn256', 'sl_sfngrass01', 'sl_sfngrssdrt01', 'grass', 'desertgryard256grs2', 'grasstype5_4', 'brngrss2stones', 'desgrassbrn_grn', 'desgrasandblend', 'hiwayinside4_256', 'grassdirtblend', 'roadblend:O', 'greyground256', 'forest_rocks', 'sidewgrass4', 'ws_drysand2grass', }, ['img/2.union'] = { 'sw_farmroad01', 'desmudtrail', 'desmudtrail2', 'dirttracksgrass256', 'desgreengrasstrckend', 'cw2_weeroad1', }, ['img/3.union'] = { 'grifnewtex1b', 'des_dirttrackl', 'cw2_mountroad', 'des_dirttrack1r', 'des_dirttrack1', 'des_dirt2track' , 'des_quarryrd', 'des_quarryrdr', 'des_quarryrdl', 'des_dirt2 trackl' , 'des_dirt2trackr', 'tar_1line256hvtodirt', }, ['img/4.union'] = { 'des_oldrunway' , 'ws_runwaytarmac' , 'plaintarmac1' , 'ws_carpark2', }, ['img/5.union'] = { 'sam_camo', 'bonyrd_skin2', 'concretewall22_256', 'corugwall_sandy', }, ['img/UNION.union'] = { 'unnamed', }, ['img/MDD.union'] = { 'telepole2128', 'board64_law', 'metatelepole1', 'cj_w_wood', }, ['img/FROND.union'] = { 'cj_flag2', }, ['img/6.union'] = { 'ws_freeway3blend', 'dt_roadblend', 'kbpavementblend', 'ws_freeway3', 'dt_road', 'roadnew4blend_256', 'craproad1_lae', 'craproad7_lae7', 'snpedtest1', 'cos_hiwaymid_256', 'hiwaymidlle_256', 'roadnew4_512', 'roadnew4_256', 'vegasroad1_256', 'vegasroad2_256', 'vegasroad3_256', 'hiwayend_256', 'sf_road5', 'sf_junction2', 'vegasdirtyroad1_256', 'vegasdirtyroad2_256', 'vegastriproad1_256', 'vgsroadirt1_256', 'vegasdirtyroad3_256', 'sf_tramline2', }, ['img/7.union'] = { 'ws_traintrax1', }, ['img/8.union'] = { 'pavebsandend', 'sidewgrass_fuked', 'sidewgrass3', 'lasunion994', 'kbpavement_test', 'laroad_centre1', 'sjmndukwal2', 'macpath_lae', 'sjmhoodlawn41', 'sidewgrass5', 'sidewgrass1', 'sidewgrass2' , 'pavebsand256', 'vegasdirtypaveblend1', 'dirt64b2', 'ws_sub_pen_conc3', 'concretenewb256', 'ws_sub_pen_conc', 'ws_tunnelwall2', 'vegaspavement2_256', 'blendpavement2b_256', 'hiwayinside5_256', 'dt_road_stoplinea', 'pierplanks02_128', 'vegasdirtypaveblend2', 'vegasdirtypave1_256', 'hiwayinside_256', 'hiwayinsideblend3_256', 'des_pave_trackstart', 'sf_pave6', 'stonesandkb2_128', 'ws_nicepave', 'sidelatino1_lae', 'kbpavement_test', 'craproad5_lae', 'pavebsand256grassblended', 'pavebsand256', ':Oroad01_law', }, ['img/9.union'] = { 'newpavement', 'dockpave_256', 'pavea256', }, ['img/10.union'] = { 'sjmhoodlawn41', 'plaintarmac1', }, ['img/11.union'] = { 'sw_stonesgrass', 'stones256', 'grassbrn2rockbrng' , 'ws_traingravel', ':Obrnclifftop', ':Obrncliffbtmbmp', 'redclifftop256', 'redcliffroof_la', 'hllblf2_lae', }, ['img/12.union'] = { --'rocktbrn128blndlit', 'lasclifface', 'rocktbrn128', 'cs_rockdetail2', 'cw2_mountdirtscree', 'sw_rockgrassb1', 'sw_rockgrass1' , 'des_redrock1', 'rocktbrn128blnd', 'des_redrock2', 'sw_traingravelb1', }, ['img/13.union'] = { 'sw_sand', 'sandstonemixb', 'sandnew_law', 'ws_drysand', 'ws_wetdryblendsand', 'ws_wetsand', 'desertgravel256', }, ['img/14.union'] = { 'tar_venturasjoin', 'crossing_law', 'snpdwargrn1', 'tar_1line256hvblend', 'roaddgrassblnd', 'tar_1line256hvlightsand', 'tar_1line256hvgtravel', 'tar_1line256hvblend2', 'tar_1line256hvblenddrtdot', 'tar_freewyleft', 'tar_1line256hv', 'des_1line256', 'des_1linetar', 'tar_1linefreewy', 'tar_lineslipway', 'des_1lineend', 'sf_junction3', 'sf_junction5', 'tar_1line256hvblenddrt', 'tar_freewyright', }, ['img/16.union'] = { 'gras07si', 'kb_ivy2_256', }, ['img/17.union'] = { -- дерево 'bcorya0', 'sm_bark_light', 'gen_log', 'bpiced1', 'bpinud2', 'sm_redwood_bark', 'bchamae', 'bzelka1', 'bgleda0', 'oakbark64', 'veg_bevtreebase', 'sm_josh_bark', 'bfraxa1', 'bthuja1', }, ['img/18.union'] = { 'fancy_slab128', 'coasty_bit4_sfe', 'stoneclad1', 'taxi_256', 'offwhitebrix', 'des_ranchwall1', 'ws_oldpaintedyello', 'ws_oldpaintedyello_b' , 'vgs_shopwall01_128', 'block2_high', 'sea_wall_temp', 'block', 'concretebigb256128', 'sw_tunnel01', 'sw_tunnel02bmp', 'sw_tunnel01lod', 'stormdrain3_nt', 'brick', 'carparkwall12_256', 'stormdrain1_nt', 'macbrij2_lae', 'rufwaldock1', 'stormdrain3_nt', 'stormdrain2_nt', 'laroad_offroad1', 'gb_nastybar20', 'ws_freeway2', 'ws_freeway1', 'wallgreyred128', 'stormdrain6', 'ws_coppersheet2', 'ws_goldengate2', 'ws_goldengate5b', 'stormdrain5_nt', 'sw_wallbrick_06', 'lasdockbar', 'cj_white_wall2', 'upt_conc floorclean', 'craproad3_lae', 'bow_warehousewall', 'macbrij4_lae', 'forumstand1_lae', 'block2_low', 'block2', 'woodsuport1_128' , 'woodsuport2_128', }, ['img/19.union'] = { 'sfncn_rockgrass3', }, ['img/20.union'] = { 'vgs_rockmid1a', 'vgs_rockbot1a', 'rocktq128_forestblend', 'rocktq128', 'rock_country128', 'rocktq128_dirt', 'rocktq128blender', 'rocktq128_grass4blend', 'sw_stones', 'des_redrockmid', 'sm_rock2_desert', 'des_redrockbot', 'des_yelrock', 'des_dirt2gygrass', 'rocktb128', 'greyrockbig' , }, ['img/21.union'] = { --'txgrass0_1', 'sm_des_bush2', 'sm_des_bush3', 'sm_des_bush1', }, ['img/22.union'] = { --Листя 'newtreeleaves128', 'newtreed256', 'tree19mi', 'sprucbr', 'elm_treegrn4' , 'locustbra', 'oakb', 'oak2b', 'trunk3', 'elmdead', 'sm_pinetreebit', 'oakleaf1', 'oakleaf2', 'elm_treegrn2', 'hazelbranch', 'hazelbrnch', 'pinebrnch1', 'ashbrnch', 'cedarwee', 'cedarbare', 'elmtreered', 'elm_treegrn', 'weeelm', }, ['img/23.union'] = { 'des_dirttrackx', }, ['img/24.union'] = { 'ws_oldpainted2', 'ws_goldengate5bnoalpha', 'dish_roundbit_a', 'ws_goldengate5', }, ['img/25.union'] = { 'telewireslong2', 'telewireslong', }, --Земля ['img/26.union'] = { 'stones256128', 'trainground2', 'newgrnd1brn_128', 'sw_dirt01', 'ws_rotten_concrete1', 'des_crackeddirt1', 'redstones01_256', }, --Брукывка ['img/27.union'] = { 'indund_64', 'brickred2', 'brickred', 'sm_conc_hatch', 'grass_concpath_128hv', 'tilered', 'd0acbe76', }, --Битон земля ['img/28.union'] = { 'ws_carparknew2', 'ws_carparknew1', 'ws_carparknew2a', 'lasjmslumwall', 'bow_abattoir_conc2', 'ws_sub_pen_conc2', 'carpark_128', 'parking2plain', 'parking2', 'heliconcrete', 'hseconcblend1_256', 'ws_carparknew2b', 'dustyconcrete', 'concretedust2_line', 'des_dustconc', 'drvin_ground1', 'grass_path_law', 'ws_airpt_concrete', }, --Криша ['img/29.union'] = { 'sanpedock5', 'fastfood1_lae', 'shingles3', 'des_oldtinroof', 'sjmscruffhut4', 'sw_cabinroof', 'sw_corrugtile', 'sw_slate01', 'ws_corr_metal3', 'ws_corr_metal2', 'acrooftop1256', 'corr_roof1', 'des_shingles', 'des_ghotwood1', 'genroof02_128', 'ws_corr_2_plain', 'roof01l256', 'browntin1', 'vgspawnroof02_128', 'shingles5', 'rooftiles1', 'hospunder_law', 'shingles2', 'woodroof01_128', 'rooftiles2', 'trail_wall1', 'corrroof_64hv', }, --Метал ['img/30.union'] = { 'banding9_64hv', 'redmetal', 'des_bytower1', 'metal1_128', 'bluemetal', 'des_facmetalsoild', 'sm_quarry_crusher1', 'lampost_16clr', 'lamppost', 'cj_lamppost1', 'lamppost2', 'cj_sheetmetal', 'a51_blastdoor', 'ws_greymetal', 'drvin_back', 'drvin_panel', 'iron', 'des_rails1', }, --Шифер ['img/31.union'] = { 'des_sherrifwall1', 'a51_vent1', 'block2bb', 'newall11-1', 'airportmetalwall256', 'dirtyledge_law', 'ws_corrugated1', 'ws_corrugated2', 'corrugated5_64hv', 'corugwall2-1', 'bluemetal02', 'sanpedock1', 'ws_airportwin3', 'ws_airportwall2', 'ws_whitewall2_top', 'coasty_fencet_sfe', 'crencouwall1', 'woodenpanels256', 'hilcouwall2', 'woodwalllight2256', }, --Дерево стыни ['img/32.union'] = { 'des_redslats' , 'des_motelwall5', 'sw_barnwood1', 'gb_nastybar08', 'des_woodfence1', 'des_bywall2', 'des_bywall1', 'boardwalk_la', 'des_greyslats', 'darkplanks1', 'ws_vic_wood1', 'sw_barnwoodblu', 'des_motelwall4', 'corugwall1', 'cratetop128', 'ws_green_wall1', 'des_greyboards', 'trail_side1', 'trail_wall2', 'des_ntwnwall1', }, --Битон стыни ['img/33.union'] = { 'latranswall1', 'latranswall2', 'newall4-4', 'puttywall1', 'compcouwall1', 'ws_sandstone1', 'trail_wall3', 'ws_rottenwall', 'sanpedock96', 'ws_airportwall1', 'ws_whitewall2_bottom', 'yellowall_la', 'corugwallnew6_128', 'bluapartwall1_256', 'des_brick1', 'des_roswin4', 'des_adobewall2', 'dockwall1', 'conc_wall2_128h', 'comptwall10', }, --Кровь ['img/34.union'] = { 'bloodpool_64', }, --Ефекти ['img/afterburner.union'] = { 'afterburner',}, ['img/ashes.union'] = { 'ashes',}, ['img/ashes2.union'] = { 'ashes2',}, ['img/beam.union'] = { 'beam',}, ['img/beamcorona.union'] = { 'beamcorona',}, ['img/beastie.union'] = { 'beastie',}, ['img/Bgush1.union'] = { 'Bgush1',}, ['img/Bgush2.union'] = { 'Bgush2',}, ['img/Bgush3.union'] = { 'Bgush3',}, ['img/Bgush4.union'] = { 'Bgush4',}, ['img/blaze1.union'] = { 'blaze1',}, ['img/blaze2.union'] = { 'blaze2',}, ['img/blaze3.union'] = { 'blaze3',}, ['img/blaze4.union'] = { 'blaze4',}, ['img/blood1.union'] = { 'blood1',}, ['img/blood2.union'] = { 'blood2',}, ['img/blood3.union'] = { 'blood3',}, ['img/blood4.union'] = { 'blood4',}, ['img/BloodCloud.union'] = { 'BloodCloud',}, ['img/blooddrop1.union'] = { 'blooddrop1',}, ['img/blooddrop2.union'] = { 'blooddrop2',}, ['img/blooddrop3.union'] = { 'blooddrop3',}, ['img/blooddrop4.union'] = { 'blooddrop4',}, ['img/BloodRayne.union'] = { 'BloodRayne',}, ['img/BloodSplash.union'] = { 'BloodSplash',}, ['img/Bnitro.union'] = { 'Bnitro',}, ['img/boatsplash.union'] = { 'boatsplash',}, ['img/boatwake1.union'] = { 'boatwake1',}, ['img/bsplat1.union'] = { 'bsplat1',}, ['img/bsplat2.union'] = { 'bsplat2',}, ['img/bsplat3.union'] = { 'bsplat3',}, ['img/bsplat4.union'] = { 'bsplat4',}, ['img/bsplat5.union'] = { 'bsplat5',}, ['img/bubbles.union'] = { 'bubbles',}, ['img/burn1.union'] = { 'burn1',}, ['img/burn2.union'] = { 'burn2',}, ['img/burn3.union'] = { 'burn3',}, ['img/burn4.union'] = { 'burn4',}, ['img/butterfly1.union'] = { 'butterfly1',}, ['img/butterfly2.union'] = { 'butterfly2',}, ['img/butterfly3.union'] = { 'butterfly3',}, ['img/By.union'] = { 'By',}, ['img/cardebris1.union'] = { 'cardebris1',}, ['img/cardebris2.union'] = { 'cardebris2',}, ['img/cardebris3.union'] = { 'cardebris3',}, ['img/cardebris4.union'] = { 'cardebris4',}, ['img/cardebris5.union'] = { 'cardebris5',}, ['img/cardebris_01.union'] = { 'cardebris_01',}, ['img/cardebris_02.union'] = { 'cardebris_02',}, ['img/cardebris_03.union'] = { 'cardebris_03',}, ['img/cardebris_04.union'] = { 'cardebris_04',}, ['img/cardebris_05.union'] = { 'cardebris_05',}, ['img/carsplash_02.union'] = { 'carsplash_02',}, ['img/cement.union'] = { 'cement',}, ['img/cloudmasked.union'] = { 'cloudmasked',}, ['img/coronaringa.union'] = { 'coronaringa',}, ['img/Debris1.union'] = { 'Debris1',}, ['img/Debris2.union'] = { 'Debris2',}, ['img/Debris3.union'] = { 'Debris3',}, ['img/DebrisGaEX.union'] = { 'DebrisGaEX',}, ['img/dirt1.union'] = { 'dirt1',}, ['img/dirt2.union'] = { 'dirt2',}, ['img/dragon.union'] = { 'dragon',}, ['img/drift1.union'] = { 'drift1',}, ['img/drift2.union'] = { 'drift2',}, ['img/drift3.union'] = { 'drift3',}, ['img/drift4.union'] = { 'drift4',}, ['img/driftb1.union'] = { 'driftb1',}, ['img/driftb2.union'] = { 'driftb2',}, ['img/driftb3.union'] = { 'driftb3',}, ['img/driftb4.union'] = { 'driftb4',}, ['img/Drop1.union'] = { 'Drop1',}, ['img/Drop2.union'] = { 'Drop2',}, ['img/electric1.union'] = { 'electric1',}, ['img/electric2.union'] = { 'electric2',}, ['img/electric3.union'] = { 'electric3',}, ['img/electric4.union'] = { 'electric4',}, ['img/electric5.union'] = { 'electric5',}, ['img/electric6.union'] = { 'electric6',}, ['img/electric7.union'] = { 'electric7',}, ['img/electric8.union'] = { 'electric8',}, ['img/Fdebris1.union'] = { 'Fdebris1',}, ['img/Fdebris2.union'] = { 'Fdebris2',}, ['img/Fdebris3.union'] = { 'Fdebris3',}, ['img/Fdebris4.union'] = { 'Fdebris4',}, ['img/feather.union'] = { 'feather',}, ['img/fireball1.union'] = { 'fireball1',}, ['img/fireball10.union'] = { 'fireball10',}, ['img/fireball2.union'] = { 'fireball2',}, ['img/fireball3.union'] = { 'fireball3',}, ['img/fireball4.union'] = { 'fireball4',}, ['img/fireball5.union'] = { 'fireball5',}, ['img/fireball6.union'] = { 'fireball6',}, ['img/fireball7.union'] = { 'fireball7',}, ['img/fireball8.union'] = { 'fireball8',}, ['img/fireball9.union'] = { 'fireball9',}, ['img/FireEX.union'] = { 'FireEX',}, ['img/fireball2.union'] = { 'wjet6',}, -- --['img/FireEX.union'] = { 'bullethitsmoke',}, -- ['img/FireFlame.union'] = { 'FireFlame',}, ['img/FireFlame3.union'] = { 'FireFlame3',}, ['img/flake1.union'] = { 'flake1',}, ['img/flake2.union'] = { 'flake2',}, ['img/flame1.union'] = { 'flame1',}, ['img/flame2.union'] = { 'flame2',}, ['img/flame3.union'] = { 'flame3',}, ['img/flame4.union'] = { 'flame4',}, ['img/flamethrower.union'] = { 'flamethrower',}, ['img/flash1.union'] = { 'flash1',}, ['img/flash2.union'] = { 'flash2',}, ['img/flash3.union'] = { 'flash3',}, ['img/flash4.union'] = { 'flash4',}, ['img/fly1.union'] = { 'fly1',}, ['img/fly2.union'] = { 'fly2',}, ['img/fly3.union'] = { 'fly3',}, ['img/Fnitro.union'] = { 'Fnitro',}, ['img/Foliage.union'] = { 'Foliage',}, ['img/Function-X-.union'] = { 'Function-X-',}, ['img/gameleaf01_64.union'] = { 'gameleaf01_64',}, ['img/gensplash.union'] = { 'gensplash',}, ['img/glassmall.union'] = { 'glassmall',}, ['img/glowlight.union'] = { 'glowlight',}, ['img/gore1.union'] = { 'gore1',}, ['img/gore2.union'] = { 'gore2',}, ['img/gore3.union'] = { 'gore3',}, ['img/gore4.union'] = { 'gore4',}, ['img/gum.union'] = { 'gum',}, ['img/GunFlash.union'] = { 'GunFlash',}, ['img/GunFlash1.union'] = { 'GunFlash1',}, ['img/GunFlash2.union'] = { 'GunFlash2',}, ['img/GunFlash3.union'] = { 'GunFlash3',}, ['img/GunFlash4.union'] = { 'GunFlash4',}, ['img/gunshell.union'] = { 'gunshell',}, ['img/headshot1.union'] = { 'headshot1',}, ['img/headshot2.union'] = { 'headshot2',}, ['img/headshot3.union'] = { 'headshot3',}, ['img/headshot4.union'] = { 'headshot4',}, ['img/headshot5.union'] = { 'headshot5',}, ['img/inferno1.union'] = { 'inferno1',}, ['img/inferno2.union'] = { 'inferno2',}, ['img/inferno3.union'] = { 'inferno3',}, ['img/inferno4.union'] = { 'inferno4',}, ['img/inferno5.union'] = { 'inferno5',}, ['img/inflame1.union'] = { 'inflame1',}, ['img/inflame2.union'] = { 'inflame2',}, ['img/inflame3.union'] = { 'inflame3',}, ['img/inflame4.union'] = { 'inflame4',}, ['img/inflamed1.union'] = { 'inflamed1',}, ['img/inflamed2.union'] = { 'inflamed2',}, ['img/inflamed3.union'] = { 'inflamed3',}, ['img/inflamed4.union'] = { 'inflamed4',}, ['img/laser.union'] = { 'laser',}, ['img/leaf1.union'] = { 'leaf1',}, ['img/leaf2.union'] = { 'leaf2',}, ['img/light1.union'] = { 'light1',}, ['img/light2.union'] = { 'light2',}, ['img/light3.union'] = { 'light3',}, ['img/light4.union'] = { 'light4',}, ['img/light5.union'] = { 'light5',}, ['img/light6.union'] = { 'light6',}, ['img/lightning1.union'] = { 'lightning1',}, ['img/lightning2.union'] = { 'lightning2',}, ['img/lightning3.union'] = { 'lightning3',}, ['img/lightning4.union'] = { 'lightning4',}, ['img/lightning5.union'] = { 'lightning5',}, ['img/molotov1.union'] = { 'molotov1',}, ['img/molotov2.union'] = { 'molotov2',}, ['img/molotov3.union'] = { 'molotov3',}, ['img/molotov4.union'] = { 'molotov4',}, ['img/muzzle1.union'] = { 'muzzle1',}, ['img/muzzle2.union'] = { 'muzzle2',}, ['img/muzzle3.union'] = { 'muzzle3',}, ['img/muzzle4.union'] = { 'muzzle4',}, ['img/neon.union'] = { 'neon',}, ['img/NewFx1.union'] = { 'NewFx1',}, ['img/NewFx2.union'] = { 'NewFx2',}, ['img/NewFx3.union'] = { 'NewFx3',}, ['img/newspaper.union'] = { 'newspaper',}, ['img/Overdoseeffects.union'] = { 'Overdoseeffects',}, ['img/paper1.union'] = { 'paper1',}, ['img/paper2.union'] = { 'paper2',}, ['img/paper3.union'] = { 'paper3',}, ['img/paper4.union'] = { 'paper4',}, ['img/Pnitro.union'] = { 'Pnitro',}, ['img/pointlight.union'] = { 'pointlight',}, ['img/puke.union'] = { 'puke',}, ['img/railex.union'] = { 'railex',}, ['img/rain1.union'] = { 'rain1',}, ['img/rain2.union'] = { 'rain2',}, ['img/rain3.union'] = { 'rain3',}, ['img/rain4.union'] = { 'rain4',}, ['img/realex1.union'] = { 'realex1',}, ['img/realex2.union'] = { 'realex2',}, ['img/realex3.union'] = { 'realex3',}, ['img/realex4.union'] = { 'realex4',}, ['img/realexb1.union'] = { 'realexb1',}, ['img/realexb2.union'] = { 'realexb2',}, ['img/realexb3.union'] = { 'realexb3',}, ['img/realexb4.union'] = { 'realexb4',}, ['img/realfire1.union'] = { 'realfire1',}, ['img/realfire2.union'] = { 'realfire2',}, ['img/realfire3.union'] = { 'realfire3',}, ['img/realfire4.union'] = { 'realfire4',}, ['img/rope1.union'] = { 'rope1',}, ['img/rope2.union'] = { 'rope2',}, ['img/snow1.union'] = { 'snow1',}, ['img/snow2.union'] = { 'snow2',}, ['img/snow3.union'] = { 'snow3',}, ['img/sonic1.union'] = { 'sonic1',}, ['img/sonic2.union'] = { 'sonic2',}, ['img/sparkdebris1.union'] = { 'sparkdebris1',}, ['img/sparkdebris2.union'] = { 'sparkdebris2',}, ['img/sparkdebris3.union'] = { 'sparkdebris3',}, ['img/sparkdebris4.union'] = { 'sparkdebris4',}, ['img/Sparks.union'] = { 'Sparks',}, ['img/Sparks2.union'] = { 'Sparks2',}, ['img/Sparks3.union'] = { 'Sparks3',}, ['img/Sparks4.union'] = { 'Sparks4',}, ['img/Sparks5.union'] = { 'Sparks5',}, ['img/Sparks6.union'] = { 'Sparks6',}, ['img/Sparks7.union'] = { 'Sparks7',}, ['img/SparksFlash.union'] = { 'SparksFlash',}, --['img/sphere.union'] = { 'sphere',}, ['img/sphere_CJ.union'] = { 'sphere_CJ',}, ['img/splash1.union'] = { 'splash1',}, ['img/splash2.union'] = { 'splash2',}, ['img/splash3.union'] = { 'splash3',}, ['img/splash4.union'] = { 'splash4',}, ['img/splash5.union'] = { 'splash5',}, ['img/splash6.union'] = { 'splash6',}, ['img/splash_up.union'] = { 'splash_up',}, ['img/splash_up1.union'] = { 'splash_up1',}, ['img/splash_up2.union'] = { 'splash_up2',}, ['img/splatter1.union'] = { 'splatter1',}, ['img/splatter2.union'] = { 'splatter2',}, ['img/splatter3.union'] = { 'splatter3',}, ['img/splatter4.union'] = { 'splatter4',}, ['img/water1.union'] = { 'water1',}, ['img/water2.union'] = { 'water2',}, ['img/water3.union'] = { 'water3',}, ['img/water4.union'] = { 'water4',}, ['img/waterripple1.union'] = { 'waterripple1',}, ['img/waterripple2.union'] = { 'waterripple2',}, ['img/waterripple3.union'] = { 'waterripple3',}, ['img/waterripple4.union'] = { 'waterripple4',}, ['img/waterspark.union'] = { 'waterspark',}, ['img/waterspark_16.union'] = { 'waterspark_16',}, ['img/wgush1.union'] = { 'wgush1',}, ['img/wjet2.union'] = { 'wjet2',}, ['img/wjet4.union'] = { 'wjet4',}, ['img/wjet6.union'] = { 'wjet6',}, ['img/wood1.union'] = { 'wood1',}, ['img/wood2.union'] = { 'wood2',}, ['img/wood3.union'] = { 'wood3',}, ['img/wood4.union'] = { 'wood4',}, ['img/fx2/carfx1.union'] = { 'carfx1',}, ['img/fx2/cloud1.union'] = { 'cloud1',}, ['img/fx2/cloudhigh.union'] = { 'cloudhigh',}, ['img/fx2/cloudmasked.union'] = { 'cloudmasked',}, ['img/fx2/coronaheadlightline.union'] = { 'coronaheadlightline',}, ['img/fx2/coronamoon.union'] = { 'coronamoon',}, ['img/fx2/coronareflect.union'] = { 'coronareflect',}, ['img/fx2/coronaringb.union'] = { 'coronaringb',}, ['img/fx2/coronastar.union'] = { 'coronastar',}, ['img/fx2/finishFlag.union'] = { 'finishFlag',}, ['img/fx2/handman.union'] = { 'handman',}, ['img/fx2/headlight.union'] = { 'headlight',}, ['img/fx2/headlight1.union'] = { 'headlight1',}, ['img/fx2/lamp_shad_64.union'] = { 'lamp_shad_64',}, ['img/fx2/lockon.union'] = { 'lockon',}, ['img/fx2/lockonFire.union'] = { 'lockonFire',}, ['img/fx2/lunar.union'] = { 'lunar',}, ['img/fx2/particleskid.union'] = { 'particleskid',}, ['img/fx2/rainfx.union'] = { 'rainfx',}, ['img/fx2/roadsignfont.union'] = { 'roadsignfont',}, ['img/fx2/seabd32.union'] = { 'seabd32',}, ['img/fx2/shad_bike.union'] = { 'shad_bike',}, ['img/fx2/shad_car.union'] = { 'shad_car',}, ['img/fx2/shad_exp.union'] = { 'shad_exp',}, --['img/fx2/shad_heli.union'] = { 'shad_heli',}, ['img/fx2/shad_ped.union'] = { 'shad_ped',}, ['img/fx2/shad_rcbaron.union'] = { 'shad_rcbaron',}, ['img/fx2/Sky.union'] = { 'Sky',}, ['img/fx2/Sky2.union'] = { 'Sky2',}, ['img/fx2/Sky3.union'] = { 'Sky3',}, ['img/fx2/Skysnow.union'] = { 'Skysnow',}, ['img/fx2/target256.union'] = { 'target256',}, ['img/fx2/txgrassbig0.union'] = { 'txgrassbig0',}, ['img/fx2/txgrassbig1.union'] = { 'txgrassbig1',}, ['img/fx2/waterclear256.union'] = { 'waterclear256',}, ['img/fx2/waterwake.union'] = { 'waterwake',}, ['img/fx2/white.union'] = { 'white',}, ['img/fx2/wincrack_32.union'] = { 'wincrack_32',}, ['1.png'] = { 'sphere',}, } function loadShaders () for path,texstures in pairs (shaderMap) do local shader = dxCreateShader('shader.fx') table.insert(shaderList, shader) local terrain = dxCreateTexture(path) dxSetShaderValue(shader, 'gTexture', terrain) for i,txd in ipairs (texstures) do engineRemoveShaderFromWorldTexture(nightShader, txd) engineApplyShaderToWorldTexture(shader,txd) end end end addEventHandler( "onClientResourceStart", resourceRoot, loadShaders ) Link to comment
Ayush Rathore Posted April 12, 2017 Share Posted April 12, 2017 @JanKy mix your "onClientResourceStart" functions into one function and also put night_init() in the first line of function like this function loadShaders () InselMapStart() night_init() for path,texstures in pairs (shaderMap) do local shader = dxCreateShader('shader.fx') table.insert(shaderList, shader) local terrain = dxCreateTexture(path) dxSetShaderValue(shader, 'gTexture', terrain) for i,txd in ipairs (texstures) do engineRemoveShaderFromWorldTexture(nightShader, txd) engineApplyShaderToWorldTexture(shader,txd) end end end addEventHandler( "onClientResourceStart", resourceRoot, loadShaders ) 1 Link to comment
JanKy Posted April 12, 2017 Author Share Posted April 12, 2017 @Ayush Rathore Umm, didn't work. Same thing.. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now