What's new

Solved How do you display HUD elements on other players screens?

Status
Not open for further replies.
Neru

Neru

Newbie
Messages
14
Reaction score
6
Points
20
Sin$
0
Created an example script for someone to show me, but I was wondering how I can do this for certain people in my game.

Code:
#include common_scripts\utility;
#include maps\_hud_util;
#include maps\_utility;

init() {
    self iPrintln("^3Script ran.");
    element = createRectangle("CENTER", "CENTER", 0, 0, 100, 100, (0, 0, 0), 0, 1, "WHITE");

    for(;;) {
        if(self MeleeButtonPressed() && isDefined(element)) {
            element Destroy();
        }
        wait .1;
    }
}

createRectangle(align, relative, x, y, width, height, color, sort, alpha, shader) {
    // Function not created by me, credits to Smokey xKoVx for providing on YouTube.
    barElemBG = newClientHudElem( self );
    barElemBG.elemType = "bar";
    barElemBG.width = width;
    barElemBG.height = height;
    barElemBG.align = align;
    barElemBG.relative = relative;
    barElemBG.xOffset = 0;
    barElemBG.yOffset = 0;
    barElemBG.children = [];
    barElemBG.sort = sort;
    barElemBG.color = color;
    barElemBG.alpha = alpha;
    barElemBG setParent( level.uiParent );
    barElemBG setShader( shader, width , height );
    barElemBG.hidden = false;
    barElemBG setPoint(align,relative,x,y);
    return barElemBG;
}
 
Status
Not open for further replies.
Top Bottom
Login
Register