Sign in to follow this  

CEF question

Recommended Posts

Hey guys, 

Im creating notifications and cant get the reason why im getting 'undefined' in the message of notification.

client-side notify.js script:


let notifyBrowser = null;

    'receiveNotify', (msg, type, position, time) => {
        if (notifyBrowser == null ) {
            notifyBrowser ="package://gamemode/modules/UI/notifications/index.html");
            notifyBrowser.execute(`sendNotify('${msg}', '${type}', '${position}', ${time})`);
        else {
            notifyBrowser = null;
  'receiveNotify', msg, type, position, time);
    'deleteNotify', () => {
        if (notifyBrowser != null) {
            notifyBrowser = null;



module.exports = {
    sendNotify: function (player, msg = "", type = "", position = "bottom-right", time = 1500) {'receiveNotify', msg, type, position, time);
    sendNotifyToAll: function (msg, type, position = 'bottom-right', time = 1500) {
        mp.players.forEach ( (player, id) => {
  'receiveNotify', msg, type, position, time);

and where Im using that:

gm.notification = require('./notifications/notice.js');

gm.notification.sendNotify(player, "Sėkmingai prisijunget prie savo paskyros!", "success", "bottom-right", 1500);


CEF html code:

<!DOCTYPE html>
<html lang="en">
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css" href="../assets/css/uikit.css">
	<script src="../assets/js/uikit.js"></script>
	<script src="../assets/js/uikit-icons.js"></script>
	<script type="text/javascript">
		function sendNotify(msg, type, position, time) {
				message: msg,
				status: type,
				pos: position,
				timeout: time
			setTimeout(function() {
			}, time);

I tried to debug so I get msg - [object Object], type - undefined, position - undefined, time - undefined.

Some ideas?



it doesn't even change position of this notify.

Edited by sancio

Share this post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.