Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • OPG PROJECT

    Группа ВК

    По-настоящему хороший сервер с уникальным модом! 
     Заходи к нам,тебе тут понравится!
Sign in to follow this  
Devil228

Универсальный скрипт HUD

Recommended Posts

Скрипт универсальный HUD для любого сервера.
Прописываем в Description.



class RscTitles
{
    class hud_pics
    {
        duration     =  99999;
        idd = -1;
        name = "hudicons_pic";
        onLoad = "with uiNameSpace do {hudicons_pic = _this select 0 }";
        
        class Controls
        {
            class gradicon: RscPicture
            {
                idc = 55106;
                text = "gui\hud\grad1.paa";        
                x = 0.0153125 * safezoneW + safezoneX;
                y = 0.704 * safezoneH + safezoneY;
                w = 0.02125 * safezoneW;
                h = 0.035 * safezoneH;
            };
            class foodicon: RscPicture
            {
                idc = 55104;
                text = "gui\hud\food1.paa";        
                x = 0.0153125 * safezoneW + safezoneX;
                y = 0.764 * safezoneH + safezoneY;
                w = 0.02125 * safezoneW;
                h = 0.035 * safezoneH;
            };
            class watericon: RscPicture
            {
                idc = 55105;
                text = "gui\hud\water1.paa";        
                x = 0.0153125 * safezoneW + safezoneX;
                y = 0.819 * safezoneH + safezoneY;
                w = 0.02125 * safezoneW;
                h = 0.035 * safezoneH;
            };
            class healthicon: RscPicture
            {
                idc = 55101;
                text = "gui\hud\health1.paa";
                name = "healthicon";
                x = 0.0153125 * safezoneW + safezoneX;
                y = 0.874 * safezoneH + safezoneY;
                w = 0.02125 * safezoneW;
                h = 0.035 * safezoneH;
            };
            class runicon: RscPicture
            {
                idc = 55102;
                text = "gui\hud\stamina1.paa";
                x = 0.0153125 * safezoneW + safezoneX;
                y = 0.929 * safezoneH + safezoneY;
                w = 0.02125 * safezoneW;
                h = 0.035 * safezoneH;
            };
            class rudicon: RscPicture
            {
                idc = 55109;
                text = "gui\hud\rad1.paa";
                x = 0.0359375 * safezoneW + safezoneX;
                y = 0.929 * safezoneH + safezoneY;
                w = 0.02125 * safezoneW;
                h = 0.035 * safezoneH;
            };
        };
    };
};    

 

 

