Jump to content

[Help] Exports issue


Recommended Posts

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
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

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
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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...