.:HyPeX:. Posted March 4, 2014 Posted March 4, 2014 Hey guys i got a weird problem, i cant trigger an event Client-Side, it says its not added, but it is! Script_S: function SetPlayerTeam(prev, acc, auto) OnlineTable[source] = source local acc = getPlayerAccount(source) if getAccountData(acc, "Played") ~= false then outputChatBox(" Player "..string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").. " Logged in", getRootElement(), TextColour.R, TextColour.G, TextColour.B) triggerClientEvent("onClientPlayerLogin", getRootElement(), source) And Script_C: function OnPlayerLogin(player) if player == getLocalPlayer() then executeCommandHandler("gui23456") end end addEvent("onClientPlayerLogin", true) addEventHandler("onClientPlayerLogin", getRootElement(), OnPlayerLogin)
.:HyPeX:. Posted March 4, 2014 Author Posted March 4, 2014 When are you executing "SetPlayerTeam"? onPlayerLogin
Anubhav Posted March 4, 2014 Posted March 4, 2014 function SetPlayerTeam(prev, acc, auto) OnlineTable[source] = source local acc = getPlayerAccount(source) if getAccountData(acc, "Played") ~= false then outputChatBox(" Player "..string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").. " Logged in", getRootElement(), TextColour.R, TextColour.G, TextColour.B) if player == client then executeCommandHandler("gui23456") end end end
myonlake Posted March 4, 2014 Posted March 4, 2014 I highly recommend using indentation as the code is nearly unreadable right now.
.:HyPeX:. Posted March 4, 2014 Author Posted March 4, 2014 function SetPlayerTeam(prev, acc, auto) OnlineTable[source] = source local acc = getPlayerAccount(source) if getAccountData(acc, "Played") ~= false then outputChatBox(" Player "..string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").. " Logged in", getRootElement(), TextColour.R, TextColour.G, TextColour.B) if player == client then executeCommandHandler("gui23456") end end end It was a cut part of the code, not needed to add ends or stuff. I highly recommend using indentation as the code is nearly unreadable right now. It's the forum's lua code thingy, its width is too shor and lines down alot of stuff, i have everything in one line, so its okay for me
Castillo Posted March 4, 2014 Posted March 4, 2014 function SetPlayerTeam(prev, acc, auto) OnlineTable[source] = source local acc = getPlayerAccount(source) if getAccountData(acc, "Played") ~= false then outputChatBox(" Player "..string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").. " Logged in", getRootElement(), TextColour.R, TextColour.G, TextColour.B) if player == client then executeCommandHandler("gui23456") end end end if player == client then What is that? and executeCommandHandler server-side has a player argument. @Hypex: Forums have no problem with indentation.
.:HyPeX:. Posted March 4, 2014 Author Posted March 4, 2014 function SetPlayerTeam(prev, acc, auto) OnlineTable[source] = source local acc = getPlayerAccount(source) if getAccountData(acc, "Played") ~= false then outputChatBox(" Player "..string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").. " Logged in", getRootElement(), TextColour.R, TextColour.G, TextColour.B) if player == client then executeCommandHandler("gui23456") end end end if player == client then What is that? and executeCommandHandler server-side has a player argument. He mixed my client side with my server side.. didnt even paid attention. @Topic: Fixed this by sendind to root element and player as arg 1. Client Side = if Player == getLocalPlayer()
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