.: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) My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
Castillo Posted March 4, 2014 Posted March 4, 2014 When are you executing "SetPlayerTeam"? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
.:HyPeX:. Posted March 4, 2014 Author Posted March 4, 2014 When are you executing "SetPlayerTeam"? onPlayerLogin My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
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 See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
myonlake Posted March 4, 2014 Posted March 4, 2014 I highly recommend using indentation as the code is nearly unreadable right now. If I helped you, please click the like button on the right Thanks!
.: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 My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
.: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() My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
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