Jump to content

ayuda con mis scripts


Recommended Posts

Pues sigue estos pasos:

En la consola, escribe "refresh"

Espera un momentito...

Si sale algo sobre tu resource que diga "failed to load", entonces escríbelo acá.

no aparece nada de nada,ni failed to load,es como si no estubiera,esta es my ventana de login :

function createLoginWindow() 
    local X = 0.375 
    local Y = 0.375 
    local Width = 0.25 
    local Height = 0.25 
    wdwLogin = guiCreateWindow(X, Y, Width, Height, "Porfavor ingrese", true) 
  
  
    X = 0.0825 
    Y = 0.2 
    Width = 0.25 
    Height = 0.25 
    guiCreateLabel(X, Y, Width, Height, "Usuario", true, wdwLogin) 
    Y = 0.5 
    guiCreateLabel(X, Y, Width, Height, "Contraseña", true, wdwLogin) 
  
  
    X = 0.415 
    Y = 0.2 
    Width = 0.5 
    Height = 0.15 
    edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) 
    Y = 0.5 
    edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) 
    guiEditSetMaxLength(edtUser, 50) 
    guiEditSetMaxLength(edtPass, 50) 
  
    X = 0.415 
    Y = 0.7 
    Width = 0.25 
    Height = 0.2 
    btnLogin = guiCreateButton(X, Y, Width, Height, "Ingresar", true, wdwLogin) 
  
    guiSetVisible(wdwLogin, false) 
  
        addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), 
    function () 
        createLoginWindow() 
  
        end 
  
        addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), 
    function () 
        createLoginWindow() 
  
                outputChatBox("Welcome to My new Server, please be patient and log in/register.") 
  
        -- if the GUI was successfully created, then show the GUI to the player 
            if (wdwLogin ~= nil) then 
            guiSetVisible(wdwLogin, true) 
        else 
            outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") 
            end 
  
            showCursor(true) 
  
            guiSetInputEnabled(true) 
    end 
  
        addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) 
  
        function createLoginWindow() 
  
    addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) 
  
        end 
  
        function clientSubmitLogin(button,state) 
    if button == "left" and state == "up" then 
        guiSetInputEnabled(false) 
        guiSetVisible(wdwLogin, false) 
        showCursor(false) 
    end 
end 
  
        function clientSubmitLogin(button,state) 
    if button == "left" and state == "up" then 
        local username = guiGetText(edtUser) 
        local password = guiGetText(edtPass) 
  
        if username and password then 
            triggerServerEvent("submitLogin", getRootElement(), username, password) 
  
            guiSetInputEnabled(false) 
            guiSetVisible(wdwLogin, false) 
            showCursor(false) 
        else 
            outputChatBox("Please enter a username and password.") 
        end 
    end 
end 
  
       function loginHandler(username,password) 
  
end 
  
  
addEvent("submitLogin",true) 
addEventHandler("submitLogin",root,loginHandler) 
  
function loginHandler(username,password) 
    if username == "user" and password == "apple" then 
        if (client) then 
            spawnPlayer(client, 1959.55, -1714.46, 10) 
            fadeCamera(client, true) 
                        setCameraTarget(client, client) 
            outputChatBox("Welcome to My Server.", client) 
        end 
    else 
        outputChatBox("Invalid username and password. Please re-connect and try again.",client) 
        end 
end 
  
addEvent("submitLogin",true) 
addEventHandler("submitLogin",root,loginHandler) 

Edited by Guest
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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