El_Matador Posted June 21, 2012 Share Posted June 21, 2012 Hi all , what i can Slow mute sound after login? Please help... Clienct side code : Info= guiCreateLabel(0.61,0.9333,0.6025,0.1267,"Revolution Racing",true) guiSetFont ( Info, "clear-normal" ) guiSetFont ( Info, "sa-header" ) guiLabelSetColor ( Info, 000, 000, 000 ) guiSetAlpha ( Info, 0.2222 ) local function onResourceStart() showPlayerHudComponent("weapon", false) showPlayerHudComponent("ammo", false) showPlayerHudComponent("vehicle_name", false) showPlayerHudComponent("money", false) showPlayerHudComponent("clock", false) showPlayerHudComponent("health", false) showPlayerHudComponent("armour", false) showPlayerHudComponent("breath", false) showPlayerHudComponent("area_name", false) showPlayerHudComponent("radar", false) end addEventHandler( "onClientResourceStart", getResourceRootElement( ), onResourceStart ) function cameraMoveSoft(camPosX, camPosY, camPosZ, newCamPosX, newCamPosY, newCamPosZ, camLookX, camLookY, camLookZ, newCamLookX, newCamLookY, newCamLookZ, typeCameraMove) local x = 0 local y = 0 function moveCamera() x = x + 0.00009 y = y + 0.1000 local cameraX, cameraY, cameraZ = interpolateBetween(camPosX, camPosY, camPosZ, newCamPosX, newCamPosY, newCamPosZ, x, "Linear") local lookX, lookY, lookZ = interpolateBetween(camLookX, camLookY, camLookZ, newCamLookX, newCamLookY, newCamLookZ, y, "Linear") setCameraMatrix(cameraX, cameraY, cameraZ, lookX, lookY, lookZ) if cameraX == newCamPosX and cameraY == newCamPosY and cameraZ == newCamPosZ and lookX == newCamLookX and lookY == newCamLookY and lookZ == newCamLookZ then removeEventHandler("onClientRender", getRootElement(), moveCamera) end end addEventHandler("onClientRender", getRootElement(), moveCamera) end cameraMoveSoft(1810.669,1108,8, 1806,2037, 8, 0, 0, 0, 0, 200000, 0, "Linear") function spawn(player) if not isElement(player) then return end repeat until spawnPlayer ( player, -1964+math.random(0,0), 136+math.random(5,9), 28, 90, math.random(9,288) ) fadeCamera(player, true) setCameraTarget(player, player) end addEventHandler("onPlayerJoin", root, function() spawn(source) end ) local localPlayer = getLocalPlayer() local playerName = getPlayerName(localPlayer) sound = playSound("logowanie.ogg") setSoundVolume(sound, 1) function createPasswordWindow() windowChangepw = guiCreateWindow(0.3859,0.349,0.2219,0.1628,"Zmien haslo",true) guiSetSize(windowChangepw, 165, 21) guiSetAlpha(windowChangepw,0.80000001192093) editOldpw = guiCreateEdit(110,29,165,21,"",false,windowChangepw) guiSetAlpha(editOldpw,1) guiEditSetMasked(editOldpw,true) labelOldpw = guiCreateLabel(10,29,90,21,"Stare hasło:",false,windowChangepw) guiSetAlpha(labelOldpw,1) guiLabelSetColor(labelOldpw,255,255,255) guiLabelSetVerticalAlign(labelOldpw,"center") guiLabelSetHorizontalAlign(labelOldpw,"left",false) editNewpw = guiCreateEdit(110,60,165,21,"",false,windowChangepw) guiSetAlpha(editNewpw,1) guiEditSetMasked(editNewpw,true) guiEditSetMaxLength(editNewpw,50) labelNewpw = guiCreateLabel(10,60,90,21,"Nowe hasło:",false,windowChangepw) guiSetAlpha(labelNewpw,1) guiLabelSetColor(labelNewpw,255,255,255) guiLabelSetVerticalAlign(labelNewpw,"center") guiLabelSetHorizontalAlign(labelNewpw,"left",false) buttonChangepw = guiCreateButton(10,91,265,23,"Zmień Hasło",false,windowChangepw) guiSetAlpha(buttonChangepw,1) guiSetVisible(windowChangepw, false) addEventHandler("onClientGUIClick", buttonChangepw, clientSubmitChangepw, false) end function createLoginWindow() windowLogin = guiCreateWindow(0.3345,0.3646,0.2109,0.2018,"Zaloguj się",true) guiSetSize(windowLogin, 430, 205, false) guiSetAlpha(windowLogin,1) labelUsername = guiCreateLabel(90,72,59,24,"Login:",false,windowLogin) guiSetAlpha(labelUsername,1) guiLabelSetColor(labelUsername,255,255,255) guiLabelSetVerticalAlign(labelUsername,"center") guiLabelSetHorizontalAlign(labelUsername,"left",false) labelPassword = guiCreateLabel(90,100,59,24,"Haslo:",false,windowLogin) guiSetAlpha(labelPassword,1) guiLabelSetColor(labelPassword,255,255,255) guiLabelSetVerticalAlign(labelPassword,"center") guiLabelSetHorizontalAlign(labelPassword,"left",false) --labelInfo = guiCreateLabel(120,26,250,17,"Witamy na Serwerze",false,windowLogin) --labelInfo = guiCreateLabel(120,56,260,27,"ll Revolution Racing ll",false,windowLogin) --guiSetAlpha(labelInfo,1) --guiLabelSetColor(labelInfo,255,255,255) --guiLabelSetVerticalAlign(labelInfo,"top") --guiLabelSetHorizontalAlign(labelInfo,"center",false) --guiSetFont(labelInfo,"default-bold-small") editUsername = guiCreateEdit(140,72,181,25,playerName,false,windowLogin) guiSetAlpha(editUsername,1) guiEditSetMaxLength(editUsername, 50) editPassword = guiCreateEdit(140,100,181,25,"",false,windowLogin) guiSetAlpha(editPassword,1) guiEditSetMasked(editPassword, true) guiEditSetMaxLength(editPassword, 50) buttonLogin = guiCreateButton(50,140,137,40,"Zaloguj",false,windowLogin) guiSetAlpha(buttonLogin,1) buttonRegister = guiCreateButton(240,140,137,40,"Zarejestruj",false,windowLogin) guiSetAlpha(buttonRegister,1) --[[ GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} windowLogin = guiCreateTabPanel(0.2898,0.3854,0.3994,0.2531,true) GUIEditor_Tab[1] = guiCreateTab("Logowanie/Rejestracja",windowLogin) GUIEditor_Edit[1] = guiCreateEdit(138,157,5,5,"",false,GUIEditor_Tab[1]) editUsername = guiCreateEdit(46,26,318,33,"",false,GUIEditor_Tab[1]) editPassword = guiCreateEdit(46,83,318,33,"",false,GUIEditor_Tab[1]) buttonLogin = guiCreateButton(237,125,127,25,"Zaloguj",false,GUIEditor_Tab[1]) guiSetProperty(GUIEditor_Button[1],"Text","Zaloguj") GUIEditor_Label[1] = guiCreateLabel(51,5,307,17,"Login",false,GUIEditor_Tab[1]) GUIEditor_Label[2] = guiCreateLabel(52,65,271,14,"Haslo",false,GUIEditor_Tab[1]) buttonRegister = guiCreateButton(103,125,127,25,"Zarejestruj",false,GUIEditor_Tab[1]) guiSetProperty(GUIEditor_Button[2],"Text","Zarejestruj") --]] guiSetVisible(windowLogin, false) addEventHandler("onClientGUIClick", buttonLogin, clientSubmitLogin, false) addEventHandler("onClientGUIClick", buttonRegister, clientSubmitRegister, false) end function resourceStart() createLoginWindow() if (windowLogin ~= nil) then guiSetVisible(windowLogin, true) else outputChatBox("Wystapil blad.") end showCursor(true) guiSetInputEnabled(true) end function changePw() createPasswordWindow() guiSetVisible(windowChangepw, true) showCursor(true) guiSetInputEnabled(true) end function clientSubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(editUsername) local password = guiGetText(editPassword) if username and password then triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password) else guiSetText(labelInfo, "Podaj login i haslo.") end end end function clientSubmitRegister(button, state) if button == "left" and state == "up" then local username = guiGetText(editUsername) local password = guiGetText(editPassword) if username and password then triggerServerEvent("submitRegister", getRootElement(), localPlayer, username, password) else guiSetText(labelInfo, "Podaj login i haslo.") end end end function clientSubmitChangepw(button, state) if button == "left" and state == "up" then local oldpassword = guiGetText(editOldpw) local newpassword = guiGetText(editNewpw) if oldpassword and newpassword then triggerServerEvent("submitChangepw", getRootElement(), localPlayer, oldpassword, newpassword) else outputChatBox("Podaj stare i nowe haslo.") end end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(windowLogin, false) destroyElement (Info) showCursor(false) fadeCamera ( false, 2.0, 0, 0, 0) setTimer (Kamera, 3000, 1 ) playSound3D ( "pg.ogg", -2045.42, 173.59, 29.84 ) end hidePasswordWindow = function() guiSetVisible(windowChangepw, false) end local screenWidth, screenHeight = guiGetScreenSize ( ) local messageLoadnig = "Ładowanie" function Kamera() removeEventHandler("onClientRender", getRootElement(), moveCamera) setCameraInterior(1) setCameraMatrix ( -2045.42, 173.59, 29.84, -4000, 1550, 0, 0, 0 ) fadeCamera(true,5) dxDrawText("* ".. messageLoadnig,503.0,16.0,573.0,32.0,tocolor(0,0,255,170),0.8,"sans","left","top",false,false,false) end function unknownError() outputChatBox("Nie wypełniłeś wszystkich pól.", player) end function loginWrong() outputChatBox("Wpisałeś niepoprawne dane.", player) end function registerTaken() outputChatBox("Nazwa użytkownika jest już zajęta.", player) end addEvent("hidePasswordWindow", true) addEvent("hideLoginWindow", true) addEvent("unknownError", true) addEvent("loginWrong", true) addEvent("registerTaken", true) Link to comment
TwiX! Posted June 21, 2012 Share Posted June 21, 2012 /debugscript 3 in chat wont check all code Link to comment
Guest Guest4401 Posted June 21, 2012 Share Posted June 21, 2012 By slow mute, if you mean that the sound volume should be gradually decreasing, then use setSoundVolume from 1 to 0 in setTimer and later on stop it with stopSound 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