-Note Posted April 15, 2020 Share Posted April 15, 2020 (edited) I tried using this exports but it won't work function getPlayerAccountID (player) local thePlayer = player or localPlayer if ( isElement(thePlayer)) then local ac = getPlayerAccount(thePlayer) local userID = getAccountID(ac) if (userID) then return tonumber(userID) else return false end else return false end end I tried executing this exports in-game by using run code "srun exports.ServerExports: getPlayerAccountID(p)" and it doesn't work with error "stack overflow" & "tail call" ps: firstly I executed this before executing the command above "srun p = getPlayerFromName("Note")" pss: I tried using "srun getAccountID(getPlayerAccount(p))" and it works but the exports won't. psss: I also tried using this in run code "srun local ac = getPlayerAccount(p)" "srun getAccountID(ac)" and it works too!! I don't know why my exports won't. Edited April 15, 2020 by -Note Link to comment
#\_oskar_/# Posted April 15, 2020 Share Posted April 15, 2020 Did you add this in the meta file? <export function="getPlayerAccountID" /> Link to comment
Soapbosnia Posted April 15, 2020 Share Posted April 15, 2020 Why are you using localPlayer server-side? Link to comment
-Note Posted April 15, 2020 Author Share Posted April 15, 2020 31 minutes ago, #\_oskar_/# said: Did you add this in the meta file? <export function="getPlayerAccountID" /> Just now, Soapbosnia said: Why are you using localPlayer server-side? I use this on meta so I can call it by server or client <export function="getPlayerAccountID" type="client" /> <export function="getPlayerAccountID" type="server" /> Link to comment
Soapbosnia Posted April 15, 2020 Share Posted April 15, 2020 5 hours ago, -Note said: I use this on meta so I can call it by server or client <export function="getPlayerAccountID" type="client" /><export function="getPlayerAccountID" type="server" /> client side scripts can only call client side exported functions, same goes for server side. Solution: use events for the client side version of getAccountID 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