Destroy Browser if not whitelisted

This commit is contained in:
VegaZ
2018-10-02 17:51:37 +02:00
parent 3b9f2057a7
commit 45de10555f
2 changed files with 9 additions and 0 deletions

View File

@@ -78,6 +78,14 @@ mp.events.add('showLogin', () => {
mp.game.cam.renderScriptCams(true, false, 0, true, false); mp.game.cam.renderScriptCams(true, false, 0, true, false);
}); });
mp.events.add('disableLogin', () => {
if (loginBrowser) {
loginBrowser.destroy();
}
mp.gui.cursor.show(false, false);
mp.gui.chat.activate(true);
});
function showCefError(error) { function showCefError(error) {
loginBrowser.execute(`showError(\`` + error + `\`)`); loginBrowser.execute(`showError(\`` + error + `\`)`);
} }

View File

@@ -25,6 +25,7 @@ namespace reallife_gamemode.Server.Events
{ {
if(!(player.SocialClubName == "VegasZ") || !(player.SocialClubName == "datgame_") || !(player.SocialClubName == "xSprite")) if(!(player.SocialClubName == "VegasZ") || !(player.SocialClubName == "datgame_") || !(player.SocialClubName == "xSprite"))
{ {
player.TriggerEvent("disableLogin");
player.Kick(); player.Kick();
return; return;
} }