Jump to content

Register problem


MACIEKW89

Recommended Posts

Posted (edited)

Hi!

I have a problem with my Login Panel. Register not found. Nothing in debugscript.

Code:

--Rejestracja-- 
addEventHandler("onClickRegister", getRootElement(), 
function(plr, username, password) 
    local account = getAccount(username, password) 
    if (account ~= false) then 
            outputChatBox("This account is already exists!", plr, 255 , 0, 0) 
    else 
        local accountAdd = addAccount(username, password) 
        if(logIn(plr, accountAdd, password) == true) then 
            outputChatBox("You have successfully registered your account!", plr, 0 , 255, 0) 
            triggerClientEvent("onSuccessRegister", getRootElement()) 
        else 
            outputChatBox("Error 2 - Register line 39 REPORT TO ADMIN!", plr, 255 , 0, 0) 
        end 
    end 
end) 

I add the resource to Admin group in ACL.

Help me please

Edited by Guest
Posted

-.-

--[[---------------------------------  
|   Panel Logowania by MACIEKW89    | 
|         Strona Serwera            | 
-----------------------------------]] 
  
addEvent("onClickLogin", true) 
addEvent("onClickRegister", true) 
addEvent("onLoginSpawn", true) 
addEvent("onRegisterSpawn", true) 
  
--Logowanie-- 
addEventHandler("onClickLogin", getRootElement(),  
function(plr, username, password)  
    local account = getAccount(username, password) 
    if (account ~= false) then 
        if (logIn(plr, account, password) == true) then 
            outputChatBox("Zalogowano pomyślnie", plr, 0, 255, 0) 
            triggerClientEvent("onSuccessLogin", getRootElement()) 
        else 
            outputChatBox("Błąd 1 - Logowanie lin.19 ZGŁOŚ ADMINOWI!", plr, 255, 0, 0) 
        end 
    else 
        outputChatBox("Błędny login lub hasło!", plr, 255, 0, 0) 
    end 
end) 
  
--Rejestracja-- 
addEventHandler("onClickRegister", getRootElement(),  
function(plr, username, password)  
    local account = getAccount(username, password) 
    if (account ~= false) then 
            outputChatBox("Takie konto już istnieje!", plr, 255 , 0, 0) 
    else 
        local accountAdd = addAccount(username, password) 
        if(logIn(plr, accountAdd, password) == true) then 
            outputChatBox("Zarejestrowano pomyślnie!", plr, 0 , 255, 0) 
            triggerClientEvent("onSuccessRegister", getRootElement()) 
        else 
            outputChatBox("Błąd 2 - Rejestracja lin.39 ZGŁOŚ ADMINOWI!", plr, 255 , 0, 0) 
        end 
    end 
     
end) 
  
--Spawn-- 
addEventHandler ("onLoginSpawn", getRootElement(),  
function(player) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
    setGameType ( "ZombieMode v1.0" ) 
    setMapName ( "San Zombies" ) 
end) 
  
addEventHandler("onRegisterSpawn", getRootElement(),  
function(player) 
    local x = 2491.57 
    local y = -1672.27 
    local z = 13.3359 
    spawnPlayer(player, x, y, z) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
    setGameType ( "ZombieMode v1.0" ) 
    setMapName ( "San Zombies" ) 
    giveWeapon(player, 29, 1000) 
end) 
  
--Respawn-- 
addEventHandler( "onPlayerWasted", getRootElement(), 
function() 
        setTimer( spawnPlayer, 5000, 1, source, 2491.57, -1672.27, 13.3359 ) 
end) 

Here is my full code (server-side).

Posted

Try this:

--[[--------------------------------- 
|   Panel Logowania by MACIEKW89    | 
|         Strona Serwera            | 
-----------------------------------]] 
  
addEvent("onClickLogin", true) 
addEvent("onClickRegister", true) 
addEvent("onLoginSpawn", true) 
addEvent("onRegisterSpawn", true) 
setGameType ( "ZombieMode v1.0" ) 
setMapName ( "San Zombies" ) 
  
--Logowanie-- 
addEventHandler("onClickLogin", getRootElement(), 
function(plr, username, password) 
    local account = getAccount(username, password) 
    if (account ~= false) then 
        if (logIn(plr, account, password)) then 
            outputChatBox("Zalogowano pomyślnie", plr, 0, 255, 0) 
            triggerClientEvent("onSuccessLogin", getRootElement()) 
        else 
            outputChatBox("Błąd 1 - Logowanie lin.19 ZGŁOŚ ADMINOWI!", plr, 255, 0, 0) 
        end 
    else 
        outputChatBox("Błędny login lub hasło!", plr, 255, 0, 0) 
    end 
end) 
  
--Rejestracja-- 
addEventHandler("onClickRegister", getRootElement(), 
function(plr, username, password) 
    local account = getAccount(username, password) 
    if (account ~= false) then 
            outputChatBox("Takie konto już istnieje!", plr, 255 , 0, 0) 
    else 
        local accountAdd = addAccount(username, password) 
        if(logIn(plr, accountAdd, password)) then 
            outputChatBox("Zarejestrowano pomyślnie!", plr, 0 , 255, 0) 
            triggerClientEvent("onSuccessRegister", getRootElement()) 
        else 
            outputChatBox("Błąd 2 - Rejestracja lin.39 ZGŁOŚ ADMINOWI!", plr, 255 , 0, 0) 
        end 
    end 
    
end) 
  
--Spawn-- 
addEventHandler ("onLoginSpawn", getRootElement(), 
function(player) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
end) 
  
addEventHandler("onRegisterSpawn", getRootElement(), 
function(player) 
    local x = 2491.57 
    local y = -1672.27 
    local z = 13.3359 
    spawnPlayer(player, x, y, z) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
    giveWeapon(player, 29, 1000) 
end) 
  
--Respawn-- 
addEventHandler( "onPlayerWasted", getRootElement(), 
function() 
        setTimer( spawnPlayer, 5000, 1, source, 2491.57, -1672.27, 13.3359 ) 
end) 

That should work, if it doesn't then please tell us what's the problem and what you are trying to do.

Posted

I have to do a register when I Click on the button then create window with 2 edit box. Login and Password. If I click on the button "Register" then script register new account. This script don't register me :/

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