Jump to content

¿Existe esto?


depato123

Recommended Posts

descarga el server.log, abrelo con chromo y presiona f3 alli escribes el serial del jugador y bingo! ahi te das cuenta de eso... es un truco muy practico... yo acostumbro a darle stop a mi server cada 30 dias aproximadamente y descargo el server.log y los voy guardando en una memoria .. luego reemplazas el server.log por un bloc en blanco con igual nombre y doy star al server... actualmente tengo mas de 15 bloc de la consola descargado.

Link to comment
Si se puede, lo que tenes que hacer es ejecutar la funcion que quieras despues de que te registres.

¿Como?

Por ejemplo yo tengo esta función y quiero hacer que el gui aparezca luego de registrarse y no al entrar al server. ¿Que debo utilizar para eso?

GUIEditor = { 
    window = {}, 
    label = {}, 
    memo = {} 
} 
  
  
function closeLogin ( ) 
    GUIEditor.window[1] = guiCreateWindow(477, 572, 486, 96, "", false) 
    guiWindowSetSizable(GUIEditor.window[1], false) 
  
    GUIEditor.label[1] = guiCreateLabel(14, 34, 120, 29, "Nombre de usuario:", false, GUIEditor.window[1]) 
    guiSetFont(GUIEditor.label[1], "default-bold-small") 
    GUIEditor.memo[1] = guiCreateMemo(140, 26, 336, 37, "", false, GUIEditor.window[1]) 
    GUIEditor.label[2] = guiCreateLabel(14, 73, 482, 19, "Elije tu nombre de usuario, (Nickname)", false, GUIEditor.window[1]) 
    guiSetFont(GUIEditor.label[2], "default-bold-small")     
end 
addEvent ( "onClientPlayerLogin", true ) 
addEventHandler ( "onClientPlayerLogin", root, closeLogin ) 

Link to comment
------------------------------------------ 
--            Dx Login Panel            -- 
------------------------------------------ 
-- Developer: Braydon Davis (xXMADEXx)  -- 
-- File: server.lua                     -- 
-- Copyright 2013 (C) Braydon Davis     -- 
-- All rights reserved.                 -- 
------------------------------------------ 
  
local cameras = { 
    { 329.10980224609, -2117.2749023438, 50.161201477051, 329.65179443359, -2116.4926757813, 49.853763580322 }, 
    { 1266.0053710938, -1965.7087402344, 114.59829711914, 1265.1549072266, -1966.1115722656, 114.25980377197 }, 
    { 1514.0283203125, -1716.5743408203, 39.910701751709, 1514.5087890625, -1715.865234375, 39.394691467285 }, 
    { 1338.7514648438, -875.66558837891, 99.84880065918, 1339.4935302734, -875.07824707031, 99.52579498291 }, 
    { 1426.5421142578, -725.40289306641, 120.97090148926, 1427.3695068359, -725.00805664063, 120.571434021 }, 
    { 1357.5914306641, -592.23327636719, 125.15190124512, 1357.1751708984, -593.02673339844, 124.70780944824 }, 
    { 988.01123046875, -341.88409423828, 74.752601623535, 988.70251464844, -342.45135498047, 75.200187683105 }, 
    { -224.32290649414, -153.71020507813, 35.085899353027, -223.61195373535, -153.04695129395, 34.852146148682 } 
} 
  
