Adaptive Cards in deferrals

I do.

Basicly im doing this:

    var jsoncontent = API.LoadResourceFile("EgoRP", "data.json");
           deferrals.defer();
            await Delay(1);
            deferrals.update($"Überprüfe Datenbank...");
 await Delay(1);
   deferrals.presentCard(jsoncontent, new Action<dynamic, string>((data, rawData) =>
                             {
                                  Debug.WriteLine("test");
                              }
                              )) ;

But Still it wont show up. If u put the same adaptive card Data into a Lua Script, it works 100%.
Am i missing something? do i need to convert that json string into an json object or what am i doing wrong?

I also tried JsonConvert.SerializeObject(jsoncontent) where i have to put the card json in presentcard. Now im getting at least a BLANK card. but cant seem toi get it working properly…

Edit: Now after a Server restart, nothing changed in code im back to having no card at all…

Try to increase the delay time to 500 or 1000

doesnt do the trick. while testing i have been getting a blank card again but now its also gone again…

Idk what i should be doing wrong. Its not giving any error or clue on what could be not working properly.
Even FiveM’s own code snippets do not appear to work…

The shit is so inconsistent, been trying my ass off to get this working, but no luck.

The cards sometimes appear, but only if you are lucky, otherwise you have to relog to make it work. Im using the latest artifacts, and my cards are 1.0 in version, cant seem to figure out what i am doing wrong.

Im also running with 5000 in delay after every deferral, but still not working. And if you click a button it only goes to the next step sometimes, this should not be prod, it sucks and is buggy asf.

Please fix this or create a decent guide, i will link to my cards, so you can see them, please tell me if i am doing anything wrong.

Link to cards: FiveM Lua Adaptive Cards

well no shit from your paste there is no code use this GitHub - NoahtheDeveloper/FiveM-Adaptive-Cards: Live images of work done for the server Liberty Rewind by CandiModz. and make cards with the designer Designer | Adaptive Cards

If course I’m not just using the paste, I’m following the docs on how to use the deferrals.presentCard function

Adaptive cards are only used on deferrals? Can they be used ingame? To save time on creation HTML’s etc.

Great job :partying_face:

how do you make it go to a link?

test 5

test5

Use markdown syntax [TEXT](HTTPS://URL)
image

1 Like

Actually very helpful topic. Thanks for your work! I will be trying this to its extent.

1 Like

Is there any update on the new deferrals?

What do you mean?

Seems the recent UI update has effected most layouts of the Adaptive Cards

mine works fine: np_betakeys | v1.0 - YouTube

Again - what do you mean?