Jump to content

kelso000

Member
  • Posts

    49
  • Joined

  • Last visited

Posts posted by kelso000

  1. Somehow you deleted a };

    //    @file Version: 1.0
    //    @file Name: playerHud.hpp
    //    @file Author: [zDT] Andrew
    //    @file Info: Credits to DayZ Epoch/Origins All rights to them
    //    @file Info: Images used here are not altered from original content
    //    @file Info: The images are just reused in the same form as original
    class z_RscText {

        idc = -1;
        type = CT_STATIC;
        style = ST_LEFT;
        colorBackground[] = { 1 , 1 , 1 , 0 };
        colorText[] = { 1 , 1 , 1 , 1 };
        font = FontM;
        sizeEx = 0.025;
        h = 0.25;
        text = "";
    };
    class Money_Status
    {
        type = 13;
        idc = -1;
        colorBackground[] = {0,0,0,0};
        colorText[] = {1,1,1,1};
        font = "Zeppelin32";
        sizeEx = 0.023;
        lineSpacing = 3;
        text = "";
        style = 0x02;
        x = 0;
        y = 0;
        w = 0.2;
        h = 0.15;
    };
    class RscPictureGUI
    {
        access = 0;
        type = 0;
        idc = -1;
        colorBackground[] = {0,0,0,0};
        colorText[] = {0.38,0.63,0.26,0.75};
        font = "TahomaB";
        sizeEx = 0;
        lineSpacing = 0;
        text = "";
        style = "0x30 + 0x100 + 0x800";
        x = 0;
        y = 0;
        w = 0.2;
        h = 0.15;
    };

    class RscTextGUIK {
        type = 0;
        idc = -1;
        style = 0x02;
        colorBackground[] = {0,0,0,0};
        colorText[] = {1, 1, 1, 0.5};
        font = "TahomaB";
        size = 0.03;
        sizeEx = 0.03;
        x = 0;
        y = 0;
        w = 0.1;
        h = 0.2;
    };
    class RscStructuredText {
        class Attributes;
    };
    class RscStructuredTextGUI: RscStructuredText
    {
        colorBackground[] = {0,0,0,0};
        colorText[] = {1,1,1,1};
        class Attributes: Attributes
        {
            align = "center";
            valign = "middle";
        };
    };
    class DZGMHud_Rsc
    {
        idd = -1;
        movingEnable = 1;
        enableSimulation = 1;
        enableDisplay = 1;

        onLoad = "uiNamespace setVariable ['dzgmHudDisp',_this select 0];";

        duration = 99999999999999999;
        fadein  = 0;
        fadeout = 0;
        class controls
        {
            class Icons : w_RscStructuredText
            {
                idc = -1;
                style = 0x00;
                x = .9;
                y = .9;
                w = .9;
                h = .9;
                size = .08;
                colorBackground[] = {0,0,0,0};
                colortext[] = {0,0,0,.7};
                text ="";
                class Attributes {
                    align = "left";
                };        
            };
            class PlayerIcon00:Icons {idc = 46300 +  0;};
            class PlayerIcon01:Icons {idc = 46300 +  1;};
            class PlayerIcon02:Icons {idc = 46300 +  2;};
            class PlayerIcon03:Icons {idc = 46300 +  3;};
            class PlayerIcon04:Icons {idc = 46300 +  4;};
            class PlayerIcon05:Icons {idc = 46300 +  5;};
            class PlayerIcon06:Icons {idc = 46300 +  6;};
            class PlayerIcon07:Icons {idc = 46300 +  7;};
            class PlayerIcon08:Icons {idc = 46300 +  8;};
            class PlayerIcon09:Icons {idc = 46300 +  9;};
            class PlayerIcon10:Icons {idc = 46300 + 10;};
            class PlayerIcon11:Icons {idc = 46300 + 11;};
            class PlayerIcon12:Icons {idc = 46300 + 12;};
            class PlayerIcon13:Icons {idc = 46300 + 13;};
            class PlayerIcon14:Icons {idc = 46300 + 14;};
            class PlayerIcon15:Icons {idc = 46300 + 15;};
            class PlayerIcon16:Icons {idc = 46300 + 16;};
            class PlayerIcon17:Icons {idc = 46300 + 17;};
            class PlayerIcon18:Icons {idc = 46300 + 18;};
            class PlayerIcon19:Icons {idc = 46300 + 19;};
            class PlayerIcon20:Icons {idc = 46300 + 20;};
            class PlayerIcon21:Icons {idc = 46300 + 21;};
            class PlayerIcon22:Icons {idc = 46300 + 22;};
            class PlayerIcon23:Icons {idc = 46300 + 23;};
            class PlayerIcon24:Icons {idc = 46300 + 24;};
            class PlayerIcon25:Icons {idc = 46300 + 25;};
            class PlayerIcon26:Icons {idc = 46300 + 26;};
            class PlayerIcon27:Icons {idc = 46300 + 27;};
            class PlayerIcon28:Icons {idc = 46300 + 28;};
            class PlayerIcon29:Icons {idc = 46300 + 29;};
            class PlayerIcon30:Icons {idc = 46300 + 30;};
            class PlayerIcon31:Icons {idc = 46300 + 31;};
            class PlayerIcon32:Icons {idc = 46300 + 32;};
            class PlayerIcon33:Icons {idc = 46300 + 33;};
            class PlayerIcon34:Icons {idc = 46300 + 34;};
            class PlayerIcon35:Icons {idc = 46300 + 35;};
            class PlayerIcon36:Icons {idc = 46300 + 36;};
            class PlayerIcon37:Icons {idc = 46300 + 37;};
            class PlayerIcon38:Icons {idc = 46300 + 38;};
            class PlayerIcon39:Icons {idc = 46300 + 39;};
            class PlayerIcon40:Icons {idc = 46300 + 40;};
        };
    };

    #define hud_Survivor 3600
    #define hud_HS 3601
    #define hud_Bandit 3602
    #define hud_Zombie 3603
    #define hud_Icon 3604
    #define hud_Kills 3605
    #define hud_KillsZ_HS 3606
    #define hud_KillsB 3607
    #define hud_KillsZ 3608
    #define hud_Border 3609
    #define hud_Humanity 3610
    #define hud_Z 3611
    #define hud_blood 3612
    #define hud_fps 3613
    #define hud_serv 3614
    #define hud_site 3615
    #define Hud_BG1 3616
    #define Hud_BG2 3617
    #define Hud_BG3 3618
    #define Hud_BG4 3619
    #define hud_ts 3620

    class Server_Hud {
        idd = -1;
        fadeout=0;
        fadein=0;
        duration = 10e10;
        name= "Server_Hud";
        onLoad = "uiNamespace setVariable ['Server_Hud', _this select 0]";
        
            class controlsBackground {
            class ZSC_Status: Money_Status
            {
                idc = 4900
                size = 0.040;
                x = safezoneX + (safezoneW -0.35);
                y = safezoneY + 0.42 * safezoneW;
                w = 0.35;
                h = 0.20;

    };


            class Attributes {
                    align = "right";
                };
            };
            class Hud_BG1: RscPictureGUI
            {
                idc = hud_BG1;
                size = 1;
                text = "\z\addons\dayz_code\gui\status\status_bg.paa";
                x = 0.955313 * safezoneW + safezoneX;
                y = 0.23  * safezoneH + safezoneY;
                w = 0.075;
                h = 0.10;
                class Attributes {
                    align = "center";
                };
            };
            class Hud_BG2: RscPictureGUI
            {
                idc = hud_BG2;
                size = 1;
                text = "\z\addons\dayz_code\gui\status\status_bg.paa";
                x = 0.955313 * safezoneW + safezoneX;
                y = 0.3 * safezoneH + safezoneY;
                w = 0.075;
                h = 0.10;
                class Attributes {
                    align = "center";
                };
            };
            class Hud_BG3: RscPictureGUI
            {
                idc = hud_BG3;
                size = 1;
                text = "\z\addons\dayz_code\gui\status\status_bg.paa";
                x = 0.955313 * safezoneW + safezoneX;
                y = 0.37 * safezoneH + safezoneY;
                w = 0.075;
                h = 0.10;
                class Attributes {
                    align = "center";
                };
            };
            class Hud_BG4: RscPictureGUI
            {
                idc = hud_BG4;
                size = 1;
                text = "\z\addons\dayz_code\gui\status\status_bg.paa";
                x = 0.955313 * safezoneW + safezoneX;
                y = 0.44 * safezoneH + safezoneY;
                w = 0.075;
                h = 0.10;
                class Attributes {
                    align = "center";
                };
            };
            class Hud_HudSurvivor: RscPictureGUI
            {
                idc = hud_Survivor;
                size = 1;
                text = "images\icons\st_humanity_survivor.paa";
                x = 0.955313 * safezoneW + safezoneX;
                y = 0.23 * safezoneH + safezoneY;
                w = 0.075;
                h = 0.10;
                colorText[] = {1,1,1,0.7};
                class Attributes {
                    align = "center";
                };
            };
            class Hud_HudHS: RscPictureGUI
            {
                idc = hud_HS;
                size = 1;
                text = "images\icons\zombie.paa";
                x = 0.955313 * safezoneW + safezoneX;
                y = 0.44 * safezoneH + safezoneY;
                w = 0.075;
                h = 0.10;
                colorText[] = {1,1,1,0.75};
                class Attributes {
                    align = "center";
                };
            };
            class Hud_HudBandit: RscPictureGUI
            {
                idc = hud_Bandit;
                size = 1;
                text = "images\icons\st_humanity_bandit.paa";
                x = 0.955313 * safezoneW + safezoneX;
                y = 0.3 * safezoneH + safezoneY;
                w = 0.075;
                h = 0.10;
                colorText[] = {1,1,1,0.75};
                class Attributes {
                    align = "center";
                };
            };
            class Hud_HudZombie: RscPictureGUI
            {
                idc = hud_Zombie;
                size = 1;
                text = "images\icons\zombie.paa";
                x = 0.955313 * safezoneW + safezoneX;
                y = 0.37 * safezoneH + safezoneY;
                w = 0.075;
                h = 0.10;
                colorText[] = {1,1,1,0.75};
                class Attributes {
                    align = "center";
                };
            };
            class Hud_HudIcon: RscTextGUIK
            {
                idc = hud_Icon;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.885 * safezoneW + safezoneX;
                y = 0.070 * safezoneH + safezoneY;
                w = 0.093 * safezoneW;
                h = 0.113 * safezoneH;
                colorText[] = {1,1,1,1};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "center";
                };
            };
            class Hud_HudKills: RscTextGUIK
            {
                idc = hud_Kills;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.931 * safezoneW + safezoneX;
                y = 0.256 * safezoneH + safezoneY;
                w = 0.037 * safezoneW;
                h = 0.047 * safezoneH;
                colorText[] = {1,1,1,0.75};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "right";
                };
            };
            class Hud_HudKillsZ_HS: RscTextGUIK
            {
                idc = hud_KillsZ_HS;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.931 * safezoneW + safezoneX;
                y = 0.466 * safezoneH + safezoneY;
                w = 0.037 * safezoneW;
                h = 0.047 * safezoneH;
                colorText[] = {1,1,1,0.75};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "right";
                };
            };
            class Hud_HudKillsB: RscTextGUIK
            {
                idc = hud_KillsB;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.931 * safezoneW + safezoneX;
                y = 0.326 * safezoneH + safezoneY;
                w = 0.037 * safezoneW;
                h = 0.047 * safezoneH;
                colorText[] = {1,1,1,0.75};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "right";
                };
            };
            class Hud_HudKillsZ: RscTextGUIK
            {
                idc = hud_KillsZ;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.931 * safezoneW + safezoneX;
                y = 0.396 * safezoneH + safezoneY;
                w = 0.037 * safezoneW;
                h = 0.047 * safezoneH;
                colorText[] = {1,1,1,0.75};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "right";
                };
            };
            class Hud_HudBorder: RscTextGUIK
            {
                idc = hud_Border;
                type = CT_STRUCTURED_TEXT;
                //text = "images\icons\status_humanity_border.paa";
                text = "";
                x = 0.885 * safezoneW + safezoneX;
                y = 0.080 * safezoneH + safezoneY;
                w = 0.093 * safezoneW;
                h = 0.110 * safezoneH;
                colorText[] = {0,0,0,0.6};
                class Attributes {
                    align = "center";
                };
            };
            class Hud_HudHumanity: RscTextGUIK
            {
                idc = hud_Humanity;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.9065 * safezoneW + safezoneX;
                y = 0.1630 * safezoneH + safezoneY;
                w = 0.050 * safezoneW;
                h = 0.064 * safezoneH;
                size = 0.0275;
                sizeEx = 0.0275;
                colorText[] = {0.6875,0.6875,0.6875,1};
                colorBackground[] = {0,0,0,0};
                shadow = 4;
                class Attributes {
                    align = "center";
                };
            };
            class Hud_HudZ: RscTextGUIK
            {
                idc = hud_Z;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.949513 * safezoneW + safezoneX;
                y = 0.44 * safezoneH + safezoneY;
                w = 0.075;
                h = 0.10;
                size = 0.0275;
                sizeEx = 0.0275;
                colorText[] = {1,0,0,0.85};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "right";
                };
            };
            class Hud_Blood: RscTextGUIK
            {
                idc = hud_blood;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.920313 * safezoneW + safezoneX;
                y = 0.815 * safezoneH + safezoneY; 
                w = 0.075;
                h = 0.10;
                size = 0.0275;
                sizeEx = 0.0275;
                colorText[] = {1,0,0,0.85};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "right";
                };
            };
            class Hud_Fps: RscTextGUIK
            {
                idc = hud_fps;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.916313 * safezoneW + safezoneX;
                y = 0.905 * safezoneH + safezoneY;
                w = 0.21;
                h = 0.21;
                size = 0.0275;
                sizeEx = 0.0275;
                colorText[] = {1,0,0,0.85};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "right";
                };
            };
            class Hud_Serv: RscTextGUIK
            {
                idc = hud_serv;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.845313 * safezoneW + safezoneX;
                y = 0.935 * safezoneH + safezoneY;
                w = 0.21;
                h = 0.21;
                size = 0.0275;
                sizeEx = 0.0275;
                colorText[] = {1,0,0,0.85};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "right";
                };
            };
            class Hud_Site: RscTextGUIK
            {
                idc = hud_site;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.845313 * safezoneW + safezoneX;
                y = 0.965 * safezoneH + safezoneY;
                w = 0.21;
                h = 0.21;
                size = 0.0275;
                sizeEx = 0.0275;
                colorText[] = {1,0,0,0.85};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "left";
                };
            };
            class Hud_ts: RscTextGUIK
            {
                idc = hud_ts;
                type = CT_STRUCTURED_TEXT;
                text = "";
                x = 0.845313 * safezoneW + safezoneX;
                y = 0.978 * safezoneH + safezoneY;
                w = 0.21;
                h = 0.21;
                size = 0.0275;
                sizeEx = 0.0275;
                colorText[] = {1,0,0,0.85};
                colorBackground[] = {0,0,0,0};
                shadow = 2;
                class Attributes {
                    align = "left";
                };
            };
        };
    };

  2. 22 hours ago, ViseVersa said:
    
     if ( cursorTarget isKindOf "Infostand_2_EP1" && (player distance cursorTarget) < 2 && (cursortarget getvariable["Entertype", -1] == 1) ) then { <----- Entry
    
    if ( cursorTarget isKindOf "Infostand_1_EP1" && (player distance cursorTarget) < 2 && (cursortarget getvariable["Exittype", -0] == 1) ) then { <-----Exit 

     

    Let`s review this... As we hopefully know - the fn_selfActions.sqf is called for each player individually. This in return means, that each player is giving that sign a variable and it get`s overwritten a few thousand times. Correct me, if i`m wrong.. So if each player gives that sign a variable, how in gods name would the script know, what to do?

    Solution would be: Don`t put the variable on the Sign, put it on the player or in MissionNamespace.

    Also -0 doesn`t exist. This will allways return false, no matter what. Simple maths :P

    It would know as setVariable would have to be used (see the public parameter); the variable is being set on the object itself. Did you ever get this working ElDubya?

  3. 21 hours ago, Pavillin said:

    The game servers seem they don't support windows...

    http://prntscr.com/9vzswm

    That looks like something from OVH and I can tell you that it is possible to get windows on them - I'm using the i7 OVH server and have Server 2012 R2 on it... what it doesn't support is the automated installation and you have to upload your own ISO and probably buy a KVM for a day or two to access the computer. You also have to find all the drivers by yourself ^^

    Edit: MC-32 to be exact, on OVH.com

  4. From your last post, it seems like something is funky with one of the infostands. Have you tested both types? I haven't done anything with infostands :blush:

    What I would do, however, is create a sensor in your mission.sqm to cover the secret trader area. Make it "like" a safezone - that is, copy one of the safezones and just don't call player_traderCity. If the sensor is inactive, have a global variable set like "is_in_secret_trader=false;" and if you're in it, have it set to true. Then, you can do something as simple as:

    if ((cursorTarget isKindOf "Infostand_2_EP1") && ((player distance cursorTarget) < 2) && !(is_in_secret_trader) ) then {  <--- entry

    if ((cursorTarget isKindOf "Infostand_2_EP1") && ((player distance cursorTarget) < 2) && (is_in_secret_trader) ) then {  <--- exit

    To simplify things, and for performance, I would do:

    if ((cursorTarget isKindOf "Infostand_2_EP1") && ((player distance cursorTarget) < 2)) then {
        if (is_in_secret_trader) then {
            // player is inside the trader city and needs to exit
        } else {
            // player is not inside the trader city and needs to enter
        };
    };                                                                                      

    I'll play around with the idea too sometime soon and see if I can get something working for you. 

    Edit: It's a little slow at work. lol:

    Looking at mission.sqm for chernarus; increase the items to 6 and add item 6 at the bottom:

    	class Item6
    		{
    			position[]={6325.6772,304.99033,7807.7412}; // These would be the coordinates of your secret trader - I believe in xzy
    			a=100; // Not exactly sure what a and b are for
    			b=100;
    			activationBy="WEST";
    			repeating=1;
    			interruptable=1;
    			age="UNKNOWN";
    			name="zonesuperdupersecrettrader"; // name this to your trader zone or whatever you want the name of the zone to be
    			expCond="(player distance zonesuperdupersecrettrader) < 100;"; // radius to the trader you want the sensor to activate
    			expActiv="is_in_secret_trader=true;"; // what happens when you're inside the trader
    			expDesactiv="is_in_secret_trader=false;"; // what happens when you're outside of the trader
    			class Effects
    			{
    			};
    		};

    The expActive and expDesactiv can also call a script. See your mission.sqm to see how it calls player_tradercity.

     

  5. Cool idea. Do you have the infostand in the same spot every restart?

    There are a couple ways I can think of. My first idea would be the obvious, create the infostand every restart and put deleteVehicle at the end of the script ran on it.

    Second idea would be to set a var to the infostand after accessing it and put an exitwith if the var exists at the beginning of the script. If it's already accessed, you can't click on it again.

    Last, I think you could use hideObject.

  6. 17 hours ago, Donnovan said:

    My server is not appearing, and there is no more Add Server feature.

    Matadouro Server - 177.207.204.23:2312 (query port 2313)

    I had this problem also, and need to manually refresh every ~25 minutes or so on dev.dayzlauncher.com. I made a macro to do it using a batch loop and imacros for firefox to do this every 25 mins. 

  7. ESSV2 starts each character at the top left corner of the map in a black box type thing, or bottom left in the water. That's normal.

     

    Most likely you have a broken link in one of the files. Is it only for him? If so, get his client arma2oa.RPT and post it here. If it's both of you (try dying and make a new character), post your arma2oaserver.RPT. Heck, post them both.

  8. I've been having some problems lately and could use some help. I've been up and running for about 3 months now and am averaging 25 people during the day and 40+ at night. I'm running 1 server. Typical CPU load is <15%, and server is usually above 4 FPS although it occasionally goes a little below 3.

    Dedicated box:

    2x AMD Opteron 4332HE running at 3Ghz (3.3GHz boost), 16GB ram, SSD, and a 1Gbps link

    I've been experiencing the following problems:

    1. Crash, characterized by NetServer::SendMsg spam (more then my average) and players get stuck at waiting for character to create. The only fix is a restart.
      • Client RPT shows a bunch of errors with undefined variables within files relating to the HUD. I'm assuming this is because the HUD is running without them in game.
    2. Crash, characterized by NetServer::finishDestroyPlayer and players get stuck running in places. The only fix is a restart.
    3. Server RPT spam, characterized with Server_GetDiff2 errors. Occasionally when this happens if a player trades coins to another, it will fail and one will get scalar coins - which we all know is a huge problem.

    10:26:05 Error in expression <object getVariable[(_variable + "_CHK"),_vNew];
    _result = _vNew - _vOld;

    _objec>
    10:26:05   Error position: <_vNew];
    _result = _vNew - _vOld;

    _objec>
    10:26:05   Error Undefined variable in expression: _vnew
    10:26:05 File z\addons\dayz_server\init\server_functions.sqf, line 577

    Overall, is this stuff I can fix? Is my dedicated box too weak? Also, my current Basic.cfg:

    language="English";
    adapter=-1;
    3D_Performance=1500000;
    Resolution_Bpp=32;
    Windowed=0;
    MaxCustomFileSize=0;
    MaxMsgSend=192;
    MaxSizeGuaranteed=512;
    MaxSizeNonguaranteed=192;
    MinErrorToSend=0.0040000002;
    MinErrorToSendNear=0.050000001;
     

     

    Thanks for any help

  9. You could set up something to not allow players bank with a vehicle at the same time i.e.

     _nearby = count player nearEntities ["CAManBase", 5];
     if(_nearby >= 1) exitWith {systemChat "you cannot bank with this object as someone else is nearby";};

    But I just went ahead and removed it completely. I had one person in my server that said anything about it.

    Fix for dupe giving eachother:

    And infiSTAR display:

     

  10. So I've had a problem where some people couldn't replace a plot pole due to too many objects being built. I went through the code and rewrote some stuff so the object count check is the same everywhere.  To my surprise people were still having the problem.

    Last night I had someone having the problem and had 490 objects on the pole. Much higher than my building limit. However, it doesn't seem like there is that many objects.

    So I checked the database: duplicates. Some objects were doubled, some quadrupled. The only thing different is the ObjectID.

    I've noticed that I sometimes get duplicate entries in HiveExt.log, but those are only for Player_Data. I'm not sure where to look for what is causing this problem. I'm running plot management and door management. The only thing I could think of is the plot take ownership, but I'm not even sure about that.

    Has anyone else had the problem where buildables in object_data duplicate?

  11. Sure,

    I removed the Community Base Addons format number function from the PBO and modified so it would work for this purpose:

    Save this as "cba_number.sqf" somewhere in your mission file

    private ["_integerPart", "_string", "_numIntegerDigits", "_decimalPoint","_thousandsSeparator", "_basePlaces"];
        _number = _this select 0;
        _integerWidth = _this select 1;
        _decimalPlaces = _this select 2;
        _separateThousands = _this select 3;
        _decimalPoint = ".";
        _thousandsSeparator = ",";
    
        if (_decimalPlaces > 0) then {
                _basePlaces = 10 ^ _decimalPlaces;
                _number = round(_number * _basePlaces) / _basePlaces;
                _integerPart = floor (abs _number);
            } else {
            _integerPart = round (abs _number);
        };
    
        _string = "";
        _numIntegerDigits = 0;
    
    while {_integerPart > 0} do {
        if ((_numIntegerDigits > 0) and ((_numIntegerDigits mod 3) == 0) and _separateThousands) then {
            _string = _thousandsSeparator + _string;
        };
        _string =  (str (_integerPart mod 10)) + _string;
        _numIntegerDigits = _numIntegerDigits + 1;
        _integerPart = floor (_integerPart / 10);
    };
    
    while {_numIntegerDigits < _integerWidth} do {
        if ((_numIntegerDigits > 0) and ((_numIntegerDigits mod 3) == 0) and _separateThousands) then {
            _string = _thousandsSeparator + _string;
        };
        _string = "0" + _string;
        _numIntegerDigits = _numIntegerDigits + 1;
    };
    
    if (_number < 0) then {
        _string = "-" + _string;
    };
    
    if (_decimalPlaces > 0) then {
        private ["_digit", "_multiplier", "_i"];
        _string = _string + _decimalPoint;
        _multiplier = 10;
        
        for "_i" from 1 to _decimalPlaces do {
        _digit = floor ((_number * _multiplier) mod 10);
            if (not (finite _digit)) exitWith {
                private "_j";
                    for "_j" from _i to _decimalPlaces do {
                        _string = _string + "0";
                    };
                };
                _string = _string + (str _digit);
                _multiplier = _multiplier * 10;
            };
        };
    _string;

    Put this in your compiles.sqf (change path)

    CBA_fnc_formatNumber =			compile preprocessFileLineNumbers "path\to\file\cba_number.sqf";
    

    Finally, in your server_playerSync.sqf add (and also _cashMoneyCBA at the end declaring private variables):

    _cashMoneyCBA = [_cashMoney,0,0,false] call CBA_fnc_formatNumber;
    

    under

    _cashMoney = ["cashMoney",_character] call server_getDiff2;

    and change the _cashMoney to _cashMoneyCBA here (line 192 for me)

    _key = format["CHILD:201:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:",_characterID,_playerPos,_playerGear,_playerBackp,_medical,false,false,_kills,_headShots,_distanceFoot,_timeSince,_currentState,_killsH,_killsB,_currentModel,_humanity,_cashMoney];
    

    What this does is converts _cashMoney to a string before writing it to the hive. I take back what I said though: coins will still very rarely go negative, but you won't have the write to hive errors. What I do is run this every restart:

    -- Non negative cashMoney
    UPDATE `character_data` SET `cashMoney` = 0
    	WHERE `cashMoney` < 0;

     

  12. I have been using this for awhile now and really enjoy it, I know how to add items to the traders.  My question is I want to have a Blackmarket trader in klen.  The klen and stary blackmarket trader will sell the same thing.  How do I go about placing a trader in klen that is linked to the stary blackmarket? 

     

    Thanks

    Find where you want them, I personally use infistar and click copy worldspace to RPT and chat when I'm pretending i'm the trader. Then open server pbo, click mission, then find mission.sqm. Find the trader in there and change the coordinates. 

×
×
  • Create New...