Jump to content

El_Matador

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by El_Matador

  1. But i don't have any voice script...
  2. I have server Role Play and i need this .
  3. Hello, is in MTA anywhere scriipt voice for MTA but in the 3D , the player is speaking and other players listen this when they are close, is possible?
  4. 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)
  5. Ok , but the camera after login moving further, what interior garage i must write? Any interior is no work. Can you edit the code and add the camera turns off? I write this : function Kamera() setCameraInterior(1) 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 and i see this :
  6. Sorry... I know , i bad write script's in lua , can you fix my bugs? After login camera moves on and not showing the garage (and any interior i write)
  7. So , what's i must write in the serverside code?
  8. Oh , my fault thanks , second problem is big for me , the interior after login is no set and camera is moving further, can you fix this for me? Is in the client side : 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 ) end hidePasswordWindow = function() guiSetVisible(windowChangepw, false) end local screenWidth, screenHeight = guiGetScreenSize ( ) local messageLoadnig = "Ladowanie" function Kamera() setCameraInterior(200) 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) addEventHandler("hidePasswordWindow", getRootElement(), hidePasswordWindow) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) addEventHandler("unknownError", getRootElement(), unknownError)
  9. Okay , this is good : addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), resourceStart) ?
  10. Let's fix the first .... gamemode , i writed Race World .... and MTA showing.... MTA SA
  11. Ok , moved , this is actually code : Client : 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 ) end hidePasswordWindow = function() guiSetVisible(windowChangepw, false) end local screenWidth, screenHeight = guiGetScreenSize ( ) local messageLoadnig = "Ladowanie" function Kamera() setCameraInterior(200) 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) addEventHandler("hidePasswordWindow", getRootElement(), hidePasswordWindow) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) addEventHandler("unknownError", getRootElement(), unknownError)
  12. Client side : function passwordHandler(player, oldpassword, newpassword) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("Musisz być zalogowany by zmienić swoje hasło.", player) return end local playerName = getPlayerName(player) local password_check = getAccount(playerName, oldpassword) if (password_check ~= false) then if (string.len(newpassword) >= 5) then setAccountPassword(account, newpassword) triggerClientEvent(player, "hidePasswordWindow", getRootElement()) else outputChatBox("Hasło musi zawierać przynajmniej 5 liter!", player) end else outputChatBox("Bledne stare haslo.", player) end end end function loginHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(player, account, password) == true) then outputChatBox("Jesli chcesz zmienic haslo wpisz /changepw", player) triggerClientEvent (player, "hideLoginWindow", getRootElement()) else triggerClientEvent (player, "unknownError", getRootElement()) end else triggerClientEvent (player, "loginWrong", getRootElement()) end end function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount(username, password) if (logIn(player, account, password) == true) then outputChatBox("If you want to change your password, use /changepw", player) triggerClientEvent(player, "hideLoginWindow", getRootElement()) else triggerClientEvent(player, "unknownError", getRootElement()) end end end addEvent("submitChangepw", true) addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitChangepw", root, passwordHandler) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, registerHandler)
  13. Hi all , i have problem in my script (login) after login camera must be in the interior (garage) but is isn't it. And i don't know what i can create function when i login the music volume falls (down...down...down and stop) , please help me in this script function resourceStart(resource) setGameType("Race World") setMapName("RR 1.0") setRuleValue("Script Version", scriptVersion) setRuleValue("Author", "Shape") end 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 ) end hidePasswordWindow = function() guiSetVisible(windowChangepw, false) end local screenWidth, screenHeight = guiGetScreenSize ( ) local messageLoadnig = "Ladowanie" function Kamera() setCameraInterior(200) 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)
  14. After login camera is FadeOut and FadeIn - but i set the interior (garage) and is no working , after camera fadeIn i see this :
  15. Okay , I inderstand , i build my own login panel but is no working and i delete id , i used this login panel and a little problem to set the alpha . And check my edit post up. Edit : Ok , i delete and no bugs , i have second problem , the Text "Revolution Racing" is swowing after login , i tried set the timer 3 seconds but it's no work.
  16. I write this , look : 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) guiSetVisible(info, false) showCursor(false) fadeCamera ( false, 2.0, 0, 0, 0) setTimer (Kamera, 3000, 1 ) end hidePasswordWindow = function() guiSetVisible(windowChangepw, false) end local screenWidth, screenHeight = guiGetScreenSize ( ) local messageLoadnig = "Ladowanie" function Kamera() setCameraInterior(200) 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) addEventHandler("hidePasswordWindow", getRootElement(), hidePasswordWindow) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) addEventHandler("unknownError", getRootElement(), unknownError)
  17. Ok so : 1. What i can add in the code the myWindow? 2.Where i must wite function hidePasswordWindow 3. I don't know what i must repair in this line 4. I must set this function to DxDrawText ?
  18. Ok thanks , so , whats now? I must delete "mywindow" ?
  19. Hi all , i need some help , i created Login Panel , and functions to this , and this have some problems , i can't repair this and i need help so , this is debugscript 3 : And client side code of the script (my firts script!) guiSetAlpha ( myWindow, 1 ) guiWindowSetSizable ( myWindow, false ) 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) guiSetVisible(info, false) showCursor(false) fadeCamera ( false, 2.0, 0, 0, 0) setTimer (Kamera, 3000, 1 ) end local screenWidth, screenHeight = guiGetScreenSize ( ) local messageLoadnig = "Ladowanie" function Kamera() setCameraInterior(200) fadeCamera(true,5) dxDrawColorText("* ".. 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) addEventHandler("hidePasswordWindow", getRootElement(), hidePasswordWindow) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) addEventHandler("unknownError", getRootElement(), unknownError) addEventHandler("loginWrong", getRootElement(), loginWrong) addEventHandler("registerTaken", getRootElement(), registerTaken) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), resourceStart)
  20. W porządku , a co zrobić by zamiast truchtu pod klawiszem W , bylo zwykłe chodzenie powoli ?
  21. I see, but the example is about vehicle fire. function disableFireForHydra ( theVehicle, seat, jacked ) if ( getElementModel ( theVehicle ) == 520 ) then -- if they entered a hydra toggleControl ( source, "vehicle_secondary_fire", false ) -- disable their fire key else -- if they entered another vehicle toggleControl ( source, "vehicle_secondary_fire", true ) -- enable their fire key end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), disableFireForHydra ) I looking for slow walking in key "w" and small run on the ALT + W.
  22. Debugscript : And code : bool toggleControl ( player thePlayer, string sprint, bool disabled )
  23. I used this but i can't run this , always errors and warnings , not work
  24. Ok , so what i cna use this function ?
×
×
  • Create New...