Aboodealtikrity Posted March 6, 2015 Share Posted March 6, 2015 This is in server side when The Player Login exports['CORchar']:hide.hideGUI(source) Meta table function="hideGUI" type="client" /> Client Side in other File hide={} function hide.hideGUI() showCursor(false) guiSetInputEnabled(false) showChat(true) hidewindow() end debugscript ERROR:CORlogin\CORlogin.lua 210: call: field to call 'CORchar:hideGUI' [string "?"] Im not sure if i did it in the Right way Note : im new and i search in old Resources and learn from it Link to comment
toxicsmoke11 Posted March 6, 2015 Share Posted March 6, 2015 its because your function is inside a table Link to comment
Aboodealtikrity Posted March 6, 2015 Author Share Posted March 6, 2015 its because your function is inside a table So what can i put inside the table Link to comment
JR10 Posted March 6, 2015 Share Posted March 6, 2015 You can define an alias for the function and export the alias. hide_hideGUI = hide.hideGUI <export function="hide_hideGUI" type="client"/> Link to comment
Aboodealtikrity Posted March 6, 2015 Author Share Posted March 6, 2015 You can define an alias for the function and export the alias. hide_hideGUI = hide.hideGUI <export function="hide_hideGUI" type="client"/> Oh i must equal the underscore with the dot ? and use dot ?? Link to comment
Aboodealtikrity Posted March 6, 2015 Author Share Posted March 6, 2015 You can define an alias for the function and export the alias. hide_hideGUI = hide.hideGUI <export function="hide_hideGUI" type="client"/> i tried it when i used it all the Triggers in the resource stopped ? Link to comment
JR10 Posted March 6, 2015 Share Posted March 6, 2015 No. You would use it like this: exports.resource:hide_hideGUI() Link to comment
Aboodealtikrity Posted March 6, 2015 Author Share Posted March 6, 2015 No. You would use it like this: exports.resource:hide_hideGUI() This is Client side in CORchar hide_hideGUI = hide.hideGUI function hideGUI(regged) local xmlRoot = xmlCreateFile("vgrpreg.xml", "registered") if (xmlRoot) then xmlSaveFile(xmlRoot) end showCursor(false) guiSetInputEnabled(false) showChat(true) hidepanel() if (accountwindow) then destroyElement(tabPanelCharacter) destroyElement(accountwindow) accountwindow = nil tabPanelCharacter = nil end if (regged) then buildwindow(getThisResource()) end if (bChangeAccount) then destroyElement(bChangeAccount) bChangeAccount = nil end if wDelConfirmation then destroyElement(wDelConfirmation) wDelConfirmation = nil end end addEvent("hideGUI", true) addEventHandler("hideGUI", getRootElement(), hideGUI) in server side i used exports.CORchar:hide_hideGUI() the same Error debugscript ERROR:CORlogin\CORlogin.lua 210: call: field to call 'CORchar:hideGUI' [string "?"] Link to comment
Addlibs Posted March 6, 2015 Share Posted March 6, 2015 1) You've changed the function name, you no longer store it in a table so I don't know why you're trying the suggestions above since they're no longer relevant to your case. 2) Exports from client side cannot be called server side, nor vice versa. 3) You need to define the alias AFTER defining the function. Link to comment
Aboodealtikrity Posted March 6, 2015 Author Share Posted March 6, 2015 1) You've changed the function name, you no longer store it in a table so I don't know why you're trying the suggestions above since they're no longer relevant to your case.2) Exports from client side cannot be called server side, nor vice versa. 3) You need to define the alias AFTER defining the function. 1- can you explain i didnt understood you in the second part of firs point ? 2- i have character panel i want to open it just when the player register after that when the player login directly without character panel and im sorry guys for take long time from you Thank you for your petient Link to comment
3B00DG4MER Posted March 6, 2015 Share Posted March 6, 2015 Calling a Client Side Function in Server Side How Good is this ? LOL i've never saw an Error like that before Link to comment
Addlibs Posted March 6, 2015 Share Posted March 6, 2015 1- can you explain i didnt understood you in the second part of firs point ?2- i have character panel i want to open it just when the player register after that when the player login directly without character panel hide_hideGUI = hide.hideGUI --You've set hide_hideGUI equal to hide.hideGUI (nil). Since hide.hideGUI is not defined yet, it's equal to nil; thus hide_hideGUI is also equal to nil. function hideGUI(regged) --Function name is no longer 'hide.hideGUI' (not in the 'hide' table) - No point of trying the suggestions if you chose to make the function outside the table. All above suggestions are ways to use exports on functions which are within tables. exports.CORchar:hide_hideGUI() --Trying to call a function that isn't defined. Only hideGUI is defined, not hide.hideGUI. Moreover, neither hide.hideGUI, hide_hideGUI or hideGUI were defined server side. Link to comment
Aboodealtikrity Posted March 6, 2015 Author Share Posted March 6, 2015 Calling a Client Side Function in Server Side How Good is this ? LOL i've never saw an Error like that before hahah i just want to tag in this name ... And you must read the Note in the bottom of Topic LOOL Link to comment
Aboodealtikrity Posted March 6, 2015 Author Share Posted March 6, 2015 1- can you explain i didnt understood you in the second part of firs point ?2- i have character panel i want to open it just when the player register after that when the player login directly without character panel hide_hideGUI = hide.hideGUI --You've set hide_hideGUI equal to hide.hideGUI (nil). Since hide.hideGUI is not defined yet, it's equal to nil; thus hide_hideGUI is also equal to nil. function hideGUI(regged) --Function name is no longer 'hide.hideGUI' (not in the 'hide' table) - No point of trying the suggestions if you chose to make the function outside the table. All above suggestions are ways to use exports on functions which are within tables. exports.CORchar:hide_hideGUI() --Trying to call a function that isn't defined. Only hideGUI is defined, not hide.hideGUI. Moreover, neither hide.hideGUI, hide_hideGUI or hideGUI were defined server side. Thank you For explain now i understand i was want to attach it in other file i copy it in the client file its work normally thanks guys im learning step by step 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