I try to use the new music script for my map pack but it says "Function getplayerlivesleft is used but not defined"
It is the one used in legopack-v1b
str BOSSSONG = "IBOSMUS1";//Change this to your boss theme.
str VICSONG = "MM1VIC";//Change this to your victory theme.
int serverMAX = 32;
int Maxfrags;
Bool BossMusic;
script 203 (void)
{
serverMAX = GetCVar("sv_maxclients");
int modeofplay = ACS_ExecuteWithResult(975);
bool isTeamGame = ACS_ExecuteWithResult(975,1);
int LevelParTime = GetLevelInfo(LEVELINFO_PAR_TIME);
Bool MoreFrags = False;
If(Timer() < 105){terminate;}
Switch(modeofplay)
{
Case 0: // DM / TDM
Case 5: //Terminator too!
if(GetCVar("fraglimit") <= 5){terminate;}
If(IsTeamGame==0)
{
if(PlayerFrags() <= maxfrags){terminate;}
maxfrags = PlayerFrags();
}
If(IsTeamGame==1)
{
If(BlueScore() > maxfrags){maxfrags=BlueScore();MoreFrags=true;}
If(RedScore() > maxfrags){maxfrags=RedScore();MoreFrags=true;}
If(GetCvar("sv_maxteams") >=3)
{
If(OrangeFrags() > maxfrags){maxfrags=OrangeFrags();MoreFrags=true;}
If(PurpleFrags() > maxfrags){maxfrags=PurpleFrags();MoreFrags=true;}
}
If(MoreFrags == False){terminate;}
}
if((MaxFrags >= GetCVar("fraglimit") - 5 && MaxFrags < GetCVar("fraglimit")) && BossMusic==0)
{
BossMusic=1;
SetMusic(BOSSSONG);
}
if(MaxFrags >= GetCVar("fraglimit")&& BossMusic < 2)
{
BossMusic=2;
SetMusic(VICSONG);
}
break;
Case 1: //possession
break;
Case 2: //LMS / TLMS
int BlueAlive=0;
int RedAlive=0;
int OrangeAlive=0;
int PurpleAlive=0;
int AlivePlayers=0;
for(int i=0; i < ServerMAX; i++)
{
If(!PlayerInGame(i)){continue;}
If(GetActorProperty(i+1000, APROP_HEALTH) > 0 || GetPlayerLivesLeft(i) > 0)
{
Switch(GetPlayerInfo(i, PLAYERINFO_TEAM))
{
Case 0:
BlueAlive++;
break;
Case 1:
RedAlive++;
break;
Case 2:
OrangeAlive++;
break;
Case 3:
PurpleAlive++;
break;
Default:
AlivePlayers++;
break;
}
}
}
If(IsTeamGame == 0)
{
If(AlivePlayers <= 2 && BossMusic == 0)
{
BossMusic=1;
SetMusic(BOSSSONG);
}
If(AlivePlayers == 1 && BossMusic == 1)
{
BossMusic=2;
SetMusic(VICSONG);
Delay(35*6);
SetMusic("*");
}
}
If(IsTeamGame == 1)
{
If(BossMusic==0)
{
If(LMSBossCheck(BlueAlive, RedAlive, OrangeAlive,PurpleAlive))
{
BossMusic=1;
SetMusic(BOSSSONG);
}
}
If(BossMusic==1)
{
If(((BlueAlive > 0) + (RedAlive > 0) + (OrangeAlive > 0) + (PurpleAlive > 0)) == 1)
{
BossMusic=2;
SetMusic(VICSONG);
Delay(35*6);
SetMusic("*");
}
}
}
break;
Case 3: //Duel
if(GetCVar("fraglimit") <= 1 || PlayerFrags() <= maxfrags){terminate;}
maxfrags = PlayerFrags();
if((MaxFrags == GetCVar("fraglimit") - 1 && MaxFrags < GetCVar("fraglimit")) && BossMusic==0)
{
BossMusic=1;
SetMusic(BOSSSONG);
}
if(MaxFrags >= GetCVar("fraglimit") && BossMusic < 2)
{
BossMusic=2;
SetMusic(VICSONG);
Delay(35*6);
SetMusic("*");
}
break;
Case 4: // CTF
if(GetCVar("pointlimit")<=1){terminate;}
if((BlueScore() == GetCVar("pointlimit") - 1 || RedScore() == GetCVar("pointlimit") - 1) && BossMusic==0)
{
BossMusic=1;
SetMusic(BOSSSONG);
}
if((BlueScore() == GetCVar("pointlimit") || RedScore() == GetCVar("pointlimit")) && BossMusic < 2)
{
BossMusic=2;
SetMusic(VICSONG);
}
break;
}
}
// Checks to see if there's a team with 1 player left and one team with 1 or greater.
Function int LMSBossCheck (int blue, int red, int orange, int purple)
{
int Check1;
int Check2;
If(blue == 1 || red == 1 || orange == 1 || purple == 1){Check1 = 1;}
If(Blue == 0){Check2++;}
If(Red == 0){Check2++;}
If(Orange == 0){Check2++;}
If(Purple == 0){Check2++;}
Return(Check1 == 1 && Check2 >= 2);
}
//Blue and orange frag counters for TDM
Function int OrangeFrags(void)
{
int O = ActivatorTID();
int CossackFrags=0;
For(int i = 0; i < ServerMAX; i++)
{
If(!PlayerInGame(i)){continue;}
SetActivator(i+1000);
If(GetPlayerInfo(i, PLAYERINFO_TEAM) == 2)
{
CossackFrags+=PlayerFrags();
}
}
SetActivator(O);
return(CossackFrags);
}
Function int PurpleFrags(void)
{
int O = ActivatorTID();
int KingFrags=0;
For(int i = 0; i < ServerMAX; i++)
{
If(!PlayerInGame(i)){continue;}
SetActivator(i+1000);
If(GetPlayerInfo(i, PLAYERINFO_TEAM) == 3)
{
KingFrags+=PlayerFrags();
}
}
SetActivator(O);
return(KingFrags);
}