-- name: Activate Windows -- description: Adds the requirement to activate Windows with a key and that one legendary watermark.\n\nAuthor: \\#C63057\\CrazyDany local activated = false local ACTIVATION_KEY = "windows-activation-key" local COLOR_SUCCESS = "\\#a0ffa0\\" local COLOR_WARNING = "\\#fff982\\" local COLOR_ERROR = "\\#ffa0a0\\" local function chat_error(msg) djui_chat_message_create(COLOR_ERROR .. msg) play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource) end local function chat_success(msg) djui_chat_message_create(COLOR_SUCCESS .. msg) play_sound(SOUND_MENU_MARIO_CASTLE_WARP2, gGlobalSoundSource) end local function chat_warning(msg) djui_chat_message_create(COLOR_WARNING .. msg) play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource) end local function load_state() activated = mod_storage_load_integer("windows_activated", 0) == 1 end local function save_state() mod_storage_save_integer("windows_activated", activated and 1 or 0) end load_state() local function on_hud_render() if activated then return end djui_hud_set_resolution(RESOLUTION_DJUI) local sw = djui_hud_get_screen_width() local sh = djui_hud_get_screen_height() local text1 = "Activate Windows" local scale1 = 1 local text2 = "Go to chat and use /activate-windows" local scale2 = 0.5 local tw1, th1 = djui_hud_measure_text(text1) local tw2, th2 = djui_hud_measure_text(text2) local margin = 8 local gap = 2 local x2 = sw - tw2 * scale2 - margin local y2 = sh - th2 * scale2 - margin local x1 = sw - tw1 * scale1 - margin local y1 = y2 - th1 * scale1 - gap djui_hud_set_color(255, 255, 255, 200) djui_hud_print_text(text1, x1, y1, scale1) djui_hud_print_text(text2, x2, y2, scale2) end hook_event(HOOK_ON_HUD_RENDER, on_hud_render) hook_chat_command('activate-windows', 'Activate Windows with a product key', function(msg) if activated then chat_warning("Windows is already activated.") return true end local key = (msg or ""):match("^%s*(.-)%s*$"):lower() if key == "" then chat_error("Usage: /activate-windows ") return true end if key ~= ACTIVATION_KEY then chat_error("Invalid product key. Please check and try again.") return true end activated = true save_state() chat_success("Windows activated successfully!") return true end)