Jump to content
RAGE Multiplayer Community

Send variables to CEF


Recommended Posts

Hello! I’m adding new content to my gamemode and I want to show some variables in a CEF HUD I have done.

I’ve created a new browser in Client-Side but I have the variables on the Server-Side. I want to show in a DIV the Admin level, player name, etc. and this variables are stored in server. How I can send the variables to the client-side and then show this variables on my CEF?

 

There’s any good tutorial about CEF?

 

P.S. I’m not using C#, everything is wrote on JS.

Link to post
Share on other sites

there is a "road to follow"

You have to go from server -> client -> cef

so add an event in clientside and call it from server with ur variables passed

mp.events.call("clientSideEvent", myVariables);

than in that clientside event you can pass the variables to your cef window with browser.execute();

browser.execute('initializeViewTable(myVariables);');

its could be like an array that u can handle in ur cef function

Link to post
Share on other sites
Posted (edited)

Yay! Thanks!

One question, it's possible that if I have a CEF during the gameplay the Weapon Selector Menu (that comes with default in GTA 5) doesn't shows up? I press TAB but the menu doesn't show...

Edit 1:
I think it's because displayHud is setted to FALSE automatically when CEF opens. Anyone knows any solution for that?

Edit 2:
Solved, added 

mp.game.ui.displayHud(true);

when CEF is created

Edited by hdrtop
Link to post
Share on other sites

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