crismar Posted May 2, 2014 Share 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. Link to comment
Karuzo Posted May 2, 2014 Share 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) Link to comment
crismar Posted May 2, 2014 Author Share Posted May 2, 2014 Works like a charm, thank you a lot Krzo <3 Link to comment
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