Сам скрипт HUD.sqf:

    private ["_hudicons", "_health_icon", "_run_icon", "_rad_icon", "_food_icon", "_water_icon", "_grad_icon", "_food_level_1", "_food_level_2", "_food_level_3",
     "_food_level_4", "_food_level_5", "_water_level_1", "_water_level_2", "_water_level_3",
     "_water_level_4", "_water_level_5", "_grad_level_1", "_grad_level_2", "_grad_level_3", "_grad_level_4", "_grad_level_5", "_food_level", "_water_level", "_grad_level","_rad_level","_rad_level_1","_rad_level_2","_rad_level_3","_rad_level_4","_rad_level_5"];
    disableSerialization;
    1125  cutRsc ["hud_pics", "PLAIN"];
    
    _hudicons = uiNameSpace getVariable "hudicons_pic";
    _health_icon = _hudicons displayCtrl 55101;
    _run_icon = _hudicons displayCtrl 55102;
    _rad_icon = _hudicons displayCtrl 55109;
    _food_icon = _hudicons displayCtrl 55104;
    _water_icon = _hudicons displayCtrl 55105;
    _grad_icon = _hudicons displayCtrl 55106;
    
    _food_level_1 = 0.75;
    _food_level_2 = 0.50;
    _food_level_3 = 0.25;
    _food_level_4 = 0.10;
    _food_level_5 = 0.05;
    
    _water_level_1 = 0.75;
    _water_level_2 = 0.50;
    _water_level_3 = 0.25;
    _water_level_4 = 0.15;
    _water_level_5 = 0.05;
    
    _grad_level_1 = 0.75; 
    _grad_level_2 = 0.50;
    _grad_level_3 = 0.25;
    _grad_level_4 = 0.15;
    _grad_level_5 = 0.05;
    
    while {true} do {
    
        _food_level = player getVariable ["armst_hunger",0];
        _water_level = player getVariable ["armst_thirst",0];
        _grad_level = player getVariable ["ARMST_BODYTEMP",0];
        _rad_level = 0;
        // _rad_level = armst_radiation_infection;
        
        switch (true) do {
            
            case ((getDammage player) <= 0.1): {_health_icon ctrlSetText "";};
            case ((getDammage player) <= 0.25): {_health_icon ctrlSetText "gui\hud\health1.paa";};
            case ((getDammage player) <= 0.5): {_health_icon ctrlSetText "gui\hud\health2.paa";};
            case ((getDammage player) <= 0.75): {_health_icon ctrlSetText "gui\hud\health3.paa";};
            case ((getDammage player) <= 0.9): {_health_icon ctrlSetText "gui\hud\health4.paa";};
            default{_health_icon ctrlSetText "";};
            
        };
        
        switch (true) do {
            
            case ((getFatigue player) <= 0.3): {_run_icon ctrlSetText "";};
            case ((getFatigue player) <= 0.45): {_run_icon ctrlSetText "gui\hud\stamina2.paa";};
            case ((getFatigue player) <= 0.65): {_run_icon ctrlSetText "gui\hud\stamina1.paa";};
            case ((getFatigue player) <= 0.8): {_run_icon ctrlSetText "gui\hud\stamina3.paa";};
            case ((getFatigue player) <= 1): {_run_icon ctrlSetText "gui\hud\stamina4.paa";};
            
        };
                
        switch (true) do {
            
            case (_food_level >= _food_level_1): {_food_icon ctrlSetText "";};
            case (_food_level >= _food_level_2): {_food_icon ctrlSetText "gui\hud\food2.paa";};
            case (_food_level >= _food_level_3): {_food_icon ctrlSetText "gui\hud\food2.paa";};
            case (_food_level >= _food_level_4): {_food_icon ctrlSetText "gui\hud\food3.paa";};
            case (_food_level >= _food_level_5): {_food_icon ctrlSetText "gui\hud\food4.paa";};
            
        };
        
        switch (true) do {
            
            case (_water_level >= _water_level_1): {_water_icon ctrlSetText "";};
            case (_water_level >= _water_level_2): {_water_icon ctrlSetText "gui\hud\water2.paa";};
            case (_water_level >= _water_level_3): {_water_icon ctrlSetText "gui\hud\water2.paa";};
            case (_water_level >= _water_level_4): {_water_icon ctrlSetText "gui\hud\water3.paa";};
            case (_water_level >= _water_level_5): {_water_icon ctrlSetText "gui\hud\water4.paa";};
            
        };
        
        switch (true) do {
            
            case (_grad_level >= _grad_level_1): {_grad_icon ctrlSetText "";};
            case (_grad_level >= _grad_level_2): {_grad_icon ctrlSetText "";};
            case (_grad_level >= _grad_level_3): {_grad_icon ctrlSetText "gui\hud\grad2.paa";};
            case (_grad_level >= _grad_level_4): {_grad_icon ctrlSetText "gui\hud\grad3.paa";};
            case (_grad_level >= _grad_level_5): {_grad_icon ctrlSetText "gui\hud\grad4.paa";};
            
        };
        
        // switch (true) do {
            
        //     case (_rad_level > 0.01): {_rad_icon ctrlSetText "gui\hud\rad4.paa";};
        //     case (_rad_level > 0.005): {_rad_icon ctrlSetText "gui\hud\rad3.paa";};
        //     case (_rad_level > 0.0003): {_rad_icon ctrlSetText "gui\hud\rad2.paa";};
        //     case (_rad_level > 0.00001): {_rad_icon ctrlSetText "gui\hud\rad1.paa";};
        //     case (_rad_level >= 0): {_rad_icon ctrlSetText "";};
            
        // };
        sleep 3;
    };


Картинки используем свои.
Заменяем значения в бд,еды,воды,и т.д.

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.