Jump to content

triggerClientEvent problem.


Eth

Recommended Posts

Hello there, so right now I am making a register/login window for my game using mysql , everything is working fine so far but for some reason triggerClientEvent doesn't want to be executed. here is the code:

OnPlayerConnect:

    dbQuery( CheckPlayerAccount,{playerNick}, database_connection, "SELECT `Password`,`ID`,`Banned` FROM `players` WHERE `Username`='"..playerNick.."'") 
  

CheckPlayerAccount:

  
function CheckPlayerAccount(qh,Player) 
     
    local result = dbPoll( qh, 0 ) 
    local thePlayer = getPlayerFromName ( Player ) 
    outputChatBox(Player) 
    outputDebugString("Player Name is "..Player) 
     
    if(result == true) then 
        triggerClientEvent ( thePlayer, "ShowLoginWindow", thePlayer,true) 
        triggerClientEvent ( thePlayer, "ShowRegisterWindow", thePlayer,true) 
    else 
        triggerClientEvent ( thePlayer, "ShowLoginWindow", thePlayer,true) 
        triggerClientEvent ( thePlayer, "ShowRegisterWindow", thePlayer,true) 
    end 
end 
  

Client Side:

  
  
function RegisterWindowShow(show) 
    outputDebugString("Dsd") 
    if(show == true) then  
        guiSetVisible(RegisterPanel.Window[0], true) 
        showCursor(true) 
    else 
        guiSetVisible(RegisterPanel.Window[0], false) 
    showCursor(false)  
    end 
end 
function LoginWindowShow(show) 
        outputDebugString("Dsd") 
    if(show == true) then  
        guiSetVisible(LoginPanel.Window[0], true) 
    showCursor(true) 
    else 
        guiSetVisible(LoginPanel.Window[0], false) 
    showCursor(false) 
    end 
end 
addEvent("ShowLoginWindow",true) 
addEvent("ShowRegisterWindow",true) 
addEventHandler("ShowLoginWindow",localPlayer,LoginWindowShow) 
addEventHandler("ShowRegisterWindow",localPlayer,RegisterWindowShow) 
  

now the debugstring shows my name just fine in the server sideso the code should be working, but somehow the debugstring in both ShowLoginWindow and ShowRegisterWindow aren't working, what could be the problem?

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