Please Help (Dynamic Text)

Please help me to fix this script.

This Works:
Code:
if (ExileClientPlayerScore >0 && ExileClientPlayerScore <2499) then {
    titleText ["", "PLAIN DOWN"];
    ["<br /><br /><t color='#ff0000' align='left'>RANK:</t><t align='left'> 0/10 (<t color='#FFFF00'>Bambi</t>) </t><br /><t color='#5882FA' align='left'>Next Rank:</t><t align='left'> 1/10 (<t color='#FFFF00'>Recruit</t>) Cost</t><t color='#40FF00' align='left'> 2.5k</t><t shadow='1' shadowColor='#000000' color='%15'><img size='1.0' shadowColor='#000000' image='addons\rank\exile.paa'</t>",0,0.9,15,0] spawn bis_fnc_dynamictext;
    } else {
  
    if (ExileClientPlayerScore >2500 && ExileClientPlayerScore <9999) then {
    titleText ["", "PLAIN DOWN"];
    ["<br /><br /><t color='#ff0000' align='left'>RANK:</t><t align='left'> 2/10 (<t color='#FFFF00'>Recruit</t>) </t><br /><t color='#5882FA' align='left'>Next Rank:</t><t align='left'> 3/10 (<t color='#FFFF00'>Private</t>) Cost</t><t color='#40FF00' align='left'> 2.5k</t><t shadow='1' shadowColor='#000000' color='%15'><img size='1.0' shadowColor='#000000' image='addons\rank\exile.paa'</t>",0,0.9,15,0] spawn bis_fnc_dynamictext;
    }

but this does not work:
Code:
if (ExileClientPlayerScore >0 && ExileClientPlayerScore <2499) then {
    titleText ["", "PLAIN DOWN"];
    ["<br /><br /><t color='#ff0000' align='left'>RANK:</t><t align='left'> 0/10 (<t color='#FFFF00'>Bambi</t>) </t><br /><t color='#5882FA' align='left'>Next Rank:</t><t align='left'> 1/10 (<t color='#FFFF00'>Recruit</t>) Cost</t><t color='#40FF00' align='left'> 2.5k</t><t shadow='1' shadowColor='#000000' color='%15'><img size='1.0' shadowColor='#000000' image='addons\rank\exile.paa'</t>",0,0.9,15,0] spawn bis_fnc_dynamictext;
    } else {
  
    if (ExileClientPlayerScore >2500 && ExileClientPlayerScore <9999) then {
    titleText ["", "PLAIN DOWN"];
    ["<br /><br /><t color='#ff0000' align='left'>RANK:</t><t align='left'> 2/10 (<t color='#FFFF00'>Recruit</t>) </t><br /><t color='#5882FA' align='left'>Next Rank:</t><t align='left'> 3/10 (<t color='#FFFF00'>Private</t>) Cost</t><t color='#40FF00' align='left'> 2.5k</t><t shadow='1' shadowColor='#000000' color='%15'><img size='1.0' shadowColor='#000000' image='addons\rank\exile.paa'</t>",0,0.9,15,0] spawn bis_fnc_dynamictext;
    } else {
  
    if (ExileClientPlayerScore >10000 && ExileClientPlayerScore <19999) then {
    titleText ["", "PLAIN DOWN"];
    ["<br /><br /><t color='#ff0000' align='left'>RANK:</t><t align='left'> 3/10 (<t color='#FFFF00'>Veteran</t>) </t><br /><t color='#5882FA' align='left'>Next Rank:</t><t align='left'> 4/10 (<t color='#FFFF00'>Soldier</t>) Cost</t><t color='#40FF00' align='left'> 2.5k</t><t shadow='1' shadowColor='#000000' color='%15'><img size='1.0' shadowColor='#000000' image='addons\rank\exile.paa'</t>",0,0.9,15,0] spawn bis_fnc_dynamictext;
    }
  
    };
I have 10 groups to add, can you please help me to get this working..

Many thanks in advance :)
 
Last edited:
Your welcome :D ... you had a hosed up else clause. many if's and elses will do that which is why there is a switch statement. We can use it like this with a switch true so it executes and then compares multiple cases. I dont know, maybe its not more concise than multiple if statements but I think its easier to read ...
Code:
switch (true) do {
     case (ExileclientPlayerScore < 2499):
             {
              //text output goes here
              };
     case (ExileClientPlayerScore >2500 && ExileClientPlayerScore <9999):
             {
              //text output goes here
              };
     case (ExileClientPlayerScore >10000 && ExileClientPlayerScore <19999):
             {
              //text output goes here
              };
};
 
Top