Kategorie: Network
/ League
Ab Engineversion: 5.5 OC
func SetLeagueProgressScore(int plr, int new_progress)
{
// Safety: Valid players only
var plrid = GetPlayerID(plr);
if (!plrid) return;
// Progress must be between 0 and 25
new_progress = BoundBy(new_progress, 0, 25);
// Get old progress from previous round
var progress_string = GetLeagueProgressData(plrid);
if (progress_string && GetLength(progress_string))
{
var old_progress = GetChar(progress_string)-GetChar("A");
// If old progress was better than new progress, keep old progress
new_progress = Max(old_progress, new_progress);
}
// Set new progress
SetLeagueProgressData(Format("%c", GetChar("A") + new_progress));
SetLeaguePerformance(new_progress);
return true;
}