KulakovD Posted February 7, 2017 Share Posted February 7, 2017 Баг со звуком на 1 id Дело в том что когда я беру оружие (Основное) по стреляю,и когда беру пистолет то производится звук основного оружия И в debugscript 3,показываются Warning'ыКартинка Сам код function onClientPlayerWeaponFire ( weapon,ammo,ammoInClip,hitX,hitY,hitZ,hitElement,startX, startY, startZ ) local weapon = getElementData(getLocalPlayer(),"currentweapon_1") local weapon2 = getElementData(getLocalPlayer(),"currentweapon_2") if weapon == "PKP" then sound = playSound3D ( "sounds/8.wav",startX, startY, startZ, false ) elseif weapon == "AK-74" then sound = playSound3D ( "sounds/9.wav",startX, startY, startZ, false ) elseif weapon == "RPK" then sound = playSound3D ( "sounds/33.wav",startX, startY, startZ, false ) --[[elseif weapon == "AK-74GP" then sound = playSound3D ( "sounds/10.wav",startX, startY, startZ, false ) elseif weapon == "AK-104" then sound = playSound3D ( "sounds/11.wav",startX, startY, startZ, false ) elseif weapon == "AK-104GLPSO" then sound = playSound3D ( "sounds/12.wav",startX, startY, startZ, false ) elseif weapon == "AK-104PSO" then sound = playSound3D ( "sounds/13.wav",startX, startY, startZ, false ) elseif weapon == "AKM" then sound = playSound3D ( "sounds/14.wav",startX, startY, startZ, false ) elseif weapon == "AKSgold" then sound = playSound3D ( "sounds/15.wav",startX, startY, startZ, false ) elseif weapon == "AKS-74UNKobra" then sound = playSound3D ( "sounds/16.wav",startX, startY, startZ, false ) elseif weapon == "FNFAL" then sound = playSound3D ( "sounds/17.wav",startX, startY, startZ, false ) elseif weapon == "FNFALAN-PVS4" then sound = playSound3D ( "sounds/18.wav",startX, startY, startZ, false ) elseif weapon == "G36" then sound = playSound3D ( "sounds/18.wav",startX, startY, startZ, false ) elseif weapon == "G36C" then sound = playSound3D ( "sounds/20.wav",startX, startY, startZ, false ) elseif weapon == "G36-CSDcamo" then sound = playSound3D ( "sounds/20.wav",startX, startY, startZ, false ) elseif weapon == "G36C-SD" then sound = playSound3D ( "sounds/20.wav",startX, startY, startZ, false ) elseif weapon == "G36K" then sound = playSound3D ( "sounds/20.wav",startX, startY, startZ, false ) elseif weapon == "L85A2ACOGGL" then sound = playSound3D ( "sounds/24.wav",startX, startY, startZ, false ) elseif weapon == "L85A2AWS" then sound = playSound3D ( "sounds/24.wav",startX, startY, startZ, false ) elseif weapon == "L85A2Holo" then sound = playSound3D ( "sounds/24.wav",startX, startY, startZ, false ) elseif weapon == "L85A2SUSAT" then sound = playSound3D ( "sounds/24.wav",startX, startY, startZ, false ) elseif weapon == "M240" then sound = playSound3D ( "sounds/28.wav",startX, startY, startZ, false ) elseif weapon == "MG36" then sound = playSound3D ( "sounds/28.wav",startX, startY, startZ, false ) elseif weapon == "M4A1 HWS M203" then sound = playSound3D ( "sounds/4.wav",startX, startY, startZ, false )]]-- elseif weapon == "M4A1 CCO" then sound = playSound3D ( "sounds/5.wav",startX, startY, startZ, false ) elseif weapon == "AKS" then sound = playSound3D ( "sounds/6.wav",startX, startY, startZ, false ) elseif weapon == "Lee Enfield" then sound = playSound3D ( "sounds/lee-enfield.wav",startX, startY, startZ, false ) elseif weapon == "G17" then sound = playSound3D ( "sounds/Colt45.mp3",startX, startY, startZ, false ) elseif weapon == "Револьвер" then sound = playSound3D ( "sounds/Deagle.mp3",startX, startY, startZ, false ) elseif weapon == "M9 SD" then sound = playSound3D ( "sounds/Silenced.mp3",startX, startY, startZ, false ) elseif weapon == "SPAZ-12 Combat Shotgun" then sound = playSound3D ( "sounds/Shotgun.mp3",startX, startY, startZ, false ) elseif weapon == "Sawn-Off Shotgun" then sound = playSound3D ( "sounds/Sawed-Off.mp3",startX, startY, startZ, false ) elseif weapon == "Винчестер 1866" then sound = playSound3D ( "sounds/Combat Shotgun.mp3",startX, startY, startZ, false ) elseif weapon == "PDW" then sound = playSound3D ( "sounds/UZI.mp3",startX, startY, startZ, false ) elseif weapon == "P90" then sound = playSound3D ( "sounds/tec9.mp3",startX, startY, startZ, false ) elseif weapon == "MP5" then sound = playSound3D ( "sounds/MP5.mp3",startX, startY, startZ, false ) elseif weapon == "AK-47" then sound = playSound3D ( "sounds/AK-47.mp3",startX, startY, startZ, false ) elseif weapon == "M4" then sound = playSound3D ( "sounds/M4.mp3",startX, startY, startZ, false ) elseif weapon == "Lee Enfield" then sound = playSound3D ( "sounds/Rifle",startX, startY, startZ, false ) elseif weapon == "M107" then sound = playSound3D ( "sounds/Sniper.mp3",startX, startY, startZ, false ) elseif weapon == "SVD" then sound = playSound3D ( "sounds/Sniper.mp3",startX, startY, startZ, false ) elseif weapon == "AS50" then sound = playSound3D ( "sounds/32.wav",startX, startY, startZ, false ) end setSoundMaxDistance(sound,40) setSoundVolume(sound,0.7) end setWorldSoundEnabled(5,false) addEventHandler("onClientPlayerWeaponFire",getRootElement(),onClientPlayerWeaponFire ) local h1, h2, h3 = debug.gethook() debug.sethook() debug.sethook( _, h1, h2, h3 ) setSoundMaxDastance(sound,40) setSoundVolume(sound,0.7) Строки в которой ошибка Link to comment
nikitafloy Posted February 7, 2017 Share Posted February 7, 2017 Картинка не грузится, укажи weapon ружья, которое проверяешь, выведи отдельно "startX, startY, startZ", в meta.xml проверь наличие этих файлов звуковых Link to comment
Fabervox Posted February 8, 2017 Share Posted February 8, 2017 @KulakovD, картинка во-первых не работает что уже сказано, во-вторых из лога можно скопировать. Ванговать, мы то конечно можем, но вот луа-машина нет. weapon2 вообще не используется после получения. А с weapon вместо того что-бы обработать то что передается в функцию, заново присваивается значение. Я бы посоветовал назвать файлы звуков также как и названия оружий, и в одном формате сделать. Занести названия оружий с кастомным звуком в таблицу(лучше в качестве индексов), и далее просто проверять есть ли индекс. 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