Jump to content

[HELP] What did i do wrong?


geryha

Recommended Posts

script 
    function createLoginWindow() 
        local X = 0.375 
        local X = 0.375 
        local Width = 0.25 
        local height = 0.25 
        wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) 
         
         
        X = 0.0825 
        Y = 0.2 
         
        Width = 0.25 
        Height = 0.25 
         
         
        guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin) 
         
        Y = 0.5 
        guiCreateLabel(X, Y, Width, Height, "Password", 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, "Log In", true, wdwLogin) 
         
         
        guiSetVisible(wdwLogin, false) 
    end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), 
        function () 
                createLoginWindow() 
         
         
                outputChatBox("Welcome to my MTA:SA Server, please log in.") 
                 
                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 
) 
  
script 

now its just unexpected near function.. :o

Link to comment

Now there's nothing on my screen just a black screen :o

Meta.xml

    "yourname" type="gamemode" version="1.0" description="My First Gamemode" /> 
    

gui.lua

function createLoginWindow() 
        local X = 0.375 
        local X = 0.375 
        local Width = 0.25 
        local height = 0.25 
        wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) 
         
         
        X = 0.0825 
        Y = 0.2 
         
        Width = 0.25 
        Height = 0.25 
         
         
        guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin) 
         
        Y = 0.5 
        guiCreateLabel(X, Y, Width, Height, "Password", 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, "Log In", true, wdwLogin) 
         
         
        guiSetVisible(wdwLogin, false) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), 
        function () 
                createLoginWindow() 
         
         
                outputChatBox("Welcome to my MTA:SA Server, please log in.") 
                 
                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 
) 

server.lua

local root = getRootElement() 
  
  
function PlayerSpawn() 
     
end 
addEventHandler("onPlayerSpawn", root, PlayerSpawn) 
function playerConnect(playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber) 
    outputChatBox("* ".. playerNick .. " has connected the Server.", getRootElement(), 255, 100, 100, false) 
  
end 
addEventHandler("onPlayerConnect", getRootElement(), playerConnect) 

Client.lua

*blank*

