UGX-Mods

Call of Duty: Black Ops 1 => Help Desk => Scripting => Topic started by: mobofthedead123 on December 02, 2019, 07:11:49 pm

Title: HUD Elements in my BO1 Custom Map
Post by: mobofthedead123 on December 02, 2019, 07:11:49 pm
Hello, does anyone know how to add HUD elements through script in my BO1 custom zombies map? I want to add some text into the top right corner but I'm not sure how to go about it. Thanks.
Title: Re: HUD Elements in my BO1 Custom Map
Post by: klevi on May 05, 2022, 09:37:39 am
First thread this function where you want to call the HUD. Like, if there's a specific moment in your code, add this line
Code Snippet
cpp
thread setting_up();
After you do that, add this to the bottom of the same file
Code Snippet
cpp
setting_up()
{
    players = get_players();
    array_thread(players, ::hud_function);
}
Code Snippet
cpp
hud_function()
{
    hud = create_simple_hud(self);
    hud.foreground = true;
    hud.hidewheninmenu = true;
    hud.y = 0;
    hud.x = 0;
    hud.alignX = "right";
    hud.alignY = "top";
    hud.horzAlign = "right";
    hud.vertAlign = "top";
    hud.alpha = 1;
    hud SetText("your mom for example");
}
if you're still getting an error saying 'unknow function' then add this line on the 1st row of your file
Code Snippet
cpp
#include maps\_hud_util;