Jump to content

LucasMorais

Members
  • Posts

    22
  • Joined

  • Last visited

Posts posted by LucasMorais

  1. Hi. When I try to connect to a server that needs to download 250KB+ maps, it stops downloading and my internet disconnects. The windows XP SP3 firewall is activated, but MTA is in the exceptions. What shall i do?

  2. Hi, it's me again and again.. err.. i'm trying to do a login/register system for a roleplay server. But when I click "REGISTRO", nothing happens.. help?

    login.lua ( GUI )

    function loginWindow() 
        GUIEditor_Window = {} 
        GUIEditor_Button = {} 
        GUIEditor_Memo = {} 
        GUIEditor_Label = {} 
        GUIEditor_Edit = {} 
        GUIEditor_Scrollbar = {} 
        guiSetInputEnabled(true) 
        showCursor(true) 
        GUIEditor_Window[1] = guiCreateWindow(284,338,483,172,"LOGUE-SE OU REGISTRE-SE!",false) 
        guiWindowSetMovable(GUIEditor_Window[1],false) 
        guiWindowSetSizable(GUIEditor_Window[1],false) 
        LoginEdit = guiCreateLabel(13,28,118,19,"Nome de usuário:",false,GUIEditor_Window[1]) 
        GUIEditor_Edit[1] = guiCreateEdit(9,47,143,19,"",false,GUIEditor_Window[1]) 
        GUIEditor_Label[2] = guiCreateLabel(11,68,118,19,"Senha:",false,GUIEditor_Window[1]) 
        GUIEditor_Edit[2] = guiCreateEdit(9,47,143,19,"",false,GUIEditor_Window[1]) 
        guiEditSetMaxLength(GUIEditor_Edit[2],15) 
        PassEdit = guiCreateEdit(9,84,143,19,"",false,GUIEditor_Window[1]) 
        guiEditSetMasked(PassEdit,true) 
        LoginB = guiCreateButton(9,113,70,29,"Login",false,GUIEditor_Window[1]) 
        RegB = guiCreateButton(84,114,70,29,"Registro",false,GUIEditor_Window[1]) 
        GUIEditor_Label[3] = guiCreateLabel(100,149,313,18,"Connect Roleplay 2011 - [url=http://www.connect-rp.com]http://www.connect-rp.com[/url]",false,GUIEditor_Window[1]) 
        guiSetFont(GUIEditor_Label[3],"default-bold-small") 
        GUIEditor_Label[4] = guiCreateLabel(164,22,308,18,"Atualizações:",false,GUIEditor_Window[1]) 
        guiSetFont(GUIEditor_Label[4],"clear-normal") 
        GUIEditor_Memo[1] = guiCreateMemo(164,42,298,98,"v0.1 BETA:\n- GUI @ Login feita.\n-------------------------------------------------------------------\nPróximas atualizações:\nv0.2 BETA:\n- Sistema de salvamento de contas.",false,GUIEditor_Window[1]) 
        guiSetVisible(GUIEditor_Window[1], true) 
        local sound = playSound("sounds/mario.mp3") --Play wasted.mp3 from the sounds folder 
        setSoundVolume(sound, 1.0) -- set the sound volume to 50% 
        end 
        addEventHandler("onClientResourceStart", getResourceRootElement(), loginWindow) 
      
      
      
    function activateThis() 
    triggerClientEvent("thisThing", getRootElement()) 
    end 
    addEventHandler("onClientResourceStart", getResourceRootElement(), loginwindow) 
    

    account.lua

    addEvent("thisThing", true) 
      
    local playerRegister = false 
        function onPlayerRegister(username, password) 
    onClientGUIClick(left, up, 114,70) 
    guiGetText(LoginEdit) 
    guiGetText(PassEdit) 
    if(password ~= "" and password ~= nil and username ~= and username ~= nil and playerRegister = false) then 
    triggerServerEvent("addTheAccount", getRootElement()) 
    end 
    addEventHandler("onClientGUIClick", RegB) 
    

    contas.lua (add the account)

    addEvent("addTheAccount", true) 
      
    function registerThePlayer(source, username, password) 
    local accountAdded = addAccount(username, password) 
    if(accountAdded) then 
    outputChatBox("Obrigado por se registrar, agora logue-se.", source) 
    playerRegister = true 
    else 
    outputChatBox("Ocorreu um erro enquanto estávamos criando sua conta, tente novamente.", source) 
    end 
    if(playerRegister == true) then 
    outputChatBox("Este nome de usuário já está registrado, escolha outro!", source) 
    end 
    end 
    addEventHandler("addTheAccount", getRootElement(), registerThePlayer) 
    

    I am trying to solve, I would be happy if anyone tries to help me :)

  3. Well, I need help again. With binding keys.

    This is server-side, it's correct?

    function keys(keyPresser, key, keyState) 
    if(key == "m") and if(keyState == "down") and if(isCursorShowing == false) 
    showCursor(true) 
    end 
    if(key == "m") and if(keyState == "down") and if(isCursorShowing == true) 
    showCursor(false) 
        end 
    end 
    function bindedKeys() 
    bindKey("m", "down", keys) 
    end 
    

  4. Hi, it's me again! I need some help with this. I already have the GUI, but I can't make it appear when the player Join. Please notice that i'm new in LUA scripting.

    Client-Side file:

    function () 
    GUIEditor_Window = {} 
    GUIEditor_Button = {} 
    GUIEditor_Memo = {} 
    GUIEditor_Label = {} 
    GUIEditor_Edit = {} 
    GUIEditor_Scrollbar = {} 
    guiSetInputEnabled(false) 
    GUIEditor_Window[1] = guiCreateWindow(284,338,483,172,"LOGUE-SE OU REGISTRE-SE!",false) 
    guiWindowSetMovable(GUIEditor_Window[1],false) 
    guiWindowSetSizable(GUIEditor_Window[1],false) 
    GUIEditor_Label[1] = guiCreateLabel(13,28,118,19,"Nome de usuário:",false,GUIEditor_Window[1]) 
    GUIEditor_Edit[1] = guiCreateEdit(9,47,143,19,"",false,GUIEditor_Window[1]) 
    GUIEditor_Label[2] = guiCreateLabel(11,68,118,19,"Senha:",false,GUIEditor_Window[1]) 
    GUIEditor_Edit[2] = guiCreateEdit(9,47,143,19,"",false,GUIEditor_Window[1]) 
    guiEditSetMaxLength(GUIEditor_Edit[2],15) 
    GUIEditor_Edit[3] = guiCreateEdit(9,84,143,19,"",false,GUIEditor_Window[1]) 
    guiEditSetMasked(GUIEditor_Edit[3],true) 
    GUIEditor_Button[1] = guiCreateButton(9,113,70,29,"Login",false,GUIEditor_Window[1]) 
    GUIEditor_Button[2] = guiCreateButton(84,114,70,29,"Registro",false,GUIEditor_Window[1]) 
    GUIEditor_Label[3] = guiCreateLabel(100,149,313,18,"Advanced Roleplay 2011 - [url=http://www.advanced-roleplay.com]www.advanced-roleplay.com[/url]",false,GUIEditor_Window[1]) 
    guiSetFont(GUIEditor_Label[3],"default-bold-small") 
    GUIEditor_Label[4] = guiCreateLabel(164,22,308,18,"Atualizações:",false,GUIEditor_Window[1]) 
    guiSetFont(GUIEditor_Label[4],"clear-normal") 
    GUIEditor_Memo[1] = guiCreateMemo(164,42,298,98,"v0.1 BETA:\n- GUI @ Login feita.\n-------------------------------------------------------------------\nPróximas atualizações:\nv0.2 BETA:\n- Sistema de salvamento de contas.",false,GUIEditor_Window[1]) 
    guiSetVisible(GUIEditor_Window[1], true) 
    end 
    addEventHandler("onPlayerJoin", getRootElement(), loginWindow) 
    

    I don't need to post the server-side file, because it has nothing related to the client-side file. I know, i have to do something in the server-side file to activate the client-side, but I don't know wich one to use and how-to. Help please!

  5. Hello. I am new at MTA/LUA scripting and I am trying to do a system that when I press one key, the engines turns on, and when I press another key, the engine turns off. But, when I type /bindit, enter the car and press the key, there is an error at the server console. It is like this: "Bad argument @ setVehicleEngineState". This is the system, it's server-side.

    function engineOn(player, key, keyState, theVehicle) 
    if(keyState == "down") then 
    setVehicleEngineState(theVehicle, true) 
    end 
    end 
      
    function engineOff(player, key, keyState, theVehicle) 
    if(keyState == "down") then 
    setVehicleEngineState(theVehicle, false) 
    end 
    end 
      
    function bindTheKeys(player, commandName) 
    bindKey(player, "j", "down", engineOn) 
    bindKey(player, "k", "down", engineOff) 
    end 
    addCommandHandler("bindit", bindTheKeys) 
    

    Thanks.

  6. Oi gente. Eu estou tentando fazer um sistema de ligar/desligar o motor à base de bindKey. O código eu estou fazendo em server-side. Aí vai:

    function engineOn(player, key, keyState, theVehicle) 
    if(keyState == "down") then 
    setVehicleEngineState(theVehicle, true) 
    end 
    end 
      
    function engineOff(player, key, keyState, theVehicle) 
    if(keyState == "down") then 
    setVehicleEngineState(theVehicle, false) 
    end 
    end 
      
    function bindTheKeys(player, commandName) 
    bindKey(player, "j", "down", engineOn) 
    bindKey(player, "k", "down", engineOff) 
    end 
    addCommandHandler("bindit", bindTheKeys) 
    

    Quando eu digito /bindit, aparece na janela do servidor: "Bad argument @ setVehicleEngineState". Queria saber como resolver.

    E outra pergunta: como eu faço pra essas keys já "bindarem" na hora que o player spawna?

×
×
  • Create New...