Jump to content

Login Panel and problems in working


Recommended Posts

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 :

1.jpg

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)
 
Link to comment

1. myWindow isn't created anywhere hence the first two bad arguements (line 1 & 2)

2. Can't find the function: "hidePasswordWindow" anywhere. Line: 246

3. the gui window "info" isn't created anywhere, hence the bad arguement @ 213

4. dxDrawColorText? do you mean: dxDrawText? line: 226

Edited by Guest
Link to comment
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 ?

Just, delete the first two lines they are rather useless or change "myWindow" to the window variable you want to set it's alpha and sizable to.

And, if you don't know how am I supposed to know?

Anyhow try this 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 haslo:",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 haslo:",false,windowChangepw)
    guiSetAlpha(labelNewpw,1)
    guiLabelSetColor(labelNewpw,255,255,255)
    guiLabelSetVerticalAlign(labelNewpw,"center")
    guiLabelSetHorizontalAlign(labelNewpw,"left",false)
    buttonChangepw = guiCreateButton(10,91,265,23,"Zmien Haslo",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 sie",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)
    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)
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 wypelniles wszystkich pól.", player)
end
 
function loginWrong()
    outputChatBox("Wpisales niepoprawne dane.", player)
end
 
function registerTaken()
    outputChatBox("Nazwa uzytkownika jest juz zajeta.", player)
end
 
hidePasswordWindow = function()
    guiSetVisible(windowChangepw, false)
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)
Link to comment

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)
Edited by Guest
Link to comment
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)
Edited by Guest
Link to comment

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.

Edited by Guest
Link to comment
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.

I edited my post, change it to:

destroyElement(Info) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...