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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.