Jump to content

exporting a function


Andreas.

Recommended Posts

Hello, i'm new to the whole exporting thing and i tried but i seem to encounter a problem i cant solve..

server

function showPlayerGUI(status, player) 
    triggerClientEvent(player, "showGUI", player, status) 
end 
  

client

addEvent("showGUI", true) 
function showGUI(status) 
    if status == "true" then 
        guiSetVisible(guiWindow, true) 
        showCursor(true) 
    elseif status == "false" then 
        guiSetVisible(guiWindow, false) 
        showCursor(false) 
    end 
end 
addEventHandler("showGUI", root, showGUI) 
  

meta.xml

<export function="showPlayerGUI" type="server"/> 
<export function="showGUI" type="client"/> 

and where I trigger the export

exports.(RES)showGUI:showPlayerGUI(source, "true") 

debug message;

<name> expected near '(' 

EDIT: Okay, I got it to work client-sided still need help with ^

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