-
Notifications
You must be signed in to change notification settings - Fork 2
I must not have at least 1 brain cell... #2
Comments
It's because the syntax is Callbacks:TriggerCallback(callback_name, function, data_being_sent) |
Since you flipped the data being returned with the data you're trying to send, the query isn't finding anything and therefor never triggering the callback function. |
So a modification, such as below should work right? Where callbackname is 'get_store_cost', function is where callback data will be stored (yes?), and the last parameters being the data from client that is being sent to server? store is a table that gets sent as the data from client to the server.
and my server side still good?
I assume with registering it's the same order of functions right? |
['id_store'] = source.id Since your sending data thru the callback, this should be ['id_store'] = data |
Nice! Ok I got it to work with your help! I really appreciate that. I do notice that if I change the code and restart my resource, I also have to restart the callback resource or I end up with errors like this: Hopefully I can gain some of my brain cells back now that I am heading in the correct direction.. |
It's due to how the resource is written. When you restart the callbacks, the table that holds them via: [ Callbacks = exports['callbacks']:FetchCallbacks() ] no longer exists. All you would have to do is just reassign the variable with the export again. These callbacks were in my framework, and when you restart a resource it automatically refreshes that component. Since they are standalone, this isn't the case! But glad to be of help. |
I can't figure out why I cannot get this to work. I am missing something simple I am sure...
I will admit I am new to LUA and new to Redm/Fivem framework (Python / Ruby guy).
First, I have the resource added and started in the resource.cfg
At the top of my client and server I have placed this:
Callbacks = exports['callbacks']:FetchCallbacks()
I have a RegisterNUICallback() that calls the Trigger (I assumed this could work very similar to the register command example)
The two print statements before the Callbacks:TriggerCallback work. The third inside the Callbacks:TriggerCallback never gets called.
And on my Server side I have this:
The print "Made it here" never gets executed.
The text was updated successfully, but these errors were encountered: