crismar Posted May 2, 2014 Posted May 2, 2014 Howdy! I'm building a UCP and I've a strange problem. My script is something like this: addEventHandler("onClientGUIClick", modifyAccount, function() local thePlayer = localPlayer triggerServerEvent("getDetails", root) end) ^ The first part works fine, the server gets the right details and outputs the correct results, the problem is it outputs them to EVERYONE, meaning if one clicks the respective button, entire server will be shown the GUI. The server event is here: function getTheirDetails() local ucpMail = getAccountData(getPlayerAccount(client), "ucpMail") or "E-Mailul acestui cont nu a fost setat!" local ucpUser = getAccountName(getPlayerAccount(client)) or "Nu esti logat!" triggerClientEvent("onResults", root, ucpMail, ucpUser) end addEvent("getDetails", true) addEventHandler("getDetails", root, getTheirDetails) I want to know how to triggerClientEvent back to the 'client' ? I tried getPlayerFromName and triggerClientEvent("onResults", client, ucpMail, ucpUser) but it didn't work. Contact me if you are looking for a Web Developer. 3rd of October 2014 - Founder of RomaniaZ
Karuzo Posted May 2, 2014 Posted May 2, 2014 --client triggerServerEvent("getDetails", localPlayer,localPlayer) --server function getTheirDetails(lp) local ucpMail = getAccountData(getPlayerAccount(client), "ucpMail") or "E-Mailul acestui cont nu a fost setat!" local ucpUser = getAccountName(getPlayerAccount(client)) or "Nu esti logat!" triggerClientEvent(lp,"onResults", lp, ucpMail, ucpUser) end addEvent("getDetails", true) addEventHandler("getDetails", root, getTheirDetails)
crismar Posted May 2, 2014 Author Posted May 2, 2014 Works like a charm, thank you a lot Krzo <3 Contact me if you are looking for a Web Developer. 3rd of October 2014 - Founder of RomaniaZ
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