function openView( plr ) 
    local theplr = nil 
    if ( source and getElementType ( source ) == 'player' ) then 
        theplr = source 
    elseif ( plr and getElementType ( plr ) == 'player' ) then 
        theplr = plr 
    end 
    setTimer ( function ( p ) 
        local ind = math.random ( #cameras ) 
        setCameraMatrix ( p, unpack ( cameras[ind] ) ) 
    end, 700, 1, theplr ) 
end 
addEventHandler ( "onPlayerJoin", root, openView ) 
addEventHandler ( "onPlayerLogout", root, openView ) 
--addCommandHandler ( 'view', openView ) 
  
function attemptLogin ( user, pass ) 
    if ( user and pass and type ( user ) == 'string' and type ( pass ) == 'string' ) then 
        --local user = string.lower ( user ) 
        --local pass = string.lower ( pass ) 
        local account = getAccount ( user ) 
        if ( account ) then 
            if ( not logIn ( source, account, pass ) ) then 
                message ( source, "Incorrect password." ) 
                return false 
            end 
            setCameraTarget ( source, source ) 
            triggerLogin ( source, user, pass ) 
        else 
            message ( source, "Unknown account." ) 
            return false 
        end 
    end 
    return false 
end 
addEvent ( "Login:onClientAttemptLogin", true ) 
addEventHandler ( "Login:onClientAttemptLogin", root, attemptLogin ) 
  
function attemptRegister ( user, pass ) 
    if ( user and pass and type ( user ) == 'string' and type ( pass ) == 'string' ) then 
        --local user = string.lower ( user ) 
        --local pass = string.lower ( pass ) 
        local account = getAccount ( user ) 
        if ( not account ) then 
            local account = addAccount ( user, pass ) 
            if ( account ) then 
                if ( not logIn ( source, account, pass ) ) then 
                    return message ( source, "Logging in has failed." ) 
                end 
                setCameraTarget ( source, source ) 
                triggerLogin ( source, user, pass ) 
            else 
                message ( source, "Adding account failed.\nPlease report to an admin." ) 
            end 
        else 
            message ( source, "This account already exists." ) 
        end 
    end 
    return false 
end 
addEvent ( "Login:onClientAttemptRegistration", true ) 
addEventHandler ( "Login:onClientAttemptRegistration", root, attemptRegister ) 
  
function message ( source, msg ) 
    triggerClientEvent ( source, "onPlayerLoginPanelError", source, msg ) 
end 
  
function triggerLogin ( source, user,  pass ) 
    triggerClientEvent ( source, "onClientPlayerLogin", source, user, pass ) 
end 
  
addEventHandler ( 'onPlayerLogout', root, function ( ) 
    triggerClientEvent ( source, 'onClientPlayerLogout', source ) 
end ) 

Link to comment
------------------------------------------ 
--            Dx Login Panel            -- 
------------------------------------------ 
-- Developer: Braydon Davis (xXMADEXx)  -- 
-- File: server.lua                     -- 
-- Copyright 2013 (C) Braydon Davis     -- 
-- All rights reserved.                 -- 
------------------------------------------ 
  
local cameras = { 
    { 329.10980224609, -2117.2749023438, 50.161201477051, 329.65179443359, -2116.4926757813, 49.853763580322 }, 
    { 1266.0053710938, -1965.7087402344, 114.59829711914, 1265.1549072266, -1966.1115722656, 114.25980377197 }, 
    { 1514.0283203125, -1716.5743408203, 39.910701751709, 1514.5087890625, -1715.865234375, 39.394691467285 }, 
    { 1338.7514648438, -875.66558837891, 99.84880065918, 1339.4935302734, -875.07824707031, 99.52579498291 }, 
    { 1426.5421142578, -725.40289306641, 120.97090148926, 1427.3695068359, -725.00805664063, 120.571434021 }, 
    { 1357.5914306641, -592.23327636719, 125.15190124512, 1357.1751708984, -593.02673339844, 124.70780944824 }, 
    { 988.01123046875, -341.88409423828, 74.752601623535, 988.70251464844, -342.45135498047, 75.200187683105 }, 
    { -224.32290649414, -153.71020507813, 35.085899353027, -223.61195373535, -153.04695129395, 34.852146148682 } 
} 
  
function openView( plr ) 
    local theplr = nil 
    if ( source and getElementType ( source ) == 'player' ) then 
        theplr = source 
    elseif ( plr and getElementType ( plr ) == 'player' ) then 
        theplr = plr 
    end 
    setTimer ( function ( p ) 
        local ind = math.random ( #cameras ) 
        setCameraMatrix ( p, unpack ( cameras[ind] ) ) 
    end, 700, 1, theplr ) 
end 
addEventHandler ( "onPlayerJoin", root, openView ) 
addEventHandler ( "onPlayerLogout", root, openView ) 
--addCommandHandler ( 'view', openView ) 
  
function attemptLogin ( user, pass ) 
    if ( user and pass and type ( user ) == 'string' and type ( pass ) == 'string' ) then 
        --local user = string.lower ( user ) 
        --local pass = string.lower ( pass ) 
        local account = getAccount ( user ) 
        if ( account ) then 
            if ( not logIn ( source, account, pass ) ) then 
                message ( source, "Incorrect password." ) 
                return false 
            end 
            setCameraTarget ( source, source ) 
            triggerLogin ( source, user, pass ) 
        else 
            message ( source, "Unknown account." ) 
            return false 
        end 
    end 
    return false 
end 
addEvent ( "Login:onClientAttemptLogin", true ) 
addEventHandler ( "Login:onClientAttemptLogin", root, attemptLogin ) 
  
function attemptRegister ( user, pass ) 
    if ( user and pass and type ( user ) == 'string' and type ( pass ) == 'string' ) then 
        --local user = string.lower ( user ) 
        --local pass = string.lower ( pass ) 
        local account = getAccount ( user ) 
        if ( not account ) then 
            local account = addAccount ( user, pass ) 
            if ( account ) then 
                if ( not logIn ( source, account, pass ) ) then 
                    return message ( source, "Logging in has failed." ) 
                end 
                triggerEvent ( "onPlayerRegister", source ) 
                setCameraTarget ( source, source ) 
                triggerLogin ( source, user, pass ) 
            else 
                message ( source, "Adding account failed.\nPlease report to an admin." ) 
            end 
        else 
            message ( source, "This account already exists." ) 
        end 
    end 
    return false 
end 
addEvent ( "Login:onClientAttemptRegistration", true ) 
addEventHandler ( "Login:onClientAttemptRegistration", root, attemptRegister ) 
  
function message ( source, msg ) 
    triggerClientEvent ( source, "onPlayerLoginPanelError", source, msg ) 
end 
  
function triggerLogin ( source, user,  pass ) 
    triggerClientEvent ( source, "onClientPlayerLogin", source, user, pass ) 
end 
  
addEventHandler ( 'onPlayerLogout', root, function ( ) 
    triggerClientEvent ( source, 'onClientPlayerLogout', source ) 
end ) 

Ok, con esto ahora tenes un evento llamado: "onPlayerRegister" que podes usar en otros scripts, ejemplo:

addEvent ( "onPlayerRegister", true ) 
addEventHandler ( "onPlayerRegister", root, 
    function ( ) 
        outputChatBox ( getPlayerName ( source ) .." es nuevo en el servidor, bienvenido!", root, 0, 255, 0 ) 
    end 
) 

Link to comment

Gracias.

Ya lo probe.

Pero no funciona al registrarme no aparece el gui

que especifique aqui

GUIEditor = { 
    window = {}, 
    label = {}, 
    memo = {} 
} 
  
  
function openGui( ) 
    GUIEditor.window[1] = guiCreateWindow(477, 572, 486, 96, "", false) 
    guiWindowSetSizable(GUIEditor.window[1], false) 
  
    GUIEditor.label[1] = guiCreateLabel(14, 34, 120, 29, "Nombre de usuario:", false, GUIEditor.window[1]) 
    guiSetFont(GUIEditor.label[1], "default-bold-small") 
    GUIEditor.memo[1] = guiCreateMemo(140, 26, 336, 37, "", false, GUIEditor.window[1]) 
    GUIEditor.label[2] = guiCreateLabel(14, 73, 482, 19, "Elije tu nombre de usuario, recuerda que el formato debe ser de nombre_apellido", false, GUIEditor.window[1]) 
    guiSetFont(GUIEditor.label[2], "default-bold-small")     
end 
addEvent ( "onPlayerRegister", true ) 
addEventHandler ( "onPlayerRegister", root, openGui) 

Link to comment
  • Recently Browsing   0 members

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