Jump to content

Triggering Problems


Karuzo

Recommended Posts

Hey Guys,

So i'm working on a downloader and i'm triggering from server to client but it always says that the event hasn't been added clientside.

My Code:

Client

addEvent("sendModData", true) 
addEventHandler("sendModData", getRootElement(), 
    function(TXDs, DFFs) 
        outputChatBox("lol") 
        TXDfiles = TXDs 
        DFFfiles = DFFs 
        checkMods() 
    end 
) 
  

Server

for _, player in ipairs(getElementsByType("player")) do 
outputChatBox(#TXDs) 
outputChatBox(#DFFs) 
triggerClientEvent(player, "sendModData", player, TXDs, DFFs) 
end 
end 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), loadModFiles) 

Meta.xml

    

Link to comment
Trigger an event from the client to the server, at the end of the client script. onClientReady or something.

When the server receives it, tell it to send back an event with the data to the client.

Done.

Yeah was that easy.

Thanks.

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