mtaserver.conf

  
    -- This parameter specifies the name the server will be visible as in the ingame server browser  
         and on Game-Monitor. It is a required parameter. --> 
    Default MTA Server
     
    -- ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING - it is generally only 
         needed for professional servers and should be left blank otherwise. 
         This parameter specifies the IP to use for servers that have multiple IP addresses. If left 
         blank, it will default to server's standard local IP address. --> 
     
     
  
     
    22003 
     
     
    32 
     
     
    1 
     
     
    22005 
     
     
     
  
     
    1 
     
     
     
  
     
    5 
  
     
    20 
  
     
     
     
  
     
     
  
     
     
  
     
    1 
  
    [url=https://wiki.multitheftauto.com/wiki/GetPlayerVersion]https://wiki.multitheftauto.com/wiki/GetPlayerVersion[/url] 
         and look like this: 1.1.0-9.03100.0  
         Note that this setting only determines if the client should be prompted to update. The actual 
         build number they receive will be the highest available. See: [url=https://nightly.multitheftauto.com/ver]https://nightly.multitheftauto.com/ver[/url]  --> 
     
  
    [url=https://nightly.multitheftauto.com/ver]https://nightly.multitheftauto.com/ver[/url]  --> 
     
  
     
    1 
  
      
    0 
  
     
    
  
    -- This parameter reduces the server's bandwidth usage by using various optimizations. 
         Values: none, medium or maximum ; default value: medium --> 
    medium
  
    -- The following ???_sync_interval parameters determine the time in milliseconds between certain 
         network packets being sent. More information on how each settings works is available here: 
         https://wiki.multitheftauto.com/wiki/Server_mtaserver.conf --> 
    -- Player sync interval. Default: 100 --> 
    100
    -- Lightweight (player) sync interval. Used when players are far apart. Default: 1500 --> 
    1500
    -- Camera sync interval. Default: 500 --> 
    500
    -- Ped sync interval. Default: 400 --> 
    500
    -- Unoccupied_vehicle sync interval. Default: 400 --> 
    1000
    -- Keysync mouse rotation sync interval. For limiting key sync packets due to mouse movement. Default: 100 --> 
    100
    -- Keysync analog movement sync interval. For limiting key sync packets due to joystick movement. Default: 100 --> 
    100
  
    -- This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth. 
         Values: 0 - disabled , 1 - enabled ; default value: 0. --> 
    0
  
    -- This parameter sets the amount of extrapolation that clients will apply to remote vehicles. This can reduce 
         some of the latency induced location disparency by predicting where the remote vehicles will probably be. 
         Depending on the gamemode, an incorrect prediction may have a negative effect. Therefore this setting 
         should be considered experimental. 
         Available range: 0 to 100.  Default - 0 --> 
    0
  
    -- This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to 
         compensate for. 
         Only relevant if  is greater than zero. 
         Available range: 50 to 500.  Default - 150 --> 
    350
  
    -- This parameter specifies whether or not to run the network synchronization on another thread. 
         Enabling will make the sync smoother, but may increase cpu usage slightly. 
         Values: 0 - Off, 1 - On.  Default: 1 --> 
    1
  
    -- Specifies the location and file name of this servers unique private key. 
         This is used to prevent private files saved on the client from being read by other servers. 
         More infomation about client private files can be found here: [url=https://wiki.multitheftauto.com/wiki/Filepath]https://wiki.multitheftauto.com/wiki/Filepath[/url] 
         Keep a backup of this file in a safe place. Default value: server-id.keys--> 
    server-id.keys
  
    -- Specifies the location and name of the main server log file. If left blank, server won't be saving this file. --> 
    logs/server.log
  
    -- As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. 
         If left blank, this file is not used --> 
    logs/server_auth.log
  
    -- Specifies the location and name of the file used to log database queries. 
         The server command 'debugdb' sets the amount of logging. --> 
    logs/db.log
     
    -- This parameter specifies the location and name of the Access Control List settings file. If left 
         blank, server will use acl.xml file, located in the same folder as this configuration file. --> 
    acl.xml
  
    -- Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file. --> 
    logs/scripts.log
     
    -- Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0. --> 
    0
     
    -- Specifies the level of the html debug. Available values: 0, 1, 2, 3. When not set, defaults to 0. --> 
    0
  
    -- Specifies the frame rate limit that will be applied to connecting clients. 
         Available range: 25 to 100. Default: 36. --> 
    60
     
    -- Specifies whether or not players should automatically be logged in based on their IP adresses --> 
    0
  
    -- This parameter specifies whether or not to enable player voice chat in-game 
         Values: 0 - disabled , 1 - enabled --> 
    0
     
    -- This parameter specifies the sample rate for voice chat.  'voice' parameter must be set to 1 for this to be effective. 
         Higher settings use more bandwidth and increase the sampling quality of voice chat 
         Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz).  Default - 1 --> 
    1
     
    -- This parameter specifies the voice quality for voice chat.  'voice' parameter must be set to 1 for this to be effective. 
         Higher settings use more bandwidth and increase the the overall quality of voice chat 
         Available range: 0 to 10.  Default - 4 --> 
    4
  
    -- Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings.  
         If not set, MTA handles this automatically.  Use with care. --> 
    -- 24600 --> 
  
    -- This parameter specifies the path to use for a basic backup of some server files. 
         Note that basic backups are only made during server startup. Default value: backups --> 
    backups
  
    -- This parameter specifies the number of days between each basic backup. 
         Backups are only made during server startup, so the actual interval maybe much longer. 
         Setting backup_interval to 0 will disable backups 
         Available range: 0 to 30.  Default - 3 --> 
    3
  
    -- This parameter specifies the maximum number of backup copies to keep. 
         Setting backup_copies to 0 will disable backups 
         Available range: 0 to 100.  Default - 5 --> 
    5
  
    -- Specifies the module(s) which are loaded with the server. To load several modules, add more 
         parameter(s). Optional parameter. --> 
    --  --> 
    --  --> 
     
    -- Specifies resources that are loaded when the server starts and/or which are protected from being stopped. 
         To specify several resources, add more  parameter(s). --> 
  
    "admin" startup="0" protected="0"/> 
    "defaultstats" startup="0" protected="0"/> 
    "helpmanager" startup="0" protected="0"/> 
    "joinquit" startup="0" protected="0"/> 
    "mapcycler" startup="0" protected="0"/> 
    "mapmanager" startup="0" protected="0"/> 
    "parachute" startup="1" protected="0"/> 
    "resourcebrowser" startup="0" protected="1" default="true"/> 
    "resourcemanager" startup="0" protected="1"/> 
    "scoreboard" startup="1" protected="0"/> 
    "spawnmanager" startup="0" protected="0"/> 
    "voice" startup="1" protected="0" /> 
    "votemanager" startup="0" protected="0"/> 
    "webadmin" startup="0" protected="0"/> 
    "playerblips" startup="1" protected="0"/> 
     
    -- play is the default freeroam gamemode. Remove the following line to prevent it from starting. -->        
    "mygamemode" startup="1" protected="0"/> 
     

  

Link to comment
function createLoginWindow() 
        local X = 0.375 
        local X = 0.375 
        local Width = 0.25 
        local height = 0.25 
        wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) 
         
         
        X = 0.0825 
        Y = 0.2 
         
        Width = 0.25 
        Height = 0.25 
         
         
        guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin) 
         
        Y = 0.5 
        guiCreateLabel(X, Y, Width, Height, "Password", 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, "Log In", true, wdwLogin) 
         
         
        guiSetVisible(wdwLogin, false) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), 
        function()  
                createLoginWindow() 
         
                outputChatBox("Welcome to my MTA:SA Server, please log in.") 
                 
                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 

Can't seem to get it working..

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...