Модератор раздела "Создание скриптов для читов"
-
Автор темы
- #1
main menu button (cs logo)
(в скрипте для неверлуза после выгрузки лого не возвращалось, тут всё исправлено)
news
background
hide/show model in mainmenu
hide/show alert
change model in mainmenu (background)
(в скрипте для неверлуза после выгрузки лого не возвращалось, тут всё исправлено)
code_language.lua:
local cs_logo = panorama.loadstring([[
var panel = null;
var cs_logo = null;
var original_transform = null;
var original_visibility = null;
var _Create = function(layout) {
cs_logo = $.GetContextPanel().FindChildTraverse("MainMenuNavBarHome");
if (!cs_logo) {
return;
}
original_transform = cs_logo.style.transform || 'none';
original_visibility = cs_logo.style.visibility || 'visible';
cs_logo.style.transform = 'translate3d(-9999px, -9999px, 0)';
cs_logo.style.visibility = 'collapse';
var parent = cs_logo.GetParent();
if (!parent) {
return;
}
panel = $.CreatePanel("Panel", parent, "CustomPanel");
if (!panel) {
return;
}
if (!panel.BLoadLayoutFromString(layout, false, false)) {
panel.DeleteAsync(0);
panel = null;
return;
}
parent.MoveChildBefore(panel, parent.GetChild(0));
};
var _Destroy = function() {
if (cs_logo) {
if (panel) {
panel.DeleteAsync(0.0);
panel = null;
}
cs_logo.style.transform = original_transform;
cs_logo.style.visibility = original_visibility;
}
};
return {
create: _Create,
destroy: _Destroy,
};
]], "CSGOMainMenu")()
local button = [[
<root>
<Panel class="mainmenu-navbar__btn-small mainmenu-navbar__btn-home">
<RadioButton id="main_menu"
onactivate="MainMenu.OnHomeButtonPressed(); $.DispatchEvent( 'PlaySoundEffect', 'UIPanorama.mainmenu_press_home', 'MOUSE' ); $.DispatchEvent('PlayMainMenuMusic', true, true); GameInterfaceAPI.SetSettingString('panorama_play_movie_ambient_sound', '1');"
oncancel="MainMenu.OnEscapeKeyPressed();"
onmouseover=""
onmouseout="">
<Image textureheight="90" texturewidth="-1" src="https://yougame.biz/data/avatars/o/279/279781.jpg?1681929515" />
</RadioButton>
</Panel>
</root>
]]
cs_logo.create(button)
client.set_event_callback('shutdown', function()
cs_logo.destroy()
end)
news
code_language.lua:
local news_container = panorama.loadstring([[
var panel = null;
var js_news = null;
var original_transform = null;
var original_visibility = null;
var _Create = function(layout) {
js_news = $.GetContextPanel().FindChildTraverse("JsNewsContainer");
if (!js_news) {
return;
}
original_transform = js_news.style.transform || 'none';
original_visibility = js_news.style.visibility || 'visible';
js_news.style.transform = 'translate3d(-9999px, -9999px, 0)';
js_news.style.visibility = 'collapse';
var parent = js_news.GetParent();
if (!parent) {
return;
}
panel = $.CreatePanel("Panel", parent, "CustomPanel");
if(!panel) {
return;
}
if(!panel.BLoadLayoutFromString(layout, false, false)) {
panel.DeleteAsync(0);
panel = null;
return;
}
parent.MoveChildBefore(panel, js_news);
};
var _Destroy = function() {
if (js_news) {
if (panel) {
panel.DeleteAsync(0.0);
panel = null;
}
js_news.style.transform = original_transform;
js_news.style.visibility = original_visibility;
}
};
return {
create: _Create,
destroy: _Destroy,
};
]], "CSGOMainMenu")()
local button = [[
<root>
<Panel class="news-panel MainMenuModeOnly">
<Button id="main_menu_news"
onactivate="UiToolkitAPI.ShowGenericPopupBgStyle('razeclub.ru', 'uwukson4800', '', 'blur'); $.DispatchEvent( 'PlaySoundEffect', 'UIPanorama.mainmenu_press_quit', 'MOUSE' ); $.DispatchEvent('PlayMainMenuMusic', true, true); GameInterfaceAPI.SetSettingString('panorama_play_movie_ambient_sound', '1');"
oncancel="MainMenu.OnEscapeKeyPressed();"
onmouseover=""
onmouseout="">
<Image textureheight="450" texturewidth="-1" src="https://yougame.biz/data/avatars/o/279/279781.jpg?1681929515" />
</Button>
</Panel>
</root>
]]
news_container.create(button)
client.set_event_callback('shutdown', function()
news_container.destroy()
end)
background
code_language.lua:
local background = panorama.loadstring([[
var _ChangeBackground = function(imageUrl) {
var moviePanel = $.GetContextPanel().FindChildTraverse("MainMenuMovie");
if (moviePanel) {
moviePanel.style.opacity = "0";
}
var bgPanel = $.GetContextPanel().FindChildTraverse("MainMenuBackground");
if (bgPanel) {
bgPanel.style.backgroundImage = 'url("' + imageUrl + '")';
bgPanel.style.backgroundPosition = 'center';
bgPanel.style.backgroundSize = 'cover';
bgPanel.style.backgroundRepeat = 'no-repeat';
bgPanel.style.opacity = "1";
}
};
var _RestoreDefault = function() {
var moviePanel = $.GetContextPanel().FindChildTraverse("MainMenuMovie");
if (moviePanel) {
moviePanel.style.opacity = "1";
}
var bgPanel = $.GetContextPanel().FindChildTraverse("MainMenuBackground");
if (bgPanel) {
bgPanel.style.backgroundImage = 'none';
}
};
return {
change: _ChangeBackground,
restore: _RestoreDefault
};
]], "CSGOMainMenu")()
background.change("https://yougame.biz/data/avatars/o/279/279781.jpg?1681929515")
client.set_event_callback('shutdown', function()
background.restore()
end)
hide/show model in mainmenu
code_language.lua:
local model = panorama.loadstring([[
var _HideModel = function() {
var vanityPanel = $.GetContextPanel().FindChildTraverse("JsMainmenu_Vanity");
if (vanityPanel) {
vanityPanel.style.opacity = "0";
vanityPanel.style.visibility = "collapse";
}
};
var _ShowModel = function() {
var vanityPanel = $.GetContextPanel().FindChildTraverse("JsMainmenu_Vanity");
if (vanityPanel) {
vanityPanel.style.opacity = "1";
vanityPanel.style.visibility = "visible";
}
};
return {
hide: _HideModel,
show: _ShowModel
};
]], "CSGOMainMenu")()
model.hide()
client.set_event_callback('shutdown', function()
model.show()
end)
hide/show alert
code_language.lua:
local alert = panorama.loadstring([[
var _HideAlert = function() {
var notifications = [
"NotificationsContainer",
"JsGameNotifications",
"MainMenuNotifications",
"CSGONotifications",
"NotificationsPanelContainer"
];
notifications.forEach(function(id) {
var panel = $.GetContextPanel().FindChildTraverse(id);
if (panel) {
panel.style.visibility = "collapse";
panel.style.height = "0px";
panel.style.opacity = "0";
}
});
};
var _ShowAlert = function() {
var notifications = [
"NotificationsContainer",
"JsGameNotifications",
"MainMenuNotifications",
"CSGONotifications",
"NotificationsPanelContainer"
];
notifications.forEach(function(id) {
var panel = $.GetContextPanel().FindChildTraverse(id);
if (panel) {
panel.style.visibility = "visible";
panel.style.height = "fit-children";
panel.style.opacity = "1";
}
});
};
return {
hide: _HideAlert,
show: _ShowAlert
};
]], "CSGOMainMenu")()
alert.hide()
client.set_event_callback('shutdown', function()
alert.show()
end)
code_language.lua:
local menu_customization = panorama.loadstring([[
var _change = function(img_url) {
var mainMenuPanel = $.GetContextPanel().FindChildTraverse("MainMenu");
if (!mainMenuPanel) return;
var characterPreviewPanel = $.GetContextPanel().FindChildTraverse("JsMainmenu_Vanity");
if (characterPreviewPanel) {
characterPreviewPanel.style.backgroundImage = 'url("' + img_url + '")';
characterPreviewPanel.style.backgroundSize = 'contain';
characterPreviewPanel.style.backgroundPosition = 'center';
characterPreviewPanel.style.backgroundRepeat = 'no-repeat';
characterPreviewPanel.SetScene(
"resource/ui/econ/ItemModelPanelCharWeaponInspect.res",
"models/player/custom_player/legacy/tm_phoenix_heavy.mdl",
false
);
characterPreviewPanel.SetCameraPreset(1, false);
characterPreviewPanel.SetSceneRotation(5, 2, 5); // uwukson: if you don't want the model to rotate, then delete this line
}
};
var _restore = function() {
var mainMenuPanel = $.GetContextPanel().FindChildTraverse("MainMenu");
if (mainMenuPanel) {
var characterPreviewPanel = $.GetContextPanel().FindChildTraverse("JsMainmenu_Vanity");
if (characterPreviewPanel) {
characterPreviewPanel.style.backgroundImage = 'none';
characterPreviewPanel.style.backgroundSize = 'auto';
characterPreviewPanel.style.backgroundPosition = '0% 0%';
characterPreviewPanel.style.backgroundRepeat = 'repeat';
characterPreviewPanel.SetScene(
"resource/ui/econ/ItemModelPanelCharMainMenu.res",
"models/player/custom_player/legacy/ctm_sas.mdl",
false
);
characterPreviewPanel.SetCameraPreset(1, false);
}
}
};
return {
change: _change,
restore: _restore
};
]], "CSGOMainMenu")()
menu_customization.change("https://yougame.biz/data/avatars/o/279/279781.jpg?1735272377")
client.set_event_callback("shutdown", function()
menu_customization.restore()
end)
Последнее редактирование: