KamilPL Posted April 1, 2013 Posted April 1, 2013 I create a gui window to login/register. But when somebody join to the game, everyone see this window. What's happening ? server-side function searchplayerindatabase() base = mysql_connect("ip", "user", "pass", "base") nick = getPlayerName(source) local informations = mysql_query(base, "SELECT * FROM players WHERE Nick='".. nick .."'") player = mysql_fetch_assoc(Informations) if (not player) then triggerClientEvent("rejestration", root) else triggerClientEvent("login", root, player) end end addEventHandler("onPlayerJoin", root, searchplayerindatabase) client-side function rejestration() -- create window etc. end addEvent("rejestration", true) addEventHandler("rejestration", root, rejestration) function login() -- create window etc. end addEvent("login", true) addEventHandler("login", root, login)
Castillo Posted April 1, 2013 Posted April 1, 2013 triggerClientEvent("login", root, player) That's wrong, should be: triggerClientEvent ( player, "login", player ) The same on "rejestration" event. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted April 1, 2013 Posted April 1, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now