Code: Select all
Script "ComboSystem" ENTER
{
str combomessage;
int combosound; //Sound count variable
While(true)
{
If(combokills>0)
{
SetFont("COMBO01");
HudMessage(s:"A"; HUDMSG_PLAIN, 0, CR_UNTRANSLATED, 1.5, 0.1, 1873);
//last value was 3.7
If(combokills==1){combomessage="x1"; If(combosound!=1){PlaySound(0,"weapons/rocklx",CHAN_BODY,1.0,FALSE,0); combosound=1;}} //If sound count isn't 1, set it to 1 and play sound
If(combokills==2){combomessage="x2"; If(combosound!=2){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=2;}}
If(combokills==3){combomessage="x3"; If(combosound!=3){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=3;}}
If(combokills==4){combomessage="x4"; If(combosound!=4){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=4;}}
If(combokills==5){combomessage="x5"; If(combosound!=5){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=5;}}
If(combokills==6){combomessage="x6"; If(combosound!=6){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=6;}}
If(combokills==7){combomessage="x7"; If(combosound!=7){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=7;}}
If(combokills==8){combomessage="x8"; If(combosound!=8){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=8;}}
If(combokills==9){combomessage="x9"; If(combosound!=9){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=9;}}
If(combokills==10){combomessage="x10"; If(combosound!=10){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=10;}}
If(combokills==11){combomessage="x11"; If(combosound!=11){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=11;}}
If(combokills==12){combomessage="x12"; If(combosound!=12){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=12;}}
If(combokills==13){combomessage="x13"; If(combosound!=13){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=13;}}
If(combokills==14){combomessage="x14"; If(combosound!=14){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=14;}}
If(combokills==15){combomessage="x15"; If(combosound!=15){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=15;}}
If(combokills==16){combomessage="x16"; If(combosound!=16){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=16;}}
If(combokills==17){combomessage="x17"; If(combosound!=17){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=17;}}
If(combokills==18){combomessage="x18"; If(combosound!=18){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=18;}}
If(combokills==19){combomessage="x19"; If(combosound!=19){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=19;}}
If(combokills==20){combomessage="x20"; If(combosound!=20){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=20;}}
If(combokills>=21){combomessage="WHAT!?"; If(combosound!=21){PlaySound(0,"combosnd",CHAN_BODY,1.0,FALSE,0); combosound=21;}}
//Combo Counter HUD Element (MAIN ONE)
SetFont("BIGFONT");
HudMessage(s:combomessage; HUDMSG_PLAIN, 100, 0, 0.1, 0.2, 0);
int time = Ceil(FixedDiv(combotimer<<16,35.0));
//Val after PLAIN is 100
If(combotimer<=0){combokills=0; combosound=0;} //When timer runs out, combo ends and reset the sound count
Else{combotimer--;}
}
Else
{
SetFont("NULLHUD");
HudMessage(s:" "; HUDMSG_PLAIN, 100, CR_UNTRANSLATED, 0.1, 0.8, 3.7);
HudMessage(s:" "; HUDMSG_PLAIN, 100, 0, 0.5, 0.2, 0);
HudMessage(s:" "; HUDMSG_PLAIN, 101, 0, 0.5, 0.2, 0);
}
Delay(1);
}
}